/* 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: color-mix(in srgb, var(--page) 86%, transparent);
  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: 11px 22px; font-size: 15px; border-radius: 999px; text-decoration: none; display: inline-block; }
body.landing .btn { color: var(--text); }
body.landing .btn.primary { color: var(--panel); }

/* ---------- hero ---------- */
.hero { padding: 56px 0 56px; }
.hero-copy { max-width: 720px; margin: 0 auto 20px; text-align: center; }
h1 { margin: 0 0 18px; font-size: clamp(38px, 5.6vw, 64px); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.headline-accent { color: var(--accent); }
.lede { margin: 0 auto 12px; max-width: 600px; font-size: 19px; color: var(--body); }
.hero-count { margin: 0 auto 24px; font-size: 15px; color: var(--muted); }
.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: var(--r-card);
  background: var(--bg);
  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: var(--border); }
.pill.live { margin-left: auto; color: var(--pass); border-color: color-mix(in srgb, var(--pass) 35%, transparent); }

.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);
}

/* ---------- sections ---------- */
.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section h2 { margin: 0 0 22px; font-size: 28px; font-weight: 800; 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: var(--r-card); padding: 18px 18px 6px; }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  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: var(--body); }

#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); }

/* the one dark band: email signup and footer */
.dark-band {
  --text: #F8FAFC;
  --body: #DCE2E8;
  --muted: #DCE2E8;
  --faint: #DCE2E8;
  --border: #364250;
  --accent: #DCE2E8;
  --pass: #A9DDBB;
  --fail: #F2A99F;
  background: var(--band);
  color: var(--text);
}
body.landing .dark-band a { color: var(--text); }
body.landing .dark-band .btn.primary { background: #F8FAFC; border-color: #F8FAFC; color: #1C2530; }
body.landing .dark-band .btn.primary:hover { background: #DCE2E8; border-color: #DCE2E8; }
.updates { max-width: 1180px; margin: 0 auto; padding: 64px 24px; border-top: 0; text-align: center; }
.updates-intro { margin: -10px 0 20px; color: var(--body); }
.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: 11px 18px;
  border-radius: 999px;
  border: 1px solid #F8FAFC;
  background: #F8FAFC;
  color: #1C2530;
  outline: none;
}
.signup input:focus { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.signup-done {
  max-width: 460px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: var(--r-inner);
  color: var(--pass);
  background: color-mix(in srgb, var(--pass) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--pass) 40%, transparent);
  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: var(--r-inner);
  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: 50%; }
.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; }
}
