:root {
  --bg: #f6f5f1;
  --ink: #141414;
  --muted: #76756f;
  --rule: #dcdad3;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --ink: #ecebe6;
    --muted: #93928c;
    --rule: #2c2b28;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.wrap { max-width: 960px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* Header */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 32px; padding-bottom: 32px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; text-decoration: none; }
.mark { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.nav { color: var(--muted); text-decoration: none; }
.nav:hover { color: var(--ink); }
.nav-links { display: flex; gap: 24px; }
.nav[aria-current="page"] { color: var(--ink); }

/* Sections: space only, no rules */
main > section { padding-top: 120px; padding-bottom: 0; }
main > section.hero { padding-top: 160px; }
main > section:last-child { padding-bottom: 160px; }

h1, h3, .statement, .principle, .stats dt {
  font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em;
}
h1 { font-size: clamp(48px, 9vw, 96px); line-height: 1; margin: 0 0 32px; }
.lede { font-size: 20px; max-width: 30em; margin: 0 0 48px; }
.rotator-lines { display: grid; margin: 0; }
.rotator-lines span {
  grid-area: 1 / 1; opacity: 0; transform: translateY(6px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.rotator-lines span.is-active { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rotator-lines span { transition: none; }
}

.btn {
  display: inline-block; padding: 14px 24px; border-radius: 999px;
  background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 500;
}
.btn:hover { opacity: 0.85; }

/* Results */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; margin: 0; }
.stats dt { font-size: 64px; line-height: 1; margin-bottom: 8px; }
.stats dd { margin: 0; color: var(--muted); }
.note { margin: 32px 0 0; color: var(--muted); font-size: 13px; }

/* Services */
.services {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px;
}
.services h3 { font-size: 32px; line-height: 1.1; margin: 0 0 8px; }
.services p { margin: 0; color: var(--muted); }
.principle { font-style: italic; font-size: 22px; margin: 48px 0 0; }

/* Studio */
.kicker { margin: 0 0 16px; color: var(--muted); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 16px 0; border-top: 1px solid var(--rule);
}
.rows a { font-weight: 500; }
.rows span { color: var(--muted); text-align: right; }
.rows .name { color: var(--ink); font-weight: 500; text-align: left; font-size: 16px; }

/* People */
.person h3 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.1; margin: 0 0 8px; }
.person p { margin: 0 0 16px; max-width: 34em; color: var(--muted); }
.person .role { color: var(--ink); font-weight: 500; margin-bottom: 12px; }

/* How it works (AP flow) */
#how .statement, .statement.section-head { margin-bottom: 48px; }
.flows { margin: 0; }
.flow-tabs { display: flex; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.flow-tabs button {
  font: 500 15px/1.4 var(--sans); color: var(--muted); background: none; cursor: pointer;
  border: 0; border-bottom: 2px solid transparent; padding: 0 0 6px;
}
.flow-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.flow-tabs button:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.flow-track {
  position: relative; display: flex; gap: 48px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.flow-track::-webkit-scrollbar { display: none; }
.flow { flex: 0 0 100%; min-width: 0; margin: 0; scroll-snap-align: start; }
.flow figcaption { font-family: var(--serif); font-size: 22px; line-height: 1.3; margin-bottom: 28px; }
.flow ol {
  list-style: none; margin: 0; padding: 0; position: relative;
  display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 16px;
}
.flow ol::before {
  content: ""; position: absolute; left: 6px; top: 6px;
  right: calc((100% - (var(--n) - 1) * 16px) / var(--n) - 6px);
  border-top: 1px solid var(--rule);
}
.flow li { position: relative; display: flex; flex-direction: column; gap: 12px; font-weight: 500; }
.flows .dot {
  display: inline-block; width: 13px; height: 13px; border-radius: 50%; flex: none;
  background: var(--ink); border: 2px solid var(--ink); position: relative;
}
.flows .you .dot, .flows .dot.you { background: var(--bg); }
.flows .io .dot { background: var(--bg); border-color: var(--muted); }
.flow .io { color: var(--muted); }
.flow-legend { display: flex; align-items: center; gap: 8px; margin: 32px 0 0; font-size: 13px; color: var(--muted); }
.flow-legend .dot { width: 9px; height: 9px; }
.flow-legend .dot.you { margin-left: 12px; }

.commitments {
  list-style: none; margin: 48px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px;
}
.commitments li { border-top: 1px solid var(--rule); padding-top: 12px; }

/* Client quotes */
.quotes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.quotes blockquote { margin: 0; font-family: var(--serif); font-size: 22px; line-height: 1.3; }
.quotes p { margin: 0; font-size: 13px; color: var(--muted); }

.tools { margin: 32px 0 0; color: var(--muted); max-width: 36em; }

/* Contact */
.contact-line { margin: 24px 0 0; color: var(--muted); }
.contact-line a { color: var(--ink); font-weight: 500; }
.statement { font-size: 32px; line-height: 1.2; max-width: 20em; margin: 0; }
.statement a { white-space: nowrap; }

/* Footer */
.site-footer {
  padding-bottom: 48px; color: var(--muted); font-size: 13px;
}
.site-footer p { margin: 0; padding-top: 24px; border-top: 1px solid var(--rule); }

/* Privacy page */
.doc { padding-bottom: 120px; }
.doc h1 { font-size: clamp(48px, 7vw, 64px); margin-top: 80px; }
.doc h2 { font-size: 16px; font-weight: 500; margin: 48px 0 8px; }
.doc p { max-width: 36em; }

@media (max-width: 640px) {
  main > section { padding-top: 80px; }
  main > section.hero { padding-top: 96px; }
  main > section:last-child { padding-bottom: 96px; }
  .lede { font-size: 18px; }
  .services { grid-template-columns: 1fr; gap: 40px; }
  .stats { gap: 16px; }
  .stats dt { font-size: 36px; }
  .stats dd { font-size: 13px; }
  .statement { font-size: 28px; }
  .flow-tabs { gap: 20px; }
  .flow-track { gap: 24px; }
  .flow { flex-basis: 86%; }
  .flow figcaption { font-size: 20px; }
  .flow ol { grid-template-columns: 1fr; gap: 14px; }
  .flow ol::before { left: 6px; right: auto; top: 8px; bottom: 8px; border-top: 0; border-left: 1px solid var(--rule); }
  .flow li { flex-direction: row; align-items: center; gap: 14px; }
  .commitments { grid-template-columns: 1fr; gap: 0; margin-top: 40px; }
  .commitments li { padding: 12px 0; }
  .quotes { grid-template-columns: 1fr; gap: 40px; }
  .rows span { font-size: 13px; }
}
