@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Gochi Hand"; src: url("fonts/gochi-hand-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: block; }

:root {
  --wall: #1B328B;       /* secondary */
  --wall-hi: #223DAA;    /* secondary-600 */
  --wall-lo: #1C2E7D;    /* background-700 */
  --primary: #8FA0E2;
  --primary-100: #D6DCF5;
  --ink: #0B1230;
  --ink-2: #17204A;
  --ink-line: #36427A;
  --white: #F7F8FC;
  --mist: #B5BEE3;      /* text-200: secondary text on wall and ink */
  --paper: #ECE6D6;
  --accent: #E022ED;
  --accent-300: #EB71F4;
  --accent-400: #E442F0;
  --pad: clamp(20px, 4.4vw, 72px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --display: "Barlow Condensed", "Barlow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--ink-line) var(--ink); }
body { margin: 0; background: var(--ink); color: var(--white); font-family: var(--body); font-size: 1.0625rem; line-height: 1.5; caret-color: var(--accent); }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
a { color: inherit; text-underline-offset: 0.2em; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
.sprite { position: absolute; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.config-warning { margin: 0; padding: 10px var(--pad); background: var(--accent); color: var(--ink); font-weight: 600; font-size: 0.9375rem; }
.config-warning code { font-size: 0.875rem; }

/* ---------- Home screen (first viewport) ---------- */

.home {
  --grime: 1;
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: var(--wall);
  isolation: isolate;
}
.wallpaper {
  position: absolute; inset: 0; z-index: 0;
  background: var(--wall);
  filter: saturate(calc(1 - 0.5 * var(--grime))) brightness(calc(1 - 0.3 * var(--grime)));
  transition: filter 900ms var(--ease-out);
}
.wp-shape { position: absolute; border-radius: 50%; }
.wp-a { width: 88vmax; height: 88vmax; left: -30vmax; top: 34%; background: var(--wall-lo); }
.wp-b { width: 60vmax; height: 60vmax; right: -22vmax; top: -24vmax; background: var(--wall-hi); }
.wp-c { width: 30vmax; height: 30vmax; right: 18%; bottom: -16vmax; background: #2A42A2; }

.grime { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.grime canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.scraps { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.scrap {
  position: absolute; left: var(--x); top: var(--y);
  width: var(--w, 92px); height: auto; aspect-ratio: 10 / 9;
  transform: rotate(var(--r, 0deg));
  filter: drop-shadow(0 6px 8px rgba(10, 8, 4, 0.35));
  transition: transform 750ms cubic-bezier(0.5, 0, 0.75, 0), opacity 450ms 250ms ease-in;
}
.scrap.receipt { aspect-ratio: 6 / 11; --w: 52px; }
.scrap.swept { transform: translate(60px, 180px) rotate(calc(var(--r, 0deg) + 70deg)) scale(0.8); opacity: 0; }
.s1 { --x: 84%; --y: 9%;  --r: -14deg; --w: 96px; }
.s2 { --x: 49%; --y: 12%; --r: 22deg; }
.s3 { --x: 5%;  --y: 82%; --r: 8deg;  --w: 84px; }
.s4 { --x: 27%; --y: 83%; --r: -28deg; }
.s5 { --x: 90%; --y: 84%; --r: 34deg; --w: 78px; }
.s6 { --x: 71%; --y: 88%; --r: -6deg; --w: 70px; }

.home-ui {
  position: relative; z-index: 3;
  min-height: 100svh;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto auto 1fr auto;
  column-gap: clamp(16px, 2.2vw, 36px);
  padding: 0 var(--pad);
}

.status-bar {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
  height: 44px;
}
.wordmark { font-family: var(--body); font-weight: 600; font-size: 0.875rem; line-height: 1; }
.status-icons { display: flex; gap: 8px; }
.status-icons svg { width: 18px; height: 18px; }

.clock { grid-column: 1 / span 6; grid-row: 2; display: flex; flex-direction: column; align-items: flex-start; margin-top: clamp(16px, 5vh, 56px); }
.clock-time { font-family: var(--display); font-weight: 600; font-size: clamp(3.5rem, 2rem + 4.2vw, 6rem); line-height: 0.9; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.clock-date { font-weight: 600; font-size: 1.0625rem; color: var(--white); margin-top: 6px; text-shadow: 0 1px 2px rgba(8, 10, 24, 0.55), 0 0 12px rgba(8, 10, 24, 0.45); }

.pitch { grid-column: 1 / span 7; grid-row: 3; align-self: center; padding: clamp(28px, 6vh, 64px) 0; }
.pitch h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.875rem, 1rem + 5.4vw, 6rem);
  line-height: 0.94; letter-spacing: -0.01em;
  max-width: 13ch;
  text-shadow: 0 2px 18px rgba(8, 10, 24, 0.35);
}
.lede-short { display: none; }
.lede { margin-top: clamp(16px, 2.6vh, 28px); max-width: 38ch; font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.3125rem); line-height: 1.45; font-weight: 500; color: var(--white); text-shadow: 0 1px 2px rgba(8, 10, 24, 0.55), 0 0 14px rgba(8, 10, 24, 0.5); }

.today {
  grid-column: 8 / -1; grid-row: 2 / 4; align-self: center;
  margin-top: clamp(16px, 4vh, 48px);
  background: rgba(11, 18, 48, 0.94);
  border-radius: 28px;
  padding: 22px 22px 18px;
  box-shadow: 0 18px 40px -12px rgba(5, 6, 18, 0.55);
}
.today-head { display: flex; align-items: baseline; justify-content: space-between; }
.today h2 { font-family: var(--display); font-weight: 600; font-size: 1.75rem; line-height: 1; }
.today-count { font-weight: 600; font-size: 0.9375rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.today-hint { margin-top: 6px; font-size: 0.9375rem; color: var(--mist); }
.tasks { margin-top: 12px; }
.tasks > li + li { border-top: 1px solid var(--ink-line); }

.task {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 56px; padding: 10px 2px;
  font-size: 1.0625rem; font-weight: 500;
  border-radius: 10px;
}
.task:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tick {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(247, 248, 252, 0.75);
  display: grid; place-items: center; color: transparent;
  transition: background-color 220ms var(--ease-out), border-color 220ms var(--ease-out), transform 220ms var(--ease-out);
}
.tick svg { width: 18px; height: 18px; }
.task:hover .tick { border-color: var(--accent); }
.task:active .tick { transform: scale(0.9); }
.task-title { transition: color 300ms ease; }
.task[aria-pressed="true"] .tick, .task-cta.done .tick { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.task[aria-pressed="true"] .task-title { color: #909ED5; text-decoration: line-through; text-decoration-thickness: 2px; }

.task-cta { display: flex; gap: 14px; padding: 14px 2px 4px; }
.task-cta > .tick { margin-top: 2px; border-color: var(--accent); cursor: text; }
.cta-body { flex: 1; min-width: 0; }
.task-cta .task-title { display: block; font-size: 1.0625rem; font-weight: 600; margin-bottom: 10px; }

.field-row { display: flex; gap: 8px; }
.signup input[type="email"], .survey input[type="text"] {
  flex: 1; min-width: 0; height: 48px; padding: 0 14px;
  font: inherit; font-size: 1rem; color: var(--white);
  background: var(--ink-2); border: 1.5px solid var(--ink-line); border-radius: 12px;
}
.signup input::placeholder, .survey input::placeholder { color: #909ED5; opacity: 1; }
.signup input:focus-visible, .survey input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(224, 34, 237, 0.4); }
.signup input[aria-invalid="true"] { border-color: #FF8A7A; }

.btn {
  flex: none; height: 48px; padding: 0 20px;
  font: inherit; font-weight: 600; font-size: 1rem;
  color: var(--ink); background: var(--accent);
  border: 0; border-radius: 12px; cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}
.btn:hover { background: var(--accent-400); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: progress; opacity: 0.7; }
.btn-ink { background: var(--ink); color: var(--accent); }
.btn-ink:hover { background: var(--ink-2); }
.link-btn { all: unset; cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; padding: 8px 4px; border-radius: 6px; }
.link-btn:focus-visible { outline: 3px solid var(--accent); }

.form-note { margin-top: 8px; font-size: 0.875rem; color: var(--mist); }
.form-error { margin-top: 8px; font-size: 0.9375rem; font-weight: 600; color: #FFB3A8; }
.signed-msg { font-weight: 600; }
.signed-msg span { display: block; font-weight: 400; color: var(--mist); font-size: 0.9375rem; margin-top: 2px; }

.survey { display: grid; gap: 14px; }
.survey-thanks { font-weight: 600; }
.survey fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 4px; }
.survey legend { font-weight: 600; font-size: 0.9375rem; margin-bottom: 4px; padding: 0; }
.survey fieldset label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 0.9375rem; cursor: pointer; }
.survey input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.survey-text { display: grid; gap: 6px; }
.survey-text label { font-weight: 600; font-size: 0.9375rem; }
.survey-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.survey-actions .btn { width: auto; flex: 1 1 auto; max-width: 260px; }

.dock {
  grid-column: 1 / -1; grid-row: 4;
  display: flex; justify-content: center; gap: clamp(14px, 3vw, 40px);
  padding: 20px 0 calc(22px + env(safe-area-inset-bottom));
}
.dock li { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 64px; }
.app { width: 56px; height: 56px; border-radius: 18px; background: var(--white); color: var(--ink); display: grid; place-items: center; box-shadow: 0 6px 14px -4px rgba(5, 6, 18, 0.5); }
.app svg { width: 26px; height: 26px; }
.app-label { font-size: 0.8125rem; font-weight: 500; text-shadow: 0 1px 3px rgba(5, 6, 18, 0.8); }

/* ---------- How it works ---------- */

.how {
  background: var(--ink);
  padding: clamp(80px, 13vw, 168px) var(--pad);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.2vw, 36px); row-gap: clamp(48px, 7vw, 88px);
}
.how-copy { grid-column: 1 / span 6; align-self: center; }
.how h2, .launcher h2, .close h2 { font-family: var(--display); font-weight: 800; font-size: clamp(2.5rem, 1.2rem + 4vw, 5rem); line-height: 0.95; letter-spacing: -0.005em; }
.how-lines { margin-top: clamp(28px, 4vw, 44px); display: grid; gap: 18px; max-width: 30ch; }
.how-lines li { font-size: clamp(1.375rem, 1rem + 1vw, 1.875rem); line-height: 1.22; font-weight: 500; }
.how-lines li:nth-child(2) { color: #C9B998; }
.how-lines li:nth-child(3) { color: var(--primary); }

.scale {
  grid-column: 7 / -1; margin: 0; align-self: center;
  display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); column-gap: clamp(20px, 3vw, 44px); align-items: center;
}
.scale-tile { width: 100%; aspect-ratio: 9 / 16; border-radius: 22px; background: var(--wall); }
.scale-control { display: grid; gap: 6px; }
.scale-label { font-weight: 600; font-size: 0.9375rem; color: var(--mist); }
.scale-out { font-family: var(--display); font-weight: 600; font-size: clamp(1.75rem, 1.2rem + 1.4vw, 2.5rem); line-height: 1.05; font-variant-numeric: tabular-nums; }
.scale-ends { display: flex; justify-content: space-between; font-size: 0.875rem; color: var(--mist); }
.scale input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 8px 0 0; background: transparent; cursor: pointer; --fill: 37.5%; }
.scale input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--fill), var(--ink-line) var(--fill)); }
.scale input[type="range"]::-moz-range-track { height: 8px; border-radius: 4px; background: var(--ink-line); }
.scale input[type="range"]::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--accent); }
.scale input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: var(--accent); border: 3px solid var(--white); box-shadow: 0 2px 6px rgba(5, 6, 18, 0.5); }
.scale input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid var(--white); }
.scale input[type="range"]:focus-visible { outline: none; }
.scale input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(224, 34, 237, 0.45); }
.scale input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(224, 34, 237, 0.45); }
.scale figcaption { grid-column: 1 / -1; margin-top: 22px; color: var(--mist); font-size: 0.9375rem; max-width: 60ch; }

