/*
 * The home page: the app's login wall at page scale (app: features/auth/graph-hero.tsx). Paper die-cut stickers with
 * bold garment glyphs slap onto the wall, the middle one stamped today; the rest of the page is what grafit does, told
 * with the same stickers. Shares the tokens in styles.css; your colour (--spray) is changed live by the paint tins.
 */

.home {
  --k-top: #ff66ae;
  --k-outer: #ff8040;
  --k-bottom: #8099ff;
  --k-shoes: #45e2c8;
  --danger: #c62a21;
  --spring: cubic-bezier(0.34, 1.45, 0.5, 1);   /* things stuck on the wall: they land, overshoot, settle */
}
@media (prefers-color-scheme: dark) { .home { --danger: #ff675e; } }

.home { overflow-x: clip; }
.home main { max-width: none; padding: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ─── The bar: the wordmark, two links and the action, over the wall ─────── */

.bar {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left));
  transition: background-color 240ms var(--ease), box-shadow 240ms var(--ease);
}
.bar.scrolled {
  background: color-mix(in srgb, var(--wall) 80%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 1px 0 var(--border-subtle);
}
.bar .wordmark { font: 750 26px/1 var(--syne); letter-spacing: -0.2px; }
.bar nav { display: flex; align-items: center; gap: 24px; font: 600 15px/18px var(--syne); }
.bar nav a { color: var(--text-2); text-decoration: none; }
.bar nav a:hover { color: var(--text); }
.bar .pill { color: var(--text); background: var(--raised); padding: 11px 18px; border-radius: 999px; box-shadow: var(--elev-1); }
@media (max-width: 640px) { .bar nav a:not(.pill) { display: none; } .bar .pill { padding: 10px 16px; } }

/* ─── Stickers (app: Slap, GraphHero) ─────────────────────────────────────── */

/* A sticker's width, registered as a length so it's worked out in pixels on the sticker and its glyph inherits that:
   unregistered, the viewport units in it would be resolved again inside the <svg>, against the svg itself. */
@property --w { syntax: '<length>'; inherits: true; initial-value: 72px; }

.st {
  --w: var(--u, 72px);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--w);
  background: var(--paper);
  color: #121016;
  /* The cut-out's shadow (CUTOUT: 0 5 9 at 20%), and a hair of edge so paper reads on white. */
  box-shadow: 0 5px 9px rgb(18 16 22 / 0.2), 0 0 0 1px rgb(18 16 22 / 0.04);
  transform: rotate(var(--t, 0deg));
}
.st.card { aspect-ratio: 58 / 78; border-radius: calc(var(--w) * 0.1); }
.st.disc { aspect-ratio: 1; border-radius: 50%; }
.st svg { width: calc(var(--w) * 0.5); height: calc(var(--w) * 0.5); flex: none; }
@media (prefers-color-scheme: dark) { .st { box-shadow: 0 6px 14px rgb(0 0 0 / 0.45); } }

/* The stamp: a mono tag on your colour, hit on at a slant. */
.stamp { display: inline-block; font: 700 12px/14px var(--mono); letter-spacing: 0.6px; text-transform: uppercase; color: var(--on-paint); background: var(--spray); padding: 4px 8px; border-radius: 6px; }
/* Tape: a mono fact, outlined. */
.home .tape { background: var(--raised); box-shadow: var(--elev-1); border: 0; transform: rotate(var(--t, 0deg)); white-space: nowrap; }

@keyframes slap {
  0% { opacity: 0; transform: rotate(calc(var(--t, 0deg) + 12deg)) scale(1.35); }
  14% { opacity: 1; }
  62% { transform: rotate(calc(var(--t, 0deg) - 1.5deg)) scale(0.96); }
  100% { opacity: 1; transform: rotate(var(--t, 0deg)) scale(1); }
}
@keyframes stamp-in {
  0% { opacity: 0; transform: translateX(-50%) rotate(-4deg) scale(1.3); }
  55% { opacity: 1; transform: translateX(-50%) rotate(-10deg) scale(0.95); }
  100% { opacity: 1; transform: translateX(-50%) rotate(-8deg) scale(1); }
}

/* ─── Hero: the wall, then the words under it ────────────────────────────── */

.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 76px 0 clamp(32px, 6svh, 64px); overflow: hidden; }

