/* sky.css — Loss Aversion Diagnostic: the site's one daylight page.
   Self-contained (no base.css/vercel.css): Cold Instrument DNA in daylight.
   Landmines honored: no filter in any animation; every decorative overlay is
   pointer-events:none !important. */

:root {
  --ink:    #0f2030;
  --ink-2:  #21384c;
  --ink-55: rgba(15, 32, 48, 0.55);
  --ink-25: rgba(15, 32, 48, 0.25);
  --pos:    #1d6fb8; /* positive signal in daylight — never #2effc0 here */
  --glass-hi: rgba(255, 255, 255, 0.70);
  --glass-lo: rgba(255, 255, 255, 0.20);
  --mono: 'Geist Mono', monospace;
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--sans);
  color: var(--ink-2);
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  min-height: 100dvh;
  /* poster = instant sky (LCP + no-WebGL + reduced-motion fallback) */
  background: #8ec7ef url('/assets/img/sky-poster.jpg') center / cover no-repeat fixed;
  overflow-x: clip;
}
h1, h2, h3 { color: var(--ink); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--pos); text-decoration: none; }
a:hover { color: var(--ink); }

#sky-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none !important;
  opacity: 0; transition: opacity 1.2s ease;
}
html.sky-live #sky-canvas { opacity: 1; }

/* ── Nav (light glass) ─────────────────────────────────────────── */
.sky-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(240, 248, 253, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(15, 32, 48, 0.10);
}
.sky-nav .logo { display: inline-flex; align-items: center; gap: 10px; }
.sky-nav .logo__word { font-weight: 500; font-size: 1rem; color: var(--ink); letter-spacing: -0.02em; }
.sky-nav .logo__word span { color: var(--ink-55); }
.sky-nav .nav-back { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-55); }
.sky-nav .nav-back:hover { color: var(--ink); }

/* ── Layout ────────────────────────────────────────────────────── */
main { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-content: center; padding: 6.5rem 1rem 3rem; }
.sky-col { width: min(720px, 100%); margin-inline: auto; }

/* ── Liquid glass panel ────────────────────────────────────────── */
.glass {
  position: relative;
  border: 1px solid transparent;
  border-radius: 16px;
  background:
    linear-gradient(rgba(255,255,255,0.44), rgba(255,255,255,0.36)) padding-box,
    linear-gradient(135deg, var(--glass-hi), var(--glass-lo)) border-box;
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.60), 0 18px 44px rgba(15,32,48,0.16);
  padding: clamp(1.5rem, 4vw, 2.75rem);
}

/* corner calibration marks — ink, and NEVER clickable */
.corner-marks, .corner-marks::before, .corner-marks::after { pointer-events: none !important; }
.corner-marks { position: absolute; inset: 0; z-index: 3; }
.corner-marks::before, .corner-marks::after {
  content: ''; position: absolute; width: 10px; height: 10px;
  background:
    linear-gradient(to right,  transparent calc(50% - 0.5px), var(--ink-25) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to bottom, transparent calc(50% - 0.5px), var(--ink-25) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px));
}
.corner-marks::before { top: -5px; left: -5px; }
.corner-marks::after  { bottom: -5px; right: -5px; }

