/*
 * Landing page for ChessCoach365.
 *
 * Two constraints shape this file:
 *
 * 1. No inline styles and no inline scripts, so the page is servable under the
 *    application's own CSP (script-src 'self'; style-src 'self') without an
 *    exception. Everything visual lives here; landing.js only sets class names.
 * 2. The palette, radii and type are lifted from styles-foundation.css so the
 *    page reads as the app's own front door. The app commits to a single dark
 *    world (color-scheme: dark), so this page does too: no light variant, and
 *    every colour is painted explicitly rather than inherited from a host.
 */

:root {
  /* Copied verbatim from styles-foundation.css. Keep in sync with the app. */
  --paper: #0a0e13;
  --paper-2: #151d27;
  --paper-3: #1b2531;
  --text: #eaf1f8;
  --muted: #93a4b8;
  --faint: #8194aa;
  --line: #263344;
  --gold: #ffc53d;
  --gold-bright: #ffe08a;
  --green: #2fe08a;
  --green-2: #17b96c;
  --blue: #4dabff;
  --violet: #a97bff;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --radius: 18px;
  --display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Landing-only additions. */
  --radius-sm: 12px;
  --measure: 62ch;
  --page: 1120px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; background: var(--paper); }

body {
  min-width: 320px;
  margin: 0;
  /* The app's ambient glow: violet from the top right, blue from the top left. */
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(169, 123, 255, .10), transparent 60%),
    radial-gradient(900px 600px at 10% 0%, rgba(77, 171, 255, .08), transparent 55%),
    var(--paper);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
:focus-visible { outline: 3px solid rgba(77, 171, 255, .62); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: 22px; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 780;
  letter-spacing: -.025em;
  line-height: 1.08;
  text-wrap: balance;
}

h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); }
h3 { font-size: 1.25rem; }

p { margin: 0; max-width: var(--measure); }

/* The app's section marker: green, heavy, wide-tracked. */
.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: .69rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow.is-quiet { color: var(--faint); font-weight: 800; }

.num { font-variant-numeric: tabular-nums; }

/* Stage tones, drawn from the app palette: it warms green to blue to gold. */
.t-400 { --tone: var(--faint); }
.t-1600 { --tone: var(--green); }
.t-1800 { --tone: var(--blue); }
.t-2000 { --tone: var(--gold); }

/* Proportional bar fills. Percentages are the real share of the session. */
.fill-0 { width: 0; }
.fill-2 { width: 2%; }
.fill-10 { width: 10%; }
.fill-11 { width: 11%; }
.fill-21 { width: 21%; }
.fill-22 { width: 22%; }
.fill-33 { width: 33%; }
.fill-62 { width: 61.5%; }
.fill-67 { width: 67%; }
.fill-100 { width: 100%; }

/* ---------- masthead ---------- */

.masthead { border-bottom: 1px solid var(--line); }

/*
 * Narrow: wordmark and login share the first row, the tagline wraps beneath.
 * Wide: all three sit on one row. Placement is explicit rather than left to
 * auto-flow, which would otherwise push the button onto its own row.
 */
.masthead-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 18px;
  padding-block: 14px;
}
.masthead .wordmark { grid-area: 1 / 1; }
.masthead .eyebrow { grid-area: 2 / 1 / 3 / 3; }
.masthead-login { grid-area: 1 / 2; }

@media (min-width: 760px) {
  .masthead-inner { grid-template-columns: auto minmax(0, 1fr) auto; }
  .masthead .eyebrow { grid-area: 1 / 2; text-align: right; }
  .masthead-login { grid-area: 1 / 3; }
}

.wordmark {
  font-family: var(--display);
  font-weight: 850;
  letter-spacing: -.025em;
  font-size: 1.02rem;
}
.wordmark span { color: var(--green); }

