:root{
  --bg: #f8fbff;
  --panel: rgba(255,255,255,.88);
  --stroke: rgba(15,23,42,.12);
  --text: #0f172a;
  --muted: rgba(15,23,42,.78);
  --muted2: rgba(15,23,42,.58);
  --accent: #0ea5e9;
  --accent2:#2563eb;
  --good:#22c55e;
  --bad:#ef4444;
  --shadow: 0 18px 45px rgba(15,23,42,.12);
  --radius: 22px;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--text);
  background: radial-gradient(1300px 900px at 12% 5%, rgba(14,165,233,.18), transparent 62%),
              radial-gradient(1100px 850px at 88% 12%, rgba(37,99,235,.12), transparent 58%),
              var(--bg);
}

a{ color:inherit; text-decoration:none; opacity:.85; }
a:hover{ opacity:1; }

.topbar{
  position:fixed;
  top:0; left:0; right:0;
  display:flex;
  align-items:center;
  gap:14px;
  padding:12px 16px;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stroke);
  z-index: 1000;
}

.brand{
  display:flex; align-items:center; gap:10px;
  font-weight:700;
  letter-spacing:.2px;
  white-space:nowrap;
}
.dot{
  width:10px; height:10px; border-radius:50%;
  background: linear-gradient(135deg,var(--accent2),var(--accent));
  box-shadow: 0 0 18px rgba(139,92,246,.45);
}

.nav{
  display:none;
  gap:10px;
  flex: 1;
  overflow:auto;
  padding:0 4px;
}
.mobileIndicator{
  font-size: 12px;
  color: var(--muted2);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(14,165,233,.06);
  white-space: nowrap;
}
@media (min-width: 980px){
  .nav{ display:flex; }
  .mobileIndicator{ display:none; }
  .nav a{ font-size:12px; padding:6px 10px; border-radius:999px; border:1px solid transparent; }
  .nav a:hover{ border-color: var(--stroke); background: rgba(15,23,42,.05); }
  .nav a.active{
    border-color: rgba(14,165,233,.35);
    background: rgba(14,165,233,.12);
    color: #0f172a;
    font-weight: 700;
  }
}

.progressWrap{
  width:160px; height:8px;
  border-radius:999px;
  background: rgba(15,23,42,.08);
  overflow:hidden;
  border:1px solid rgba(15,23,42,.12);
}
.progressBar{
  width:0%;
  height:100%;
  background: linear-gradient(90deg,var(--accent2),var(--accent));
  border-radius:999px;
}

main{ padding-top: 58px; }

.slide{
  min-height: calc(100vh - 58px);
  display:flex;
  align-items:center;
  padding: 64px 18px;
}

.content{
  width:min(1100px, 100%);
  margin: 0 auto;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 34px);
  position:relative;
  overflow:hidden;
}

.hero .content{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
}

.kicker{
  margin:0 0 10px 0;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted2);
}

h1{
  margin:0 0 12px 0;
  font-size: clamp(30px, 4.2vw, 54px);
  line-height: 1.04;
}

h2{
  margin:0 0 10px 0;
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.12;
}

.lead{
  margin:0;
  font-size: 16px;
  line-height:1.55;
  color: var(--muted);
  max-width: 70ch;
}

.bullets{
  margin: 14px 0 0 0;
  padding-left: 18px;
  color: var(--muted);
}
.bullets li{ margin: 8px 0; }

.twoCol{
  display:grid;
  gap: 18px;
  grid-template-columns: 1fr;
}
@media (min-width: 900px){
  .twoCol{ grid-template-columns: 1.05fr .95fr; }
}

.viz{
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 14px;
  position:relative;
  overflow:hidden;
}

.caption{
  margin: 14px 0 0 0;
  color: var(--muted2);
}
.caption.small{ font-size: 12px; margin-top: 10px; }

.hint{
  margin-top: 16px;
  color: var(--muted2);
  font-size: 12px;
}

.btn{
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  transition: transform .15s ease, background .15s ease;
  user-select:none;
}
.btn:hover{ background: rgba(255,255,255,.10); }
.btn:active{ transform: translateY(1px); }
.btn.ghost{ background: transparent; }
.btn.success{ border-color: rgba(34,197,94,.35); }
.btn.danger{ border-color: rgba(239,68,68,.35); }
.btn.primary{
  background: linear-gradient(135deg, rgba(14,165,233,.18), rgba(37,99,235,.18));
  border-color: rgba(14,165,233,.35);
  font-weight: 700;
}
.btn.primary:hover{
  background: linear-gradient(135deg, rgba(14,165,233,.28), rgba(37,99,235,.22));
}