/* ── Eyebrows / type ───────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-55); margin: 0 0 1rem;
}
.eyebrow .n { color: var(--pos); }

/* ── Buttons ───────────────────────────────────────────────────── */
.sky-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-weight: 500; font-size: 0.95rem;
  padding: 0.8rem 1.75rem; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(15,32,48,0.35); color: var(--ink);
  background: rgba(255,255,255,0.35);
  transition: background .15s, transform .15s;
  text-decoration: none;
}
.sky-btn:hover { background: rgba(255,255,255,0.55); transform: translateY(-1px); }
.sky-btn--primary { background: var(--ink); color: #eaf4fb; border-color: transparent; }
.sky-btn--primary:hover { background: #1b3a54; }
.sky-btn:focus-visible, .card-opt:focus-visible, .inst:focus-visible {
  outline: 2px solid var(--pos); outline-offset: 3px;
}
.sky-btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ── Altitude progress bar ─────────────────────────────────────── */
.altitude {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: rgba(15,32,48,0.10);
}
.altitude > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #1d6fb8, #4a9de0);
  transition: width .3s ease;
}

/* ── Instrument sliders ────────────────────────────────────────── */
.inst-wrap { position: relative; padding: 2.2rem 0 0.5rem; }
.inst-ticks {
  position: absolute; left: 2px; right: 2px; top: calc(2.2rem + 26px);
  height: 6px; pointer-events: none !important;
  background: repeating-linear-gradient(to right, var(--ink-25) 0 1px, transparent 1px calc((100% - 1px) / 20));
}
.inst {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 32px; background: transparent; cursor: pointer; margin: 0;
}
.inst::-webkit-slider-runnable-track {
  height: 8px; border-radius: 99px;
  background: linear-gradient(rgba(255,255,255,0.55), rgba(255,255,255,0.35));
  border: 1px solid rgba(15,32,48,0.22);
  box-shadow: inset 0 1px 2px rgba(15,32,48,0.12);
}
.inst::-moz-range-track {
  height: 8px; border-radius: 99px;
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(15,32,48,0.22);
}
.inst::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px; border-radius: 50%; margin-top: -10px;
  background: linear-gradient(160deg, #ffffff 0%, #dceefb 100%);
  border: 1px solid rgba(15,32,48,0.30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 3px 8px rgba(15,32,48,0.25);
}
.inst::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(160deg, #ffffff 0%, #dceefb 100%);
  border: 1px solid rgba(15,32,48,0.30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 3px 8px rgba(15,32,48,0.25);
}
.inst-bubble {
  position: absolute; top: 0; transform: translateX(-50%);
  font-family: var(--mono); font-size: 0.82rem; color: var(--ink);
  background: rgba(255,255,255,0.75); border: 1px solid rgba(15,32,48,0.18);
  border-radius: 7px; padding: 2px 9px; white-space: nowrap;
  pointer-events: none !important;
}
.inst-ends {
  display: flex; justify-content: space-between; margin-top: 0.4rem;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-55);
}

/* ── Choice cards ──────────────────────────────────────────────── */
.card-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.card-opt {
  position: relative; text-align: left; cursor: pointer;
  font-family: var(--sans); font-size: 0.95rem; color: var(--ink-2);
  border: 1px solid transparent; border-radius: 12px;
  background:
    linear-gradient(rgba(255,255,255,0.50), rgba(255,255,255,0.38)) padding-box,
    linear-gradient(135deg, var(--glass-hi), var(--glass-lo)) border-box;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 8px 20px rgba(15,32,48,0.10);
  padding: 1.1rem 1.2rem;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card-opt:hover { transform: translateY(-2px); }
.card-opt[aria-pressed="true"] {
  transform: translateY(-3px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65), 0 0 0 2px var(--pos), 0 14px 30px rgba(29,111,184,0.28);
}
.card-opt .k { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-55); display: block; margin-bottom: 0.35rem; }
.card-opt strong { color: var(--ink); font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  .card-opt.breathe { animation: skyBreathe 3.6s ease-in-out infinite; }
}
@keyframes skyBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.016); }
}

/* ── Question flow (filter-free transitions) ───────────────────── */
.q-stage { position: relative; min-height: 340px; }
.q-step { position: absolute; inset: 0; opacity: 0; transform: translateY(18px); pointer-events: none; transition: opacity .3s ease, transform .3s ease; }
.q-step.on { position: relative; opacity: 1; transform: none; pointer-events: auto; }
.q-step.out { opacity: 0; transform: translateY(-18px); }
.q-text { font-size: clamp(1.15rem, 2.6vw, 1.5rem); font-weight: 600; color: var(--ink); margin: 0 0 1.6rem; }
.q-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; gap: 1rem; }
.q-note { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-55); }

/* A1 — the coin. Decorative (pointer-events dead), transform-only 3D flip
   driven by --flip; no filter anywhere (backdrop-root landmine). */
