/* human web. Values come from Figma RZVGLqcmMW55MbHX4HMcS6, see DESIGN.md */
:root {
  --paper: #F1EDE4;
  --paper-raised: #F8F6F0;
  --ink: #151412;
  --muted: #6A665D;
  --hairline: rgba(21, 20, 18, .14);
  --thread: rgba(21, 20, 18, .26);
  --biro: #2438C9;
  --biro-press: #1B2BA0;
  --biro-tint: rgba(36, 56, 201, .08);
  --void: #0B0B0A;
  --dim: #8C877C;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gutter: 40px;
  --display: 'Gloock', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 14px/22px var(--mono);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--biro); outline-offset: 2px; }

.label {
  font: 500 12px/16px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons (Figma: Button / *) */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  font: 500 12px/16px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color .2s var(--ease), transform .12s var(--ease), border-color .2s var(--ease);
}
.pill:hover { background: rgba(21, 20, 18, .04); }
.pill:active { transform: scale(.97); }
.pill[aria-disabled="true"] { opacity: .45; cursor: default; }
.pill[aria-disabled="true"]:hover { background: none; }
.pill.primary { background: var(--biro); border-color: var(--biro); color: var(--paper); }
.pill.primary:hover { background: var(--biro-press); border-color: var(--biro-press); }
.pill.primary:disabled { opacity: .45; cursor: default; }
.pill.lg { height: 48px; padding: 0 24px; font-size: 14px; }

/* ---------- hero (Figma: Web / Desktop 2:2) */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
}
#web {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: pan-y;
}
#web.dragging { cursor: grabbing; }
#web.on-mark { cursor: pointer; }

.bar {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 32px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.wordmark { font: 400 24px/28px var(--display); padding: 8px 0; margin: -8px 0; }
/* Figma 14:2 / 14:39: one segmented bar instead of loose pills */
.seg {
  display: flex;
  align-items: stretch;
  height: 40px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--paper-raised);
  overflow: hidden;
}
.seg-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  font: 500 12px/16px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.seg-item + .seg-item { box-shadow: inset 1px 0 0 var(--hairline); }
.seg-item:hover { background: rgba(21, 20, 18, .045); }
.seg-item:active { background: rgba(21, 20, 18, .08); }
.seg-item[aria-disabled="true"] { color: var(--muted); cursor: default; }
.seg-item[aria-disabled="true"]:hover, .seg-item[aria-disabled="true"]:active { background: none; }
.seg-item.icon { width: 40px; padding: 0; font-size: 16px; letter-spacing: 0; }
.seg-item:focus-visible { outline-offset: -2px; }
.ca .ca-label { color: var(--muted); }
.ca .ca-value { font-weight: 400; letter-spacing: 0; text-transform: none; }
.ca svg { width: 14px; height: 14px; margin-right: -2px; color: var(--muted); }
.ca[data-empty] { cursor: default; }
.ca[data-empty]:hover, .ca[data-empty]:active { background: none; }

.headline {
  position: absolute;
  left: var(--gutter);
  bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  pointer-events: none;
}
.headline h1 {
  --lh: .893em;
  position: relative;
  font: 400 clamp(56px, 7.78vw, 112px) / var(--lh) var(--display);
  letter-spacing: -.02em;
}
/* Figma 11:4, drawn left to right once the page lands */
.ink-underline {
  position: absolute;
  left: 2.589em;
  top: calc(var(--lh) + .747em);
  width: 3.625em;
  height: .152em;
  clip-path: inset(0 100% 0 0);
}
body:not(.pre) .ink-underline { clip-path: inset(0 0 0 0); transition: clip-path .75s cubic-bezier(.6, 0, .3, 1) .55s; }
.headline .sub { color: var(--muted); }

