/* Vula Intelligence: brand theme on the Touchstone tokens (DESIGN.md in the repo root is the source of truth).
   Only DESIGN.md values: paper/ink colours, Geist, sizes 120/48/24/18/14 (phone 56/32/20/16/14), 4-96 spacing. */
@font-face {
  font-family: "Geist Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
}

:root[data-theme="vula"] {
  --bg: #f4eee7; --panel: #ece5dc; --panel-2: #e4dcd1; --hover: #e9e2d9;
  --border: #dcd3c8; --border-strong: #c4baae;
  --text: #1e1e1e; --muted: #5c5955; --faint: #66625e;
  --accent: #1e1e1e; --accent-strong: #1e1e1e; --accent-soft: #e4dcd1; --accent-text: #1e1e1e; --on-accent: #fffbf7;
  --fs-display: 96px; --fs-h1: 48px; --fs-h2: 24px; --fs-body: 18px; --fs-small: 14px;
  --radius-control: 9999px; --radius-xl: 16px; --control-h: 48px;
  --measure: 60ch;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
@media (max-width: 720px) {
  :root[data-theme="vula"] { --fs-display: 56px; --fs-h1: 32px; --fs-h2: 20px; --fs-body: 16px; }
}
/* dark band: the deck's "Our commitment" panel */
.band-dark {
  --bg: #1e1e1e; --panel: #272727; --border: #3a3734; --border-strong: #3a3734;
  --text: #fffbf7; --muted: #b8b2ab; --accent: #fffbf7; --accent-text: #fffbf7;
  background: var(--bg); color: var(--text);
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); }
a:not(.btn) { color: inherit; }
.wrap { max-width: 1312px; margin: 0 auto; padding: 0 var(--space-6); box-sizing: border-box; }
@media (max-width: 720px) { .wrap { padding: 0 var(--space-4); } }
.muted { color: var(--muted); }
h1, h2, h3 { text-wrap: balance; }
.t-h1 { font-weight: var(--fw-regular); letter-spacing: -0.04em; line-height: 1.1; }
.skip { position: absolute; left: var(--space-4); top: -64px; z-index: 20; }
.skip:focus { top: var(--space-4); background: var(--bg); padding: var(--space-2) var(--space-3); }
.arrow { width: 0.62em; height: 0.64em; fill: currentColor; flex: none; }
.arrow-lg { width: 48px; height: 50px; }
@media (max-width: 720px) { .arrow-lg { width: 32px; height: 33px; } }
.link { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.link:hover { text-decoration-thickness: 2px; }

/* buttons: pills; one filled button on the page */
.btn { min-height: var(--control-h); padding: var(--space-2) var(--space-5); border-color: var(--text); background: transparent;
  transition: transform 300ms var(--ease), background-color 300ms var(--ease), color 300ms var(--ease); }
.btn:hover { background: var(--text); color: var(--bg); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--text); filter: none; transform: translateY(-2px); }
.btn-lg { font-size: var(--fs-body); }

