/* LydianTech.ai — shared styles. Tokens first; dark mode redefines tokens only. */
/* Self-hosted fonts (latin subset). No third-party font requests, so the CSP can stay font-src 'self'. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/Inter-var.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/SourceSerif4-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/SourceSerif4-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #fbfaf6;
  --surface: #ffffff;
  --surface-2: #f4f1ea;
  --ink: #16181d;
  --ink-2: #3a3f47;
  --muted: #5d636d;
  --line: #e4dfd3;
  --stone: #16181d;
  --stone-ink: #f4f1ea;
  --gold: #b8892b;
  --gold-ink: #8a6417;
  --gold-soft: #f5ecd6;
  --teal: #0e7a72;
  --teal-soft: #dff1ee;
  --good: #1f7a3d;
  --warn: #9a6a00;
  --bad: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 24, 29, .06), 0 8px 24px rgba(22, 24, 29, .06);
  --max: 1160px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1114;
    --surface: #171a1f;
    --surface-2: #1d2127;
    --ink: #eeece6;
    --ink-2: #cfd2d6;
    --muted: #a2a8b0;
    --line: #2b3038;
    --stone: #0a0b0d;
    --stone-ink: #eeece6;
    --gold: #d9ad4f;
    --gold-ink: #e3bd66;
    --gold-soft: #2a2416;
    --teal: #45c2b5;
    --teal-soft: #142a28;
    --good: #5cc27f;
    --warn: #e0b04a;
    --bad: #f07a70;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1114; --surface: #171a1f; --surface-2: #1d2127; --ink: #eeece6; --ink-2: #cfd2d6;
  --muted: #a2a8b0; --line: #2b3038; --stone: #0a0b0d; --stone-ink: #eeece6; --gold: #d9ad4f;
  --gold-ink: #e3bd66; --gold-soft: #2a2416; --teal: #45c2b5; --teal-soft: #142a28;
  --good: #5cc27f; --warn: #e0b04a; --bad: #f07a70; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--gold-ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } body { font-size: 16px; } }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--sans); font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; }
.brand svg { width: 34px; height: 34px; }
.brand .t { color: var(--teal); }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a { display: block; padding: 8px 11px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .95rem; font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ink); font: inherit; cursor: pointer; }
@media (max-width: 1020px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav-links.open { display: flex; }
  .nav-links .btn { margin-top: 8px; text-align: center; }
}

/* Buttons */
.btn { display: inline-block; padding: 12px 20px; border-radius: 10px; font-weight: 600; text-decoration: none; font-size: .98rem; border: 1px solid transparent; transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--stone); color: var(--stone-ink); }
.btn-primary:hover { color: var(--gold); }
:root[data-theme="dark"] .btn-primary, .btn-primary { box-shadow: inset 0 -2px 0 var(--gold); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.nav-links .btn-primary { color: var(--stone-ink); padding: 9px 14px; }

/* Sections */
section { padding: 88px 0; }
@media (max-width: 700px) { section { padding: 60px 0; } }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 14px; }
.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 720px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }
.alt { background: var(--surface-2); }
.dark { background: var(--stone); color: var(--stone-ink); }
.dark .lead, .dark p { color: color-mix(in srgb, var(--stone-ink) 82%, transparent); }
.dark .eyebrow { color: var(--gold); }
.dark h2, .dark h3 { color: var(--stone-ink); }

/* Hero */
.hero { padding: 96px 0 80px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }
.hero h1 em { font-style: normal; color: var(--gold-ink); }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.page-hero { padding: 72px 0 48px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(2rem, 4.4vw, 3rem); max-width: 860px; }

