/* Kevin's palette: night navy, lime for what keeps a craft up, rose for what pulls it down. */
:root {
  --bg: #0d131c;
  --panel: #141c27;
  --panel-2: #1a2431;
  --line: #263243;
  --text: #eef2f7;
  --muted: #9aa7b8;
  --lime: #c9f26b;
  --lime-ink: #18200a;
  --rose: #f2839f;
  --rose-ink: #2a0d15;
  --teal: #4fa3b8;
  --mint: #a8e6c9;
  --steel: #b7c3d3;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.55 'Fira Sans', system-ui, -apple-system, sans-serif;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { line-height: 1.12; margin: 0; }
h1 { font-weight: 800; font-size: clamp(36px, 6vw, 64px); letter-spacing: -0.01em; }
h2 { font-weight: 800; font-size: clamp(24px, 3.2vw, 32px); }
h3 { font-weight: 700; font-size: 20px; }

.hero { text-align: center; padding: 56px 16px 28px; max-width: 860px; margin: 0 auto; }
.eyebrow { margin: 0 0 12px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.lead { margin: 16px auto 0; max-width: 640px; color: var(--steel); font-style: italic; font-size: 18px; text-align: left; }

main { max-width: 1180px; margin: 0 auto; padding: 0 16px 72px; display: grid; gap: 40px; }

.stage { display: grid; gap: 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #080c12; }
.landscape { width: 100%; aspect-ratio: 16 / 8.4; min-height: 340px; }
.landscape svg { display: block; width: 100%; height: 100%; }
.you { animation: rise 900ms cubic-bezier(.2,.7,.15,1) both; }
.you-halo { animation: breathe 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.35); opacity: .45; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.result { text-align: center; padding: 22px 16px 26px; background: linear-gradient(#0b1018, var(--bg)); }
.result p { margin: 0; }
.result-craft { color: var(--muted); font-size: 15px; }
.result-score { font-weight: 800; font-size: clamp(44px, 7vw, 68px); line-height: 1.05; margin-top: 4px !important; font-variant-numeric: tabular-nums; }
.result-arq-label { font-size: .38em; letter-spacing: .14em; color: var(--muted); vertical-align: middle; }
.result-band { margin-top: 8px !important; color: var(--steel); font-style: italic; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }

.chip { display: inline-block; padding: 3px 12px; border-radius: 999px; font-style: normal; font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.chip.peak { background: var(--lime); color: var(--lime-ink); }
.chip.highland { background: var(--mint); color: #0c2419; }
.chip.shoreline { background: var(--steel); color: #141b25; }
.chip.submerged { background: var(--teal); color: #061a20; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px; }
.panel h2, .section-title { text-align: center; }
.section-lead { color: var(--muted); max-width: 680px; margin: 10px auto 0; }

.ask { text-align: center; }
.ask-row { display: flex; gap: 10px; max-width: 680px; margin: 18px auto 0; }
.ask-row input {
  flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px;
}
.ask-row input:focus { outline: 2px solid var(--lime); outline-offset: 1px; }
.hint { color: var(--muted); font-size: 14px; margin: 12px auto 0; max-width: 620px; text-align: left; }
.hint.warn { color: var(--rose); }

.btn {
  font: inherit; font-weight: 700; font-size: 15px; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--steel); }
.btn:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.btn.primary { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.btn.primary:hover { filter: brightness(1.06); }
.btn[disabled] { opacity: .6; cursor: progress; }

.formula {
  margin: 22px auto 0; max-width: 760px; text-align: center; padding: 16px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: 18px;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.formula .top { color: var(--lime); }
.formula .bottom { color: var(--rose); }
.formula .eq { color: var(--muted); font-weight: 400; }

.factors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.factor { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 14px; align-content: start; }
.factor-head { display: flex; gap: 14px; align-items: flex-start; }
.badge { flex: none; width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 26px; background: var(--lime); color: var(--lime-ink); }
.factor.bottom .badge { background: var(--rose); color: var(--rose-ink); }
.factor-q { margin: 4px 0 0; color: var(--muted); font-size: 15px; }

.picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.picker button {
  font: inherit; font-weight: 700; font-size: 17px; padding: 10px 0; border-radius: 10px; cursor: pointer;
  background: var(--bg); color: var(--text); border: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.picker button:hover:not([disabled]) { border-color: var(--steel); }
.picker button[aria-checked="true"] { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.factor.bottom .picker button[aria-checked="true"] { background: var(--rose); color: var(--rose-ink); border-color: var(--rose); }
.picker button[disabled] { opacity: .3; cursor: not-allowed; }
.picker button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.picker button.changed { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--steel); }

.anchors { list-style: none; margin: 0; padding: 0; display: grid; }
.anchors li { display: grid; grid-template-columns: 28px 1fr; gap: 4px 8px; padding: 9px 8px; border-top: 1px solid var(--line); border-radius: 8px; transition: background-color .4s ease; }
.anchors .n { font-weight: 800; color: var(--lime); }
.factor.bottom .anchors .n { color: var(--rose); }
.anchors .t { font-size: 15px; }
.anchors .eg { grid-column: 2; font-size: 13px; font-style: italic; color: var(--muted); }
.anchors li.on { background: rgba(201, 242, 107, .09); }
.factor.bottom .anchors li.on { background: rgba(242, 131, 159, .1); }
.anchors li.between { background: linear-gradient(rgba(255,255,255,.035), rgba(255,255,255,.035)); }
.reason { margin: 0; font-size: 14px; color: var(--steel); border-left: 3px solid var(--line); padding-left: 10px; }
.reason b { color: var(--text); }

.climb .path { text-align: center; font-weight: 700; margin: 18px auto 0; max-width: 680px; }
.moves { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.move {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 6px 14px; align-items: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.move .badge { width: 38px; height: 38px; font-size: 20px; }
.move.bottom .badge { background: var(--rose); color: var(--rose-ink); }
.move-title { font-weight: 700; }
.move-idea { grid-column: 2 / 4; color: var(--muted); font-size: 15px; margin: 0; }
.move-gain { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--lime); text-align: right; }
.move-gain small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.move .btn { grid-column: 2 / 4; justify-self: start; padding: 8px 14px; font-size: 14px; }
.move .chip { margin-left: 6px; vertical-align: 2px; }
.moves .none { color: var(--muted); text-align: center; }
.whatif { margin-top: 16px; text-align: center; color: var(--steel); }
.whatif p { margin: 0 0 10px; }

.share { text-align: center; }
.share canvas { display: block; width: 100%; max-width: 720px; height: auto; margin: 20px auto; border-radius: 12px; border: 1px solid var(--line); }

.ref-table { margin-top: 20px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ref-row {
  display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(6, 34px) 64px 112px; align-items: center; gap: 4px;
  padding: 11px 16px; border-top: 1px solid var(--line); background: var(--panel); font-variant-numeric: tabular-nums;
  width: 100%; text-align: left; font: inherit; color: inherit; border-left: 0; border-right: 0; border-bottom: 0; cursor: pointer;
}
.ref-row.head { border-top: 0; background: var(--bg); cursor: default; font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.ref-row:not(.head):hover, .ref-row.lit { background: var(--panel-2); }
.ref-row .num { text-align: center; color: var(--steel); }
.ref-row .num.top { color: var(--lime); }
.ref-row .num.bottom { color: var(--rose); }
.ref-row .val { text-align: right; font-weight: 800; }
.ref-row .tag { text-align: right; }
.ref-row .name { font-weight: 500; }

.about p { max-width: 720px; margin: 14px auto 0; color: var(--steel); }
.about .credit { color: var(--text); font-weight: 700; text-align: center; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { padding-top: 40px; }
  .landscape { aspect-ratio: auto; height: 460px; min-height: 0; }
  .factors { grid-template-columns: 1fr; }
  .ask-row { flex-direction: column; }
  .panel { padding: 22px 16px; }
  .ref-row { grid-template-columns: minmax(0, 1fr) 58px 96px; }
  .ref-row .num { display: none; }
  .move { grid-template-columns: 40px 1fr auto; padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .you, .you-halo { animation: none; }
  .anchors li { transition: none; }
}