.board {
  --u: clamp(52px, min(7.4vw, 10.5svh), 96px);
  position: relative;
  height: clamp(280px, 47svh, 520px);
  margin: 0 auto;
  width: 100%;
}
.board .st { position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%); translate: -50% -50%; }
.board .st.today { --w: calc(var(--u) * 1.3); z-index: 2; }
.board .st.today .stamp { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%) rotate(-8deg); font-size: 13px; padding: 5px 10px; }
@media (prefers-reduced-motion: no-preference) {
  .board .st { animation: slap 620ms var(--ease) calc(250ms + var(--i) * 75ms) backwards; transition: transform 260ms var(--spring), box-shadow 260ms var(--ease); }
  .board .st.today .stamp { animation: stamp-in 380ms var(--ease) 1500ms backwards; }
  .board .st.again { animation: slap 560ms var(--ease) 0ms backwards; }
  @media (hover: hover) {
    .board .st:hover { transform: rotate(var(--t)) scale(1.08); box-shadow: 0 12px 22px rgb(18 16 22 / 0.22), 0 0 0 1px rgb(18 16 22 / 0.04); z-index: 3; cursor: pointer; }
  }
}

.hero-copy { text-align: center; padding: clamp(28px, 5svh, 56px) var(--gutter) 0; position: relative; z-index: 2; }
.hero h1 { font: 750 clamp(40px, 11.2vw, 96px)/0.95 var(--syne); letter-spacing: -0.035em; margin: 0 0 18px; text-wrap: balance; }
.hero .lede { margin: 0 auto; max-width: 34ch; font-size: clamp(17px, 1.6vw, 20px); color: var(--text-2); text-wrap: balance; }

/* ─── The waitlist form ──────────────────────────────────────────────────── */

.join { margin: 28px auto 0; max-width: 560px; position: relative; }
.field { display: flex; gap: 10px; }
.join input[type='email'] {
  flex: 1; min-width: 0;
  font: 400 18px/22px var(--geist); color: var(--text);
  padding: 17px 20px; border: 0; border-radius: var(--r-md);
  background: var(--raised); box-shadow: var(--elev-1);
  caret-color: var(--spray-ink);
}
.join input[type='email']::placeholder { color: var(--text-3); }
.join input[type='email']:focus-visible { outline: 2px solid var(--spray); outline-offset: 2px; }
.join input[aria-invalid='true'] { box-shadow: var(--elev-1), inset 0 0 0 2px var(--danger); }

/* The lip (MASTER.md §5): your colour on a 4pt lip of itself mixed toward ink; a press pushes the face onto it. */
.lip {
  font: 600 19px/22px var(--syne); color: var(--on-paint);
  padding: 0 26px; min-height: 56px; border: 0; border-radius: var(--r-md);
  background: var(--spray); box-shadow: 0 4px 0 var(--lip);
  cursor: pointer; white-space: nowrap;
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease), background-color 300ms var(--ease);
}
.lip:hover { filter: brightness(1.04); }
.lip:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--lip); }
.lip:disabled { cursor: progress; opacity: 0.75; transform: translateY(3px); box-shadow: 0 1px 0 var(--lip); }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.note { margin: 14px 0 0; font-size: 14px; line-height: 20px; color: var(--text-3); text-wrap: balance; }
.note[data-state='error'] { color: var(--danger); font-weight: 500; }
.note a { color: inherit; }
.join.done .field, .join.done .phones { display: none; }
.join.done .note { color: var(--text); font: 600 18px/24px var(--syne); }
.join.done .note .stamp { margin-right: 10px; transform: rotate(-6deg); vertical-align: 2px; }
@media (max-width: 560px) {
  .field { flex-direction: column; }
  .lip { width: 100%; }
}

/* ─── Sections ───────────────────────────────────────────────────────────── */

.home section:not(.hero) { width: min(100% - 2 * var(--gutter), 1180px); margin: 0 auto; padding: clamp(80px, 12vw, 168px) 0 0; }
.big { font: 750 clamp(40px, 6.2vw, 80px)/1 var(--syne); letter-spacing: -0.035em; margin: 0 0 0.45em; text-wrap: balance; }
.home section p { font-size: 18px; line-height: 1.55; color: var(--text-2); }
.home h3 { font: 750 clamp(28px, 3.3vw, 40px)/1.08 var(--syne); letter-spacing: -0.025em; margin: 0 0 14px; text-wrap: balance; }

/* How it works: three steps, the words on one side, the stickers doing it on the other. */
.step { display: grid; gap: 28px; align-items: center; margin-top: clamp(40px, 6vw, 72px); }
@media (min-width: 860px) {
  .step { grid-template-columns: 5fr 6fr; gap: 64px; }
  .step.flip .step-text { order: 2; }
}
.step-text p { max-width: 40ch; margin: 0; }
.n { display: block; font: 800 clamp(88px, 11vw, 150px)/0.92 var(--syne); letter-spacing: -0.04em; color: var(--spray); margin-bottom: 14px; transition: color 300ms var(--ease); }
/* Syne's 3 is an old-style figure: it drops 0.17em under the baseline the 1 and 2 sit on, so it gets that much more air. */
.n.tail { margin-bottom: calc(32px + 0.17em); }

