/* =========================================================
   Avalon Systems — primary stylesheet
   Brand: burgundy #563233, ink #080606, parchment #F4EFE6
   Type:  Libre Bodoni (display/italic), Inter (UI/body)
   ========================================================= */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink:        #080606;
  --ink-2:      #111010;
  --ink-3:      #1a1818;
  --ink-4:      #242120;
  --line:       #2c2826;
  --burgundy:   #563233;
  --burgundy-2: #6b3f40;
  --burgundy-3: #834b4d;
  --gold:       #b9986a;
  --parchment:  #f4efe6;
  --paper:      #ece5d6;
  --text:       #f1ece2;
  --text-dim:   #c8c1b3;
  --text-mute:  #8b8579;
  --radius:     6px;
  --radius-lg:  14px;
  --shadow:     0 30px 60px -20px rgba(0,0,0,0.6), 0 8px 20px -8px rgba(0,0,0,0.4);
  --serif:      'Libre Bodoni', 'Bodoni 72', 'Didot', Georgia, serif;
  --sans:       'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease:       cubic-bezier(0.2, 0.8, 0.2, 1);
}

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  font-family: var(--sans);
  background: var(--ink);
  color: var(--text);
  line-height: 1.65;
  font-weight: 400;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(1200px 700px at 12% -10%, rgba(86, 50, 51, 0.18), transparent 60%),
    radial-gradient(900px 600px at 100% 5%, rgba(185, 152, 106, 0.05), transparent 55%),
    linear-gradient(180deg, #0a0808 0%, #080606 40%, #050404 100%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--burgundy-3); }
img, svg { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: 0; background: 0; color: inherit; }

::selection { background: var(--burgundy); color: var(--parchment); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.container-narrow { max-width: 880px; margin: 0 auto; padding: 0 28px; }

/* ===== Typography ===== */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--parchment);
}

h1 { font-size: clamp(2.6rem, 6vw, 5.2rem); }
h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
h3 { font-size: clamp(1.4rem, 2vw, 1.8rem); font-weight: 700; }
h4 { font-size: 1.15rem; font-style: normal; font-family: var(--sans); font-weight: 600; letter-spacing: 0.02em; color: var(--parchment); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--burgundy-3);
  display: inline-block;
  position: relative;
  padding-left: 56px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: ''; position: absolute; left: 0; top: 50%;
  width: 42px; height: 1px; background: var(--burgundy-3);
}

.lede {
  font-size: 1.18rem;
  color: var(--text-dim);
  max-width: 64ch;
  line-height: 1.7;
}

.serif-italic { font-family: var(--serif); font-style: italic; }
.gold-text { color: var(--gold); }
.burgundy-text { color: var(--burgundy-3); }