.sign-block {
  position: absolute;
  right: var(--gutter);
  bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 24px;
}
.count { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.count-num { font: 400 72px/72px var(--display); font-variant-numeric: tabular-nums; }
.count .label { color: var(--muted); }
.live { display: flex; gap: 8px; font: 400 12px/16px var(--mono); animation: land .4s var(--ease) both; }
.live b { color: var(--biro); font-weight: 500; }
.live span { color: var(--muted); }
.count .label-short { display: none; }

/* Figma: Mark label 2:9 */
.mark-label {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  font: 400 12px/16px var(--mono);
  white-space: nowrap;
  pointer-events: none;
  will-change: transform;
}
.mark-label b { font-weight: 500; }
.mark-label span { color: var(--muted); }
.mark-label.you b { color: var(--biro); }

/* zoom cluster fades in over the web, never pops */
.view-ctl {
  position: absolute;
  left: 50%;
  top: 88px;
  transform: translate(-50%, -6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s linear .25s;
}
.view-ctl.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }

/* exploring the web: the headline steps aside */
.headline { transition: opacity .35s var(--ease), transform .35s var(--ease); }
.exploring .headline { opacity: 0; transform: translateY(8px); }

/* pin prompt after the gate signature */
.pin-prompt {
  position: absolute;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 8px 8px 20px;
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  box-shadow: 0 24px 64px rgba(21, 20, 18, .18);
  white-space: nowrap;
}
.pin-prompt p { font: 400 14px/22px var(--mono); }
.pin-prompt .err { color: var(--biro); }
.pin-prompt .row { display: flex; gap: 8px; }

/* reveal: UI lands after the camera settles */
.page-ui { transition: opacity .6s var(--ease), transform .6s var(--ease); }
.pre .page-ui { opacity: 0; transform: translateY(12px); }

/* ---------- latest + footer (Figma 5:46) */
.latest { padding: 160px var(--gutter) 0; }
.latest-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 40px;
}
.latest-head h2 {
  font: 400 clamp(56px, 7.78vw, 112px) / .893 var(--display);
  letter-spacing: -.02em;
}
.latest-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  list-style: none;
  margin: 0;
  padding: 0;
}
.latest-row li {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 24px;
  box-shadow: inset -1px 0 0 var(--hairline);
  min-width: 0;
}
.latest-row li:last-child { box-shadow: none; }
.latest-row canvas { width: 120px; height: 120px; display: block; }
.latest-row .meta { display: flex; gap: 8px; font: 400 12px/16px var(--mono); white-space: nowrap; }
.latest-row .meta b { font-weight: 500; }
.latest-row .meta span { color: var(--muted); }
.latest-row li.fresh canvas { animation: land .7s var(--ease) both; }
@keyframes land { from { opacity: 0; transform: translateY(8px); } }

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 120px var(--gutter) 40px;
}
.foot nav { display: flex; gap: 32px; }
.foot nav a { padding: 14px 18px; margin: -14px -18px; }
.foot nav a:hover { color: var(--biro); }
.foot p { font: 400 12px/16px var(--mono); color: var(--muted); }