/* floating nav */
.nav-wrap { position: fixed; top: var(--space-4); left: 0; right: 0; z-index: 10; display: flex; justify-content: center; padding: 0 var(--space-4); pointer-events: none; }
.nav { pointer-events: auto; display: flex; align-items: center; gap: var(--space-6); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  border-radius: 9999px; background: rgb(244 238 231 / 0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); box-shadow: 0 8px 24px rgb(30 30 30 / 0.06); max-width: 100%; box-sizing: border-box; }
.brand { font-weight: var(--fw-medium); letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.nav-links { display: flex; gap: var(--space-5); font-size: var(--fs-small); }
.nav-links a { text-decoration: none; color: var(--muted); transition: color 300ms var(--ease); }
.nav-links a:hover { color: var(--text); }
.btn-nav { min-height: 40px; padding: var(--space-2) var(--space-4); font-size: var(--fs-small); }
@media (max-width: 720px) { .nav-links { display: none; } .nav { gap: var(--space-4); width: 100%; justify-content: space-between; } }

/* ---------- hero: pinned still frame ---------- */
.hero { position: relative; }
.hero-pin { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; box-sizing: border-box;
  padding-top: var(--space-9); }
.hero-head { width: 100%; position: relative; z-index: 2; }
.hero-title { font-size: var(--fs-display); font-weight: var(--fw-regular); letter-spacing: -0.06em; line-height: 1; margin: 0;
  display: flex; flex-direction: column; text-wrap: nowrap; }
.ht-2 { margin-left: 16%; display: inline-flex; align-items: center; gap: var(--space-6); }
@media (max-width: 720px) { .ht-2 { gap: var(--space-3); margin-left: var(--space-6); } }
.frame-slot { display: none; }
.hero-body { width: 100%; display: flex; gap: var(--space-8); align-items: flex-start; padding-top: var(--space-7); padding-bottom: var(--space-7); }
.hero-intro { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-5); position: relative; z-index: 2; }
.hero-intro .lead { max-width: 28ch; color: var(--text); }
.hero-cta { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; }
@media (max-width: 900px) { .frame, .motion .frame-slot { align-self: center; } .hero-body { flex-direction: column; align-items: stretch; gap: var(--space-6); padding-top: var(--space-6); } }
/* still state (no JS, reduced motion, automation): the framed drawing sits under the title */
.frame { position: relative; z-index: 1; overflow: hidden; background: var(--bg); border-radius: var(--radius-xl);
  flex: none; width: min(560px, 100%); height: 640px; margin: 0; }
@media (max-width: 720px) { .frame { height: 420px; } }
.head { position: absolute; left: 50%; top: 50%; height: 86%; width: auto; transform: translate(-50%, -50%); }
/* motion: a tall section; the pin sticks while the frame opens to full screen */
.motion .hero { height: 420vh; }
.motion .hero-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.motion .frame-slot { display: block; flex: none; width: 100%; height: 48vh; height: max(240px, calc(100svh - 520px)); margin: 0; }
@media (min-width: 901px) {
  .motion .frame-slot { position: absolute; right: var(--space-6); top: var(--space-9); bottom: var(--space-7); width: min(46vw, 640px); height: auto; }
  .motion .hero-intro { max-width: 46%; }
}
.motion .frame { position: absolute; inset: 0; width: auto; height: auto; margin: 0; border-radius: 0; will-change: clip-path; clip-path: inset(100% 0 0 0); }
.motion .head { left: 0; top: 0; height: auto; transform-origin: 0 0; will-change: transform; }
.motion .hero-head, .motion .hero-intro { will-change: opacity, transform; }

/* ---------- sections ---------- */
.sec { padding: var(--space-9) 0; scroll-margin-top: 0; }
.sec .wrap > .sec-head, .sec .wrap > .eyebrow { scroll-margin-top: 96px; }
@media (max-width: 720px) { .sec { padding: var(--space-8) 0; } }
.sec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-5);
  padding-bottom: var(--space-5); margin-bottom: var(--space-7); border-bottom: 2px solid var(--text); }
.sec-head .t-h1 { font-size: var(--fs-display); letter-spacing: -0.06em; line-height: 1; }
.lead { font-size: var(--fs-h2); line-height: 1.4; letter-spacing: -0.01em; max-width: 34ch; }
.lead strong { font-weight: var(--fw-medium); }
.photo { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); filter: grayscale(1); }