/* ===== Navigation ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 18px 0;
  transition: all 0.4s var(--ease);
  background: rgba(8, 6, 6, 0.55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid transparent;
}
.navbar.scrolled {
  padding: 12px 0;
  background: rgba(8, 6, 6, 0.85);
  border-bottom: 1px solid var(--line);
}
.nav-row {
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
}
.nav-brand {
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
}
.nav-brand img { height: 42px; }
.nav-brand-text {
  display: flex; flex-direction: column; line-height: 1.1;
}
.nav-brand-name {
  font-family: var(--serif); font-style: italic; font-weight: 700;
  font-size: 1.25rem; color: var(--parchment);
}
.nav-brand-tag {
  font-size: 0.65rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--burgundy-3); margin-top: 2px;
}
.nav-links {
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.nav-links a {
  display: inline-block; padding: 9px 14px;
  font-size: 0.92rem; font-weight: 500; color: var(--text-dim);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}
.nav-links a:hover {
  color: var(--parchment);
  background: rgba(255,255,255,0.04);
}
.nav-links a.active { color: var(--parchment); }
.nav-cta {
  background: var(--burgundy);
  color: var(--parchment) !important;
  padding: 10px 20px !important;
  border-radius: var(--radius);
  font-weight: 600 !important;
  letter-spacing: 0.02em;
  transition: all 0.25s var(--ease) !important;
}
.nav-cta:hover {
  background: var(--burgundy-2) !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 30px -10px rgba(86, 50, 51, 0.6);
}
.nav-toggle {
  display: none;
  width: 38px; height: 38px;
  flex-direction: column; justify-content: center; gap: 5px;
  padding: 0 8px;
}
.nav-toggle span {
  display: block; height: 2px; background: var(--parchment);
  transition: all 0.3s ease;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 28px;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  transition: all 0.25s var(--ease);
  position: relative; overflow: hidden;
  cursor: pointer; white-space: nowrap;
}
.btn-primary {
  background: var(--burgundy);
  color: var(--parchment);
  box-shadow: 0 12px 30px -12px rgba(86, 50, 51, 0.65);
}
.btn-primary:hover {
  background: var(--burgundy-2);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -14px rgba(86, 50, 51, 0.85);
  color: var(--parchment);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  border-color: var(--burgundy-3);
  background: rgba(86, 50, 51, 0.08);
  color: var(--parchment);
}
.btn-arrow::after {
  content: '→'; transition: transform 0.25s ease;
}
.btn-arrow:hover::after { transform: translateX(4px); }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  position: relative;
  display: flex; align-items: center;
  padding: 140px 0 100px;
  overflow: hidden;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(86, 50, 51, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86, 50, 51, 0.08) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 0%, transparent 70%);
}
.hero-glow {
  position: absolute;
  width: 1100px; height: 1100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(86, 50, 51, 0.32) 0%, transparent 60%);
  filter: blur(20px);
  pointer-events: none;
  top: -350px; left: 50%; transform: translateX(-50%);
}
.hero-content {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px; align-items: center;
}
.hero-text { max-width: 640px; }
.hero h1 {
  margin: 18px 0 24px;
}
.hero h1 .accent {
  color: var(--burgundy-3);
}
.hero-tagline {
  font-size: 1.18rem;
  color: var(--text-dim);
  margin-bottom: 38px;
  line-height: 1.7;
  max-width: 56ch;
}
.hero-actions {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-bottom: 50px;
}
.hero-meta {
  display: flex; gap: 36px; flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.hero-meta-item {
  display: flex; flex-direction: column; gap: 4px;
}
.hero-meta-num {
  font-family: var(--serif); font-style: italic; font-weight: 700;
  font-size: 1.8rem; color: var(--parchment);
  line-height: 1;
}
.hero-meta-label {
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-mute);
}

.hero-visual {
  position: relative;
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
}
.hero-visual-frame {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.hero-visual-frame::before,
.hero-visual-frame::after {
  content: ''; position: absolute;
  width: 90%; height: 90%;
  border: 1px solid var(--line);
  border-radius: 50%;
  pointer-events: none;
  animation: spin-slow 60s linear infinite;
}
.hero-visual-frame::after {
  width: 70%; height: 70%;
  border-style: dashed;
  border-color: rgba(86, 50, 51, 0.3);
  animation-direction: reverse;
  animation-duration: 80s;
}
.hero-visual-logo {
  width: 64%;
  filter: drop-shadow(0 30px 60px rgba(86, 50, 51, 0.4));
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== Generic section ===== */
section { padding: 110px 0; position: relative; }
.section-head { margin-bottom: 64px; max-width: 760px; }
.section-head .lede { margin-top: 22px; }

.divider-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 30%, var(--line) 70%, transparent);
  margin: 0 auto;
}

/* ===== Pillars (3-up grid) ===== */
.pillars {
  background: linear-gradient(180deg, transparent, rgba(86, 50, 51, 0.04), transparent);
}
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.pillar-card {
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 38px 32px 36px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease);
}
.pillar-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--burgundy), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease);
}
.pillar-card:hover {
  transform: translateY(-4px);
  border-color: var(--burgundy);
  box-shadow: var(--shadow);
}
.pillar-card:hover::before { transform: translateX(0); }