/* The app's own primary button, from styles.css. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-family: var(--display);
  font-weight: 780;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--green); color: #04220f; box-shadow: 0 8px 22px rgba(47, 224, 138, .22); }
/* Overrides the page-wide gold link hover, which would recolour the label. */
.button.primary:hover, .button.primary:focus-visible { background: var(--green-2); color: #04220f; }

@media (prefers-reduced-motion: reduce) {
  .button:hover { transform: none; }
}

/* ---------- hero ---------- */

.hero { padding-block: clamp(46px, 8vw, 88px) 34px; }

.hero-grid { display: grid; gap: clamp(26px, 4vw, 40px); grid-template-columns: 1fr; align-items: end; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}

.slogan {
  font-size: clamp(3.4rem, 12vw, 7.2rem);
  font-weight: 800;
  line-height: .9;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  margin-block: 14px 0;
}
.slogan .arrow { color: var(--faint); font-weight: 400; }
.slogan .target {
  background: linear-gradient(150deg, var(--gold), var(--gold-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Without clipping support the transparent fill would erase the page's
   headline number, so fall back to flat gold. */
@supports not (background-clip: text) {
  .slogan .target { background: none; color: var(--gold); }
}

.slogan-unit {
  display: block;
  color: var(--muted);
  font-size: clamp(.8rem, 1.7vw, 1rem);
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1.4;
  text-transform: uppercase;
  margin-top: 18px;
}

.lede { font-size: clamp(1.06rem, 1.9vw, 1.26rem); line-height: 1.5; color: var(--muted); margin-top: 20px; }
.lede strong { color: var(--text); font-weight: 700; }

.hero-note { margin-top: 18px; color: var(--faint); font-size: .95rem; max-width: 46ch; }
.hero-note b { color: var(--gold); }

.figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.figure { background: var(--paper-2); padding: 18px 16px 16px; }
.figure b {
  display: block;
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.figure small {
  display: block;
  margin-top: 9px;
  color: var(--faint);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .13em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* ---------- the 1095-day calendar ---------- */

.calendar {
  margin-top: clamp(44px, 7vw, 70px);
  padding: 24px 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(21, 29, 39, .86);
  box-shadow: var(--shadow);
}

.calendar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  margin-bottom: 22px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--muted);
}
.legend i { width: 9px; height: 9px; border-radius: 3px; background: currentColor; font-style: normal; }
.legend .k1600 i { color: var(--green); }
.legend .k1800 i { color: var(--blue); }
.legend .k2000 i { color: var(--gold); }
.legend .kwe i { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }

.bands { display: flex; flex-direction: column; gap: 18px; overflow-x: auto; padding-block: 4px 8px; }

.band {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 560px;
}

.band-label { line-height: 1.3; }
.band-label b {
  display: block;
  color: var(--tone);
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.band-label small {
  color: var(--faint);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.days {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-columns: 1fr;
  gap: 2px;
}

.day { aspect-ratio: 1; border-radius: 3px; background: var(--tone); min-width: 4px; }
.day.we { background: transparent; box-shadow: inset 0 0 0 1.5px var(--tone); }
.day.milestone {
  background: linear-gradient(150deg, var(--gold), var(--gold-bright));
  box-shadow: 0 0 0 2px var(--paper-2), 0 0 0 3.5px var(--gold), 0 0 14px rgba(255, 197, 61, .5);
  z-index: 1;
}

/*
 * One sweep across the three years, left to right. The stagger comes from the
 * duration, not the delay: all three bands start within 50ms, so the window in
 * which the backwards fill hides the grid stays negligible even if the
 * animation is throttled. Opacity is never animated, so no state is faded out.
 */
@media (prefers-reduced-motion: no-preference) {
  .days { animation: sweep .9s cubic-bezier(.22, .61, .36, 1) .05s both; }
  .t-1800 .days { animation-duration: 1.25s; }
  .t-2000 .days { animation-duration: 1.6s; }
}

@keyframes sweep {
  from { clip-path: inset(-8px 100% -8px -8px); }
  to { clip-path: inset(-8px -8px -8px -8px); }
}

.calendar-caption { margin-top: 18px; font-size: .9rem; color: var(--faint); max-width: 70ch; }

/* ---------- generic section ---------- */

.section { padding-block: clamp(56px, 8vw, 88px); border-top: 1px solid var(--line); }

.section-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 36px; }
/* :not(.eyebrow) keeps this off the green section marker, which is also a <p>. */
.section-head p:not(.eyebrow) { color: var(--muted); }

/* ---------- stages ---------- */

.axis { position: relative; margin-bottom: 34px; padding-top: 26px; }

.axis-line {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    var(--faint) 0%, var(--faint) 20%, var(--green) 80%, var(--blue) 90%, var(--gold) 100%);
}

.axis-ticks {
  position: relative;
  height: 30px;
  color: var(--faint);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

.tick { position: absolute; top: 9px; transform: translateX(-50%); white-space: nowrap; }
.tick::before { content: ""; position: absolute; top: -14px; left: 50%; width: 1px; height: 9px; background: var(--line); }
.tick-0 { left: 0; transform: none; }
.tick-0::before { left: 0; }
.tick-400 { left: 20%; }
.tick-1600 { left: 80%; }
.tick-1800 { left: 90%; }
.tick-2000 { left: 100%; transform: translateX(-100%); }
.tick-2000::before { left: auto; right: 0; }

.stages { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .stages { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.stage {
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
}
/* A tone rail along the top edge, clipped by the card's own radius. */
.stage::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--tone);
}
.stage.is-prep { background: transparent; border-style: dashed; box-shadow: none; }
.stage.is-prep::before { opacity: .5; }

.stage-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.stage-rating {
  color: var(--tone);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.status {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--muted);
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status.live {
  background: linear-gradient(150deg, var(--green), #7af0b6);
  color: #04220f;
  box-shadow: 0 0 0 1px rgba(47, 224, 138, .35), 0 6px 18px rgba(47, 224, 138, .22);
}

.stage h3 { font-size: 1.06rem; }
.stage p { font-size: .93rem; color: var(--muted); max-width: none; }

.stage-months {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.pullquote {
  margin-top: 32px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(1.14rem, 2.3vw, 1.5rem);
  font-weight: 780;
  letter-spacing: -.025em;
  line-height: 1.25;
  max-width: 52ch;
}

/* ---------- day plan ---------- */

.plans { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.plan {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 24px 22px 26px;
  box-shadow: var(--shadow);
}

.plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.plan-total {
  color: var(--gold);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
}
.plan-total small {
  display: block;
  margin-top: 7px;
  color: var(--faint);
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

/* Mirrors the app's daily-step row: a bordered tile per scheduled block. */
.step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: baseline;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-3);
}
.step-name { font-size: .95rem; font-weight: 750; }
.step-time { color: var(--gold); font-size: .84rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.step-bar { grid-column: 1 / -1; height: 6px; margin-top: 4px; border-radius: 999px; background: var(--paper); overflow: hidden; }
.step-bar i { display: block; height: 100%; border-radius: inherit; background: var(--tone); }
.step-desc { grid-column: 1 / -1; margin-top: 2px; font-size: .86rem; color: var(--faint); max-width: none; }

.plan-foot { margin-top: 18px; font-size: .86rem; color: var(--faint); max-width: none; }

/* ---------- inventory ---------- */

.inventory { display: grid; gap: 30px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .inventory { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 44px; } }

.inventory-head { margin-bottom: 18px; }

.domains { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.domain { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; align-items: baseline; }
.domain-name { font-size: .95rem; font-weight: 750; }
.domain-count { color: var(--muted); font-size: .84rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.domain-bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--paper-3); overflow: hidden; }
.domain-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); }

.inventory-note { margin-top: 26px; font-size: .92rem; color: var(--muted); }
.inventory-note b { color: var(--gold); font-weight: 800; }

.features {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  grid-template-columns: 1fr;
  box-shadow: var(--shadow);
}
@media (min-width: 620px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.feature { background: var(--paper-2); padding: 20px; display: flex; flex-direction: column; gap: 9px; }
.feature h3 { font-size: 1rem; }
.feature p { font-size: .89rem; color: var(--muted); max-width: none; }

/* ---------- sources ---------- */

.sources { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .sources { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.source {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.source:hover, .source:focus-visible {
  border-color: rgba(255, 255, 255, .22);
  background: var(--paper-3);
  transform: translateY(-2px);
  color: inherit;
}
@media (prefers-reduced-motion: reduce) {
  .source:hover, .source:focus-visible { transform: none; }
}

.source-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.source-claim {
  color: var(--gold);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.source h3 { font-size: 1.06rem; }
.source p { font-size: .92rem; color: var(--muted); max-width: none; }

.takeaway {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: .86rem;
  line-height: 1.55;
}
.takeaway b { color: var(--green); font-weight: 800; }

.watch {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--gold);
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- closer ---------- */

.closer { border-top: 1px solid var(--line); padding-block: clamp(56px, 8vw, 88px); }

.closer-grid { display: grid; gap: 30px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .closer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 50px; } }

.closer h2 { font-size: clamp(1.75rem, 4.2vw, 2.6rem); margin-top: 14px; }
.closer-body { margin-top: 20px; color: var(--muted); }
.closer-body + .closer-body { margin-top: 14px; }

.facts {
  list-style: none;
  margin: 0;
  padding: 6px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}
.facts li {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 16px;
  padding-block: 15px;
  border-top: 1px solid var(--line);
  font-size: .93rem;
  align-items: baseline;
}
.facts li:first-child { border-top: 0; }
.facts .k {
  color: var(--faint);
  font-size: .64rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

@media (max-width: 560px) {
  .facts li { grid-template-columns: 1fr; gap: 5px; }
}

/* ---------- footer ---------- */

.footer { border-top: 1px solid var(--line); padding-block: 30px 46px; }
.footer p { font-size: .84rem; color: var(--faint); max-width: 78ch; }
.footer p + p { margin-top: 10px; }
.footer b { color: var(--muted); }
