/* ==========================================================================
   Sundeck — landing page
   Aesthetic: a fine paper planner. Hairline rules over boxes, serif numerals,
   generous rhythm, no shadows, no gradients, nothing red.
   ========================================================================== */

:root {
  /* Light — warm paper */
  --paper:      #faf7f2;
  --paper-alt:  #f4efe6;
  --ink:        #1b1917;
  --ink-soft:   #4a443c;
  --muted:      #756d62;
  --rule:       #e2dacd;
  --rule-soft:  #ece5d9;
  --accent:     #0f63b8;   /* the app's blue, darkened for text contrast */
  --accent-ink: #0b4c8f;
  --clay:       #a8532c;   /* deferral counts, the "problem" panel */
  --clay-soft:  #f0e2d8;

  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --shell: 1120px;
  --gap:   clamp(3.5rem, 9vw, 7.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #14120f;
    --paper-alt:  #1b1815;
    --ink:        #ece5da;
    --ink-soft:   #c4bcae;
    --muted:      #948b7d;
    --rule:       #302b25;
    --rule-soft:  #262119;
    --accent:     #74b3f5;
    --accent-ink: #9cc9fa;
    --clay:       #d99168;
    --clay-soft:  #2c211a;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.shell { width: min(100% - 2.5rem, var(--shell)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 46rem); }
.center { text-align: center; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 20;
  background: var(--ink); color: var(--paper); padding: 0.7rem 1.1rem;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ── Type ────────────────────────────────────────────────────────────── */

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0; }

h1 {
  font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4rem);
  letter-spacing: -0.022em;
  margin-bottom: 1.4rem;
}

h2 {
  font-size: clamp(1.85rem, 1.35rem + 2.1vw, 2.85rem);
  letter-spacing: -0.018em;
  max-width: 22ch;
  margin-bottom: 1.5rem;
}
/* Centred headings need the extra measure — at 22ch they break mid-clause. */
.center h2 { margin-inline: auto; max-width: 30ch; }

h3 { font-size: 1.14rem; letter-spacing: -0.01em; margin-bottom: 0.45rem; }

p { margin: 0 0 1.15rem; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.775rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.1rem;
}
.eyebrow em { text-transform: none; letter-spacing: 0.02em; }

.lede { font-size: clamp(1.05rem, 1rem + 0.35vw, 1.22rem); color: var(--ink-soft); max-width: 40ch; }
.lede-turn { color: var(--ink); }
.lede strong { font-weight: 600; }

.prose { color: var(--ink-soft); max-width: 62ch; }
.center .prose { margin-inline: auto; }

.note { font-size: 0.86rem; color: var(--muted); margin-top: 1.5rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }

/* ── Nav ─────────────────────────────────────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 4rem; }

.wordmark {
  font-family: var(--serif); font-size: 1.16rem; font-weight: 600;
  letter-spacing: -0.01em; color: var(--ink); text-decoration: none;
}
.wordmark-sm { font-size: 1rem; }

.nav nav { display: flex; align-items: center; gap: clamp(0.9rem, 2.2vw, 1.9rem); }
.nav nav a { font-size: 0.9rem; color: var(--ink-soft); text-decoration: none; }
.nav nav a:hover { color: var(--ink); }
.nav-cta { color: var(--accent) !important; font-weight: 550; }
@media (max-width: 620px) { .nav nav a:not(.nav-cta) { display: none; } }

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  background: var(--ink); color: var(--paper);
  font: inherit; font-size: 0.95rem; font-weight: 550;
  padding: 0.72rem 1.4rem; border: 1px solid var(--ink); border-radius: 3px;
  text-decoration: none; cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.btn:hover { color: var(--paper); opacity: 0.86; transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink); opacity: 1; }

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero { padding: clamp(3rem, 7vw, 6rem) 0 var(--gap); }
.hero-grid {
  display: grid; gap: clamp(2.5rem, 6vw, 5rem);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; } }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.2rem; }

/* The daily-page mock */
.hero-mock { display: flex; flex-direction: column; align-items: center; }

.phone {
  width: min(100%, 23rem);
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.9rem 1.6rem 1.7rem;
}

.phone-day { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }

.numeral {
  font-family: var(--serif);
  font-size: 4.6rem; font-weight: 600; line-height: 0.86;
  letter-spacing: -0.045em;
  font-variant-numeric: lining-nums;
}
.datestack { display: flex; flex-direction: column; font-size: 0.94rem; line-height: 1.32; color: var(--ink-soft); }
.datestack span:first-child { color: var(--ink); font-weight: 550; }

.mock-label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 0.7rem;
  display: flex; align-items: center; justify-content: space-between;
}
.mock-label-pool { margin-top: 1.9rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); }
.mock-label .count { letter-spacing: 0; font-variant-numeric: tabular-nums; }