.scene { --u: clamp(60px, 7.6vw, 100px); position: relative; height: clamp(280px, 32vw, 400px); display: grid; place-items: center; }

.scene-snap .big { --w: calc(var(--u) * 1.9); }
.scene-snap .gplus { position: absolute; width: calc(var(--u) * 1.15); height: auto; left: calc(50% + var(--u) * 0.75); top: calc(50% + var(--u) * 0.9); filter: drop-shadow(0 5px 8px rgb(18 16 22 / 0.2)); }
.scene-snap .gplus.night { display: none; }
@media (prefers-color-scheme: dark) { .scene-snap .gplus.day { display: none; } .scene-snap .gplus.night { display: block; } }
.scene-snap .tape { position: absolute; left: calc(50% - var(--u) * 1.75); top: calc(50% - var(--u) * 1.45); }

.scene-eye .big { --w: calc(var(--u) * 1.5); z-index: 1; }
.scene-eye .piece {
  --rx: calc(var(--u) * 2.05); --ry: calc(var(--u) * 1.4);
  position: absolute; left: 50%; top: 50%;
  display: grid; justify-items: center; gap: 10px;
  transform: translate(-50%, -50%) translate(calc(cos(var(--a)) * var(--rx)), calc(sin(var(--a)) * var(--ry)));
}
.scene-eye .piece .st { --w: calc(var(--u) * 0.8); }
.kind { display: inline-flex; align-items: center; gap: 6px; font: 700 11px/14px var(--mono); letter-spacing: 0.6px; text-transform: uppercase; color: var(--text); background: var(--raised); padding: 4px 9px 4px 7px; border-radius: 999px; box-shadow: var(--elev-1); }
.kind::before, .count i { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--k); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .js .scene-eye:not(.seen) .piece { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  .scene-eye .piece { transition: transform 700ms var(--spring), opacity 300ms var(--ease); }
  .scene-eye .piece:nth-of-type(2) { transition-delay: 80ms; }
  .scene-eye .piece:nth-of-type(3) { transition-delay: 160ms; }
  .scene-eye .piece:nth-of-type(4) { transition-delay: 240ms; }
}

.scene-closet { display: grid; align-content: center; justify-items: start; gap: clamp(20px, 3vw, 36px); }
.shelf { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 4px 24px; }
.stencil { font: 800 clamp(54px, 6.6vw, 92px)/0.86 var(--syne); letter-spacing: -0.045em; }
.count { grid-column: 1; display: inline-flex; align-items: center; gap: 8px; font: 700 12px/14px var(--mono); letter-spacing: 0.6px; text-transform: uppercase; }
.shelf .row { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.shelf .row .st { --w: calc(var(--u) * 0.78); }

/* The wall: fits that share a piece, close together. No lines. */
.walls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 860px) { .walls { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: 64px; align-items: center; } }
.walls-text p { max-width: 42ch; margin: 0; }
.cluster { --u: clamp(56px, 6.6vw, 88px); position: relative; height: clamp(300px, 34vw, 420px); }
.cluster > * { position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%); translate: -50% -50%; }

.diary { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: center; margin-top: clamp(56px, 8vw, 104px); }
@media (min-width: 860px) { .diary { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; } }
.diary-text p { max-width: 42ch; margin: 0; }
.week { container-type: inline-size; position: relative; background: var(--raised); border-radius: var(--r-lg); box-shadow: var(--elev-2); padding: 56px clamp(14px, 2.4vw, 28px) 28px; }
.week .streak { position: absolute; right: 20px; top: 18px; transform: rotate(-3deg); }
.week ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.week li { display: grid; justify-items: center; align-content: start; gap: 6px; }
.week b { font: 600 11px/14px var(--geist); color: var(--text-3); text-transform: lowercase; }
.week .num { font: 750 clamp(16px, 5cqw, 28px)/1 var(--syne); position: relative; padding: 2px clamp(3px, 0.6vw, 6px); isolation: isolate; }
.week .now .num::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--spray); transform: rotate(-1.5deg); }
.week .now .num { color: var(--on-paint); }
/* Sized from the week's own width (7 days must fit), not the window's. */
.week .mini { --w: clamp(30px, 9.5cqw, 48px); width: var(--w); justify-self: center; margin-top: 6px; }
.week .recap { margin-top: 10px; font: 700 10px/12px var(--mono); letter-spacing: 0.6px; text-transform: uppercase; color: var(--spray-ink); border: 1px dashed currentColor; border-radius: 6px; padding: 6px 3px; max-width: 100%; }
@container (max-width: 420px) { .week .recap { font-size: 8px; letter-spacing: 0; padding: 4px 2px; } }