/* ---------- Launcher promises ---------- */

.launcher {
  background: var(--wall);
  padding: clamp(80px, 12vw, 160px) var(--pad);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.2vw, 36px); row-gap: 48px;
}
.launcher-copy { grid-column: 1 / span 6; }
.launcher-copy p { margin-top: 24px; font-size: clamp(1.125rem, 1rem + 0.45vw, 1.375rem); max-width: 40ch; }
.wont { grid-column: 8 / -1; align-self: end; }
.wont h3 { font-family: var(--display); font-weight: 600; font-size: 1.5rem; color: var(--mist); margin-bottom: 10px; }
.wont li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1.5px solid rgba(213, 221, 250, 0.32); font-size: clamp(1.125rem, 1rem + 0.4vw, 1.375rem); font-weight: 500; line-height: 1.3; }
.wont li:last-child { border-bottom: 1.5px solid rgba(213, 221, 250, 0.32); }
.wont svg { flex: none; width: 22px; height: 22px; margin-top: 2px; color: var(--mist); }

/* ---------- Close ---------- */

.close {
  background: var(--primary); color: var(--ink); padding: clamp(80px, 12vw, 152px) var(--pad);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.2vw, 36px); align-items: end;
}
.close h2 { grid-column: 1 / span 6; grid-row: 1 / span 2; align-self: end; max-width: 12ch; }
.close-note { grid-column: 8 / -1; max-width: 40ch; font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3125rem); }
.close-slot { grid-column: 8 / -1; margin-top: 24px; }
.close .signup input[type="email"], .close .survey input[type="text"] { background: var(--primary-100); color: var(--ink); border-color: var(--ink); }
.close .signup input::placeholder, .close .survey input::placeholder { color: #384A94; }
.close .signup input:focus-visible, .close .survey input:focus-visible { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11, 18, 48, 0.25); }
.close .form-note, .close .signed-msg span { color: #1C254A; }
.close .form-error { color: #5A0A3A; }
.close .btn { background: var(--ink); color: var(--accent-300); }
.close .btn:hover { background: var(--ink-2); }
.close .survey input[type="radio"] { accent-color: var(--ink); }
.close :focus-visible { outline-color: var(--ink); }
.close ::selection { background: var(--ink); color: var(--accent-300); }

.footer { padding: 40px var(--pad) calc(48px + env(safe-area-inset-bottom)); color: var(--mist); font-size: 0.9375rem; display: grid; gap: 6px; }

/* ---------- Narrow screens ---------- */

@media (max-width: 860px) {
  .home-ui { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .status-bar, .clock, .pitch, .today, .dock { grid-column: 1; grid-row: auto; }
  .clock { margin-top: 18px; }
  .pitch { padding: 28px 0 24px; }
  .pitch h1 { max-width: 12ch; }
  .today { margin-top: 0; padding: 18px 16px 14px; border-radius: 24px; }
  .dock { justify-content: space-between; gap: 0; padding-top: 24px; }
  .dock li { width: auto; min-width: 56px; }
  .app { width: 52px; height: 52px; border-radius: 16px; }
  .how-copy, .scale, .launcher-copy, .wont { grid-column: 1 / -1; }
  .close h2, .close-note, .close-slot { grid-column: 1 / -1; grid-row: auto; }
  .close-note { margin-top: 20px; }
  .close-slot { margin-top: 28px; }
  .scale { grid-template-columns: minmax(0, 150px) minmax(0, 1fr); column-gap: 18px; }
  .scale-tile { border-radius: 16px; }
  .s1 { --x: 80%; --y: 19%; --w: 60px; }
  .s2, .s3, .s4, .s5, .s6 { display: none; }
  .clock { margin-top: 8px; }
  .clock-time { font-size: 3rem; }
  .pitch { padding: 16px 0; }
  .task { min-height: 48px; padding: 6px 2px; }
  .today-hint { margin-top: 2px; }
  .lede-long { display: none; }
  .lede-short { display: inline; }
  .s5 { --x: -4%; --y: 93%; --w: 60px; }
}
@media (max-width: 400px) {
  .field-row { flex-direction: column; }
  .field-row input[type="email"] { flex: none; width: 100%; }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* The Today card gathers dust in proportion to open tasks. */
.today { position: relative; isolation: isolate; }
.today::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: var(--dust, none) center / cover no-repeat;
  opacity: calc(0.85 * var(--grime, 1));
  transition: opacity 700ms var(--ease-out);
}
.iphone-btn { font-size: inherit; color: inherit; padding: 6px 2px; }
.iphone-done { font-weight: 600; }