.mock-list { list-style: none; margin: 0; padding: 0; font-size: 0.95rem; }
.mock-list li { display: flex; align-items: center; gap: 0.6rem; padding: 0.42rem 0; }
.mock-list li.done { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }

.tick {
  flex: none; width: 1rem; height: 1rem; border-radius: 50%;
  border: 1.5px solid var(--rule); background: transparent;
}
.tick-on { border-color: var(--muted); background: var(--muted); }

.mock-pool { color: var(--ink-soft); }
.mock-pool li { padding: 0.3rem 0; justify-content: space-between; }
.defer {
  font-size: 0.78rem; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--clay); background: var(--clay-soft);
  padding: 0.08rem 0.42rem; border-radius: 20px;
}

.mock-caption { font-size: 0.83rem; color: var(--muted); margin-top: 1.1rem; text-align: center; max-width: 26rem; }

/* ── Bands ───────────────────────────────────────────────────────────── */

.band { padding: var(--gap) 0; border-top: 1px solid var(--rule-soft); }
.band-alt { background: var(--paper-alt); }
.band-cta { background: var(--paper-alt); }

.two-col { display: grid; gap: clamp(2.5rem, 6vw, 4.5rem); align-items: center; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .two-col-flip > :first-child { order: 2; } }

/* ── Rollover vs. pool ───────────────────────────────────────────────── */

.compare { display: grid; gap: 1.5rem; margin-top: 3rem; }
@media (min-width: 780px) { .compare { grid-template-columns: 1fr 1fr; } }

.panel { margin: 0; padding: 1.9rem 1.7rem 1.6rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); }
.band-alt .panel { background: var(--paper); }
.panel-good { border-color: color-mix(in srgb, var(--accent) 32%, var(--rule)); }

.panel figcaption { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1.8rem; }
.panel-tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.panel-tag-bad { color: var(--clay); }
.panel-tag-good { color: var(--accent); }
.panel-sub { font-size: 0.92rem; color: var(--muted); }

.chart { display: flex; align-items: flex-end; gap: 0.85rem; height: 9.5rem; }
/* Bar heights live here, not in a style="" attribute: the site ships a strict
   Content-Security-Policy (style-src 'self'), which blocks inline styles — the
   bars silently collapsed to zero height in production until this moved into
   the stylesheet. Both panels share one scale (12 tasks = 100%) so the
   comparison stays honest. */
.bar[data-n="3"]  { height: 25%; }
.bar[data-n="5"]  { height: 42%; }
.bar[data-n="8"]  { height: 67%; }
.bar[data-n="12"] { height: 100%; }

.bar {
  flex: 1; position: relative;
  background: color-mix(in srgb, var(--muted) 22%, var(--rule));
  border-radius: 3px 3px 0 0;
  display: flex; align-items: flex-start; justify-content: center;
}
.bar-bad  { background: color-mix(in srgb, var(--clay) 45%, var(--rule)); }
.bar-good { background: color-mix(in srgb, var(--accent) 40%, var(--rule)); }