/* Your colour: the paint tins (app: features/accent/paint-tin.tsx) repaint the page. */
.colour { display: grid; gap: 28px; align-items: center; }
@media (min-width: 860px) { .colour { grid-template-columns: 5fr 6fr; gap: 64px; } }
.colour p { max-width: 38ch; margin: 0; }
/* One set of seven, in one row at every width. */
.tins {
  --gap: clamp(8px, 1.6vw, 18px);
  container-type: inline-size; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--gap); max-width: 560px;
}
.tin {
  /* A seventh of the row, as an explicit width and height: Safari doesn't keep a button's aspect-ratio in a grid,
     and squashed the tins into ovals. */
  --s: min(72px, (100cqw - 6 * var(--gap)) / 7);
  width: var(--s); height: var(--s); min-width: 0; padding: calc(var(--s) * 0.08); border: 0; border-radius: 50%;
  justify-self: center; align-self: center; -webkit-appearance: none; appearance: none; flex: none;
  background: var(--paper); box-shadow: 0 5px 9px rgb(18 16 22 / 0.2);
  cursor: pointer; position: relative;
  transition: transform 260ms var(--spring);
}
.tin::before { content: ''; display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--p); box-shadow: inset 0 -3px 0 rgb(18 16 22 / 0.14); }
.tin:hover { transform: translateY(-3px) rotate(-4deg); }
.tin[aria-checked='true'] { transform: scale(1.12) rotate(-6deg); outline: 2.5px solid var(--text); outline-offset: 4px; }
.tin:focus-visible { outline: 2.5px solid var(--text); outline-offset: 4px; }

/* Privacy: the promise, plainly. */
.privacy { display: grid; gap: 28px; }
@media (min-width: 860px) { .privacy { grid-template-columns: 5fr 7fr; gap: 64px; align-items: start; } }
.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px 40px; }
@media (min-width: 640px) { .promises { grid-template-columns: 1fr 1fr; } }
.promises li { display: flex; gap: 16px; align-items: flex-start; }
.promises .st { --w: 48px; flex: none; }
.promises p { margin: 0; font-size: 17px; }
.promises strong { display: block; color: var(--text); font: 600 18px/24px var(--syne); margin-bottom: 4px; }
.privacy .more { grid-column: 1 / -1; margin: 0; }
@media (min-width: 860px) { .privacy .more { grid-column: 2; } }
.privacy .more a { font: 600 17px/22px var(--syne); }

/* The close: back to the wall, and the form with the phone they use. */
.close { position: relative; text-align: center; padding-bottom: clamp(80px, 12vw, 140px) !important; }
.close-board { --u: clamp(48px, 6vw, 80px); position: absolute; inset: clamp(80px, 12vw, 168px) 0 auto; height: 360px; pointer-events: none; }
.close-board .st { position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%); translate: -50% -50%; }
@media (max-width: 860px) { .close-board { display: none; } }
.close .lede { max-width: 40ch; margin: 0 auto; }
.phones { border: 0; padding: 0; margin: 0 0 16px; display: flex; justify-content: center; gap: 8px; }
.phones legend { padding: 0; margin: 0 auto 10px; font: 700 11px/14px var(--mono); letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-3); }
.phones label { position: relative; }
.phones input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.phones span { display: inline-block; font: 600 16px/20px var(--syne); padding: 10px 18px; border-radius: 999px; background: var(--raised); box-shadow: var(--elev-1); color: var(--text-2); transition: background-color 200ms var(--ease), color 200ms var(--ease); }
.phones input:checked + span { background: var(--spray); color: var(--on-paint); }
.phones input:focus-visible + span { outline: 2px solid var(--spray); outline-offset: 3px; }

.faq { margin: clamp(64px, 9vw, 112px) auto 0; display: grid; gap: 28px 48px; text-align: left; max-width: 980px; }
@media (min-width: 760px) { .faq { grid-template-columns: repeat(3, 1fr); } }
.faq div { margin: 0; }
.faq dt { font: 600 18px/24px var(--syne); margin-bottom: 6px; }
.faq dd { margin: 0; color: var(--text-2); font-size: 16px; line-height: 1.5; }

.home .foot { margin-top: 0; }

