/* ============================================================================
   site.css — "Observatory" theme
   A dark, glass-surfaced interface built around the attractor itself.
   No web fonts, no build step: the presentation has to survive a room with
   no network, so everything here is self-contained.
   ========================================================================== */

:root {
  /* surfaces */
  --bg:          #0a0417;
  --bg-2:        #120a29;
  --surface:     rgba(255, 255, 255, .045);
  --surface-2:   rgba(255, 255, 255, .075);
  --line:        rgba(167, 139, 250, .19);
  --line-strong: rgba(167, 139, 250, .38);

  /* ink */
  --ink:      #f4efff;
  --ink-soft: #cfc2ec;
  --muted:    #9a8bba;

  /* brand */
  --primary:      #a855f7;
  --primary-deep: #7c3aed;
  --primary-soft: rgba(168, 85, 247, .14);
  --accent:       #e879f9;
  --cyan:         #38bdf8;

  /* semantic */
  --good:    #34d399;
  --warning: #fbbf24;
  --danger:  #fb7185;

  /* effects */
  --glow:   0 0 0 1px rgba(168, 85, 247, .22), 0 18px 48px -12px rgba(124, 58, 237, .45);
  --lift:   0 24px 60px -18px rgba(0, 0, 0, .75);
  --radius: 18px;
  --ease:   cubic-bezier(.22, 1, .36, 1);

  --measure: 72ch;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "SF Pro Text", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-feature-settings: "cv11", "ss01";
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Aurora field ------------------------------------------------------------ */
body::before {
  position: fixed;
  z-index: -2;
  inset: -20vmax;
  content: "";
  background:
    radial-gradient(38vmax 38vmax at 14% 8%,  rgba(124, 58, 237, .40), transparent 62%),
    radial-gradient(32vmax 32vmax at 86% 12%, rgba(232, 121, 249, .24), transparent 60%),
    radial-gradient(44vmax 44vmax at 72% 88%, rgba(56, 189, 248, .16), transparent 62%),
    radial-gradient(36vmax 36vmax at 22% 92%, rgba(168, 85, 247, .22), transparent 60%),
    var(--bg);
  animation: drift 34s var(--ease) infinite alternate;
  pointer-events: none;
}

/* Film grain — stops the large gradients from banding on a projector. */
body::after {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
}

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-2.5%, 1.5%, 0) scale(1.06); }
  100% { transform: translate3d(2%, -2%, 0) scale(1.02); }
}

::selection { background: rgba(232, 121, 249, .35); color: #fff; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #0d0620; }
::-webkit-scrollbar-thumb {
  border: 3px solid #0d0620; border-radius: 99px;
  background: linear-gradient(180deg, var(--primary), var(--primary-deep));
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

a { color: #d8b4fe; text-decoration-color: rgba(216, 180, 254, .4); text-underline-offset: .18em; transition: color .18s var(--ease); }
a:hover { color: #f0abfc; }

a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap { width: min(1140px, calc(100% - 44px)); margin: 0 auto; }
.wrap.narrow { width: min(800px, calc(100% - 44px)); }

/* ==========================================================================
   Header
   ========================================================================== */

header.site {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 4, 23, .62);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
}
header.site::after {
  position: absolute; right: 0; bottom: -1px; left: 0; height: 1px; content: "";
  background: linear-gradient(90deg, transparent, var(--line-strong) 22%, rgba(232, 121, 249, .5) 50%, var(--line-strong) 78%, transparent);
}
header.site .wrap { display: flex; align-items: center; gap: 20px; min-height: 66px; }
header.site a { color: var(--ink); text-decoration: none; }

header.site .brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .93rem; font-weight: 700; letter-spacing: -.01em;
}
header.site .brand::before {
  width: 9px; height: 9px; border-radius: 50%; content: "";
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 121, 249, .15), 0 0 16px 2px rgba(232, 121, 249, .8);
  animation: pulse 2.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(.72);  opacity: .6; }
}

