/* groove · sign in
   Tokens mirror the Figma "groove / color" variables. */

@font-face { font-family: "Geist"; src: url("../assets/fonts/Geist-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../assets/fonts/GeistMono-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #1E1D1B;
  --side: #171614;
  --line: #3D3B37;
  --text: #F4F1EA;
  --muted: #9C978F;
  --paper: #F4F1EA;
  --paper-hover: #E6E1D6;
  --ink: #171614;
  --paper-muted: #6E6A62;
  --accent: #A8385F;
  --accent-hover: #BC4A72;
  --accent-pressed: #8E2D50;
  --glow: #D9668C;
  --gain: #2F7A4F;
  --loss: #B0473B;

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-inout: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.3, 1.6, .4, 1);
  --t-instant: 80ms;
  --t-quick: 150ms;
  --t-base: 240ms;
  --t-slow: 300ms;

  --receipt-w: 440px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
p, h1, h2, li, label, small, span { text-wrap: pretty; }
h1 { text-wrap: balance; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ---------- page layout ---------- */
.page {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--receipt-w);
  column-gap: 48px;
  padding: 0 clamp(24px, 9.7vw, 140px) 96px clamp(24px, 5.5vw, 80px);
  background: radial-gradient(ellipse 60% 70% at 75% 0%, rgba(244, 241, 234, .075), rgba(244, 241, 234, 0) 70%);
  isolation: isolate;
}

.serial {
  position: absolute; left: clamp(24px, 5.5vw, 80px); top: 54px; margin: 0;
  font: 400 11px/1 "Geist Mono", monospace; letter-spacing: 2px; color: var(--muted);
}

.hero { grid-column: 1; padding-top: 150px; position: relative; z-index: 2; max-width: 640px; }
.hero__title {
  margin: 0; font-weight: 600; font-size: clamp(48px, 5.3vw, 76px); line-height: 1.05; letter-spacing: -.047em;
}
.hero__title span { display: block; color: var(--muted); }
.hero__lede { margin: 28px 0 0; font-size: 18px; line-height: 28px; color: var(--muted); }
.hero__lede .line { display: block; }

.bigdisc {
  position: absolute; z-index: 0; pointer-events: none;
  width: min(760px, 58vw); aspect-ratio: 1;
  left: -170px; bottom: max(-250px, -18vw);
}
.bigdisc__svg { width: 100%; height: 100%; display: block; }
.bigdisc__side {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, calc(-50% - 52px));
  font: 400 12px/1 "Geist Mono", monospace; letter-spacing: 3px; color: var(--paper); opacity: .75;
}

.legal {
  position: absolute; right: clamp(24px, 5.5vw, 80px); bottom: 34px; z-index: 2;
  display: flex; gap: 10px; font: 400 11px/1 "Geist Mono", monospace; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted);
}
.legal a { text-decoration: none; transition: color var(--t-quick) var(--ease-out); }
.legal a:hover, .legal a:focus-visible { color: var(--text); }

/* ---------- printer slot + receipt ---------- */
.stage { grid-column: 2; position: relative; z-index: 3; padding-top: 12px; }
.slot {
  position: absolute; top: 0; left: -24px; right: -24px; height: 16px; z-index: 4;
  background: var(--side); border-radius: 0 0 10px 10px;
  box-shadow: 0 1px 0 var(--line), 0 8px 20px rgba(0, 0, 0, .45);
}
.slot__glow {
  position: absolute; left: 20px; right: 20px; bottom: 0; height: 2px;
  background: var(--glow); box-shadow: 0 0 16px 2px rgba(217, 102, 140, .7); opacity: .85;
  transform-origin: center;
}

.receipt { position: relative; }
.paper {
  background: var(--paper); color: var(--ink);
  font-family: "Geist Mono", monospace;
  padding: 40px 34px 18px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, .5);
}
.tear {
  height: 10px;
  background: radial-gradient(circle at 10px 10px, transparent 9.5px, var(--paper) 10px) 0 0 / 20px 10px repeat-x;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .35));
}

