/* 9L Labs - one stylesheet. Tokens first; docs/brand/BRAND.md explains them.
   Dark is the default mood (screens in a room at night); light follows the device. */

:root {
  --bg: #0b0d12;
  --bg-alt: #10131a;
  --surface: #151924;
  --surface-2: #1b2030;
  --ink: #ece9e2;
  --muted: #9aa1ad;
  --line: #262c3a;
  --accent: #eaa65e;          /* dawn amber */
  --accent-ink: #1a1206;
  --pond: #5fb8ab;            /* pond teal */
  --slate: #93a6c4;           /* grey-blue */
  --rose: #d97b67;
  --focus: #f3c58f;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 40px -24px rgba(0,0,0,.6);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;

  --step--1: clamp(.83rem, .8rem + .15vw, .9rem);
  --step-0: clamp(1rem, .96rem + .2vw, 1.0625rem);
  --step-1: clamp(1.2rem, 1.1rem + .45vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3rem);
  --step-4: clamp(2.5rem, 1.8rem + 3.6vw, 4.5rem);

  --radius: 14px;
  --gutter: clamp(16px, 4vw, 32px);
  --max: 1160px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f4ef;
    --bg-alt: #eeebe3;
    --surface: #ffffff;
    --surface-2: #f8f6f1;
    --ink: #15171c;
    --muted: #5b616c;
    --line: #e0dbd0;
    --accent: #b9621f;
    --accent-ink: #ffffff;
    --pond: #2c7d72;
    --slate: #4d6283;
    --rose: #b24f3c;
    --focus: #b9621f;
    --shadow: 0 1px 2px rgba(20,20,30,.05), 0 20px 40px -28px rgba(20,20,30,.25);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .2em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 650; text-wrap: balance; }
h1 { font-size: var(--step-4); letter-spacing: -.035em; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; text-wrap: pretty; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 760px; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

.eyebrow {
  font: 500 var(--step--1)/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: 1rem;
}
.eyebrow a { text-decoration: none; }
.lead { font-size: var(--step-1); color: var(--muted); max-width: 46ch; line-height: 1.5; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; text-decoration: none; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .95rem; transition: color .2s, background .2s; }
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }

.nav-mobile { display: none; position: relative; }
.nav-mobile summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-content: center; gap: 6px; border-radius: 10px; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile summary span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s; }
.nav-mobile[open] summary span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-mobile[open] summary span:last-child { transform: translateY(-4px) rotate(-45deg); }
.nav-mobile nav { position: absolute; right: 0; top: 52px; min-width: 200px; display: grid; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.nav-mobile nav a { padding: 12px 14px; text-decoration: none; border-radius: 8px; }
.nav-mobile nav a[aria-current="page"] { background: var(--surface-2); }
@media (max-width: 720px) { .nav { display: none; } .nav-mobile { display: block; } }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }
.btn { display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; border-radius: 999px; font-weight: 600; text-decoration: none; transition: transform .15s, background .2s, border-color .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.btn-ghost:hover { border-color: var(--muted); }
.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " \2192"; }

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(96px, 16vh, 180px) 0 clamp(80px, 12vh, 140px); }
.hero-short { padding: clamp(72px, 12vh, 120px) 0 clamp(56px, 9vh, 96px); }
.hero .ambient { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; filter: blur(28px) saturate(1.15); transform: scale(1.1); opacity: .9; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 40%, var(--bg) 100%); }
.hero h1 { max-width: 16ch; }
.hero-inner { position: relative; }

/* ---------- sections ---------- */
.section { padding: clamp(64px, 10vh, 120px) 0; }
.section-tight { padding-top: clamp(32px, 5vh, 56px); }
.section-alt { background: var(--bg-alt); border-block: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.section-head { max-width: 720px; margin-bottom: 2.5rem; }
.page-head { padding: clamp(64px, 12vh, 128px) 0 clamp(16px, 3vh, 32px); }
.page-head h1 { font-size: var(--step-3); max-width: 22ch; }
.split { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.two-col { display: grid; gap: clamp(32px, 6vw, 72px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.two-col h2:not(:first-child) { margin-top: 2rem; }
@media (max-width: 860px) { .split, .two-col { grid-template-columns: minmax(0, 1fr); } }
.stack { display: grid; gap: 24px; }

/* ---------- product cards ---------- */
.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.card {
  --tone: var(--accent);
  position: relative; display: flex; flex-direction: column; gap: .25rem;
  padding: 28px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  text-decoration: none; overflow: hidden; transition: transform .2s, border-color .2s;
}
.card::before {
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tone) 38%, transparent), transparent 70%);
  pointer-events: none;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--tone) 50%, var(--line)); }