header.site nav {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-left: auto;
  font-size: .82rem; font-weight: 550;
}
header.site nav a {
  position: relative;
  padding: 7px 13px; border-radius: 99px;
  color: var(--ink-soft);
  transition: color .2s var(--ease), background .2s var(--ease);
}
header.site nav a::before {
  position: absolute; inset: 0; border-radius: 99px; content: "";
  border: 1px solid transparent;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
header.site nav a:hover { color: #fff; }
header.site nav a:hover::before { background: var(--surface); border-color: var(--line); }
header.site nav a[aria-current="page"] {
  color: #fff;
  background: linear-gradient(120deg, rgba(124, 58, 237, .55), rgba(232, 121, 249, .35));
  box-shadow: inset 0 1px rgba(255, 255, 255, .18), 0 6px 18px -6px rgba(168, 85, 247, .8);
}

/* Reading-progress line under the header. */
.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 40;
  width: 100%; height: 2px;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--primary-deep), var(--accent), var(--cyan));
  will-change: transform;
}

/* ==========================================================================
   Typography
   ========================================================================== */

main.wrap { padding: 56px 0 96px; }

h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 20ch; margin-bottom: 16px;
  font-size: clamp(2.3rem, 5.4vw, 4.3rem); font-weight: 700;
  line-height: 1.02; letter-spacing: -.045em;
  background: linear-gradient(112deg, #fff 8%, #e9d5ff 46%, #c4b5fd 82%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
h2 {
  position: relative;
  margin: 62px 0 16px; padding-left: 18px;
  font-size: clamp(1.5rem, 2.7vw, 2.1rem); font-weight: 660;
  line-height: 1.14; letter-spacing: -.028em;
}
h2::before {
  position: absolute; top: .16em; bottom: .16em; left: 0; width: 3px; border-radius: 3px; content: "";
  background: linear-gradient(180deg, var(--accent), var(--primary-deep));
  box-shadow: 0 0 12px rgba(168, 85, 247, .7);
}
h3 { margin: 30px 0 8px; font-size: 1.14rem; font-weight: 640; letter-spacing: -.015em; }

p, li { max-width: var(--measure); color: var(--ink-soft); }
.lede { max-width: 64ch; color: #ded3f6; font-size: 1.16rem; line-height: 1.72; }
.sub, .note { color: var(--muted); }
.note { font-size: .875rem; line-height: 1.6; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0 0 18px; padding: 6px 14px 6px 11px;
  border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface);
  color: #e9d5ff; font-size: .72rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
}
.eyebrow::before {
  width: 6px; height: 6px; border-radius: 50%; content: "";
  background: var(--accent); box-shadow: 0 0 10px 1px var(--accent);
}

footer.site { position: relative; border-top: 1px solid var(--line); color: var(--muted); }
footer.site .wrap { padding: 28px 0 48px; }
footer.site p { margin: 0; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero { position: relative; isolation: isolate; overflow: hidden; padding: 74px 0 24px; }
.hero-canvas {
  position: absolute; top: 50%; right: -6%; z-index: -1;
  width: min(760px, 72%); height: 132%;
  transform: translateY(-50%);
  opacity: .55;
  -webkit-mask-image: radial-gradient(closest-side, #000 42%, transparent 78%);
  mask-image: radial-gradient(closest-side, #000 42%, transparent 78%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 60ch; }

/* ==========================================================================
   Surfaces
   ========================================================================== */

.card, .panel, .tinted {
  position: relative;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--lift);
}
/* Hairline highlight along the top edge — the thing that reads as "glass". */
.card::before, .panel::before, .tinted::before, .document-link::before, .landing-action::before {
  position: absolute; top: 0; right: 14%; left: 14%; height: 1px; content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
  pointer-events: none;
}

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 30px 0; }
.card {
  display: block; overflow: hidden; padding: 26px;
  color: inherit; text-decoration: none;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--glow), var(--lift); transform: translateY(-5px); }
.card h3 { margin: 0 0 6px; color: #fff; }
.card p { margin: 0; color: var(--muted); }
.card .kicker {
  display: block; margin-bottom: 9px;
  color: var(--accent); font-size: .71rem; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase;
}
.card.primary {
  grid-column: 1 / -1;
  border-color: rgba(232, 121, 249, .45);
  background: linear-gradient(125deg, rgba(124, 58, 237, .55), rgba(232, 121, 249, .22) 62%, rgba(56, 189, 248, .16));
}
.card.primary h3, .card.primary p { color: #fff; }

.panel { padding: clamp(22px, 3vw, 32px); margin: 26px 0; }
.tinted {
  padding: 18px 22px;
  border-color: rgba(232, 121, 249, .3);
  background: linear-gradient(135deg, rgba(232, 121, 249, .14), rgba(124, 58, 237, .1));
  color: var(--ink-soft);
}
.tinted strong, .tinted b { color: #fff; }

/* ==========================================================================
   Tags
   ========================================================================== */

.tag {
  display: inline-block; padding: 3px 9px;
  border: 1px solid transparent; border-radius: 99px;
  font-size: .64rem; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; vertical-align: middle; white-space: nowrap;
}
.tag.measured, .tag.pass { border-color: rgba(52, 211, 153, .4); color: var(--good);    background: rgba(52, 211, 153, .12); }
.tag.derived            { border-color: rgba(168, 85, 247, .45); color: #d8b4fe;        background: rgba(168, 85, 247, .14); }
.tag.cited              { border-color: rgba(251, 191, 36, .4);  color: var(--warning); background: rgba(251, 191, 36, .12); }
.tag.notshown           { border-color: rgba(255, 255, 255, .16); color: var(--muted);  background: rgba(255, 255, 255, .05); }
.tag.fail               { border-color: rgba(251, 113, 133, .4); color: var(--danger);  background: rgba(251, 113, 133, .12); }

/* ==========================================================================
   Tables
   ========================================================================== */

table {
  width: 100%; margin: 22px 0; overflow: hidden;
  border: 1px solid var(--line); border-collapse: separate; border-spacing: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, .028);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--lift);
  font-size: .9rem;
}
th, td {
  padding: 13px 15px;
  border-right: 1px solid rgba(167, 139, 250, .1);
  border-bottom: 1px solid rgba(167, 139, 250, .1);
  color: var(--ink-soft); text-align: left; vertical-align: top;
}
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
th {
  color: #e9d5ff; background: rgba(124, 58, 237, .16);
  font-size: .73rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase;
}
tbody tr { transition: background .2s var(--ease); }
tbody tr:hover { background: rgba(168, 85, 247, .07); }
td b { color: #fff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
caption { padding: 12px 2px 0; color: var(--muted); caption-side: bottom; font-size: .82rem; text-align: left; }

/* ==========================================================================
   Forms and buttons
   ========================================================================== */

.controls { display: flex; flex-wrap: wrap; gap: 16px 18px; align-items: end; }

.control-group {
  display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: end;
  margin: 0 0 18px; padding: 18px 18px 20px;
  border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255, 255, 255, .028);
}
.control-group > .cg-legend {
  flex: 1 0 100%;
  margin-bottom: -4px;
  color: var(--accent); font-size: .68rem; font-weight: 800;
  letter-spacing: .15em; text-transform: uppercase;
}

.field {
  display: flex; flex-direction: column; gap: 6px;
  color: var(--muted); font-size: .79rem; font-weight: 650;
}
.field input, .field select, .field textarea {
  width: 148px; padding: 10px 12px;
  border: 1px solid rgba(167, 139, 250, .22); border-radius: 11px;
  color: var(--ink); background: rgba(10, 4, 23, .55);
  font: inherit; font-variant-numeric: tabular-nums;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.field select { appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) center, calc(100% - 12px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field textarea { width: 100%; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: rgba(154, 139, 186, .65); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(167, 139, 250, .4); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  background: rgba(10, 4, 23, .8);
  box-shadow: 0 0 0 4px rgba(232, 121, 249, .16);
  outline: 0;
}

button, .button {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; overflow: hidden;
  border: 1px solid rgba(232, 121, 249, .5); border-radius: 12px;
  color: #fff;
  background: linear-gradient(120deg, var(--primary-deep), var(--primary) 55%, var(--accent));
  box-shadow: 0 10px 26px -10px rgba(168, 85, 247, .9), inset 0 1px rgba(255, 255, 255, .28);
  cursor: pointer; font: 680 .93rem/1.2 inherit; text-decoration: none;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), filter .22s var(--ease);
}
/* Sheen that crosses the button on hover. */
button::after, .button::after {
  position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; content: "";
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: skewX(-18deg); transition: left .55s var(--ease);
}
button:hover, .button:hover { filter: brightness(1.1); box-shadow: 0 16px 34px -10px rgba(168, 85, 247, 1), inset 0 1px rgba(255, 255, 255, .35); transform: translateY(-2px); }
button:hover::after, .button:hover::after { left: 120%; }
button:active, .button:active { transform: translateY(0) scale(.985); }

button.ghost, .button.ghost {
  border-color: var(--line-strong); color: #e9d5ff;
  background: var(--surface); box-shadow: none;
}
button.ghost:hover, .button.ghost:hover { border-color: var(--accent); background: var(--surface-2); filter: none; }
button.mini { min-height: 34px; padding: 6px 13px; font-size: .8rem; border-radius: 9px; }
button[disabled] { opacity: .45; cursor: progress; filter: none; transform: none; }
button[disabled]::after { display: none; }

progress {
  width: 150px; height: 8px;
  border: 0; border-radius: 99px;
  background: rgba(255, 255, 255, .1);
  appearance: none;
}
progress::-webkit-progress-bar { border-radius: 99px; background: rgba(255, 255, 255, .1); }
progress::-webkit-progress-value { border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .18s linear; }
progress::-moz-progress-bar { border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; color: #e9d5ff; }
.kbd {
  padding: 2px 7px;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px;
  background: var(--surface);
  font-family: ui-monospace, Menlo, monospace; font-size: .78em;
}

/* ==========================================================================
   Figures and readouts
   ========================================================================== */

.plot {
  position: relative;
  min-height: 64px; margin: 20px 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 16px;
  background: rgba(255, 255, 255, .022);
  box-shadow: var(--lift);
}
/* Shimmer placeholder until Plotly paints into the element. */
.plot:empty { min-height: 340px; }
.plot:empty::after {
  position: absolute; inset: 0; content: "";
  background: linear-gradient(100deg, transparent 20%, rgba(168, 85, 247, .13) 45%, transparent 70%);
  background-size: 240% 100%;
  animation: shimmer 1.7s linear infinite;
}
@keyframes shimmer { from { background-position: 140% 0; } to { background-position: -140% 0; } }

.figcap { margin: -6px 0 28px; color: var(--muted); font-size: .89rem; }

.readout {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 1px;
  overflow: hidden; margin: 22px 0;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--line);
  box-shadow: var(--lift);
}
.readout div {
  padding: 16px 16px 15px;
  background: linear-gradient(160deg, rgba(24, 12, 48, .96), rgba(14, 6, 32, .96));
  transition: background .25s var(--ease);
}
.readout div:hover { background: linear-gradient(160deg, rgba(46, 22, 88, .96), rgba(20, 9, 44, .96)); }
.readout .k { display: block; margin-bottom: 4px; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.readout .v {
  display: block; margin-bottom: 7px;
  color: #fff; font-size: 1.42rem; font-weight: 620;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.readout .v small { color: var(--muted); font-size: .68em; font-weight: 500; }

/* ==========================================================================
   Landing
   ========================================================================== */

body.landing { overflow-x: hidden; }
.landing-shell {
  position: relative;
  display: grid; place-items: center;
  min-height: 100vh; min-height: 100svh;
  padding: 56px 22px;
}
.landing-canvas {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  opacity: .72;
  pointer-events: none;
}
/* Scrim: keeps the type readable over whichever lobe the trajectory is on. */
.landing-shell::before {
  position: fixed; inset: 0; z-index: 0; content: "";
  background: linear-gradient(100deg, rgba(10, 4, 23, .92) 0 34%, rgba(10, 4, 23, .55) 62%, rgba(10, 4, 23, .25) 100%);
  pointer-events: none;
}
.landing-content { position: relative; z-index: 1; width: min(920px, 100%); }
.landing-kicker {
  margin: 0 0 22px;
  color: #e9d5ff; font-size: .76rem; font-weight: 750;
  letter-spacing: .2em; text-transform: uppercase;
}
.landing-title {
  max-width: 15ch; margin: 0 0 20px;
  font-size: clamp(2.8rem, 7.4vw, 6.1rem); font-weight: 700;
  line-height: .98; letter-spacing: -.06em;
  background: linear-gradient(104deg, #fff 6%, #f0abfc 38%, #c4b5fd 62%, #fff 92%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sheen 9s var(--ease) infinite;
}
@keyframes sheen { 0%, 100% { background-position: 0 0; } 50% { background-position: 100% 0; } }

.landing-blurb { max-width: 46ch; margin: 0 0 38px; color: #cbbde8; font-size: 1.06rem; }
.landing-actions { display: grid; gap: 12px; }

.landing-action {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  min-height: 84px; padding: 20px 26px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 20px;
  color: #fff;
  background: linear-gradient(120deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px rgba(255, 255, 255, .12);
  font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-weight: 650; letter-spacing: -.02em;
  text-decoration: none;
  transition: transform .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.landing-action .label { display: flex; align-items: baseline; gap: 16px; min-width: 0; }
.landing-action .label > span:last-child { display: block; min-width: 0; }
.landing-action small {
  color: var(--accent); font-size: .72rem; font-weight: 800;
  letter-spacing: .16em; font-variant-numeric: tabular-nums;
}
.landing-action .arrow {
  flex: none;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 50%;
  color: #e9d5ff; font-size: 1.15rem;
  transition: transform .35s var(--ease), background .35s var(--ease), border-color .35s var(--ease);
}
.landing-action:hover {
  border-color: rgba(232, 121, 249, .6);
  box-shadow: var(--glow), inset 0 1px rgba(255, 255, 255, .2);
  transform: translateX(10px);
}
.landing-action:hover .arrow { border-color: transparent; background: linear-gradient(120deg, var(--primary), var(--accent)); transform: translateX(4px); }
.landing-foot { margin: 32px 4px 0; color: var(--muted); font-size: .8rem; }

/* ==========================================================================
   Feedback and testing
   ========================================================================== */

.feedback-hero { max-width: 760px; }

.test-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 28px 0; }
.test-step {
  min-height: 150px; padding: 20px;
  border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
}
.test-step b { display: block; margin-bottom: 8px; color: var(--accent); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.test-step p { margin: 0; font-size: .9rem; line-height: 1.55; }

.lab-frame { width: 100%; min-height: 820px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); }

.feedback-form { display: grid; gap: 20px; }
.feedback-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.feedback-form .field { color: var(--ink-soft); font-size: .92rem; font-weight: 550; }
.feedback-form .field input, .feedback-form .field textarea { width: 100%; margin-top: 2px; }
.feedback-simulation { margin-bottom: 30px; }
.feedback-simulation-controls {
  display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end;
  margin: 20px 0; padding: 16px;
  border: 1px solid var(--line); border-radius: 13px;
  background: rgba(255, 255, 255, .03);
}
.feedback-simulation-controls label { display: grid; gap: 6px; color: var(--muted); font-size: .8rem; font-weight: 650; }
.feedback-simulation-controls input {
  width: 104px; min-height: 38px; padding: 8px 10px;
  border: 1px solid rgba(167, 139, 250, .22); border-radius: 9px;
  color: var(--ink); background: rgba(10, 4, 23, .55); font: inherit;
}
.feedback-simulation-summary {
  margin: 16px 0; padding: 15px 18px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px;
  background: rgba(168, 85, 247, .09);
  color: var(--ink-soft); font-size: .9rem; line-height: 1.62;
}
.feedback-simulation-controls[hidden], .feedback-simulation-summary[hidden], .feedback-simulation .plot[hidden] { display: none; }

.check-list { display: grid; gap: 12px; }
.check-list label, .consent {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 11px;
  background: rgba(255, 255, 255, .026);
  color: var(--ink-soft); font-size: .91rem; cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.check-list label:hover, .consent:hover { border-color: var(--line-strong); background: rgba(168, 85, 247, .08); }
.check-list input, .consent input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); }
.check-list label:has(input:checked) { border-color: rgba(52, 211, 153, .45); background: rgba(52, 211, 153, .09); }

.honeypot {
  position: absolute !important; width: 1px !important; height: 1px !important;
  overflow: hidden !important; clip: rect(1px, 1px, 1px, 1px) !important; white-space: nowrap !important;
}
.feedback-status { min-height: 1.6em; margin: 0; font-weight: 650; }

/* ==========================================================================
   Drop zone
   ========================================================================== */

.dropzone {
  display: grid; place-items: center; gap: 6px;
  padding: 34px 24px;
  border: 1.5px dashed var(--line-strong); border-radius: 14px;
  background: rgba(255, 255, 255, .022);
  color: var(--muted); text-align: center; cursor: pointer;
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
.dropzone:hover { border-color: var(--accent); background: rgba(232, 121, 249, .07); color: var(--ink-soft); }
.dropzone.over { border-color: var(--accent); background: rgba(232, 121, 249, .14); color: #fff; transform: scale(1.012); }
.dropzone .dz-icon { font-size: 1.7rem; line-height: 1; opacity: .85; }

/* ==========================================================================
   Assessor document links
   ========================================================================== */

.document-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin: 26px 0; }
.document-link {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  min-height: 82px; padding: 18px 22px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 16px;
  color: #fff;
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--lift);
  font-size: 1.02rem; font-weight: 640; text-decoration: none;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.document-link .dl-icon {
  flex: none;
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(168, 85, 247, .16);
  font-size: .68rem; font-weight: 800; letter-spacing: .04em;
}
.document-link .dl-text { display: flex; flex-direction: column; gap: 2px; }
.document-link .dl-note { color: var(--muted); font-size: .78rem; font-weight: 450; }
.document-link::after {
  margin-left: auto;
  color: var(--accent); font-size: 1.3rem; content: "\2192";
  transition: transform .3s var(--ease);
}
.document-link:hover { border-color: rgba(232, 121, 249, .55); box-shadow: var(--glow), var(--lift); transform: translateY(-4px); }
.document-link:hover::after { transform: translateX(5px); }

/* ==========================================================================
   Presentation deck
   ========================================================================== */

body.deck { overflow: hidden; background: #06030f; }
body.deck::before { opacity: .55; }
body.deck .slide {
  position: fixed; inset: 0;
  display: none; align-items: center; justify-content: center;
  padding: 5vh 5vw 78px;
}
body.deck .slide.on { display: flex; animation: deck-in .5s var(--ease) both; }
body.deck .slide img {
  display: block;
  width: min(100%, calc((100vh - 124px) * 1.7777));
  max-height: calc(100vh - 124px);
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px;
  box-shadow: 0 40px 110px -20px rgba(0, 0, 0, .9), 0 0 70px -30px rgba(168, 85, 247, .8);
  object-fit: contain;
}
body.deck .deckbar {
  position: fixed; right: 0; bottom: 0; left: 0; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  min-height: 58px; padding: 10px 20px;
  border-top: 1px solid var(--line);
  background: rgba(6, 3, 15, .72);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: #e9d5ff; font-size: .8rem;
}
body.deck .deckbar button {
  min-width: 40px; min-height: 36px; padding: 6px 12px;
  border-color: var(--line); color: #fff; background: var(--surface); box-shadow: none;
}
body.deck .deckbar button:hover { background: var(--surface-2); filter: none; }
body.deck .deckbar .spacer { margin-left: auto; }
body.deck .deckbar a { color: #e9d5ff; text-decoration: none; padding: 6px 10px; border-radius: 8px; }
body.deck .deckbar a:hover { background: var(--surface); color: #fff; }
body.deck #where { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
body.deck .progress {
  position: fixed; top: 0; left: 0; z-index: 5;
  width: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary-deep), var(--accent), var(--cyan));
  box-shadow: 0 0 14px rgba(232, 121, 249, .8);
  transition: width .3s var(--ease);
}
body.deck .deck-caption { max-width: 30ch; overflow: hidden; color: #cbbde8; text-overflow: ellipsis; white-space: nowrap; }

.deck-dots { display: flex; gap: 6px; align-items: center; }
.deck-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, .25); cursor: pointer;
  transition: transform .28s var(--ease), background .28s var(--ease), width .28s var(--ease);
}
.deck-dots i:hover { background: rgba(255, 255, 255, .55); }
.deck-dots i.on { width: 20px; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); }

/* ==========================================================================
   Utilities and motion
   ========================================================================== */

.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.stack > * + * { margin-top: 10px; }
.hidden { display: none !important; }
.status { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.status.err { color: var(--danger); }
.status.ok { color: var(--good); }
ul.tight li { margin: 5px 0; }
ol.tight li { margin: 7px 0; }

/* Scroll reveal — ui.js adds .in. Without JS the content is simply visible. */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@keyframes deck-in { from { opacity: 0; transform: translateX(34px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rise    { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Entrance for the landing tiles. */
.landing-content > *  { animation: rise .7s var(--ease) both; }
.landing-content > *:nth-child(2) { animation-delay: .07s; }
.landing-content > *:nth-child(3) { animation-delay: .14s; }
.landing-content > *:nth-child(4) { animation-delay: .2s; }
.landing-action { animation: rise .65s var(--ease) both; }
.landing-action:nth-child(1) { animation-delay: .24s; }
.landing-action:nth-child(2) { animation-delay: .31s; }
.landing-action:nth-child(3) { animation-delay: .38s; }
.landing-action:nth-child(4) { animation-delay: .45s; }
.landing-action:nth-child(5) { animation-delay: .52s; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .document-links { grid-template-columns: 1fr; }
  .test-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .wrap { width: calc(100% - 32px); }
  header.site .wrap { flex-wrap: wrap; min-height: 58px; padding: 10px 0; }
  header.site nav { width: 100%; margin-left: 0; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  header.site nav::-webkit-scrollbar { display: none; }
  header.site nav a { white-space: nowrap; }
  main.wrap { padding: 32px 0 72px; }
  .hero { padding: 40px 0 12px; }
  .hero-canvas { top: 0; right: -20%; width: 130%; height: 68%; transform: none; opacity: .35; }
  .cards, .test-grid, .feedback-form .two { grid-template-columns: 1fr; }
  .card.primary { grid-column: auto; }
  .controls, .control-group { gap: 12px; }
  .field input, .field select { width: 100%; }
  .field { flex: 1 1 132px; }
  .lab-frame { min-height: 980px; }
  table { display: block; overflow-x: auto; white-space: normal; }
  h2 { margin-top: 46px; }
  body.deck .slide { padding: 16px 12px 84px; }
  body.deck .slide img { width: 100%; border-radius: 10px; }
  body.deck .deck-caption, .deck-dots { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Print — assessors print these pages, so drop the dark theme entirely.
   ========================================================================== */

@media print {
  body::before, body::after, header.site, .deckbar, .scroll-progress,
  button, .hero-canvas, .landing-canvas, .dropzone { display: none !important; }
  body { color: #000; background: #fff; }
  h1, h2, h3 { color: #000; -webkit-text-fill-color: #000; background: none; }
  p, li, td, th, .lede, .note { color: #111; }
  .card, .panel, .tinted, table, .readout, .readout div { border-color: #999; background: #fff; box-shadow: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  a { color: #000; }
}