.brand { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.brand__disc { width: 112px; height: 112px; display: block; }
.brand__ring {
  position: absolute; top: 36px; left: 50%; width: 40px; height: 40px; margin-left: -20px;
  border: 2px solid var(--glow); border-radius: 50%; opacity: 0; pointer-events: none;
}
.wordmark {
  margin: 16px 0 0; font: 600 46px/1 "Geist", sans-serif; letter-spacing: -2.6px; color: var(--ink);
}
.wordmark span { display: inline-block; }
.tagline { margin: 10px 0 0; font-size: 10px; letter-spacing: 3px; text-transform: uppercase; }

.dash { border: 0; border-top: 1.5px dashed var(--ink); opacity: .45; margin: 16px 0; }
.meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.meta__title { font-weight: 700; letter-spacing: 1.5px; }
.meta__time { color: var(--paper-muted); }

/* ---------- form ---------- */
.form { margin-top: 4px; }
.field { margin-top: 16px; }
.field__head { display: flex; justify-content: space-between; align-items: center; }
.field__label {
  display: block; font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--paper-muted);
  transition: color var(--t-quick) var(--ease-out);
}
.field__toggle {
  border: 0; background: none; padding: 2px 0; cursor: pointer;
  font: 400 10px/1 "Geist Mono", monospace; letter-spacing: 1.8px; text-transform: uppercase; color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent;
  transition: text-decoration-color var(--t-quick) var(--ease-out);
}
.field__toggle:hover { text-decoration-color: currentColor; }
.field__toggle:focus-visible { text-decoration-color: currentColor; outline: none; box-shadow: 0 0 0 3px rgba(217, 102, 140, .55); border-radius: 2px; }

.field__line { position: relative; display: flex; align-items: center; height: 38px; border-bottom: 1.5px solid rgba(23, 22, 20, .55); }
.field__line::after {
  content: ""; position: absolute; left: 50%; right: 50%; bottom: -1.5px; height: 2px; background: var(--glow);
  transition: left var(--t-base) var(--ease-out), right var(--t-base) var(--ease-out), background-color var(--t-quick);
}
.field__line:focus-within::after { left: 0; right: 0; }
.field:focus-within .field__label { color: var(--accent); }
.field__line input {
  all: unset; flex: 1; min-width: 0; height: 100%;
  font: 400 15px/1 "Geist Mono", monospace; color: var(--ink); caret-color: var(--glow);
}
.field__line input::placeholder { color: #B8B3A9; }
.field[data-field="password"] input { letter-spacing: 2px; }
.field[data-field="password"] input[type="text"] { letter-spacing: 0; }

.field__msg { margin: 0; height: 0; overflow: hidden; font-size: 11px; letter-spacing: .4px; color: var(--loss); transition: height var(--t-base) var(--ease-out); }
.field.is-invalid .field__msg { height: 22px; padding-top: 7px; }
.field.is-invalid .field__label, .field.is-wrong .field__label { color: var(--loss); }
.field.is-invalid .field__line, .field.is-wrong .field__line { border-bottom-color: var(--loss); }
.field.is-invalid .field__line::after, .field.is-wrong .field__line::after { background: var(--loss); }

.printline {
  margin: 0; min-height: 0; overflow: hidden; font-size: 11px; letter-spacing: .5px; line-height: 16px;
  max-height: 0; transition: max-height var(--t-base) var(--ease-out), margin var(--t-base) var(--ease-out);
}
.printline.is-shown { max-height: 40px; margin-top: 12px; }
.printline.is-error { color: var(--loss); }
.printline.is-ok { color: var(--gain); }

.form__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
  width: 16px; height: 16px; border: 1.5px solid var(--ink); border-radius: 3px; display: grid; place-items: center;
  transition: background-color var(--t-quick) var(--ease-out), transform var(--t-instant) var(--ease-out);
}
.check__box::after { content: "✓"; font-size: 11px; line-height: 1; color: var(--paper); transform: scale(0); transition: transform var(--t-quick) var(--ease-spring); }
.check input:checked + .check__box { background: var(--ink); }
.check input:checked + .check__box::after { transform: scale(1); }
.check:active .check__box { transform: scale(.9); }
.check input:focus-visible + .check__box { box-shadow: 0 0 0 3px rgba(217, 102, 140, .55); }

