/* Design Brief · designbrief.studio
   Tokens mirror the Figma variables (Foundations page). */

@font-face { font-family: 'Host Grotesk'; font-weight: 300; font-style: normal; font-display: swap; src: url('/assets/fonts/host-grotesk-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Host Grotesk'; font-weight: 400; font-style: normal; font-display: swap; src: url('/assets/fonts/host-grotesk-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Host Grotesk'; font-weight: 500; font-style: normal; font-display: swap; src: url('/assets/fonts/host-grotesk-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('/assets/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); }

:root {
  --ink: #0b0b0b;
  --white: #ffffff;
  --tile: #ededeb;
  --tile-2: #e3e3e0;
  --tile-3: #f5f5f3;
  --hairline: #d9d9d6;
  --muted: #6e6e6a;
  --grey-400: #a3a6ad;
  --raised: #262a32;
  --orange: #ff5f00;
  --orange-deep: #e05300;

  --bg: var(--white);
  --fg: var(--ink);
  --fg-2: var(--muted);
  --line: var(--hairline);
  --surface: var(--tile);

  --sans: 'Host Grotesk', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --margin: 80px;
  --gutter: 24px;
  --pedal-w: 193px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color .45s var(--ease), color .45s var(--ease);
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
.icon { width: 24px; height: 24px; fill: currentColor; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--bg); padding: 8px 12px; }

.wrap { max-width: 1440px; margin: 0 auto; padding: 0 var(--margin); }
.muted { color: var(--fg-2); font-weight: 300; }

/* Dark theme: whole-page invert when choosing */
body.theme-dark { --bg: var(--ink); --fg: var(--white); --fg-2: var(--grey-400); --line: var(--raised); --surface: var(--raised); }

/* ---------- Top bar ---------- */
.topbar { position: relative; z-index: 5; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 67px; border-bottom: 1px solid var(--fg); transition: border-color .45s var(--ease); }
.lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 15px; }
.lockup .mark { width: 20px; height: 26px; fill: currentColor; }
.nav { display: flex; gap: 32px; align-items: center; font-size: 13px; }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.gh { display: inline-flex; gap: 6px; align-items: center; }
.gh .icon { width: 16px; height: 16px; }

/* ---------- Type ---------- */
.slogan { font-weight: 300; font-size: clamp(44px, 5vw, 72px); line-height: 1; letter-spacing: -0.03em; margin: 0; }
.slogan strong { font-weight: 500; }
.slogan .muted { font-weight: 300; }
.lede { font-size: 18px; line-height: 1.5; color: var(--fg-2); max-width: 560px; margin: 28px 0; }
.section-heading { font-weight: 400; font-size: 32px; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 48px; }
.section-heading span { display: block; color: var(--fg-2); }
.text-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; cursor: pointer; background: none; border: 0; padding: 0; }
.text-link .icon { width: 16px; height: 16px; fill: var(--orange); }

/* ---------- Pedal ---------- */
.pedal {
  position: relative; overflow: hidden; flex: none;
  width: var(--pedal-w); min-height: 300px;
  background: var(--white); color: var(--ink);
  border: 1px solid var(--ink); border-radius: 0;
  padding: 20px; text-align: left; cursor: pointer;
  display: flex; align-items: flex-end;
  transition: background-color .08s linear, border-color .08s linear, color .08s linear;
}
.pedal-letter { position: absolute; top: 0; bottom: 0; left: -20px; right: -20px; pointer-events: none; }
.pedal-letter svg { width: 100%; height: 100%; }
.pedal-b { fill: var(--tile); transform: translateX(calc(100% + 24px)); transition: transform .24s var(--ease); }
.pedal-d { fill: var(--orange-deep); opacity: 0; }
.pedal-icon { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
.pedal-icon .icon { width: 44px; height: 44px; }
.pedal-label { position: relative; font-weight: 500; font-size: 13px; line-height: 1.2; display: inline-flex; gap: 8px; align-items: center; }
.pedal-label .icon { width: 18px; height: 18px; }
.pedal:hover .pedal-b, .pedal:focus-visible .pedal-b { transform: translateX(0); }
.pedal:active, .pedal.is-orange { background: var(--orange); border-color: var(--orange); color: var(--white); }
.pedal:active .pedal-b, .pedal.is-orange .pedal-b { opacity: 0; }
.pedal:active .pedal-d, .pedal.is-orange .pedal-d { opacity: 1; }
.pedal:active .pedal-icon, .pedal.is-orange .pedal-icon { color: var(--orange); }
.pedal.is-orange .pedal-label { color: var(--white); }
.pip { transition: cx .07s linear, cy .07s linear, opacity .07s linear; }

/* ---------- Hero ---------- */
.hero { position: relative; }
.hero-row { display: flex; gap: calc(var(--gutter) * 2 + (100% - 11 * var(--gutter)) / 12); align-items: stretch; padding-top: 112px; padding-bottom: 120px; }
.pitch { max-width: 640px; transition: opacity .24s ease-in, transform .24s ease-in; }
.ways { display: none; flex: 1; flex-direction: column; gap: 8px; }
.way {
  position: relative; flex: 1; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; align-items: end;
  background: var(--ink); color: var(--white); border: 1px solid var(--grey-400); padding: 18px 24px; text-align: left; cursor: pointer; overflow: hidden;
  opacity: 0; transform: translateY(16px);
}
.way > [data-icon] { grid-column: 1; grid-row: 1; }
.way .icon { width: 28px; height: 28px; }
.way-title { grid-column: 1; grid-row: 2; font-size: 32px; letter-spacing: -0.01em; line-height: 1.1; padding-top: 14px; position: relative; }
.way-desc { grid-column: 2; grid-row: 2; color: var(--grey-400); font-size: 15px; position: relative; }
.way::before { content: ''; position: absolute; inset: 0; background: var(--raised); transform: translateX(-101%); transition: transform .24s var(--ease); }
.way:hover::before, .way:focus-visible::before { transform: translateX(0); }
.way > * { position: relative; }

body.is-choosing .pitch { opacity: 0; transform: translateY(-24px); pointer-events: none; position: absolute; }
body.is-choosing .ways { display: flex; }
body.is-choosing .ways .way { animation: rise .32s var(--ease) forwards; }
body.is-choosing .ways .way:nth-child(2) { animation-delay: .06s; }
body.is-choosing .ways .way:nth-child(3) { animation-delay: .12s; }
body.is-choosing .hero-row { gap: 24px; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Flare ---------- */
.flare { position: relative; height: 560px; overflow: hidden; background: var(--white); }
.flare-layers { position: absolute; top: -40%; bottom: 0; left: -30%; right: -30%; transform-origin: 50% 100%; transform: scale(var(--s, 1)); will-change: transform; }
.flare-layers {
  background:
    linear-gradient(to bottom, rgba(11,11,11,0) 64%, rgba(11,11,11,1) 100%),
    radial-gradient(38% 48% at 50% 112%, rgba(11,11,11,1) 0%, rgba(11,11,11,1) 55%, rgba(11,11,11,0) 100%),
    radial-gradient(64% 86% at 50% 121%, rgba(11,11,11,1) 0%, rgba(11,11,11,.85) 50%, rgba(11,11,11,.25) 78%, rgba(11,11,11,0) 100%),
    radial-gradient(69% 98% at 50% 127%, rgba(255,95,0,0) 0%, rgba(255,95,0,0) 44%, rgba(255,95,0,.28) 55%, rgba(255,95,0,0) 72%);
}
.flare::after { /* grain */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .14; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.flare::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to bottom, #fff 0%, rgba(255,255,255,.85) 12%, rgba(255,255,255,0) 38%); }
.flare::after { z-index: 2; -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 40%); mask-image: linear-gradient(to bottom, transparent 0%, #000 40%); }
.flare-out { transform: scaleY(-1); }

/* ---------- How it works (dark) ---------- */
.how { background: var(--ink); color: var(--white); padding: 40px 0 40px; }
.how .section-heading span { color: var(--grey-400); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.step { display: flex; border: 1px solid var(--raised); min-height: 180px; }
.step-icon { flex: none; width: 96px; display: grid; place-items: center; background: var(--raised); }
.step-icon .icon { width: 32px; height: 32px; }
.step div { padding: 24px; }
.step h3 { margin: 0 0 10px; font-weight: 400; font-size: 22px; line-height: 1.25; }
.step p { margin: 0; color: var(--grey-400); }

/* ---------- Finished briefs mosaic ---------- */
.finished { padding-top: 40px; }
.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); height: 960px; overflow: hidden; }
.mosaic-col { overflow: hidden; position: relative; }
.mosaic-track { will-change: transform; }
.tile-ph { display: flex; flex-direction: column; justify-content: flex-end; padding: 20px; gap: 4px; }
.tile-ph b { font-weight: 400; font-size: 22px; }
.tile-ph span { font-size: 13px; color: var(--muted); }

/* ---------- Footer ---------- */
.footer { padding-top: 96px; }
.footer-top { display: grid; grid-template-columns: 6fr 2fr 2fr 2fr; gap: var(--gutter); align-items: start; }
.footer-top p { margin: 0; font-size: 13px; }
.lockup-stacked { align-items: flex-start; gap: 16px; font-size: 48px; line-height: .92; letter-spacing: -0.03em; }
.lockup-stacked .mark { width: 74px; height: 96px; }
.footer-bottom { display: flex; justify-content: space-between; border-top: 1px solid var(--hairline); margin-top: 80px; padding-top: 16px; padding-bottom: 48px; font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ---------- Views ---------- */
.flow { display: none; }
body:not([data-view="home"]) .hero, body:not([data-view="home"]) .landing-rest { display: none; }
body:not([data-view="home"]) .flow { display: block; }
body.theme-dark .footer, body.is-choosing .landing-rest { display: none; }

.flow-head { display: flex; justify-content: space-between; align-items: flex-end; padding-top: 96px; padding-bottom: 40px; }
.progress { display: flex; gap: 6px; }
.progress i { width: 40px; height: 3px; background: var(--raised); }
.progress i.on { background: var(--orange); }
.flow-row { display: flex; gap: 8px; align-items: stretch; padding-bottom: 120px; }
.flow-row .pedal { min-height: 346px; }

.choice {
  position: relative; flex: 1; min-height: 346px; overflow: hidden; cursor: pointer; text-align: left;
  background: var(--ink); color: var(--white); border: 1px solid var(--grey-400); padding: 24px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.choice .icon { width: 32px; height: 32px; position: relative; }
.choice b { display: block; font-weight: 400; font-size: 32px; line-height: 1.1; letter-spacing: -0.01em; margin-bottom: 8px; position: relative; }
.choice span { color: var(--grey-400); font-size: 13px; position: relative; }
.choice .pedal-letter { left: -10%; right: -10%; }
.choice .pedal-b, .choice .pedal-d { fill: var(--raised); opacity: 1; transition: transform .24s var(--ease); }
.choice .letters { position: absolute; inset: 0; display: grid; grid-template-columns: 351fr 332fr; }
.choice .letters svg { width: 100%; height: 100%; fill: var(--raised); transition: transform .24s var(--ease); }
.choice .letters svg:first-child { transform: translateX(-102%); }
.choice .letters svg:last-child { transform: translateX(102%); }
.choice:hover .letters svg, .choice:focus-visible .letters svg { transform: none; }
.choice:active { background: var(--orange); border-color: var(--orange); }
.choice:active .letters svg { fill: var(--orange-deep); transform: none; }

.search { flex: 1; display: flex; flex-direction: column; }
.field { background: var(--raised); padding: 14px 22px 18px; }
.field label { display: block; color: var(--grey-400); font-size: 13px; }
.field input { width: 100%; background: transparent; border: 0; color: var(--white); font: inherit; font-size: 32px; letter-spacing: -0.01em; padding: 6px 0 0; outline: none; caret-color: var(--orange); }
.suggest { list-style: none; margin: 0; padding: 0; }
.suggest li { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--raised); cursor: pointer; font-size: 18px; }
.suggest li span { color: var(--grey-400); font-size: 13px; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--raised); }
.picked { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 24px; }
.tag { display: inline-flex; align-items: center; gap: 10px; background: var(--orange); color: var(--white); border: 0; padding: 10px 12px 10px 14px; font-weight: 500; font-size: 13px; cursor: pointer; }
.tag .icon { width: 16px; height: 16px; }
.picked .text-link { margin-left: auto; color: var(--white); }
.empty { color: var(--grey-400); padding: 16px 22px; }

/* Brief view */
.brief-row { display: flex; gap: var(--gutter); align-items: flex-end; padding-top: 112px; padding-bottom: 48px; }
.brief-row .pedal { min-height: 346px; }
.brief-head { display: flex; flex-direction: column; gap: 24px; }
.brief-title { font-weight: 400; font-size: 32px; line-height: 1.2; letter-spacing: -0.01em; margin: 0; max-width: 900px; }
.brief-meta { font-size: 13px; color: var(--muted); margin: 0; }

.number { display: inline-flex; align-items: stretch; height: 150px; }
.number-prefix { background: var(--tile); padding: 16px 20px 20px; display: flex; flex-direction: column; justify-content: space-between; }
.number-prefix small { font-size: 22px; line-height: 1; }
.number-prefix svg { width: 54px; height: 86px; fill: currentColor; }
.number-window { border: 1px solid var(--ink); background: var(--white); display: flex; align-items: center; padding: 0 20px; overflow: hidden; }
.odo { display: flex; font-weight: 300; font-size: 120px; line-height: 1; letter-spacing: -0.03em; height: 1em; overflow: hidden; }
.odo-col { display: flex; flex-direction: column; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.odo-col span { height: 1em; display: block; font-variant-numeric: tabular-nums; }

.tiles { display: grid; gap: 2px; }
.tiles-row { display: grid; gap: 2px; grid-auto-flow: column; grid-auto-columns: 1fr; }
.ing, .del { background: var(--tile); padding: 16px 20px; min-height: 200px; display: flex; flex-direction: column; justify-content: space-between; }
.ing-top { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.ing-value { font-size: 22px; line-height: 1.25; }
.ing.swapped { background: var(--orange); color: var(--white); }
.ing.swapped .ing-top { color: var(--white); }
.details .ing { min-height: 168px; }
.del .icon { width: 28px; height: 28px; }
.del b { display: block; font-weight: 400; font-size: 22px; line-height: 1.25; margin-bottom: 6px; }
.del span { font-size: 13px; color: var(--muted); }
.brief-actions { display: flex; gap: 16px; align-items: center; padding-top: 32px; padding-bottom: 120px; }
.btn-outline { background: var(--white); border: 1px solid var(--ink); padding: 14px 20px; font-weight: 500; font-size: 13px; cursor: pointer; }
.btn-outline:hover { background: var(--tile); }

/* Clock view */
.clock-row { display: grid; grid-template-columns: var(--pedal-w) minmax(0, 660px) minmax(280px, 1fr); gap: var(--gutter); align-items: center; padding-top: 80px; padding-bottom: 48px; }
.clock-row .pedal { min-height: 600px; height: 100%; }
.clock svg { width: 100%; height: auto; overflow: visible; }
.clock text { font-family: var(--sans); font-size: 13px; fill: var(--muted); }
.clock text.sun { fill: var(--ink); }
.clock text.due { fill: var(--orange); }
.readout { display: flex; flex-direction: column; gap: 20px; }
.readout h2 { margin: 0; font-weight: 400; font-size: 22px; }
.readout p { margin: 0; }
.left { font-weight: 300; font-size: clamp(44px, 4.6vw, 72px); line-height: 1; letter-spacing: -0.03em; }
.count { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.shipped { background: var(--tile); padding: 16px 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  :root { --margin: 40px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .mosaic { grid-template-columns: repeat(3, 1fr); }
  .mosaic-col:nth-child(4) { display: none; }
  .clock-row { grid-template-columns: 1fr; }
  .clock-row .pedal { min-height: 160px; width: 100%; }
  .tiles-row { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  :root { --margin: 20px; --pedal-w: 100%; }
  .nav a:not(.gh) { display: none; }
  .hero-row, .flow-row, .brief-row { flex-direction: column; gap: 16px; padding-top: 48px; padding-bottom: 64px; }
  .pedal, .flow-row .pedal, .brief-row .pedal { min-height: 160px; }
  .choice { min-height: 160px; }
  .way-title { font-size: 24px; }
  .way { grid-template-columns: 1fr; }
  .way-desc { grid-column: 1; grid-row: 3; }
  .flare { height: 320px; }
  .mosaic { grid-template-columns: repeat(2, 1fr); height: 640px; }
  .mosaic-col:nth-child(3) { display: none; }
  .tiles-row { grid-template-columns: 1fr; }
  .odo { font-size: 80px; }
  .number { height: 110px; }
  .number-prefix svg { width: 40px; height: 60px; }
  .flow-head { flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 48px; }
  .section-heading, .brief-title { font-size: 26px; }
  .footer-top { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .way { opacity: 1; transform: none; }
}