.nextRow{
  margin-top: 18px;
  display:flex;
  align-items:center;
  gap: 12px;
  flex-wrap: wrap;
}

.guide{
  margin-top: 18px;
  display:grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 900px){
  .guide{ grid-template-columns: repeat(2, 1fr); }
}
.guideCard{
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.92);
  padding: 12px 14px;
}
.guideTitle{
  font-weight: 800;
  margin-bottom: 6px;
}
.guideText{
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.guideNote{
  margin-top: 8px;
  color: var(--muted2);
  font-size: 12px;
}
.miniSteps{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.miniSteps li{
  display:flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}
.stepBadge{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: rgba(14,165,233,.12);
  border: 1px solid rgba(14,165,233,.3);
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}
.chips{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip{
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.06);
  border: 1px solid rgba(15,23,42,.12);
  font-size: 12px;
  color: rgba(15,23,42,.8);
}
.introGuide{
  margin-top: 16px;
}

.callout{
  margin-top: 12px;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(14,165,233,.08);
  border: 1px solid rgba(14,165,233,.25);
  color: rgba(15,23,42,.82);
  font-weight: 600;
}
.mathCard{
  margin-top: 12px;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(37,99,235,.08);
  border: 1px solid rgba(37,99,235,.25);
}
.mathTitle{
  font-weight: 700;
  color: rgba(15,23,42,.78);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.mathLine{
  margin-top: 6px;
  font-weight: 700;
}

.embedControls{
  margin-top: 12px;
  display:grid;
  gap: 10px;
}
.embedHint{
  font-size: 12px;
  color: var(--muted2);
  min-height: 16px;
}
.embedNote{
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted2);
  line-height: 1.4;
}

/* Checkpoint badges removed per request */
.checkpoint{ display:none; }

/* Hero viz */
.heroViz{ margin-top: 18px; }
.babyToBrain{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
}
.stage{
  flex:1;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  text-align:center;
  transform: translateY(10px);
  opacity: 0;
}
.stage .icon{ font-size: 28px; }
.stage .label{ margin-top: 6px; font-weight: 700; color: var(--muted); }
.arrow{ color: rgba(255,255,255,.35); font-size: 18px; }

.floatingWords{
  position:relative;
  height: 110px;
  margin-top: 12px;
}
.floatingWords span{
  position:absolute;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.80);
  font-size: 12px;
  opacity: 0;
  transform: translateY(12px);
}

/* Pretrain viz */
.dataCloud{
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.16);
  padding: 14px;
  min-height: 160px;
  position:relative;
  overflow:hidden;
}
.dataChips{
  position:absolute;
  inset: 12px 12px auto 12px;
  height: 110px;
  pointer-events:none;
}
.dataChip{
  position:absolute;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--stroke);
  font-size: 11px;
  color: rgba(15,23,42,.78);
  cursor: grab;
  pointer-events:auto;
  user-select:none;
}
.dataChip:active{ cursor: grabbing; }
.dataChip:nth-child(1){ left: 4%; top: 10%; }
.dataChip:nth-child(2){ left: 24%; top: 42%; }
.dataChip:nth-child(3){ left: 48%; top: 12%; }
.dataChip:nth-child(4){ left: 66%; top: 46%; }
.dataChip:nth-child(5){ left: 10%; top: 68%; }
.dataChip:nth-child(6){ left: 36%; top: 70%; }
.dataChip:nth-child(7){ left: 72%; top: 18%; }
.cloudText{
  color: rgba(255,255,255,.60);
  font-size: 12px;
  line-height:1.6;
}
.stream{
  position:absolute;
  left: -30%;
  top: 50%;
  width: 60%;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(14,165,233,.85), rgba(139,92,246,.85), transparent);
  filter: blur(0.2px);
  opacity: 0;
}
.gpuRack{
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  padding: 12px;
  background: rgba(0,0,0,.18);
}
.gpuDrop{
  margin: 6px 0 10px 0;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px dashed rgba(14,165,233,.3);
  background: rgba(14,165,233,.06);
  font-size: 12px;
  color: var(--muted2);
  text-align:center;
}
.gpuStorage{
  margin-top: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(14,165,233,.25);
  background: rgba(14,165,233,.06);
  padding: 8px 10px;
}
.storageTitle{
  font-size: 11px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.storageSlots{
  margin-top: 6px;
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.slot{
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(14,165,233,.2);
  background: rgba(255,255,255,.8);
  opacity: .5;
  transition: opacity .2s ease, background .2s ease, box-shadow .2s ease;
}
.slot.filled{
  opacity: 1;
  background: rgba(14,165,233,.2);
  box-shadow: 0 0 8px rgba(14,165,233,.25);
}
.gpuDrop.learning{
  color: #0f172a;
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.35);
}
.rackTitle{ font-weight: 700; color: rgba(255,255,255,.78); margin-bottom: 10px; }
.gpus{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.gpu{
  height: 20px;
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: inset 0 0 0 0 rgba(14,165,233,.0);
}
.rackFoot{ margin-top:10px; font-size: 12px; color: var(--muted2); }

/* Tokenization */
.tokenDemo{ margin-top: 14px; }
.inputRow{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
}
.inputRow.compact{
  margin-top: 10px;
  gap: 8px;
}
.inputRow.compact label{
  font-size: 12px;
  color: var(--muted2);
}
.inputRow.compact{
  margin-top: 10px;
  gap: 8px;
}
.inputRow.compact label{
  font-size: 12px;
  color: var(--muted2);
}
input{
  flex:1;
  min-width: 220px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  outline:none;
}
.tokenLane, .idLane{
  margin-top: 12px;
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pill{
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  opacity:0;
  transform: translateY(10px) scale(.98);
}
.pill.small{
  font-size: 12px;
  opacity:0;
  transform: translateY(10px);
  background: rgba(0,0,0,.22);
}

/* Softmax bars */
.bars{ display:flex; flex-direction:column; gap: 10px; }
.barRow{
  display:grid;
  grid-template-columns: 90px 1fr 60px;
  gap: 10px;
  align-items:center;
}
.barName{ color: rgba(255,255,255,.78); font-weight: 650; }
.barTrack{
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  overflow:hidden;
}
.barFill{
  height:100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(14,165,233,.9), rgba(139,92,246,.9));
}
.barPct{ color: rgba(255,255,255,.68); font-variant-numeric: tabular-nums; }
.softmaxLabel{ margin-top:10px; font-size:12px; color: var(--muted2); }

/* Embedding canvas */
#embedCanvas{
  width: 100%;
  max-width: 520px;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: radial-gradient(600px 240px at 30% 30%, rgba(14,165,233,.10), transparent 60%),
              radial-gradient(520px 260px at 70% 70%, rgba(139,92,246,.10), transparent 60%),
              rgba(0,0,0,.20);
}

/* Attention */
.exampleSentence{ margin-top: 10px; }
.sentTitle{ color: var(--muted2); font-size: 12px; }
.sentText{
  margin-top: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.16);
  line-height:1.5;
  color: rgba(255,255,255,.80);
}
.pulseFocus{
  animation: focusPulse .6s ease;
}
@keyframes focusPulse{
  0%{ box-shadow: 0 0 0 0 rgba(14,165,233,.0); }
  60%{ box-shadow: 0 0 0 6px rgba(14,165,233,.18); }
  100%{ box-shadow: 0 0 0 0 rgba(14,165,233,.0); }
}
.target{
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
}

