/* AI West mockup. Tokens first, then base, then components. */
:root {
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --ink: #141413;
  --muted: #6B6A64;
  --line: #E4E2DB;
  --line2: #CFCCC3;
  --ember: #E4572E;
  --sage: #6E8F72;
  --sky: #5B8DEF;
  --ochre: #E0A030;
  --radius: 16px;
  --deep: #1B1B19;
  --on-deep: #F2F0EA;
  --deep-muted: #A3A198;
  --deep-line: #3A3935;
}
/* Light by default. Dark only when the visitor flips the footer toggle (data-theme=dark). */
:root[data-theme="dark"] {
  --bg: #111110;
  --surface: #1A1A18;
  --ink: #F2F0EA;
  --muted: #A3A198;
  --line: #2B2A27;
  --line2: #403E3A;
  --deep: #1E1E1B;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, iframe { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 999px; z-index: 50; }
.skip:focus { left: 16px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(40px, 7vw, 72px); text-wrap: balance; }
h2 { font-size: clamp(30px, 4.4vw, 48px); text-wrap: balance; }
h3 { font-size: 22px; letter-spacing: -0.01em; line-height: 1.25; }
p { margin: 0; }
em.serif { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; font-size: 1.08em; letter-spacing: -0.01em; }
.label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.label::before { content: ""; display: inline-block; width: 18px; height: 1px; background: var(--ember); vertical-align: middle; margin-right: 10px; }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 58ch; line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.stack > * + * { margin-top: 20px; }

/* Header */
.site-head { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; font-size: 18px; }
.brand i { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); display: inline-block; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 15px; transition: color 0.15s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a.btn { color: var(--bg); }
.menu-btn { display: none; background: none; border: 1px solid var(--line2); color: var(--ink); height: 40px; padding: 0 16px; border-radius: 999px; font: inherit; font-size: 14px; cursor: pointer; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 26px; border-radius: 999px; font: 500 15px/1 "Inter Tight", system-ui, sans-serif; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-ghost { border-color: var(--line2); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { height: 40px; padding: 0 20px; font-size: 14px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.link { text-decoration: none; border-bottom: 1px solid var(--line2); padding-bottom: 2px; transition: border-color 0.15s; }
.link:hover { border-color: var(--ember); }

/* Sections */
section { padding: clamp(72px, 10vw, 120px) 0; }
section + section { border-top: 1px solid var(--line); }
section.alt { background: var(--surface); }
.sec-head { display: grid; gap: 14px; margin-bottom: clamp(36px, 5vw, 56px); }
.sec-head .lede { margin-top: 4px; }

/* Hero */
.hero { padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(48px, 7vw, 88px); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); letter-spacing: 0.04em; margin-bottom: 28px; }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); }
.hero h1 { max-width: 20ch; }
.hero .lede { margin-top: 28px; }
.hero .btn-row { margin-top: 36px; }
.hero .strip { margin-top: 28px; font-size: 13px; color: var(--muted); }
.hero-diagram { margin-top: clamp(40px, 5vw, 56px); }
.hero-d { display: block; width: 100%; height: auto; }
.hero-m { display: none; width: 100%; max-width: 340px; margin: 0 auto; height: auto; }

/* Diagram primitives */
svg .n { fill: var(--surface); stroke: var(--line2); stroke-width: 1.2; }
svg .n.hi { stroke: var(--c, var(--sage)); stroke-width: 1.6; }
svg .t { fill: var(--ink); font: 500 11.5px "Inter Tight", system-ui, sans-serif; text-anchor: middle; dominant-baseline: middle; }
svg .t.lg { font-size: 15px; }
svg .t.m { fill: var(--muted); font-weight: 400; font-size: 11px; }
svg .l { stroke: var(--line2); fill: none; stroke-width: 1.2; }
svg .l.hi { stroke: var(--c, var(--sage)); stroke-width: 1.8; }
svg .dot { fill: var(--c, var(--sage)); }
svg .dash { stroke-dasharray: 3 4; }
svg .ar { fill: var(--line2); }
.draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.js .rv .draw { stroke-dashoffset: 1; }
.js .rv.in .draw { animation: draw 1.4s ease-out 0.15s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.diagram svg { display: block; width: 100%; height: auto; }

/* Reveal */
.js .rv { opacity: 0; transform: translateY(8px); transition: opacity 0.3s ease-out, transform 0.3s ease-out; }
.js .rv.in { opacity: 1; transform: none; }

/* Columns */
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.col h3 { margin: 18px 0 10px; }
.col p { color: var(--muted); }
.col .diagram { border-bottom: 1px solid var(--line); padding-bottom: 20px; }

/* Cards */
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 18px; text-decoration: none; color: inherit; transition: border-color 0.2s, transform 0.2s; }
.card:hover { border-color: color-mix(in srgb, var(--c, var(--line2)) 55%, var(--line2)); transform: translateY(-2px); }
section.alt .card { background: var(--bg); }
.card .diagram { background: color-mix(in srgb, var(--c, var(--sage)) 8%, transparent); border-radius: 12px; padding: 18px 16px 14px; }
.card h3 { margin-top: 2px; }
.card p { color: var(--muted); font-size: 16px; }
.card .go { margin-top: auto; font-size: 14px; font-weight: 500; }
.tag { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500; }
.tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--sage)); }
.tag.demo { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; border: 1px solid var(--line2); border-radius: 999px; padding: 2px 10px; }
.tag-row { display: flex; align-items: center; gap: 10px; }
.more { margin-top: 32px; }