/* opportunity */
.op-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-9); align-items: start; }
.op-copy { display: flex; flex-direction: column; gap: var(--space-5); }
.op-copy .muted { max-width: 48ch; }
.op-copy .photo { margin-top: var(--space-5); max-width: 560px; }
@media (max-width: 900px) { .op-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); } }
.stats-title { margin-bottom: var(--space-4); }
.stats { margin: 0 0 var(--space-5); }
.stats div { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-5) 0; border-top: 1px solid var(--border-strong); }
.stats div:last-child { border-bottom: 1px solid var(--border-strong); }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; font-size: var(--fs-h1); letter-spacing: -0.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* why now: oversized staggered statements (after Ribant's services list) */
.eyebrow { color: var(--muted); font-weight: var(--fw-medium); margin-bottom: var(--space-7); }
.statements { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-8); }
.statements li { display: flex; flex-direction: column; gap: var(--space-4); max-width: 900px; }
.statements li:nth-child(2) { margin-left: 12%; }
.statements li:nth-child(3) { margin-left: 24%; }
.statements .muted { max-width: 48ch; }
.statement { font-size: var(--fs-h1); letter-spacing: -0.04em; line-height: 1.1; }
@media (min-width: 1100px) { .statement { font-size: var(--fs-display); letter-spacing: -0.05em; line-height: 1; } .statements li { max-width: 1000px; } }
@media (max-width: 900px) { .statements li:nth-child(2), .statements li:nth-child(3) { margin-left: 0; } }

/* commitment (dark band) */
.cm-grid { display: block; }
@media (max-width: 900px) { .cm-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); } }
.commit { margin: 0; display: flex; flex-direction: column; }
.commit div { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-5); padding: var(--space-6) 0; border-top: 1px solid var(--border); }
.commit dd { margin: 0; color: var(--muted); }
@media (max-width: 720px) { .commit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); }
.commit div { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
@media (max-width: 900px) { .commit { grid-template-columns: minmax(0, 1fr); gap: 0; } } }
.band-dark .sec-head { border-bottom-color: var(--text); }
.photo-tall { margin-top: 0; }
@media (max-width: 900px) { .photo-tall { margin-top: 0; max-width: 420px; } }

/* steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-6); counter-reset: s; }
.steps li { counter-increment: s; display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-5); border-top: 1px solid var(--border-strong); }
@media (max-width: 1000px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* contact */
.contact { padding-bottom: var(--space-9); }
.contact-title { font-size: var(--fs-display); font-weight: var(--fw-regular); letter-spacing: -0.06em; line-height: 1; margin: 0 0 var(--space-7);
  padding-top: var(--space-5); border-top: 2px solid var(--text); }
.contact-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; }
.contact-row .lead { max-width: 30ch; }

/* footer */
.foot { border-top: 1px solid var(--border); padding: var(--space-6) 0; font-size: var(--fs-small); color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.foot .brand { color: var(--text); }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); }

/* scroll reveals: rise 32px and fade in, once (motion mode only) */
.motion .reveal { opacity: 0; transform: translateY(32px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.motion .reveal.in { opacity: 1; transform: none; }
/* commitment: title above its sentence (the photo column leaves too little room for two columns) */
.commit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); }
.commit div { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
@media (max-width: 900px) { .commit { grid-template-columns: minmax(0, 1fr); gap: 0; } }
/* phones: section titles drop to the h1 role so they stay within two lines (rule 3) */
@media (max-width: 480px) { .sec-head .t-h1 { font-size: var(--fs-h1); letter-spacing: -0.04em; } }

/* live 3D head (head3d.js): the canvas covers the opened frame; the flat drawing is the fallback */

/* motion: the opened frame always stretches over the pin (align-self: center would shrink an absolute box to 0) */
.motion .frame { align-self: stretch; justify-self: stretch; }

/* ---------- the 3D stage: one fixed layer; the hero sits under it, the other sections over it ---------- */
.stage, .stage-cap { display: none; }
.motion .stage { display: block; position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 1; pointer-events: none; }
.motion .hero-pin { z-index: 0; }
.motion main > section:not(.hero), .motion .foot { position: relative; z-index: 2; }
.motion.has-3d .frame .head, .motion.has-3d .gather-img { visibility: hidden; }
.motion .stage-cap { display: flex; flex-direction: column; gap: var(--space-2); position: fixed; z-index: 3; left: var(--space-6); bottom: var(--space-8);
  max-width: 14ch; margin: 0; font-size: var(--fs-h1); line-height: 1.1; letter-spacing: -0.04em; opacity: 0; pointer-events: none; will-change: opacity, transform; }
.cap-strong { font-weight: var(--fw-medium); }
@media (max-width: 900px) { .motion .stage-cap { left: var(--space-4); bottom: var(--space-7); max-width: 16ch; } }

/* contact: the head gathers again beside the call to action */
.contact-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-8); align-items: center; }
.gather-slot { position: relative; height: 560px; }
.gather-img { position: absolute; left: 50%; top: 50%; height: 100%; width: auto; transform: translate(-50%, -50%); }
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .gather-slot { order: -1; height: 72vw; max-height: 420px; }
}
.contact-title { padding-top: var(--space-5); }
/* phones: the hero is taller than the screen; start at the top so the title clears the nav */
@media (max-width: 900px) { .hero-pin { justify-content: flex-start; } }