.bar-n {
  position: absolute; top: -1.7rem;
  font-family: var(--serif); font-size: 1.05rem; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--ink-soft);
}
.bar-d {
  position: absolute; bottom: -1.7rem;
  font-size: 0.76rem; letter-spacing: 0.05em; color: var(--muted);
}

.panel-note { font-size: 0.9rem; color: var(--muted); margin: 3rem 0 0; }

.pull {
  margin: clamp(3.5rem, 8vw, 5.5rem) auto 0;
  max-width: 44rem; text-align: center;
  border-top: 1px solid var(--rule); padding-top: 2.4rem;
}
.pull p {
  font-family: var(--serif); font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem);
  line-height: 1.3; letter-spacing: -0.012em;
}

/* ── Steps ───────────────────────────────────────────────────────────── */

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6rem; }
.steps li { display: flex; gap: 1.1rem; padding-bottom: 1.6rem; border-bottom: 1px solid var(--rule); }
.steps li:last-child { padding-bottom: 0; border-bottom: 0; }
.step-n {
  flex: none; font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
  line-height: 1; color: var(--accent); width: 1.6rem;
}
.steps p { font-size: 0.95rem; color: var(--muted); margin: 0; }

/* ── Deferral ledger ─────────────────────────────────────────────────── */

.ledger { border: 1px solid var(--rule); border-radius: 10px; padding: 1.8rem 1.6rem 1.5rem; background: var(--paper); }
.ledger-list { list-style: none; margin: 0; padding: 0; font-size: 0.97rem; }
.ledger-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.72rem 0; border-bottom: 1px solid var(--rule-soft);
}
.ledger-list li:last-child { border-bottom: 0; }
.ledger-list li:first-child { font-weight: 550; }
.ledger-foot { font-size: 0.82rem; color: var(--muted); margin: 1.2rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); }

/* ── Feature grid ────────────────────────────────────────────────────── */

.grid { display: grid; gap: 1.6rem 2.4rem; margin-top: 3rem; grid-template-columns: 1fr; }
@media (min-width: 680px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card { padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.card p { font-size: 0.95rem; color: var(--muted); margin: 0; }

/* ── Who ─────────────────────────────────────────────────────────────── */

.who { list-style: none; margin: 2.2rem 0 0; padding: 0; display: grid; gap: 1.3rem; }
.who li { padding-left: 1.4rem; position: relative; color: var(--ink-soft); max-width: 60ch; }
.who li::before { content: "—"; position: absolute; left: 0; color: var(--muted); }
.who strong { color: var(--ink); font-weight: 600; }

/* ── Signup ──────────────────────────────────────────────────────────── */

.signup {
  display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center;
  margin: 2.4rem auto 0; max-width: 30rem;
}
.signup input {
  flex: 1 1 15rem; min-width: 0;
  font: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 3px;
  padding: 0.72rem 0.9rem;
}
.signup input::placeholder { color: var(--muted); }
.signup input:focus { border-color: var(--accent); }

.form-msg { min-height: 1.4rem; font-size: 0.88rem; margin: 0.9rem 0 0; color: var(--muted); }
.form-msg-ok  { color: var(--accent); }
.form-msg-err { color: var(--clay); }

.band-cta .note { margin-top: 0.6rem; }

/* ── Footer ──────────────────────────────────────────────────────────── */

.foot { border-top: 1px solid var(--rule); padding: 2.5rem 0; font-size: 0.88rem; color: var(--muted); }
.foot-inner { display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; justify-content: space-between; align-items: baseline; }
.foot p { margin: 0; }
.foot .wordmark { color: var(--ink); }

/* ── Reveal ──────────────────────────────────────────────────────────── */

.has-reveal .reveal { opacity: 0; transform: translateY(14px); }
.has-reveal .reveal.in {
  opacity: 1; transform: none;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .has-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}

@media print {
  .nav, .skip, .signup, .hero-actions { display: none; }
  body { background: #fff; color: #000; }
}
