/*
 * The landing page at /. Tokens, header, buttons come from learn/learn.css.
 * Graphics follow the design system's "Graphics drawn in code" rules: tokens
 * only, inline SVG, one soft gradient on the page (the hero), animations on
 * transform and opacity that pause off-screen and stop for reduced motion.
 */

.lp { overflow-x: clip; }
.lp-wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); display: flex; flex-direction: column; gap: var(--space-20); }

.lp-eyebrow { color: var(--accent); }
.lp-accent { color: var(--accent); }
.lp-h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); line-height: 1.1; letter-spacing: -0.025em; margin: 0; }
.lp-h3 { font-size: var(--text-xl); letter-spacing: -0.015em; margin: 0; }
.lp-text { margin: 0; color: var(--text-secondary); font-size: var(--text-md); line-height: 1.6; }
.lp-small { margin: 0; font-size: var(--text-sm); color: var(--text-muted); }
.lp-copy { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
.lp-center { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; }
.lp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); }
.lp-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); }
.lp-points li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-2); align-items: start; }
.lp-points svg { color: var(--accent); margin-top: 3px; }

/* ---- Hero ---- */
.lp-hero { position: relative; isolation: isolate; max-width: 1240px; margin: 0 auto; padding: var(--space-16) var(--gutter) var(--space-12); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-12); }
.lp-gradient {
  position: absolute; z-index: -1; inset: 30% -10vw -10% -10vw;
  background:
    radial-gradient(45% 55% at 30% 35%, color-mix(in oklab, var(--accent) 34%, transparent), transparent 70%),
    radial-gradient(40% 50% at 70% 70%, color-mix(in oklab, var(--series-2) 22%, transparent), transparent 70%),
    radial-gradient(35% 45% at 75% 20%, var(--accent-soft), transparent 70%);
  filter: blur(8px);
}
:root[data-theme='dark'] .lp-gradient { opacity: 0.55; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .lp-gradient { opacity: 0.55; } }
.lp-hero__copy { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--space-6) var(--space-12); align-items: end; }
.lp-hero__head, .lp-hero__side { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
.lp-hero__title { font-size: clamp(2.5rem, 1.4rem + 4vw, 4.5rem); line-height: 1.02; letter-spacing: -0.035em; margin: 0; }
.lp-hero__lede { margin: 0; max-width: 40ch; }
.lp-ctas { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
.lp-ctas .btn { height: 48px; padding: 0 24px; font-size: var(--text-md); }
.lp-note { margin: 0; font-size: var(--text-sm); color: var(--text-muted); max-width: 40ch; }
.lp-hero__stage { position: relative; min-width: 0; }

/* Editor mock: the real engine in a simplified window. */
.gx-editor { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.gx-editor__bar { display: flex; align-items: center; gap: var(--space-3); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-subtle); font-size: var(--text-xs); }
.gx-editor__dots { display: inline-flex; gap: 6px; }
.gx-editor__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.gx-editor__title { font-weight: 700; }
.gx-editor__kbd { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); }
.gx-editor__kbd svg { color: var(--accent); }
.gx-editor__body { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.gx-editor__side { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border-right: 1px solid var(--border); }
.gx-editor__head { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.gx-editor__head:not(:first-child) { margin-top: var(--space-2); }
.gx-editor__paper { padding: var(--space-5); background: var(--bg-subtle); display: flex; align-items: center; min-width: 0; }
.gx-editor__status { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); padding: 8px 14px; border-top: 1px solid var(--border); font-size: var(--text-xs); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.gx-editor__status b { color: var(--text-muted); font-weight: 600; margin-right: 2px; }

.gx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gx-chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-secondary); border-radius: var(--radius-pill); padding: 5px 10px; font: inherit; font-size: var(--text-xs); font-weight: 600; cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.gx-chip:hover { color: var(--text); border-color: var(--text-muted); }
.gx-chip[aria-pressed='true'] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.gx-slider { display: flex; flex-direction: column; gap: 6px; font-size: var(--text-sm); }
.gx-slider__top { display: flex; justify-content: space-between; gap: var(--space-2); font-weight: 500; }
.gx-slider__value { font-variant-numeric: tabular-nums; color: var(--text-secondary); font-weight: 600; }
.gx-slider__input { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; cursor: pointer; }
.gx-slider__input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--border-strong) var(--fill, 50%)); }
.gx-slider__input::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--border-strong) var(--fill, 50%)); }
.gx-slider__input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-thumb); }
.gx-slider__input::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-thumb); }
.gx-slider__input:focus-visible { outline: none; }
.gx-slider__input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-ring); }