/* ---------- landing extras (v5): title rises in, a ticker of datasets ---------- */
.ticker { width: 100%; max-width: 1312px; margin: 0 auto; padding: 0 var(--space-6) var(--space-6); box-sizing: border-box;
  display: flex; align-items: baseline; gap: var(--space-5); flex-wrap: wrap; position: relative; z-index: 2; }
.ticker-label { margin: 0; font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--muted); display: inline-flex; align-items: center; gap: var(--space-2); flex: none; }
.ticker-label .arrow { width: 12px; height: 12px; }
.ticker-track { flex: 1 1 18rem; min-width: 0; }
.ticker-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); font-size: var(--fs-small); color: var(--text); }
.ticker-list li { display: inline-flex; align-items: center; gap: var(--space-5); }
.motion .ticker-list li { white-space: nowrap; }
.motion .ticker-track { flex: 1 1 0; }
.ticker-list li::after { content: ""; width: 4px; height: 4px; background: var(--text); opacity: .5; }
@media (max-width: 720px) { .ticker { padding: 0 var(--space-4) var(--space-5); gap: var(--space-2); } }

.motion .frame-slot { position: relative; }
@media (min-width: 901px) { .motion .frame-slot { position: absolute; bottom: var(--space-9); } }
html.over-head, html.over-head body { cursor: pointer; }

.motion .ticker { position: absolute; left: 0; right: 0; bottom: 0; flex-wrap: nowrap; max-width: none; padding-left: 0; padding-right: 0; gap: 0;
  border-top: 1px solid var(--border); background: var(--bg); padding-bottom: 0; align-items: center; }
.motion .ticker-label { padding: var(--space-4) var(--space-5) var(--space-4) var(--space-6); border-right: 1px solid var(--border); }
.motion .ticker-track { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.motion .ticker-list { flex-wrap: nowrap; width: max-content; padding-left: var(--space-5); font-size: var(--fs-body); will-change: transform; }
@media (max-width: 720px) { .motion .ticker-label { padding: var(--space-3) var(--space-4); } .motion .ticker-label { display: none; } }

.motion .ht-1, .motion .ht-2 { animation: rise 1100ms var(--ease) both; }
.motion .ht-2 { animation-delay: 140ms; }
.motion .ht-2 .arrow { animation: arrow-in 900ms var(--ease) 700ms both; }
.motion .hero-intro > * { animation: rise 900ms var(--ease) both; }
.motion .hero-intro > :nth-child(1) { animation-delay: 380ms; }
.motion .hero-intro > :nth-child(2) { animation-delay: 500ms; }
.motion .hero-intro > :nth-child(3) { animation-delay: 620ms; }
.motion .ticker { animation: fade-in 900ms var(--ease) 900ms backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(0.5em); } to { opacity: 1; transform: none; } }
@keyframes arrow-in { from { opacity: 0; transform: translate(-40%, -40%); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