.pillar-num {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 2.4rem; color: var(--burgundy-3);
  line-height: 1;
  margin-bottom: 22px;
  display: block;
}
.pillar-card h3 {
  font-family: var(--sans); font-style: normal; font-weight: 600;
  font-size: 1.3rem; letter-spacing: -0.005em;
  margin-bottom: 14px;
  color: var(--parchment);
}
.pillar-card p {
  color: var(--text-dim);
  font-size: 0.97rem;
  line-height: 1.7;
}
.pillar-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 22px;
  font-size: 0.88rem; font-weight: 600;
  color: var(--burgundy-3);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.pillar-link::after { content: '→'; transition: transform 0.25s ease; }
.pillar-card:hover .pillar-link::after { transform: translateX(4px); }

/* ===== Showcase block (image + text) ===== */
.showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px; align-items: center;
}
.showcase.reverse { direction: rtl; }
.showcase.reverse > * { direction: ltr; }
.showcase-img {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
}
.showcase-img img {
  width: 88%; height: 88%;
  object-fit: contain;
}
.showcase-img::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.06), transparent 60%);
  pointer-events: none;
}
.showcase-corner {
  position: absolute;
  width: 26px; height: 26px;
  border: 1px solid var(--burgundy-3);
}
.showcase-corner.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.showcase-corner.tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }
.showcase-corner.bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; }
.showcase-corner.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }

.showcase-text h2 { margin: 14px 0 22px; }
.showcase-text .lede { margin-bottom: 28px; }

.spec-list {
  list-style: none;
  margin: 28px 0;
  padding: 0;
}
.spec-list li {
  display: flex; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.97rem;
  color: var(--text-dim);
}
.spec-list li:last-child { border-bottom: 0; }
.spec-list li::before {
  content: '◆';
  color: var(--burgundy-3);
  font-size: 0.7rem;
  flex-shrink: 0;
  margin-top: 6px;
}
.spec-list li strong {
  color: var(--parchment); font-weight: 600;
  margin-right: 8px;
}

/* ===== Feature grid ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.feature-cell {
  background: var(--ink-2);
  padding: 32px 28px;
  transition: background 0.3s ease;
}
.feature-cell:hover { background: var(--ink-3); }
.feature-icon {
  width: 42px; height: 42px;
  border: 1px solid var(--burgundy);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  color: var(--burgundy-3);
}
.feature-icon svg { width: 20px; height: 20px; }
.feature-cell h4 {
  margin-bottom: 10px;
  color: var(--parchment);
}
.feature-cell p {
  font-size: 0.92rem; color: var(--text-mute); line-height: 1.65;
}

/* ===== Integrations strip ===== */
.integrations-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 60px;
}
.integration-tile {
  padding: 32px 20px; text-align: center;
  background: var(--ink-2);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.integration-tile-name {
  font-family: var(--serif); font-style: italic; font-weight: 700;
  font-size: 1.15rem;
  color: var(--parchment);
}
.integration-tile-desc {
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-mute);
}

/* ===== Stat row ===== */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat-cell {
  background: var(--ink);
  padding: 50px 28px;
  text-align: center;
}
.stat-num {
  font-family: var(--serif); font-style: italic; font-weight: 700;
  font-size: 3rem; color: var(--burgundy-3);
  line-height: 1;
  margin-bottom: 10px;
}
.stat-label {
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-mute);
}

/* ===== Module page hero ===== */
.module-hero {
  padding: 160px 0 80px;
  position: relative;
  border-bottom: 1px solid var(--line);
}
.module-hero h1 { margin: 14px 0 22px; }
.module-hero .lede { font-size: 1.25rem; }