/* ---------- popup (Figma 5:32) */
.popup {
  width: 480px;
  max-width: calc(100vw - 32px);
  padding: 24px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(21, 20, 18, .18);
}
.popup[open] { display: flex; flex-direction: column; gap: 24px; animation: pop .2s var(--ease); }
.popup::backdrop { background: rgba(21, 20, 18, .32); animation: fade .2s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
.popup-head { display: flex; flex-direction: column; gap: 8px; }
.popup-head h2 { font: 400 40px/44px var(--display); }
.popup-head p { color: var(--muted); }
.pad {
  position: relative;
  width: 100%;
  aspect-ratio: 432 / 280;
  background: var(--paper);
  border: 1px solid var(--hairline);
  overflow: hidden;
}
.pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: url('/assets/pen-cursor.svg') 3 29, crosshair; }
.pad .x { position: absolute; left: 15px; bottom: 45px; font: 400 40px/40px var(--display); pointer-events: none; }
.pad .line { position: absolute; left: 59px; right: 21px; bottom: 52px; height: 1px; background: rgba(21, 20, 18, .4); pointer-events: none; }
.pad .clear { position: absolute; right: 16px; top: 15px; color: var(--muted); z-index: 1; }
.pad .clear:hover { color: var(--ink); }
.popup-err { color: var(--biro); margin-top: -12px; }
.popup-foot { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- intro (Figma: Intro 1-3) */
.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  color: var(--paper);
  overflow: hidden;
}
.lid {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--void);
  transition: transform .8s cubic-bezier(.7, 0, .2, 1);
}
.lid-top { top: 0; }
.lid-bottom { bottom: 0; }
.lid svg { position: absolute; left: 0; width: 100%; height: 12px; overflow: visible; }
.lid-top svg { bottom: -6px; }
.lid-bottom svg { top: -6px; }
.lid path { fill: none; stroke: var(--biro); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.intro.seam .lid path { stroke-dashoffset: 0; transition: stroke-dashoffset .42s cubic-bezier(.6, 0, .3, 1); }
.intro.open { pointer-events: none; }
.intro.open .lid-top { transform: translateY(-100%); }
.intro.open .lid-bottom { transform: translateY(100%); }
.intro.open .intro-credit, .intro.open .intro-skip { opacity: 0; }

.intro-credit {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  text-align: center;
  font: 500 12px/16px var(--mono);
  letter-spacing: .24em;
  text-transform: uppercase;
  opacity: .6;
  transition: opacity .4s var(--ease);
}
.intro-skip {
  position: absolute;
  right: var(--gutter);
  bottom: 40px;
  color: var(--dim);
  transition: opacity .4s var(--ease), color .2s var(--ease);
}
.intro-skip:hover { color: var(--paper); }
.intro-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 24px;
  pointer-events: none;
}
.intro-stage > * { grid-area: 1 / 1; }
.intro-count { display: flex; flex-direction: column; align-items: center; gap: 8px; transition: opacity .3s var(--ease); }
.intro-num { font: 400 160px/160px var(--display); font-variant-numeric: tabular-nums; }
.intro-count .label { color: var(--dim); letter-spacing: .24em; }
.card {
  position: relative;
  max-width: 1100px;
  text-align: center;
  font: 400 clamp(44px, 6.1vw, 88px) / 1.09 var(--display);
  text-wrap: balance;
  opacity: 0;
}
.card.on { animation: card var(--dur) linear both; }
/* hard cut out: the card is removed at the end, so it only fades in */
@keyframes card {
  0% { opacity: 0; transform: scale(1.07); }
  7% { opacity: 1; }
  100% { opacity: 1; transform: scale(1); }
}
.card .l2 { display: block; opacity: 0; transition: opacity .25s var(--ease); }
.card.two .l2 { opacity: 1; }
.card svg { position: absolute; left: -24px; right: -24px; top: 50%; width: calc(100% + 48px); height: 20px; margin-top: -6px; overflow: visible; }
.card path { fill: none; stroke: var(--biro); stroke-width: 4.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.card.struck path { stroke-dashoffset: 0; transition: stroke-dashoffset .2s cubic-bezier(.5, 0, .3, 1); }
.grain {
  position: absolute;
  inset: -50%;
  pointer-events: none;
  opacity: .1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .5s steps(4) infinite;
  transition: opacity .6s var(--ease);
}
.intro.open .grain { opacity: 0; }
.intro-web { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .7s var(--ease); }
.intro-web.on { opacity: 1; }
.intro-title { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.intro-title p:first-child { font: 400 clamp(72px, 11.1vw, 160px) / 1 var(--display); }
.intro-title .label { color: var(--dim); letter-spacing: .24em; opacity: 0; transition: opacity .4s var(--ease) .35s; }
.intro-title.on { animation: slam .55s cubic-bezier(.2, .9, .2, 1) both; }
.intro-title.on .label { opacity: 1; }
.intro-title.out { opacity: 0; transition: opacity .35s var(--ease); }
@keyframes slam { 0% { opacity: 0; transform: scale(1.4); } 45% { opacity: 1; } 100% { transform: scale(1); } }
.intro-stage.shake { animation: shake .4s linear; }
@keyframes shake {
  0%, 100% { transform: none; } 15% { transform: translate(-6px, 3px); } 30% { transform: translate(5px, -4px); }
  45% { transform: translate(-3px, -2px); } 60% { transform: translate(3px, 2px); } 80% { transform: translate(-1px, 1px); }
}
.flash { position: absolute; inset: 0; background: var(--paper); opacity: 0; pointer-events: none; }
.flash.go { animation: flash .2s ease-out; }
@keyframes flash { from { opacity: .16; } to { opacity: 0; } }
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-2%, -1%); }
}

/* letterbox for the pull-back reveal */
.letterbox { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
.letterbox i {
  position: absolute;
  left: 0;
  right: 0;
  height: 96px;
  background: var(--void);
  transition: transform .8s cubic-bezier(.7, 0, .2, 1);
}
.letterbox i:nth-of-type(1) { top: 0; transform: translateY(-100%); }
.letterbox i:nth-of-type(2) { bottom: 0; transform: translateY(100%); }
.letterbox.on i { transform: none; }
.letterbox p {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--paper);
  opacity: 0;
  transition: opacity .5s var(--ease);
}
.letterbox p:nth-of-type(1) { top: 40px; letter-spacing: .24em; }
.letterbox p:nth-of-type(2) { bottom: 40px; color: var(--dim); }
.letterbox.on p { opacity: .8; transition-delay: .3s; }