/* Rows */
.rows .row { display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.rows .row:last-child { border-bottom: 1px solid var(--line); }
.rows .row b { font-weight: 500; font-size: 19px; letter-spacing: -0.01em; }
.rows .row span { color: var(--muted); }

/* Fit */
.fit { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.fit .note { margin-top: 20px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }

/* Figures */
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.fig { border-top: 1px solid var(--line2); padding-top: 18px; }
.figs3 { grid-template-columns: repeat(3, 1fr); row-gap: 40px; }
.fig b { display: block; font-size: clamp(36px, 5vw, 52px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.fig span { display: block; margin-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.band { display: grid; grid-template-columns: 1fr; gap: 40px; }
.band-top { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.step { position: relative; padding-top: 44px; }
.step::before { content: ""; position: absolute; top: 8px; left: 0; right: -48px; height: 1px; background: var(--line2); }
.step:last-child::before { right: 0; }
.step::after { content: ""; position: absolute; top: 2px; left: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 1px solid var(--ink); }
section.alt .step::after { background: var(--surface); }
.step .num { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); font-weight: 500; }
.step h3 { margin: 6px 0 10px; }
.step p { color: var(--muted); }

/* Products */
.prod { display: flex; flex-direction: column; gap: 14px; }
.prod .tag-row { margin-bottom: 4px; }
.prod ul { margin: 6px 0 0; padding: 0 0 0 18px; color: var(--muted); font-size: 16px; }
.prod li { margin: 4px 0; }
.prod .meta { font-size: 14px; color: var(--muted); }

/* Videos */
.vids { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.vid { text-decoration: none; display: block; }
.vid img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: block; background: var(--line); transition: transform 0.2s; }
.vid:hover img { transform: translateY(-2px); }
.vid span { display: block; margin-top: 14px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.35; }

/* CTA */
.cta { text-align: left; }
.cta h2 { max-width: 18ch; }
.cta p { margin-top: 18px; color: var(--muted); font-size: 19px; max-width: 46ch; }
.cta .btn-row { margin-top: 32px; }
.cta .mail { margin-top: 18px; font-size: 14px; color: var(--muted); }

/* Page head */
.page-head { padding: clamp(64px, 9vw, 112px) 0 clamp(36px, 5vw, 56px); }
.page-head h1 { margin-top: 20px; max-width: 18ch; }
.page-head .lede { margin-top: 24px; }
.crumb { font-size: 14px; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--ink); }

/* Work index */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.chip { height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--ink); font: 400 14px "Inter Tight", system-ui, sans-serif; cursor: pointer; transition: background 0.15s, color 0.15s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
[hidden] { display: none !important; }

/* Case study */
.case { padding: 0 0 clamp(72px, 9vw, 120px); }
.case section { padding: clamp(48px, 6vw, 72px) 0; border-top: 1px solid var(--line); }
.case section.first { border-top: 0; padding-top: 0; }
.case h2 { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 24px; }
.case ul.plain { margin: 0; padding: 0; list-style: none; max-width: 70ch; }
.case ul.plain li { padding: 14px 0; border-top: 1px solid var(--line); color: var(--ink); }
.case ul.plain li:last-child { border-bottom: 1px solid var(--line); }
.result { font-size: clamp(22px, 2.8vw, 30px); letter-spacing: -0.015em; line-height: 1.3; font-weight: 500; max-width: 30ch; padding-left: 24px; border-left: 2px solid var(--sage); }
.built { font-size: 14px; color: var(--muted); }
.built b { font-weight: 500; color: var(--ink); margin-right: 8px; }
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: start; }

/* Flow (HTML diagram) */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px; }
.flow .st { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; position: relative; }
.flow .st::after { content: ""; position: absolute; top: 50%; right: -36px; width: 36px; height: 1px; background: var(--line2); }
.flow .st:last-child::after { display: none; }
.flow .st.hi { border-color: var(--sage); }
.flow .st .n { font-size: 12px; color: var(--muted); letter-spacing: 0.08em; font-weight: 500; }
.flow .st h3 { font-size: 18px; margin: 8px 0 8px; }
.flow .st p { font-size: 14px; color: var(--muted); line-height: 1.5; }
.flow .st.hi .n { color: var(--sage); }

/* Embed frame */
.frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.frame .bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.frame .bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line2); }
.frame .bar span { margin-left: 8px; }
.frame iframe { width: 100%; aspect-ratio: 16 / 10; min-height: 560px; border: 0; display: block; background: var(--bg); }
.caption { margin-top: 14px; font-size: 13px; color: var(--muted); max-width: 80ch; line-height: 1.5; }
.frame-links { display: flex; gap: 24px; margin-top: 16px; font-size: 14px; flex-wrap: wrap; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.demo-frame { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: clamp(32px, 6vw, 72px); text-align: center; display: grid; gap: 16px; justify-items: center; }
.demo-frame .diagram { width: min(520px, 100%); }
.todo { border: 1px dashed var(--line2); border-radius: 12px; padding: 14px 16px; color: var(--muted); font-size: 14px; display: flex; gap: 12px; align-items: flex-start; }
.todo b { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ember); font-weight: 600; padding-top: 2px; }