.coin-scene, .coin {
  pointer-events: none !important;
}
.coin-scene {
  display: flex; justify-content: center; margin-bottom: 1.25rem;
  perspective: 700px;
}
.coin {
  width: 120px; height: 120px;
  transform-style: preserve-3d;
  transform: rotateY(var(--flip, 90deg));
  transition: transform .3s cubic-bezier(.25,.8,.35,1);
}
.coin-wob { width: 100%; height: 100%; transform-style: preserve-3d; }
@media (prefers-reduced-motion: no-preference) {
  .coin-wob.settle { animation: coinSettle .38s ease-out 1; } /* one-shot, on release */
}
@keyframes coinSettle {
  0%   { transform: rotateY(0deg); }
  35%  { transform: rotateY(-9deg); }
  70%  { transform: rotateY(5deg); }
  100% { transform: rotateY(0deg); }
}
.coin-face {
  position: absolute; inset: 0; border-radius: 50%;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: grid; place-items: center;
  background: radial-gradient(120% 120% at 34% 28%, rgba(255,255,255,0.96) 0%, rgba(232,244,253,0.85) 55%, rgba(214,234,249,0.72) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.95),   /* embossed top light */
    inset 0 -3px 7px rgba(15,32,48,0.16),   /* embossed under-shade */
    0 6px 16px rgba(15,32,48,0.18);
}
.coin-face svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* reeded rim seen edge-on (mid-flip / load state) — invisible at 0/180deg */
.coin-edge {
  position: absolute; left: 50%; top: 6px; bottom: 6px; width: 8px; margin-left: -4px;
  transform: rotateY(90deg); border-radius: 4px;
  background: repeating-linear-gradient(to bottom,
    rgba(15,32,48,0.45) 0 1px, rgba(226,240,251,0.9) 1px 4px);
}
@media (prefers-reduced-motion: reduce) { .coin-edge { display: none; } }
.coin-tails { transform: rotateY(180deg); }
.coin-heads .ring { stroke: rgba(29,111,184,0.55); }
.coin-tails .ring { stroke: rgba(163,61,61,0.55); }
.coin-val {
  position: relative;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem; font-weight: 600;
}
.coin-heads .coin-val { color: #1b67ab; } /* deep sky blue, >=4.5:1 over the tinted fill */
.coin-tails .coin-val { color: #a33d3d; }
@media (prefers-reduced-motion: reduce) {
  .coin { transform: rotateY(0deg) !important; transition: none; } /* static heads-up; value still live */
}

/* D2 pie */
.pie { width: 84px; height: 84px; border-radius: 50%; border: 1px solid rgba(15,32,48,0.25); box-shadow: inset 0 1px 0 rgba(255,255,255,0.5); }

/* D1 chart */
.dd-chart { width: 100%; height: auto; display: block; margin-bottom: 1rem; }
.dd-chart polyline { fill: none; stroke: #b02a2a; stroke-width: 2; }
.dd-chart .grid { stroke: rgba(15,32,48,0.12); stroke-width: 1; }
.dd-readout { font-family: var(--mono); font-size: 0.82rem; color: var(--ink); }

/* ── Report ────────────────────────────────────────────────────── */
.gauge-wrap { display: grid; place-items: center; margin: 0.5rem 0 1.5rem; }
.lens-bars { display: grid; gap: 0.8rem; margin: 1.5rem 0; }
.lens-row { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 0.8rem; }
.lens-row .lbl { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; color: var(--ink-55); }
.lens-row .bar { height: 6px; border-radius: 99px; background: rgba(15,32,48,0.12); overflow: hidden; }
.lens-row .bar > i { display: block; height: 100%; background: linear-gradient(90deg, #1d6fb8, #4a9de0); border-radius: 99px; }
.lens-row .val { font-family: var(--mono); font-size: 0.78rem; color: var(--ink); text-align: right; }
.lambda-scale { position: relative; height: 40px; margin: 0.75rem 0 1.5rem; }
.lambda-scale .rail { position: absolute; top: 18px; left: 0; right: 0; height: 4px; border-radius: 99px; background: rgba(15,32,48,0.15); }
.lambda-scale .mark { position: absolute; top: 8px; width: 2px; height: 24px; background: var(--ink-25); }
.lambda-scale .you  { position: absolute; top: 4px; width: 4px; height: 32px; border-radius: 2px; background: var(--pos); }
.lambda-scale .tag { position: absolute; top: -14px; transform: translateX(-50%); font-family: var(--mono); font-size: 0.64rem; color: var(--ink-55); white-space: nowrap; }

/* ── Reduced motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ── 375px ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  main { padding: 5.5rem 0.8rem 2rem; }
  .glass { border-radius: 12px; }
  .q-stage { min-height: 420px; }
}