.link {
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
  transition: text-decoration-thickness var(--t-quick), color var(--t-quick);
}
.link:hover { text-decoration-thickness: 2px; }
.link:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(217, 102, 140, .55); border-radius: 2px; }
.link--strong { font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  width: 100%; height: 50px; border-radius: 9px; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font: 500 15px/1 "Geist", sans-serif; letter-spacing: -.1px;
  transition: transform var(--t-quick) var(--ease-out), box-shadow var(--t-quick) var(--ease-out), background-color var(--t-quick) var(--ease-out), color var(--t-quick);
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(217, 102, 140, .6); }
.btn--primary { margin-top: 22px; background: var(--accent); color: var(--paper); }
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(168, 56, 95, .35); }
.btn--primary:active { background: var(--accent-pressed); transform: translateY(0) scale(.98); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .25); transition-duration: var(--t-instant); }
.btn__arrow { display: inline-block; transition: transform var(--t-quick) var(--ease-out); }
.btn--primary:hover .btn__arrow { transform: translateX(4px); }
.btn--secondary { margin-top: 10px; height: 46px; background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn--secondary:hover { background: rgba(23, 22, 20, .06); transform: translateY(-1px); }
.btn--secondary:active { transform: scale(.98); transition-duration: var(--t-instant); }

.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn__arrow { display: none; }
.btn.is-loading .btn__label::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }
.btn.is-success { background: var(--gain); pointer-events: none; transform: none; box-shadow: none; }
.btn.is-nudge { animation: nudge .6s var(--ease-out) 2; }
@keyframes nudge { 50% { box-shadow: 0 0 0 4px rgba(217, 102, 140, .55); } }

.new { margin: 0; text-align: center; font-size: 12px; }
.barcode { display: block; width: 100%; height: 30px; margin-top: 14px; }
.thanks { margin: 6px 0 0; text-align: center; font-size: 9px; letter-spacing: 3px; }

/* ---------- stamps ---------- */
.stamp {
  position: absolute; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: "Geist Mono", monospace; font-weight: 700; text-align: center; line-height: 1.25; pointer-events: none;
  opacity: 0; transform: scale(1.6) rotate(-30deg);
}
.stamp { width: 124px; height: 124px; right: -46px; top: 96px; border: 3px solid currentColor; }
.stamp small { font-size: 9px; letter-spacing: .5px; }
.stamp strong { font-size: 17px; letter-spacing: .3px; }
.stamp--ok { color: var(--accent); --rot: -12deg; }
.stamp--no { color: var(--loss); --rot: 12deg; }
.stamp--info { color: var(--ink); --rot: -8deg; }
.stamp.is-in { animation: stamp-in .34s var(--ease-spring) forwards; }
@keyframes stamp-in { to { opacity: .9; transform: scale(1) rotate(var(--rot, -12deg)); } }