/* Prose */
.prose { max-width: 680px; }
.prose h2 { font-size: 28px; margin: 56px 0 14px; }
.prose h3 { font-size: 20px; margin: 32px 0 10px; }
.prose p, .prose li { color: var(--muted); }
.prose p + p { margin-top: 16px; }
.prose ul { padding-left: 20px; }
.prose strong { color: var(--ink); font-weight: 500; }
.prin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.prin > div { border-top: 1px solid var(--line2); padding-top: 18px; }
.prin h3 { font-size: 19px; margin-bottom: 8px; }
.prin p { color: var(--muted); font-size: 16px; }
.now { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; background: var(--surface); max-width: 680px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: 56px 0 40px; font-size: 14px; color: var(--muted); }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.foot h4 { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; margin-bottom: 14px; color: var(--muted); }
.foot a { display: block; text-decoration: none; padding: 4px 0; color: var(--ink); }
.foot a:hover { color: var(--ember); }
.foot-base { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.theme-btn { background: none; border: 1px solid var(--line2); color: var(--ink); height: 34px; padding: 0 14px; border-radius: 999px; font: 400 13px "Inter Tight", system-ui, sans-serif; cursor: pointer; }

/* Responsive */
@media (max-width: 880px) {
  .cols3, .steps, .vids, .grid3, .prin, .figs3 { grid-template-columns: 1fr; gap: 36px; }
  .grid2 { grid-template-columns: 1fr; }
  .fit, .split { grid-template-columns: 1fr; gap: 32px; }
  .rows .row { grid-template-columns: 1fr; gap: 6px; }
  .step::before { display: none; }
  .step { padding-top: 36px; border-top: 1px solid var(--line2); }
  .step::after { top: -7px; }
  .flow { grid-template-columns: 1fr; gap: 36px; }
  .flow .st::after { top: auto; bottom: -36px; right: auto; left: 50%; width: 1px; height: 36px; }
  .foot { grid-template-columns: 1fr; gap: 28px; }
  .hero-d { display: none; }
  .hero-m { display: block; }
  .menu-btn { display: inline-block; }
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--bg); flex-direction: column; align-items: flex-start; gap: 0; padding: 8px clamp(16px, 4vw, 32px) 24px; border-bottom: 1px solid var(--line); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 0; width: 100%; font-size: 17px; border-bottom: 1px solid var(--line); }
  .nav-links a.btn { width: auto; margin-top: 16px; border-bottom: 0; padding: 0 22px; }
  .frame iframe { aspect-ratio: auto; height: 720px; min-height: 0; }
  .tag.demo { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv { opacity: 1; transform: none; transition: none; }
  .js .rv .draw, .js .rv.in .draw { animation: none; stroke-dashoffset: 0; }
  .btn, .card, .vid img { transition: none; }
}