/* ---------- gate (Figma: Gate 3:24) */
.gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--paper);
  transition: background-color .4s var(--ease);
}
.gate.clear { background: transparent; pointer-events: none; }
.gate canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: url('/assets/pen-cursor.svg') 3 29, crosshair; }
.gate .wordmark { position: absolute; left: var(--gutter); top: 38px; pointer-events: none; }
.gate-copy {
  position: absolute;
  left: 0;
  right: 0;
  top: 31.1%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  text-align: center;
  pointer-events: none;
}
.gate-copy h1 { font: 400 clamp(48px, 6.1vw, 88px) / 1 var(--display); }
.gate-copy .label { color: var(--muted); transition: color .2s var(--ease); }
.gate-copy .label.warn { color: var(--biro); }
.gate-line {
  position: absolute;
  left: 50%;
  top: 71.1%;
  width: min(800px, calc(100vw - 48px));
  transform: translateX(-50%);
  pointer-events: none;
}
.gate-line .x { position: absolute; left: 0; bottom: 0; font: 400 40px/40px var(--display); transform: translateY(-4px); }
.gate-line .line { margin-left: 48px; height: 1px; background: rgba(21, 20, 18, .4); }
.gate-line .label { position: absolute; right: 0; top: 12px; color: var(--muted); }
.gate-skip {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  z-index: 1;
}
.gate-skip:hover { color: var(--ink); }
.gate .fade { transition: opacity .35s var(--ease); }
.gate.done .fade { opacity: 0; }

[hidden] { display: none !important; }

/* ---------- mobile (Figma: Web / Mobile 5:95) */
@media (max-width: 720px) {
  :root { --gutter: 20px; }
  .bar { top: 20px; height: 44px; }
  .pill { height: 44px; }
  .pill.lg { height: 48px; }
  .wordmark { font-size: 20px; line-height: 24px; padding: 10px 0; margin: -10px 0; }
  #x-link { display: none; }
  #buy-link { box-shadow: none; }
  .seg { height: 44px; }
  .seg-item.icon { width: 44px; }
  .ca .ca-value, .ca svg { display: none; }
  .ca[data-has] .ca-value { display: inline; }
  .headline { right: var(--gutter); bottom: 132px; gap: 16px; }
  .headline h1 { --lh: 46px; font-size: 48px; }
  .live { display: none; }
  .headline .sub { display: none; }
  .sign-block { left: var(--gutter); bottom: 20px; align-items: stretch; gap: 16px; }
  .count { flex-direction: row; align-items: baseline; gap: 8px; }
  .count-num { font: 500 14px/22px var(--mono); }
  .count .label { font: 400 14px/22px var(--mono); letter-spacing: 0; text-transform: none; }
  .sign-block .pill.lg { width: 100%; }
  .pin-prompt { left: var(--gutter); right: var(--gutter); top: auto; bottom: 20px; transform: none; flex-direction: column; align-items: stretch; border-radius: 12px; padding: 16px; gap: 12px; white-space: normal; }
  .pin-prompt .row .pill { flex: 1; }
  .view-ctl { top: 76px; }

  .latest { padding-top: 96px; }
  .latest-head { flex-direction: column; align-items: flex-start; }
  .latest-head h2 { font-size: 56px; line-height: 52px; }
  .latest-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .latest-row li:nth-child(odd) { box-shadow: inset -1px 0 0 var(--hairline); }
  .latest-row li:nth-child(even) { box-shadow: none; }
  .latest-row li:nth-child(3) { box-shadow: inset -1px 0 0 var(--hairline), inset 0 1px 0 var(--hairline); }
  .latest-row li:nth-child(4) { box-shadow: inset 0 1px 0 var(--hairline); }
  .latest-row li:nth-child(n + 5) { display: none; }
  .latest-row canvas { width: 100%; height: auto; aspect-ratio: 1; }
  .foot { flex-direction: column; align-items: flex-start; padding-top: 80px; }

  .intro-num { font-size: 104px; line-height: 104px; }
  .gate-copy { top: 28%; }
  .gate-line { top: 66%; }
}

@media (min-width: 721px) and (max-width: 1100px) {
  .latest-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .latest-row li:nth-child(3n) { box-shadow: none; }
  .latest-row li:nth-child(n + 4) { box-shadow: inset -1px 0 0 var(--hairline), inset 0 1px 0 var(--hairline); }
  .latest-row li:nth-child(6) { box-shadow: inset 0 1px 0 var(--hairline); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