/* Stone card (hero visual) */
.stone-card { background: var(--stone); color: var(--stone-ink); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); position: relative; }
.stone-card .row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: .95rem; }
.stone-card .row:last-of-type { border-bottom: 0; }
.stone-card .k { color: rgba(244,241,234,.7); }
.stone-card .ok { color: #7fd6a0; font-weight: 600; white-space: nowrap; }
.stone-card .fix { color: #f1c86b; font-weight: 600; white-space: nowrap; }
.stone-card .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stone-card .head b { font-family: var(--serif); font-size: 1.15rem; }
.stone-card .tag { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.stone-card .verdict { margin-top: 16px; padding: 14px; border-radius: 12px; background: rgba(184,137,43,.14); border: 1px solid rgba(217,173,79,.35); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.streak { height: 6px; border-radius: 6px; background: linear-gradient(90deg, transparent, var(--gold) 20%, #f1d58f 60%, transparent); margin: 18px 0 6px; opacity: .9; }

/* Grids and cards */
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .4em; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); margin-bottom: 16px; }
.card .icon svg { width: 24px; height: 24px; }
.card.gold .icon { background: var(--gold-soft); color: var(--gold-ink); }
.card a.more { font-weight: 600; text-decoration: none; }
.card a.more::after { content: " →"; }
.section-head { max-width: 760px; margin-bottom: 40px; }
.center.section-head { margin-left: auto; margin-right: auto; }

ul.check { list-style: none; padding: 0; margin: 0 0 1em; }
ul.check li { position: relative; padding-left: 28px; margin: 0 0 .55em; }
ul.check li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 14px; height: 8px; border-left: 2.5px solid var(--teal); border-bottom: 2.5px solid var(--teal); transform: rotate(-45deg); }
.dark ul.check li::before { border-color: var(--gold); }

/* Promise strip */
.promises { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 960px) { .promises { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .promises { grid-template-columns: 1fr; } }
.promise { border-top: 3px solid var(--gold); padding: 16px 4px 0; }
.promise b { display: block; font-family: var(--serif); font-size: 1.15rem; margin-bottom: 4px; }
.promise span { color: var(--muted); font-size: .95rem; }

/* Punch */
.dark.band { padding: 48px 0; }
.punch.punch-sm { font-size: clamp(1.1rem, 2vw, 1.4rem); line-height: 1.45; max-width: 820px; margin-bottom: 0; }
.link-gold { color: var(--gold); font-weight: 600; text-decoration: none; }
.link-gold::after { content: " →"; }
.link-gold:hover { color: #f1d58f; }
.punch { font-family: var(--serif); font-size: clamp(1.7rem, 4vw, 2.8rem); line-height: 1.2; max-width: 900px; margin: 0 auto 24px; }
.punch em { font-style: normal; color: var(--gold); }
.timeline-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 40px; text-align: left; }
@media (max-width: 860px) { .timeline-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .timeline-mini { grid-template-columns: 1fr; } }
.timeline-mini div { border-left: 2px solid var(--gold); padding: 2px 0 2px 16px; }
.timeline-mini b { display: block; font-family: var(--serif); font-size: 1.5rem; color: var(--gold); }

/* Workflow steps */
.steps { counter-reset: step; display: grid; gap: 16px; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step::before { counter-increment: step; content: counter(step, decimal-leading-zero); font-family: var(--serif); font-size: 1.5rem; color: var(--gold-ink); font-weight: 600; }
.step h3 { margin-bottom: .3em; }
.step p { color: var(--ink-2); }
.step.key { border-color: var(--gold); background: linear-gradient(0deg, var(--gold-soft), var(--surface) 70%); }
.step .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { font-size: .8rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.chip.ai { background: var(--teal-soft); color: var(--teal); border-color: transparent; font-weight: 600; }

/* Loop diagram */
.loop { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin: 12px 0 8px; }
.loop span { padding: 10px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .95rem; }
.loop span.gate { background: var(--stone); color: var(--gold); border-color: var(--stone); }
.loop i { color: var(--muted); font-style: normal; }
.dark .loop span { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: var(--stone-ink); }
.dark .loop span.gate { background: var(--gold); color: var(--stone); }

/* Mapping table */
.map { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.map th, .map td { padding: 16px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.map th { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.map td:first-child { font-family: var(--serif); font-weight: 600; width: 32%; }
.map tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) { .map th { display: none; } .map td { display: block; width: auto !important; border-bottom: 0; padding: 6px 16px; } .map tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 0; } }

/* Story */
.story { max-width: 740px; margin: 0 auto; }
.story p { font-size: 1.12rem; color: var(--ink-2); }
.story .year { font-family: var(--serif); color: var(--gold-ink); font-weight: 600; font-size: 1.4rem; display: block; margin: 36px 0 6px; }
.story blockquote { margin: 40px 0; padding: 24px 28px; border-left: 4px solid var(--gold); background: var(--gold-soft); border-radius: 0 var(--radius) var(--radius) 0; font-family: var(--serif); font-size: 1.4rem; line-height: 1.35; color: var(--ink); }

/* Dashboard mock */
.dash { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; }
.dash-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-top .note { font-size: .8rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.kpi .v { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; }
.kpi .l { font-size: .85rem; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px; }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }
.panel { border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
.panel h4 { margin: 0 0 12px; font-size: .95rem; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 70px 1fr 64px; align-items: center; gap: 10px; font-size: .88rem; position: relative; }
.bar .track { height: 18px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--teal); border-radius: 0 4px 4px 0; }
.bar .num { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bar:hover .fill { filter: brightness(1.15); }
.bar .tip { display: none; position: absolute; left: 80px; top: -34px; background: var(--ink); color: var(--bg); padding: 4px 8px; border-radius: 6px; font-size: .8rem; white-space: nowrap; z-index: 2; }
.bar:hover .tip, .bar:focus-within .tip { display: block; }
.claims { width: 100%; border-collapse: collapse; font-size: .88rem; }
.claims th, .claims td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.claims th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.table-scroll { overflow-x: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .82rem; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.good { color: var(--good); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--bad); } .pill.info { color: var(--teal); }
.chrono { list-style: none; margin: 0; padding: 0; position: relative; }
.chrono li { position: relative; padding: 0 0 18px 28px; }
.chrono li::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: -8px; width: 2px; background: var(--line); }
.chrono li:last-child::before { display: none; }
.chrono li::after { content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--teal); }
.chrono li.gate::after { border-color: var(--gold); }
.chrono time { display: block; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chrono b { font-weight: 600; }

/* CTA band */
.cta-band { background: var(--stone); color: var(--stone-ink); border-radius: 22px; padding: 48px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { color: var(--stone-ink); margin: 0 0 6px; }
.cta-band p { margin: 0; color: rgba(244,241,234,.78); }
.cta-band .btn-primary { background: var(--gold); color: #16181d; box-shadow: none; }
@media (max-width: 600px) { .cta-band { padding: 32px 22px; } }

/* Callout */
.callout { border: 1px solid var(--line); border-left: 4px solid var(--teal); background: var(--surface); padding: 18px 22px; border-radius: 0 var(--radius) var(--radius) 0; }
.callout.gold { border-left-color: var(--gold); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 32px; font-size: .92rem; color: var(--muted); }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .foot { grid-template-columns: 1fr; } }
.foot h4 { color: var(--ink); margin: 0 0 10px; font-size: .95rem; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 6px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* Contact form */
.form { display: grid; gap: 16px; margin-top: 8px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--bad); }
.field input, .field select, .field textarea { width: 100%; font: inherit; font-size: .98rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: transparent; }
.field .hint { font-size: .8rem; color: var(--muted); }
.consent { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; font-size: .86rem; color: var(--muted); }
.consent input { width: 16px; height: 16px; margin-top: 3px; }
.form button[disabled] { opacity: .7; cursor: default; transform: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; }
.form-status[hidden] { display: none; }
.callout--ok { border-left-color: var(--good); }
.callout--warn { border-left-color: var(--warn); }
.callout--error { border-left-color: var(--bad); }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }
