@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Mocha, from the seed deck */
  --espresso: #2b1e18;
  --deep: #231812;
  --coffee: #3d2b23;
  --mocha: #664a3d;
  --caramel: #8f6a57;
  --cream: #f5efe6;
  --text-2: #d2c2b3;
  --text-3: #ad9786;
  --line: rgb(245 239 230 / 0.1);
  --edge: rgb(176 136 112 / 0.5);
  --ok: #b3cfa3;
  --wait: #e8b885;

  --ink: var(--cream);
  --ground: var(--espresso);
  --r: 20px;
  --pad: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: dark;
  background: var(--espresso);
  color: var(--ink);
  font: 400 1.0625rem/1.6 "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; overflow-x: clip; }
h1, h2, h3, p, ol, ul, dl, dd, figure, pre { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
.defs { position: absolute; width: 0; height: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; border-radius: 6px; }
.band-cream :focus-visible { outline-color: var(--espresso); }

.skip {
  position: fixed; left: 16px; top: 12px; z-index: 20;
  padding: 10px 16px; border-radius: 10px;
  background: var(--cream); color: var(--espresso); font-weight: 600; text-decoration: none;
  transform: translateY(-160%);
}
.skip:focus-visible { transform: none; }

.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--pad); }

/* Type */
h1 {
  font-size: clamp(2.75rem, 1.6rem + 4.4vw, 5.5rem);
  font-weight: 700; line-height: 1.02; letter-spacing: -0.038em;
  text-wrap: balance;
}
h2 {
  font-size: clamp(2rem, 1.35rem + 2.4vw, 3.5rem);
  font-weight: 680; line-height: 1.06; letter-spacing: -0.032em;
  text-wrap: balance;
}
h3 { font-size: 1.25rem; font-weight: 640; line-height: 1.25; letter-spacing: -0.015em; }
p { text-wrap: pretty; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  background: var(--cream); color: var(--espresso);
  font-weight: 620; font-size: 1rem; letter-spacing: -0.005em; text-decoration: none;
  transition: background-color 200ms var(--ease), transform 160ms var(--ease);
}
.btn:hover { background: #fff8ee; transform: translateY(-1px); }
.btn:active { transform: scale(0.97); transition-duration: 80ms; }
.btn-quiet { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 1px var(--edge); }
.btn-quiet:hover { background: rgb(245 239 230 / 0.06); }
.btn-small { min-height: 44px; padding: 0 18px; font-size: 0.9375rem; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgb(43 30 24 / 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 32px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 680; font-size: 1.25rem; letter-spacing: -0.025em; min-height: 44px; }
.brand-mark { width: 26px; height: 27px; color: var(--cream); }
.brand-sub { color: var(--text-3); font-weight: 500; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a, .foot-nav a, .dev a {
  color: var(--text-2); text-decoration: none; font-size: 0.9375rem;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: color 200ms var(--ease), background-size 260ms var(--ease);
  padding-block: 12px;
}
.nav a:hover, .foot-nav a:hover, .dev a:hover { color: var(--cream); background-size: 100% 1px; }

/* Hero */
.hero { min-height: calc(100svh - 72px); display: grid; align-items: center; padding-block: clamp(48px, 8vh, 96px); }
.hero-grid { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
.hero-copy { max-width: 720px; }
.lede { margin-top: 28px; font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3125rem); line-height: 1.55; color: var(--text-2); max-width: 36em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

/* The deck's layered squares: raised tiles under one soft light. The light
   follows the pointer (hero.js sets --px and --py, -1 to 1): each surface
   catches it, and the shadows fall away from it. At rest it sits top left. */
@property --px { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --py { syntax: "<number>"; inherits: true; initial-value: 0; }
.squares { display: grid; justify-items: end; }
.sq {
  --lx: calc(var(--px) * 5px); --ly: calc(var(--py) * 5px);
  position: relative; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgb(176 136 112 / 0.22);
}
.sq::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(circle at calc(32% + var(--px) * 26%) calc(28% + var(--py) * 26%), rgb(255 238 222 / var(--glow)), transparent 58%),
    url("/grain.svg");
}
.sq-1 {
  --glow: 0.05;
  width: min(100%, 420px); aspect-ratio: 1; border-radius: 32px;
  background: linear-gradient(145deg, #433027 0%, #3a2921 100%);
  box-shadow:
    calc(-18px + var(--lx)) calc(-18px + var(--ly)) 40px rgb(255 236 220 / 0.035),
    calc(24px - var(--lx)) calc(28px - var(--ly)) 56px rgb(12 7 4 / 0.55),
    calc(8px - var(--lx) * 0.6) calc(10px - var(--ly) * 0.6) 16px rgb(12 7 4 / 0.25),
    inset 1px 1px 0 rgb(255 236 220 / 0.07),
    inset -1px -1px 0 rgb(12 7 4 / 0.3);
}
.sq-2 {
  --glow: 0.06;
  width: 74%; aspect-ratio: 1; border-radius: 26px;
  background: linear-gradient(145deg, #6e5143 0%, #5f4538 100%);
  box-shadow:
    calc(-10px + var(--lx) * 0.8) calc(-10px + var(--ly) * 0.8) 24px rgb(255 236 220 / 0.05),
    calc(16px - var(--lx) * 0.8) calc(18px - var(--ly) * 0.8) 36px rgb(18 10 6 / 0.45),
    calc(5px - var(--lx) * 0.5) calc(6px - var(--ly) * 0.5) 10px rgb(18 10 6 / 0.22),
    inset 1px 1px 0 rgb(255 236 220 / 0.09),
    inset -1px -1px 0 rgb(18 10 6 / 0.25);
}
.sq-3 {
  --glow: 0.08;
  width: 64%; aspect-ratio: 1; border-radius: 22px;
  background: linear-gradient(145deg, #9a7360 0%, #876350 100%);
  box-shadow:
    calc(-6px + var(--lx) * 0.6) calc(-6px + var(--ly) * 0.6) 16px rgb(255 236 220 / 0.06),
    calc(12px - var(--lx) * 0.6) calc(14px - var(--ly) * 0.6) 26px rgb(24 13 8 / 0.42),
    calc(4px - var(--lx) * 0.4) calc(5px - var(--ly) * 0.4) 8px rgb(24 13 8 / 0.2),
    inset 1px 1px 0 rgb(255 236 220 / 0.14),
    inset -1px -1px 0 rgb(24 13 8 / 0.2);
}
/* The mark is stamped into the top tile: the tile's own caramel, lit from the
   top left like the stack, with a faint grain (SVG filter #emboss). */
.sq-mark {
  width: 50%; height: 52%; color: #977060; overflow: visible;
  filter: drop-shadow(-1px -1px 0.5px rgb(255 236 220 / 0.28)) drop-shadow(3px 4px 5px rgb(36 20 12 / 0.42));
}

/* Bands */
.band { padding-block: clamp(88px, 12vw, 168px); border-top: 1px solid var(--line); }
/* One idea per screen */
.band, .close { min-height: 100svh; display: grid; align-content: center; }
.band-deep { background: var(--deep); }
.band-cream {
  --ink: var(--espresso);
  background: var(--cream); color: var(--espresso); border-top: 0;
}
.head { max-width: 820px; margin-bottom: clamp(48px, 6vw, 80px); }
.head-sub { margin-top: 20px; color: var(--text-2); font-size: 1.1875rem; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: clamp(28px, 3vw, 48px); }
.step { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.step-n { font-size: 0.875rem; font-weight: 600; color: #b08870; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; margin-bottom: 16px; }
.step p:not(.step-n) { margin-top: 12px; color: var(--text-2); }
.panel {
  align-self: start; padding: 8px 20px;
  border-radius: var(--r); background: var(--coffee); border: 1px solid var(--line);
  font-size: 0.9375rem;
}
.step > .panel { margin-top: 32px; }
.kv, .log { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.kv:first-child, .log:first-child { border-top: 0; }
.kv span { color: var(--text-3); }
.kv b { font-weight: 560; text-align: right; }
.kv-foot { justify-content: flex-start; }
.log { flex-direction: column; gap: 2px; }
.log span:last-child { color: var(--text-2); font-variant-numeric: tabular-nums; }
.ok, .wait { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.01em; }
.ok { color: var(--ok); }
.wait { color: var(--wait); }
.kv .ok { color: var(--ok); font-size: 0.9375rem; }
.kv .fake-link { color: var(--wait); }
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--edge); color: var(--text-2);
  font-size: 0.8125rem; font-weight: 560; white-space: nowrap;
}
.chip-live { color: var(--ok); border-color: rgb(179 207 163 / 0.45); }

/* Split sections */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(48px, 7vw, 112px); align-items: center; }
.split-copy > p { margin-top: 24px; font-size: 1.1875rem; line-height: 1.6; color: var(--text-2); max-width: 32em; }
.band-cream .split-copy > p { color: #5e4a3f; }

/* Approval card, as it appears in the app */
.device {
  justify-self: center; width: min(100%, 460px);
  padding: 14px; border-radius: 34px; background: var(--espresso);
  box-shadow: 0 40px 80px -30px rgb(43 30 24 / 0.55), 0 0 0 1px rgb(43 30 24 / 0.08);
}
.approve { padding: 32px 28px 28px; border-radius: 22px; background: var(--coffee); color: var(--cream); border: 1px solid var(--line); }
.approve-title { font-size: 1.375rem; font-weight: 660; letter-spacing: -0.02em; }
.approve-note { margin-top: 18px; color: var(--text-3); font-size: 0.9375rem; }
.approve-list { list-style: decimal; padding-left: 1.2rem; margin-top: 10px; font-size: 1.1875rem; font-weight: 560; line-height: 1.45; font-variant-numeric: tabular-nums; }
.approve hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0 18px; }
.approve-from { font-size: 0.875rem; color: var(--text-3); }
.approve-btn {
  display: flex; align-items: center; justify-content: center; margin-top: 22px;
  min-height: 52px; border-radius: 14px; background: var(--cream); color: var(--espresso); font-weight: 640;
}

/* Rings: who holds authority */
.split-flip > .rings { order: 0; }
.rings { width: min(100%, 520px); justify-self: start; }
.ring { position: relative; display: grid; border: 1px solid var(--edge); padding: 52px 24px 24px; }
.ring-1 { aspect-ratio: 1; border-radius: 30px; background: var(--coffee); }
.ring-2 { border-radius: 24px; background: var(--mocha); align-self: stretch; }
.ring-3 { border-radius: 18px; background: var(--caramel); min-height: 120px; place-items: center; padding: 24px; }
.ring-label { position: absolute; top: 18px; left: 24px; font-size: 0.875rem; font-weight: 560; color: var(--text-2); }
.ring-2 > .ring-label { color: #eadfd3; }
.ring-3 > .ring-label { position: static; color: var(--cream); font-size: 1.125rem; font-weight: 660; }
.points { margin-top: 40px; display: grid; gap: 28px; }
.points div { padding-top: 24px; border-top: 1px solid var(--line); }
.points dt { font-weight: 640; font-size: 1.1875rem; letter-spacing: -0.01em; }
.points dd { margin-top: 6px; color: var(--text-2); }

/* Who */
.who { display: grid; grid-template-columns: repeat(3, 1fr); }
.who > div { padding: 8px clamp(24px, 3vw, 44px) 8px 0; }
.who > div + div { padding-left: clamp(24px, 3vw, 44px); border-left: 1px solid var(--line); }
.who h3 { font-size: 1.5rem; }
.who p { margin-top: 12px; color: var(--text-2); }

/* Developers */
.dev { margin-top: 40px; }
.dev li { display: grid; grid-template-columns: 7.5rem 1fr auto; align-items: center; gap: 16px; min-height: 60px; border-top: 1px solid var(--line); }
.dev li:last-child { border-bottom: 1px solid var(--line); }
.dev li > span:first-child { font-weight: 600; }
.dev a { color: var(--cream); font-size: 1rem; justify-self: start; }
.dim { color: var(--text-3); }
.code {
  border-radius: var(--r); background: var(--deep); border: 1px solid var(--line);
  overflow-x: auto;
}
.code pre { padding: 28px 32px; font: 0.875rem/1.75 var(--mono); color: var(--text-2); tab-size: 2; }
.code .c { color: var(--text-3); }
.code .k { color: #e9d3bf; }
.code .s { color: var(--ok); }

/* Close */
.close { padding-block: clamp(112px, 16vw, 200px); border-top: 1px solid var(--line); text-align: center; min-height: calc(100svh - 97px); }
.close-inner { display: grid; justify-items: center; gap: 36px; }
.close-mark { width: 56px; height: 58px; color: var(--caramel); }
.close h2 { max-width: 15em; font-size: clamp(2.25rem, 1.4rem + 3.4vw, 4.5rem); }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-block: 28px; }
.foot-row { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.foot .brand { font-size: 1.0625rem; }
.foot .brand-mark { width: 20px; height: 21px; }
.foot-nav { display: flex; gap: 24px; }
.foot-note { margin-left: auto; color: var(--text-3); font-size: 0.875rem; }

/* Entrance, once, on load */
@media (prefers-reduced-motion: no-preference) {
  .enter { animation: rise 900ms var(--ease) both; }
  .hero-copy > :nth-child(2) { animation-delay: 70ms; }
  .hero-copy > :nth-child(3) { animation-delay: 140ms; }
  .sq-1 { animation: settle 1100ms var(--ease) 120ms backwards; }
  .sq-2 { animation: settle 1100ms var(--ease) 220ms backwards; }
  .sq-3 { animation: settle 1100ms var(--ease) 320ms backwards; }
  /* Pointer parallax. Each layer moves relative to its parent, so the inner
     ones travel further: depth, not tilt. The light and shadows ease with it. */
  .squares { transition: --px 1400ms cubic-bezier(0.16, 1, 0.3, 1), --py 1400ms cubic-bezier(0.16, 1, 0.3, 1); }
  .sq, .sq-mark { transform: translate(calc(var(--px) * var(--m)), calc(var(--py) * var(--m))); }
  .sq-1 { --m: 0.84px; }
  .sq-2 { --m: 0.7px; }
  .sq-3 { --m: 0.7px; }
  .sq-mark { --m: 0.56px; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes settle { from { opacity: 0; transform: scale(0.94); } }

/* Tablet */
@media (max-width: 960px) {
  .hero-grid, .split { grid-template-columns: 1fr; }
  .squares { justify-items: start; }
  .sq-1 { width: min(100%, 340px); }
  .steps, .who { grid-template-columns: 1fr; }
  .steps { row-gap: 64px; }
  .step { display: flex; flex-direction: column; }
  .step .panel { max-width: 520px; }
  .who > div, .who > div + div { padding: 28px 0; border-left: 0; border-top: 1px solid var(--line); }
  .device { justify-self: start; }
  .step .panel { align-self: stretch; }
  .split-flip > .rings { order: 2; }
  .foot-note { margin-left: 0; width: 100%; }
}

/* Phone */
@media (max-width: 640px) {
  .nav { display: none; }
  .top-row { justify-content: space-between; height: 64px; }
  .hero { min-height: calc(100svh - 64px); padding-block: 32px 48px; }
  .squares { display: none; }
  .actions .btn { flex: 1 1 100%; }
  .dev li { grid-template-columns: 1fr auto; row-gap: 2px; padding-block: 14px; }
  .dev li > :nth-child(2) { grid-row: 2; }
  .code pre { padding: 22px 20px; font-size: 0.8125rem; }
  .ring { padding: 48px 16px 16px; }
  .ring-label { left: 16px; }
  .approve { padding: 26px 20px 20px; }
}

@media (max-width: 960px) { .wide { display: none; } }