/* ECG paper drawn as SVG in mm. Accent-tinted grid, ink trace. */
.gx-paper { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 0 0 1px var(--border); }
.gx-paper__bg { fill: var(--surface); }
.gx-paper__minor { fill: none; stroke: color-mix(in oklab, var(--accent) 16%, transparent); stroke-width: 0.6px; vector-effect: non-scaling-stroke; }
.gx-paper__major { fill: none; stroke: color-mix(in oklab, var(--accent) 42%, transparent); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.gx-paper__trace { fill: none; stroke: var(--text); stroke-width: 1.3px; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.gx-paper__labels { font-family: var(--font-sans); font-size: 3.2px; font-weight: 700; fill: var(--text); }

/* The floating ⌘K chip: the one loop on the hero, a 6 px drift. */
.gx-float { position: absolute; right: clamp(-24px, -2vw, 0px); bottom: -20px; display: inline-flex; align-items: center; gap: var(--space-2); padding: 8px 14px 8px 8px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); font-size: var(--text-sm); font-weight: 600; animation: gx-drift 6s ease-in-out infinite; }
.gx-float__kbd { display: inline-grid; place-items: center; height: 24px; padding: 0 8px; border-radius: var(--radius-pill); background: var(--accent); color: var(--text-on-accent); font-size: var(--text-xs); font-weight: 700; }
.gx-float__text { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--text-xs); color: var(--text-secondary); }
@keyframes gx-drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---- Sections ---- */
.lp-section { display: flex; flex-direction: column; gap: var(--space-8); }
.lp-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-12); align-items: center; }
.lp-split--wide { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }

.lp-box { padding: var(--space-6); display: grid; place-items: center; }
.gx-box { width: 100%; max-width: 420px; height: auto; font-family: var(--font-sans); font-size: 11px; fill: var(--text-secondary); }
.gx-box__fill { fill: var(--surface); }
.gx-box__small { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.gx-box__minor { fill: none; stroke: color-mix(in oklab, var(--accent) 30%, transparent); stroke-width: 1; }
.gx-box__major { fill: none; stroke: color-mix(in oklab, var(--accent) 70%, transparent); stroke-width: 2; }
.gx-box__dim, .gx-box__lead { fill: none; stroke: var(--text-muted); stroke-width: 1; }
.gx-box__lead { stroke-dasharray: 3 3; }
.gx-box__strong { fill: var(--text); font-weight: 700; font-size: 12px; }

.lp-strip { margin: 0; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.lp-strip__paper { cursor: crosshair; touch-action: pan-y; }
.lp-strip__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-4); font-size: var(--text-sm); }
.lp-strip__label { color: var(--text-muted); }
.lp-strip__readout { margin: 0; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.lp-strip__readout.is-reading { color: var(--accent); font-weight: 600; }

/* Axis explorer */
.gx-axis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--space-6); padding: var(--space-6); align-items: center; }
.gx-axis__dial { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.gx-hex { width: 100%; max-width: 280px; height: auto; font-family: var(--font-sans); font-size: 12px; font-weight: 700; fill: var(--text-secondary); }
.gx-hex__normal { fill: var(--tone-normal-soft); }
.gx-hex__ring { fill: none; stroke: var(--border-strong); stroke-width: 1; }
.gx-hex__line { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 2 3; }
.gx-hex__vector { transition: transform var(--dur-slow) var(--ease-spring); }
.gx-hex__vector path { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; fill: none; }
.gx-hex__vector .gx-hex__head { fill: var(--accent); stroke: none; }
.gx-hex__hub { fill: var(--text); }
.gx-axis__readout { margin: 0; font-size: var(--text-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.gx-axis__readout b { color: var(--text); }
.gx-axis__leads { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.gx-axis__lead { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.gx-axis__lead figcaption { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--text-muted); }
.gx-axis__lead figcaption b { color: var(--text); }


/* ---- Bento: Learn and Practice ---- */
.lp-bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
.lp-tile { overflow: hidden; display: flex; flex-direction: column; }
.lp-tile__art { padding: var(--space-6) var(--space-6) 0; background: var(--bg-subtle); border-top: 1px solid var(--border); flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.lp-tile__art > * { width: 100%; max-width: 400px; border-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.lp-tile__copy { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
.lp-tile__eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }

.gx-learn, .gx-read { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); padding: var(--space-5); font-size: var(--text-sm); }
.gx-learn__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.gx-learn__title { font-family: var(--font-display); font-weight: 800; }
.gx-learn__meta { font-size: var(--text-xs); color: var(--text-muted); }
.gx-progress { height: 6px; border-radius: 3px; background: var(--surface-sunken); margin: var(--space-3) 0; overflow: hidden; }
.gx-progress i { display: block; width: var(--p); height: 100%; background: var(--accent); border-radius: inherit; }
.gx-learn__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.gx-learn__list li { display: flex; align-items: center; gap: var(--space-3); padding: 7px 0; border-top: 1px solid var(--border); }
.gx-learn__num { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border-strong); font-size: 11px; font-weight: 700; color: var(--text-muted); }
.gx-learn__list .is-done .gx-learn__num { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.gx-learn__list .is-current .gx-learn__num { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.gx-learn__name { font-weight: 500; }
.gx-learn__list .is-todo .gx-learn__name { color: var(--text-secondary); }
.gx-learn__here { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: var(--radius-pill); }
.gx-learn__count { margin-left: auto; font-size: var(--text-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }

.gx-read__score { display: flex; align-items: baseline; gap: var(--space-2); }
.gx-read__pct { font-family: var(--font-display); font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.gx-read__of { color: var(--text-muted); }
.gx-read__summary { margin: var(--space-3) 0 var(--space-2); color: var(--text-secondary); }
.gx-read__summary b { color: var(--text); }
.gx-read__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--space-3); align-items: center; padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.gx-read__label { font-weight: 600; }
.gx-read__field { justify-self: end; display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-variant-numeric: tabular-nums; }
.gx-read__field span { color: var(--text-muted); font-size: var(--text-xs); }
.gx-read__result { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 700; }
.gx-read__result.is-right { color: var(--tone-normal-ink); }
.gx-read__result.is-wrong { color: var(--tone-critical-ink); }
.gx-read__answer { justify-self: end; font-size: var(--text-xs); color: var(--text-secondary); }

/* ---- Closing ---- */
.lp-cta { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-4); padding: var(--space-8) var(--space-6) 0; }
.lp-cta .lp-ctas { justify-content: center; }
.lp-foot { display: flex; justify-content: space-between; gap: var(--space-4); font-size: var(--text-sm); color: var(--text-muted); border-top: 1px solid var(--border); padding: var(--space-6) 0 var(--space-10); }
.lp-foot a:hover { color: var(--text); }

.lp-opening { min-height: 100vh; min-height: var(--app-h, 100dvh); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); color: var(--text-muted); font-weight: 600; }
.lp-opening svg { color: var(--accent); animation: lp-pulse 1.2s var(--ease-out, ease-out) infinite alternate; }
@keyframes lp-pulse { from { opacity: 0.35; } to { opacity: 1; } }

/* Loops pause off-screen and stop for reduced motion. */
.is-paused .gx-anim { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .gx-anim, .lp-opening svg { animation: none !important; }
  .gx-hex__vector { transition: none; }
}

@media (max-width: 980px) {
  .lp-hero { padding-top: var(--space-12); }
  .lp-hero__copy { grid-template-columns: minmax(0, 1fr); }
  .lp-split, .lp-split--wide { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
}
@media (max-width: 760px) {
  .lp-bento { grid-template-columns: minmax(0, 1fr); }
  .gx-axis { grid-template-columns: minmax(0, 1fr); }
  .gx-editor__body { grid-template-columns: minmax(0, 1fr); }
  .gx-editor__side { border-right: 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--space-4); }
  .gx-editor__side .gx-chips, .gx-editor__side .gx-editor__head { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .lp-wrap { gap: var(--space-16); }
  .lp-hide-xs { display: none; }
  .lp-ctas { width: 100%; }
  .lp-ctas .btn { flex: 1 1 100%; }
  .gx-editor__kbd { display: none; }
  .gx-float { right: 8px; bottom: -34px; }
  .gx-editor__paper { overflow-x: auto; scrollbar-width: thin; }
  .gx-paper--12 { min-width: 600px; }
}

/* ---- Coming soon with Pro (launch stage one: Basic only) ---- */
.lp-soon { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--bg-subtle); border: 1px solid var(--border-strong); color: var(--text-secondary); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.lp-soon-card { overflow: hidden; }
.lp-soon-card .gx-editor { border: 0; box-shadow: none; border-radius: 0; }

.gx-pro__soon { margin-left: auto; }
.gx-pro .gx-editor__paper { background: transparent; padding-bottom: var(--space-2); }
.gx-pro__controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); padding: var(--space-2) var(--space-5) var(--space-4); }
.gx-pro__groups { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border); background: var(--bg-subtle); }
.gx-chip--static { cursor: default; }
.gx-chip--static:hover { color: var(--text-secondary); border-color: var(--border-strong); }
@media (max-width: 560px) { .gx-pro__controls { grid-template-columns: minmax(0, 1fr); } }

/* ---- Basic plan ---- */
.lp-plan { display: flex; justify-content: center; }
.lp-plan .lp-points { text-align: left; }

/* ---- Practice: a new tracing every time ---- */
.lp-split--fresh { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
.gx-deal { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }
.gx-deal__paper { min-height: 60px; }
.gx-deal__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.gx-deal__count { font-size: var(--text-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.gx-deal__actions { display: flex; gap: var(--space-2); }
.gx-deal__actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.gx-deal__answer { margin: 0; font-size: var(--text-sm); color: var(--text-secondary); }
.gx-deal__answer b { color: var(--text); }
.gx-deal__answer[hidden] { display: none; }
@media (max-width: 980px) { .lp-split--fresh { grid-template-columns: minmax(0, 1fr); } }
.gx-deal__actions .btn[hidden] { display: none; }

/* The first section after the hero keeps the same gap as the sections below it. */
.lp-wrap { padding-top: var(--space-8); }