.receipt.is-shake { animation: shake .32s var(--ease-inout); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.receipt.is-jolt { animation: jolt .26s var(--ease-out); }
@keyframes jolt { 40% { transform: translateY(3px); } }
.receipt.is-leaving { animation: tear-away .7s var(--ease-inout) .9s forwards; }
@keyframes tear-away { to { transform: translateY(70px) rotate(2.5deg); opacity: 0; } }

/* ---------- intro (logo animation) ---------- */
@keyframes slot-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes glow-rest { to { opacity: .25; } }
@keyframes feed { from { clip-path: inset(0 -80px 100% -80px); transform: translateY(-14px); } to { clip-path: inset(0 -80px -140px -80px); transform: none; } }
@keyframes drop { 0% { opacity: 0; transform: translateY(-180px) rotate(-260deg) scale(.5); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(3.2); } }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes big-in { from { opacity: 0; transform: translate(-80px, 60px) rotate(-30deg); } to { opacity: 1; transform: none; } }

.bigdisc__svg { animation: spin 24s linear infinite; }
.brand__disc .disc-label { transform-box: fill-box; transform-origin: center; }

body.intro-pending .slot__glow,
body.intro-pending .receipt,
body.intro-pending .bigdisc,
body.intro-pending .hero,
body.intro-pending .serial,
body.intro-pending .legal { opacity: 0; }

body.intro-play .slot__glow { animation: slot-in .45s var(--ease-out) .15s both, glow-rest .8s ease 2.6s forwards; }
body.intro-play .receipt { animation: feed 1s cubic-bezier(.3, .7, .2, 1) .55s both; }
body.intro-play .brand__disc { animation: drop .9s cubic-bezier(.25, 1.4, .4, 1) 1.25s both, spin 7s linear 2.15s infinite; }
body.intro-play .brand__disc .disc-label { animation: pop .45s var(--ease-spring) 1.95s both; }
body.intro-play .brand__ring { animation: ring .8s ease-out 2.05s; }
body.intro-play .wordmark span { animation: rise .5s var(--ease-out) both; animation-delay: calc(2.2s + var(--i) * 50ms); }
body.intro-play .tagline { animation: fade-up .6s var(--ease-out) 2.55s both; }
body.intro-play .printed > * { animation: fade-up .5s var(--ease-out) both; animation-delay: calc(2.6s + var(--i) * 70ms); }
body.intro-play .bigdisc { animation: big-in 1.6s var(--ease-out) .2s both; }
body.intro-play .hero { animation: fade-up .9s var(--ease-out) 1s both; }
body.intro-play .serial, body.intro-play .legal { animation: fade .8s ease 1.4s both; }

body.intro-done .slot__glow { opacity: .25; }
body.intro-done .brand__disc { animation: spin 7s linear infinite; }


/* ---------- flow: compact header, headings, notes ---------- */
.brand__disc, .wordmark { transition: width var(--t-slow) var(--ease-out), height var(--t-slow) var(--ease-out), font-size var(--t-slow) var(--ease-out), margin var(--t-slow) var(--ease-out); }
.receipt.is-compact .paper { padding-top: 30px; }
.receipt.is-compact .brand__disc { width: 64px; height: 64px; }
.receipt.is-compact .brand__ring { top: 12px; }
.receipt.is-compact .wordmark { font-size: 32px; letter-spacing: -1.8px; margin-top: 10px; }
.receipt.is-compact .tagline { margin-top: 8px; }

.h { margin: 18px 0 0; font: 600 26px/1.15 "Geist", sans-serif; letter-spacing: -.8px; color: var(--ink); outline: none; }
.note { margin: 12px 0 0; font-size: 13px; line-height: 20px; color: var(--ink); }
.note .em { font-weight: 700; word-break: break-all; }
.muted { color: var(--paper-muted); }
.dots::after { content: ""; animation: dots 1s steps(4, end) infinite; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.devbox { margin: 16px 0 0; padding: 12px 14px; border: 1.5px dashed var(--paper-muted); border-radius: 6px; font-size: 11px; line-height: 20px; letter-spacing: .4px; color: var(--paper-muted); }
.devbox a { color: var(--ink); }

.btn:disabled { cursor: default; opacity: .55; transform: none; box-shadow: none; }
.btn--secondary:disabled:hover { background: transparent; }

.check--top { align-items: flex-start; margin-top: 18px; font-size: 12px; line-height: 18px; }
.check--top .check__box { margin-top: 1px; flex-shrink: 0; }
.check__msg { height: auto; color: var(--loss); }
.check__msg:not(:empty) { padding-top: 6px; }
.form.terms-bad .check__box { border-color: var(--loss); box-shadow: 0 0 0 3px rgba(176, 71, 59, .18); }

/* password strength, printed like receipt lines */
.meter { margin-top: 10px; }
.meter__top { display: flex; align-items: center; gap: 12px; }
.meter__bar { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.meter__bar i { height: 4px; border-radius: 2px; background: rgba(23, 22, 20, .14); transition: background-color var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-spring); }
.meter__label { font-size: 10px; letter-spacing: 1.6px; color: var(--paper-muted); min-width: 64px; text-align: right; }
.meter[data-score="1"] .meter__bar i:nth-child(-n+1) { background: var(--loss); }
.meter[data-score="2"] .meter__bar i:nth-child(-n+2) { background: #C9922E; }
.meter[data-score="3"] .meter__bar i:nth-child(-n+3) { background: var(--gain); }
.meter[data-score="4"] .meter__bar i { background: var(--gain); }
.meter[data-score="4"] .meter__label, .meter[data-score="3"] .meter__label { color: var(--gain); }
.meter__rules { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 10px; letter-spacing: .6px; color: var(--paper-muted); }
.meter__rules li::before { content: "·"; display: inline-block; width: 14px; transition: transform var(--t-quick) var(--ease-spring); }
.meter__rules li.is-met { color: var(--gain); }
.meter__rules li.is-met::before { content: "✓"; transform: scale(1.1); }

/* start choices on the welcome receipt */
.choices { border: 0; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.choice { display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice__box { display: block; padding: 12px 14px 12px 40px; border: 1.5px solid rgba(23, 22, 20, .3); border-radius: 8px; position: relative; transition: border-color var(--t-quick), background-color var(--t-quick), transform var(--t-quick) var(--ease-out); }
.choice__box::before { content: ""; position: absolute; left: 14px; top: 15px; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ink); transition: box-shadow var(--t-quick) var(--ease-spring); }
.choice__box b { display: block; font: 600 14px/1.3 "Geist", sans-serif; }
.choice__box small { display: block; margin-top: 2px; font-size: 11px; line-height: 16px; color: var(--paper-muted); }
.choice:hover .choice__box { border-color: var(--ink); transform: translateY(-1px); }
.choice input:checked + .choice__box { border-color: var(--ink); background: rgba(23, 22, 20, .04); }
.choice input:checked + .choice__box::before { box-shadow: inset 0 0 0 3.5px var(--paper), inset 0 0 0 8px var(--accent); border-color: var(--accent); }
.choice input:focus-visible + .choice__box { box-shadow: 0 0 0 3px rgba(217, 102, 140, .55); }

/* step change: the receipt is pulled back into the slot, then a new one prints */
@keyframes retract { from { clip-path: inset(0 -80px -140px -80px); transform: none; } to { clip-path: inset(0 -80px 100% -80px); transform: translateY(-24px); } }
.receipt.is-retract { animation: retract .38s var(--ease-inout) forwards; }
.receipt.is-retract .stamp { opacity: 0; transition: opacity .1s; }
.receipt.is-reprint { animation: feed .75s cubic-bezier(.3, .7, .2, 1) both; }
.receipt.is-reprint .printed > * { animation: fade-up .45s var(--ease-out) both; animation-delay: calc(.2s + var(--i) * 45ms); }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  :root { --receipt-w: 400px; }
  .page { column-gap: 32px; padding-right: clamp(24px, 5vw, 64px); }
  .hero { padding-top: 130px; }
  .paper { padding: 34px 28px 16px; }
}

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  :root { --receipt-w: min(440px, calc(100vw - 32px)); }
  .page { grid-template-columns: 1fr; padding: 0 16px 120px; justify-items: center; }
  .serial { display: none; }
  .stage { grid-column: 1; grid-row: 1; width: var(--receipt-w); }
  .hero { grid-row: 2; grid-column: 1; padding-top: 56px; text-align: left; width: var(--receipt-w); }
  .hero__title { font-size: 44px; }
  .hero__lede { font-size: 16px; line-height: 25px; }
  .hero__lede .line { display: inline; }
  .hero__lede .line::after { content: " "; }
  .bigdisc { width: 120vw; left: -40vw; bottom: -55vw; opacity: .55; }
  body.intro-play .bigdisc { animation-name: fade; }
  .bigdisc__side { display: none; }
  .legal { left: 16px; right: 16px; justify-content: center; bottom: 28px; }
  .stamp { right: -6px; top: 60px; width: 104px; height: 104px; }
  .stamp strong { font-size: 15px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .bigdisc__svg, .brand__disc { animation: none !important; }
}