/* ---- Character pass: colour washes, deep sections, feature card ---- */
.hero { position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }
.hero::before { content: ""; position: absolute; inset: -10% -8% 0 28%; pointer-events: none; filter: blur(30px);
  background:
    radial-gradient(38% 46% at 72% 22%, color-mix(in srgb, var(--sky) 20%, transparent), transparent 70%),
    radial-gradient(30% 40% at 92% 58%, color-mix(in srgb, var(--ochre) 18%, transparent), transparent 70%),
    radial-gradient(36% 44% at 48% 70%, color-mix(in srgb, var(--sage) 18%, transparent), transparent 70%); }
.hero h1 em.serif { color: var(--ember); }
h2 em.serif { font-size: 1.1em; }

.deep { background: var(--deep); color: var(--on-deep); }
.deep + section, section + .deep { border-top-color: transparent; }
.deep h2, .deep h3 { color: var(--on-deep); }
.deep .label, .deep .muted, .deep p, .deep .fig span { color: var(--deep-muted); }
.deep .link { color: var(--on-deep); border-color: var(--deep-line); }
.deep .link:hover { border-color: var(--ember); }
.deep .fig { border-top: 2px solid var(--deep-line); }
.deep .fig:nth-child(1) { border-top-color: #9DBBA0; }
.deep .fig:nth-child(1) b { color: #A9C7AC; }
.deep .fig:nth-child(2) { border-top-color: #8FB2F5; }
.deep .fig:nth-child(2) b { color: #A3C0F7; }
.deep .fig:nth-child(3) { border-top-color: #EDBB5E; }
.deep .fig:nth-child(3) b { color: #F0C878; }
.deep .btn-primary { background: var(--on-deep); color: var(--deep); }
.deep .cta p, .cta.deep p { color: var(--deep-muted); }
.deep .mail { color: var(--deep-muted); }

.figs .fig { border-top-width: 2px; }
.figs .fig:nth-child(3n+1) { border-top-color: var(--sage); }
.figs .fig:nth-child(3n+2) { border-top-color: var(--sky); }
.figs .fig:nth-child(3n) { border-top-color: var(--ochre); }

.step:nth-child(1)::after { background: var(--sage); border-color: var(--sage); }
.step:nth-child(2)::after { background: var(--sky); border-color: var(--sky); }
.step:nth-child(3)::after { background: var(--ochre); border-color: var(--ochre); }
section.alt .step:nth-child(1)::after { background: var(--sage); }
section.alt .step:nth-child(2)::after { background: var(--sky); }
section.alt .step:nth-child(3)::after { background: var(--ochre); }

.flow .st.hi { border-color: var(--c, var(--sage)); }
.flow .st.hi .n { color: var(--c, var(--sage)); }
.demo-frame { background: color-mix(in srgb, var(--c, var(--sky)) 6%, var(--surface)); }

/* Feature card: the lead work item */
.card.feature { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 5vw, 64px); align-items: center; padding: clamp(28px, 4vw, 52px); border-color: color-mix(in srgb, var(--c) 30%, var(--line)); }
.card.feature .ftext { display: flex; flex-direction: column; gap: 20px; }
.card.feature h3 { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.08; letter-spacing: -0.02em; }
.card.feature p { font-size: 18px; max-width: 46ch; }
.card.feature .diagram { padding: clamp(20px, 3vw, 36px); }
.card.feature .tag.demo { margin-left: 0; }
.tag.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sage); margin-right: 7px; display: inline-block; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sage) 50%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
@media (max-width: 880px) { .card.feature { grid-template-columns: 1fr; } .card.feature .diagram { order: -1; } }
@media (prefers-reduced-motion: reduce) { .tag.live::before { animation: none; } }

svg .t.lg2 { font-size: 14px; }
.card.feature .diagram svg.wd { max-width: 340px; margin: 0 auto; }