.card h3 { margin: 1rem 0 .25rem; font-size: var(--step-2); }
.card .tagline { color: var(--tone); font-weight: 600; margin-bottom: .75rem; }
.card p { color: var(--muted); }
.card .more { margin-top: auto; padding-top: 1rem; font-weight: 600; }
.tone-slate { --tone: var(--slate); }
.tone-dawn { --tone: var(--accent); }
.tone-pond { --tone: var(--pond); }

.status { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font: 500 .75rem/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-live { color: var(--pond); }
.status-review { color: var(--accent); }
.status-dev { color: var(--slate); }
.status-planned { color: var(--muted); }

/* product long form */
.product { display: grid; gap: clamp(24px, 4vw, 56px); grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); padding: clamp(28px, 4vw, 44px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden; }
.product::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tone); }
.product h2 { font-size: var(--step-3); margin: .75rem 0 .25rem; }
.product .tagline { color: var(--tone); font-weight: 600; }
.product .body p { color: var(--muted); }
.product .body p:first-child { color: var(--ink); }
.product dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 1.5rem 0 0; font-size: var(--step--1); }
.product dt { color: var(--muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; padding-top: .2em; }
.product dd { margin: 0; }
@media (max-width: 860px) { .product { grid-template-columns: minmax(0, 1fr); } }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.chips li { font-size: .8rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }

/* ---------- principles ---------- */
.principles { display: grid; gap: 1px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.principles article { background: var(--bg-alt); padding: 28px; }
.principles .num { display: block; font: 500 .8rem/1 var(--font-mono); color: var(--accent); margin-bottom: 1.25rem; }
.principles p { color: var(--muted); margin: 0; }

/* ---------- platforms ---------- */
.platforms { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.platforms li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.platforms strong { font-weight: 600; display: block; }
.platforms span.note { color: var(--muted); font-size: var(--step--1); }

/* ---------- contacts ---------- */
.contacts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.contact { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.contact h3 { font-size: 1rem; margin-bottom: .35rem; }
.contact p { color: var(--muted); font-size: var(--step--1); margin-bottom: .9rem; }
.contact a { font-weight: 600; word-break: break-word; }
.support-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.support-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 18px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }

/* ---------- facts ---------- */
.facts-list { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 10px 20px; margin: 0 0 1.5rem; padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.facts-list dt { color: var(--muted); font-size: var(--step--1); }
.facts-list dd { margin: 0; }
@media (max-width: 520px) { .facts-list { grid-template-columns: minmax(0, 1fr); gap: 2px; } .facts-list dd { margin-bottom: 10px; } }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.facts { width: 100%; border-collapse: collapse; font-size: var(--step--1); min-width: 640px; }
table.facts th, table.facts td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.facts thead th { font: 500 .72rem/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
table.facts tbody tr:last-child td, table.facts tbody tr:last-child th { border-bottom: 0; }

/* ---------- prose ---------- */
.prose h2 { font-size: var(--step-1); margin-top: 2.25rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .6rem; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding-left: 28px; margin-bottom: 1rem; color: var(--muted); }
.ticks li strong { color: var(--ink); }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent); }

/* ---------- cta ---------- */
.cta-inner { text-align: center; display: grid; justify-items: center; }
.cta-inner p { color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 32px; background: var(--bg-alt); font-size: var(--step--1); }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 2fr repeat(3, 1fr); }
.footer-grid h2 { font: 500 .72rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 1rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { text-decoration: underline; }
.footer-brand p { margin: .75rem 0 0; }
.footer-base { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); }
.footer-base p { margin: 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

.page-404 { min-height: 60vh; }
