:root {
  --bg: #07080c;
  --bg-2: #0e1018;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eceef4;
  --muted: #8b91a3;
  --warm: #ff9e7a;
  --cool: #7cc4ff;
  --accent: #ffd278;
  --sans: "Sora", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-weight: 300; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* header */
.pro-top {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px clamp(16px, 4vw, 48px);
  background: linear-gradient(var(--bg) 30%, transparent);
}
.wordmark { font-weight: 600; font-size: 22px; letter-spacing: -0.02em; text-decoration: none; }
.wordmark span { font-weight: 300; color: var(--muted); }
.pro-nav { display: flex; gap: clamp(14px, 2.4vw, 32px); }
.pro-nav a {
  text-decoration: none; font-size: 13px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); position: relative; padding: 4px 0;
}
.pro-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--text);
  transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.pro-nav a:hover { color: var(--text); }
.pro-nav a:hover::after { transform: scaleX(1); }

/* hero */
.hero {
  position: relative; min-height: 100vh;
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center;
  padding: 90px clamp(16px, 4vw, 48px) 0; gap: 24px;
}
.eyebrow { color: var(--muted); font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 18px; }
.hero h1 { font-weight: 300; font-size: clamp(48px, 8vw, 112px); letter-spacing: -0.04em; line-height: 1; margin: 0 0 22px; }
.sub { font-size: clamp(18px, 2vw, 24px); font-weight: 400; margin: 0 0 12px; }
.body { color: var(--muted); max-width: 440px; margin: 0 0 32px; }
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 999px;
  text-decoration: none; font-size: 14px; font-weight: 400; transition: background .2s, color .2s, border-color .2s;
}
.cta:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

.hero-vis { position: relative; align-self: end; height: calc(100vh - 90px); min-height: 560px; }
#brain { position: absolute; inset: 0; width: 100%; height: 100%; }
.cord-menu { position: absolute; inset: 0; pointer-events: none; }
.cord-menu a {
  position: absolute; transform: translateY(-50%);
  display: flex; align-items: baseline; gap: 12px; white-space: nowrap;
  text-decoration: none; pointer-events: auto;
  opacity: 0; transition: opacity .6s, color .2s;
}
.cord-menu.on a { opacity: 1; }
.cord-menu .lvl { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; min-width: 2.6em; font-variant-numeric: tabular-nums; }
.cord-menu .nm { font-size: clamp(15px, 1.5vw, 19px); font-weight: 400; }
.cord-menu a:hover .nm, .cord-menu a:focus-visible .nm { color: var(--accent); }
.cord-menu a:focus-visible { outline: 1px dashed var(--accent); outline-offset: 4px; }
.legend {
  position: absolute; right: 0; bottom: 20px; margin: 0;
  font-size: 11px; color: var(--muted); letter-spacing: 0.04em;
}
.sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 4px 0 10px; }
.sw.warm { background: var(--warm); }
.sw.cool { background: var(--cool); }

.scroll-cue {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  color: var(--muted); animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

/* below the fold */
.statement { padding: 18vh clamp(16px, 4vw, 48px); max-width: 1100px; margin: 0 auto; }
.statement p { font-size: clamp(24px, 3.4vw, 44px); font-weight: 300; line-height: 1.3; letter-spacing: -0.02em; margin: 0; }

.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  border-top: 1px solid var(--line); margin: 0 clamp(16px, 4vw, 48px);
}
.tile {
  display: block; padding: 36px 28px 44px 0; text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.tile + .tile { padding-left: 28px; border-left: 1px solid var(--line); }
.tile-k { font-size: 12px; color: var(--muted); letter-spacing: 0.1em; }
.tile h2 { font-weight: 400; font-size: 24px; margin: 16px 0 10px; letter-spacing: -0.01em; transition: color .2s; }
.tile p { color: var(--muted); margin: 0; }
.tile:hover h2 { color: var(--accent); }

.pro-foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 40px clamp(16px, 4vw, 48px); color: var(--muted); font-size: 13px;
}

@media (max-width: 860px) {
  .pro-nav { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 96px; }
  .cord-menu .nm { font-size: 15px; }
  .hero-vis { height: 640px; min-height: 0; }
  .tile + .tile { padding-left: 0; border-left: none; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-cue { animation: none; }
}

/* n slider + equations */
.nfold { margin-top: 40px; max-width: 460px; }
.nfold-row { display: flex; align-items: center; gap: 14px; }
.nfold-row label { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.nfold-row output { font-size: 14px; font-variant-numeric: tabular-nums; min-width: 4.8em; color: var(--accent); }
#nslider {
  flex: 1; appearance: none; -webkit-appearance: none; height: 2px; background: rgba(255,255,255,.18);
  border-radius: 2px; outline: none; cursor: grab;
}
#nslider:active { cursor: grabbing; }
#nslider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--text); border: 3px solid var(--bg); box-shadow: 0 0 0 1px rgba(255,255,255,.4);
}
#nslider::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%; background: var(--text);
  border: 3px solid var(--bg); box-shadow: 0 0 0 1px rgba(255,255,255,.4);
}
#nslider:focus-visible { box-shadow: 0 0 0 4px rgba(255,210,120,.25); }
.eq {
  position: relative; max-height: 0; overflow: visible; visibility: hidden;
  transition: max-height .5s ease, margin .5s ease;
}
.nfold.open .eq { max-height: 460px; margin-top: 22px; }
.nfold.open .eq.go { visibility: visible; }
/* glyphs condense out of thin air */
.eq .mat { animation: materialise .9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes materialise {
  0%   { opacity: 0; filter: blur(7px); text-shadow: 0 0 14px var(--accent); color: var(--accent); }
  55%  { opacity: 1; filter: blur(0.6px); text-shadow: 0 0 10px rgba(255,210,120,.8); color: #fff3d6; }
  100% { opacity: 1; filter: none; text-shadow: none; }
}
.eq .speck {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 6px var(--accent); pointer-events: none;
}
@media (prefers-reduced-motion: reduce) { .eq .mat { animation-duration: .3s; } }
.eq-k { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 10px 0 0; }
.eq-m { color: var(--text); font-size: 13px; overflow-x: auto; overflow-y: hidden; }
.eq-m .katex-display { margin: 6px 0; text-align: left; }
.eq-m .katex-display > .katex { text-align: left; }
.eq-note { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

/* patellarrefleks (goofy.js) */
.reflex {
  position: absolute; left: calc(40% - 70px); bottom: 64px; z-index: 3;
  display: flex; align-items: center; gap: 10px;
}
.reflex-btn {
  padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: rgba(14,16,24,.7);
  cursor: crosshair; line-height: 0; transition: border-color .2s;
}
.reflex-btn:hover, .reflex-btn:focus-visible { border-color: var(--accent); outline: none; }
.reflex-btn canvas { width: 108px; height: 78px; image-rendering: pixelated; }
.reflex-k { margin: 0; max-width: 220px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.reflex-k .lvl { font-size: 10px; letter-spacing: .1em; color: var(--accent); margin-right: 4px; }
@media (max-width: 860px) { .reflex { left: 16px; bottom: 48px; } }
.reflex.left { flex-direction: column; align-items: flex-start; gap: 4px; }
.reflex.left .reflex-k { max-width: 140px; }