.heatmap{
  display:grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  height: 220px;
  align-content: start;
  position:relative;
  z-index: 2;
}
.cell{
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  opacity: .55;
  transform: scale(.98);
  transition: opacity .35s ease, transform .35s ease, box-shadow .35s ease;
}
.cell.hot{
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 0 0 2px rgba(14,165,233,.20), 0 0 22px rgba(139,92,246,.25);
  background: linear-gradient(135deg, rgba(14,165,233,.20), rgba(139,92,246,.18));
}
.attLines{
  position:absolute;
  inset: 14px 14px auto 14px;
  height: 220px;
  width: calc(100% - 28px);
  z-index: 1;
  opacity: 0;
  transition: opacity .35s ease;
}

/* Transformer stack */
.stack{
  display:flex;
  flex-direction:column-reverse;
  gap: 10px;
  min-height: 320px;
  justify-content:flex-start;
}
.layer{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  padding: 12px;
  transform: translateY(10px);
  opacity: 0;
}
.layerTitle{ font-weight: 750; }
.layerBody{
  margin-top: 6px;
  color: var(--muted2);
  font-size: 12px;
}

/* RLHF */
.feedbackButtons{ display:flex; gap: 10px; flex-wrap: wrap; }
.loop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.loopNode{
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  min-width: 120px;
  text-align:center;
  font-weight: 700;
}
.loopArrow{ color: rgba(255,255,255,.35); font-size: 18px; }
.loopNode.train{ border-color: rgba(14,165,233,.25); }
.pulseRing{
  position:absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(14,165,233,.75);
  box-shadow: 0 0 20px rgba(139,92,246,.30);
  opacity: 0;
}

