/* Landing page. Builds on styles.css (tokens, cards, pills, buttons, the challenge list). */

html:has(body.landing) { height: auto; scroll-behavior: smooth; }
body.landing { display: block; height: auto; overflow: auto; }
/* The landing page is a pitch, not a document: dragging over it shouldn't select text. */
body.landing { -webkit-user-select: none; user-select: none; }
body.landing input { -webkit-user-select: text; user-select: text; }
body.landing a { color: var(--accent); }

.site-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  background: rgba(13, 16, 22, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-nav { display: flex; gap: 22px; margin-left: auto; }
body.landing .site-nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
body.landing .site-nav a:hover { color: var(--text); }

main { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
section[id] { scroll-margin-top: 72px; }

.btn.big { padding: 10px 18px; font-size: 15px; border-radius: 10px; text-decoration: none; display: inline-block; }
body.landing .btn { color: var(--text); }
body.landing .btn.primary { color: #fff; }

/* ---------- hero ---------- */
.hero { padding: 28px 0 40px; }
.hero-copy { max-width: 720px; margin: 0 auto 20px; text-align: center; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1 { margin: 0 0 18px; font-size: clamp(36px, 5.4vw, 60px); line-height: 1.05; letter-spacing: -0.02em; }
.grad {
  background: linear-gradient(90deg, var(--pos), #a98bff 55%, var(--neg));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { margin: 0 auto 26px; max-width: 600px; font-size: 18px; color: #c9cfdb; }
.lede em { color: var(--text); }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-note { margin: 14px 0 0; font-size: 13px; color: var(--faint); }
.try-rule { width: min(560px, 100%); margin: 12px auto 0; border: 0; border-top: 1px solid var(--border); }
.try-it { margin: 10px 0 0; color: var(--text); font-size: 19px; font-weight: 600; }
.try-it span { display: inline-block; margin-left: 4px; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .try-it span { animation: none; } }

/* the demo, styled like a small version of the challenge screen */
.window {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(138, 164, 255, 0.06);
  overflow: hidden;
}
.window-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #2b3140; }
.pill.live { margin-left: auto; color: var(--pass); border-color: rgba(63, 185, 80, 0.35); }

.demo-grid { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(280px, 1fr); }
.demo-viz {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-right: 1px solid var(--border);
}
.demo-viz .legend span:last-child { display: none; }
.demo-viz .card-head span:not(.pill):not(.sel) { display: none; }

.demo-side { display: flex; flex-direction: column; }
.file-tab {
  align-self: flex-start;
  padding: 7px 14px;
  font: 12px var(--mono);
  color: var(--text);
  border-right: 1px solid var(--border);
  border-bottom: 2px solid var(--accent);
  background: var(--panel);
}
.demo-code {
  margin: 0;
  padding: 16px 16px 12px;
  font: 14px/1.9 var(--mono);
  color: #eeffff;
  white-space: pre;
  overflow-x: auto;
  border-top: 1px solid var(--border);
}
.tok-c { color: #616d8a; font-style: italic; }
.tok-p { color: #89ddff; }
.tok-b { color: #89ddff; }
.demo-code .num {
  font: inherit;
  color: #f78c6c;
  background: rgba(247, 140, 108, 0.1);
  border: 0;
  border-bottom: 1px dashed rgba(247, 140, 108, 0.6);
  border-radius: 3px;
  padding: 0 5px;
  text-align: center;
  cursor: ew-resize;
  touch-action: none; /* a finger drag scrubs the number instead of scrolling */
  outline: none;
}
.demo-code .num:hover, .demo-code .num.dragging { background: rgba(247, 140, 108, 0.22); }
.demo-code .num:focus { cursor: text; background: rgba(247, 140, 108, 0.18); box-shadow: 0 0 0 1px rgba(247, 140, 108, 0.7); }

.demo-check {
  margin: 4px 16px 0;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid;
}
.demo-check .mark { font-weight: 800; margin-right: 4px; }
.demo-check.fail { color: #ffb3ae; background: rgba(248, 81, 73, 0.08); border-color: rgba(248, 81, 73, 0.35); }
.demo-check.pass { color: var(--pass); background: rgba(63, 185, 80, 0.1); border-color: rgba(63, 185, 80, 0.4); }
.demo-prompt { margin: 12px 16px 16px; font-size: 14px; color: #c9cfdb; }
.demo-prompt code { font: 13px var(--mono); color: #f78c6c; }
.demo-prompt strong { color: var(--text); }
.demo-prompt a { font-weight: 600; }

/* ---------- sections ---------- */
.section { padding: 48px 0; border-top: 1px solid var(--border); }
.section h2 { margin: 0 0 22px; font-size: 26px; letter-spacing: -0.01em; }
.section-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.progress { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.progress .bar { width: 140px; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--pass); transition: width 0.3s; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px 18px 6px; }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(138, 164, 255, 0.14);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}
.steps h3 { margin: 12px 0 6px; font-size: 17px; }
.steps p { margin: 0 0 12px; color: #c9cfdb; }

#challenge-list .ch-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
#challenge-list .ch-card { padding: 16px 18px; gap: 6px; }
#challenge-list .ch-title { font-size: 16px; }
body.landing .ch-card { color: var(--text); }

.updates { text-align: center; }
.updates-intro { margin: -10px 0 20px; color: #c9cfdb; }
.signup { display: flex; gap: 10px; justify-content: center; max-width: 460px; margin: 0 auto; }
.signup[hidden] { display: none; }
.signup input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  outline: none;
}
.signup input:focus { border-color: var(--accent); }
.signup-done {
  max-width: 460px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--pass);
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.4);
  font-weight: 600;
}
.signups-soon { margin: 0; color: var(--muted); font-weight: 600; }
.signup-msg { margin: 14px 0 0; font-size: 13px; color: var(--faint); }
.signup-msg.error { color: var(--fail); }
.signup-msg a { color: var(--muted); }
/* Turnstile shows itself only when it needs the visitor to click (appearance: interaction-only). */
.turnstile { display: flex; justify-content: center; }
.turnstile:not(:empty) { margin-top: 12px; }

/* A message after opening a link from an email (confirm / unsubscribe). */
.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  margin: 16px auto 0;
  padding: 12px 12px 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--pass);
  background: var(--panel);
  font-weight: 600;
}
.notice[hidden] { display: none; }
.notice.error { border-left-color: var(--fail); }
.notice span { flex: 1; }
.notice-close { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 2px 6px; cursor: pointer; border-radius: 6px; }
.notice-close:hover { color: var(--text); background: var(--panel-2); }

.site-foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 13px;
}

/* ---------- narrower screens ---------- */
@media (max-width: 1000px) {
  .demo-grid { grid-template-columns: 1fr; }
  .demo-viz { border-right: 0; border-bottom: 1px solid var(--border); }
}
@media (max-width: 760px) {
  main { padding: 0 16px; }
  .site-top { padding: 0 16px; }
  .site-nav { display: none; }
  .hero { padding-top: 36px; }
  .lede { font-size: 16px; }
  .demo-viz { grid-template-columns: 1fr; }
  .steps, #challenge-list .ch-list { grid-template-columns: 1fr; }
  .progress { margin-left: 0; }
  .signup { flex-direction: column; }
}