/* ===== Pricing-style table for specs ===== */
.tech-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 32px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.tech-table th, .tech-table td {
  padding: 16px 22px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.tech-table th {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--burgundy-3);
  background: var(--ink-3);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.tech-table td:first-child {
  color: var(--parchment); font-weight: 500;
  width: 40%;
}
.tech-table td { color: var(--text-dim); }
.tech-table tr:last-child td { border-bottom: 0; }
.tech-table tr:hover td { background: rgba(86, 50, 51, 0.06); }

/* ===== Two-column body ===== */
.two-col {
  columns: 2;
  column-gap: 56px;
  color: var(--text-dim);
}
.two-col p { break-inside: avoid; margin-bottom: 1.2em; }

/* ===== CTA banner ===== */
.cta-banner {
  margin: 80px 0;
  padding: 70px 50px;
  background: linear-gradient(135deg, var(--ink-3) 0%, var(--ink-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.cta-banner::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--burgundy), transparent);
}
.cta-banner h2 { margin-bottom: 18px; }
.cta-banner p { color: var(--text-dim); margin-bottom: 32px; max-width: 60ch; margin-left: auto; margin-right: auto; }
.cta-banner .btn { margin: 0 6px; }

/* ===== Footer ===== */
footer {
  padding: 80px 0 40px;
  border-top: 1px solid var(--line);
  background: var(--ink-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 60px;
}
.footer-brand img { height: 48px; margin-bottom: 18px; }
.footer-brand p { color: var(--text-mute); font-size: 0.92rem; line-height: 1.7; max-width: 32ch; }
.footer-col h5 {
  font-family: var(--sans); font-style: normal; font-weight: 600;
  font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--burgundy-3);
  margin-bottom: 22px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 12px; }
.footer-col a {
  color: var(--text-dim);
  font-size: 0.92rem;
  transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--parchment); }
.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.85rem; color: var(--text-mute);
}
.footer-bottom-links { display: flex; gap: 28px; }

/* ===== Page header (for inner pages) ===== */
.page-prose {
  max-width: 760px;
  margin: 0 auto;
  padding: 160px 28px 120px;
  color: var(--text-dim);
  line-height: 1.8;
  font-size: 1.02rem;
}
.page-prose h1 { margin-bottom: 28px; }
.page-prose h2 {
  font-size: 1.6rem;
  margin: 56px 0 18px;
  color: var(--parchment);
}
.page-prose h3 {
  font-family: var(--sans); font-style: normal; font-weight: 600;
  font-size: 1.1rem; margin: 30px 0 12px;
  color: var(--parchment);
}
.page-prose p { margin-bottom: 16px; }
.page-prose ul, .page-prose ol { margin: 0 0 18px 24px; }
.page-prose li { margin-bottom: 8px; }
.page-prose a {
  color: var(--burgundy-3);
  border-bottom: 1px solid rgba(131, 75, 77, 0.3);
}
.page-prose a:hover {
  color: var(--parchment);
  border-bottom-color: var(--parchment);
}
.page-meta {
  display: block;
  font-size: 0.85rem;
  color: var(--text-mute);
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed; top: 70px; right: 0; bottom: 0;
    width: min(320px, 80vw);
    flex-direction: column; align-items: stretch;
    background: var(--ink-2);
    border-left: 1px solid var(--line);
    padding: 30px 24px;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    overflow-y: auto;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 14px 18px; }

  .hero { padding: 120px 0 80px; }
  .hero-content { grid-template-columns: 1fr; gap: 50px; }
  .hero-visual { max-width: 360px; margin: 0 auto; }

  .pillars-grid { grid-template-columns: 1fr; }
  .showcase { grid-template-columns: 1fr; gap: 50px; }
  .showcase.reverse { direction: ltr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .two-col { columns: 1; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: clamp(2.2rem, 9vw, 3rem); }
  section { padding: 80px 0; }
  .stat-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
  .cta-banner { padding: 50px 28px; }
  .nav-brand-tag { display: none; }
}

/* ===== Reveal animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