/* Hallucination */
.warning{
  margin-top: 12px;
  display:flex;
  gap: 10px;
  align-items:flex-start;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(239,68,68,.28);
  background: rgba(239,68,68,.12);
  color: #7f1d1d;
}
.warnIcon{ font-size: 18px; margin-top: 1px; color: #b91c1c; }

.chatBubble{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.20);
  padding: 14px;
  transform: translateY(6px);
}
.bubbleTitle{ color: var(--muted2); font-size: 12px; }
.bubbleText{ margin-top: 8px; font-size: 18px; }
.factResult{ margin-top: 10px; color: var(--muted); min-height: 20px; }
.factResult.ok{
  color: #14532d;
  background: rgba(34,197,94,.16);
  border: 1px solid rgba(34,197,94,.35);
  padding: 6px 10px;
  border-radius: 10px;
  display:inline-block;
}
.factResult.bad{
  color: #7f1d1d;
  background: rgba(239,68,68,.18);
  border: 1px solid rgba(239,68,68,.35);
  padding: 6px 10px;
  border-radius: 10px;
  display:inline-block;
}

.wobble{ animation: wobble .55s ease-in-out; }
@keyframes wobble{
  0%{ transform: rotate(0deg); }
  20%{ transform: rotate(-2deg); }
  45%{ transform: rotate(2deg); }
  70%{ transform: rotate(-1deg); }
  100%{ transform: rotate(0deg); }
}

/* Future cards */
.cards{
  margin-top: 18px;
  display:grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 900px){
  .cards{ grid-template-columns: repeat(3, 1fr); }
}
.card{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  padding: 14px;
  transform: translateY(10px);
  opacity: 0;
}
.cardIcon{ font-size: 22px; }
.cardTitle{ margin-top: 8px; font-weight: 800; }
.cardText{ margin-top: 6px; color: var(--muted); }

.end{
  margin-top: 22px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted2);
}
.endLine{ font-size: 12px; }

/* Animation helpers (activated by JS) */
.on .stage{ animation: rise .6s ease forwards; }
.on .stage:nth-child(1){ animation-delay: .05s; }
.on .stage:nth-child(3){ animation-delay: .18s; }
.on .stage:nth-child(5){ animation-delay: .31s; }

@keyframes rise{
  to{ transform: translateY(0); opacity: 1; }
}

.wordsOn span{ opacity: 1; transform: translateY(0); transition: all .6s ease; }
.wordsOn span:nth-child(1){ left: 6%; top: 10%; transition-delay: .06s; }
.wordsOn span:nth-child(2){ left: 26%; top: 55%; transition-delay: .12s; }
.wordsOn span:nth-child(3){ left: 48%; top: 20%; transition-delay: .18s; }
.wordsOn span:nth-child(4){ left: 68%; top: 60%; transition-delay: .24s; }
.wordsOn span:nth-child(5){ left: 10%; top: 70%; transition-delay: .30s; }
.wordsOn span:nth-child(6){ left: 40%; top: 72%; transition-delay: .36s; }
.wordsOn span:nth-child(7){ left: 72%; top: 18%; transition-delay: .42s; }
.wordsOn span:nth-child(8){ left: 84%; top: 74%; transition-delay: .48s; }

/* Light theme overrides for previously hardcoded dark surfaces */
.content{
  background: var(--panel);
  border: 1px solid var(--stroke);
}
.hero .content{
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.86));
}
.viz,
.babyToBrain,
.stage,
.gpuRack,
input,
.pill,
.loopNode,
.chatBubble,
.card{
  background: rgba(255,255,255,.9);
  border-color: var(--stroke);
}
.sentText{
  background: rgba(255,255,255,.92);
  border-color: var(--stroke);
  color: rgba(15,23,42,.82);
}
.barTrack,
.progressWrap{
  background: rgba(15,23,42,.08);
  border-color: rgba(15,23,42,.12);
}
.cell{
  background: rgba(15,23,42,.05);
  border-color: var(--stroke);
}
.floatingWords span{
  background: rgba(255,255,255,.9);
  border-color: var(--stroke);
  color: rgba(15,23,42,.8);
}
.arrow,
.loopArrow{
  color: rgba(15,23,42,.35);
}
.barName{ color: rgba(15,23,42,.78); }
.barPct{ color: rgba(15,23,42,.68); }
.cloudText{ color: rgba(15,23,42,.62); }
.dataCloud{ border-color: rgba(15,23,42,.2); }
.rackTitle{ color: rgba(15,23,42,.78); }
.btn{
  background: rgba(255,255,255,.9);
  border-color: var(--stroke);
}
.btn:hover{ background: rgba(14,165,233,.08); }
