@font-face {
  font-family: "Archivo Lagoon";
  src: url("../assets/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

@font-face {
  font-family: "Plex Lagoon";
  src: url("../assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Plex Lagoon";
  src: url("../assets/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #e8eaec;
  --muted: #a0a8b0;
  --dim: #6f7b85;
  --bg: #05060a;
  --surface: #0a1018;
  --surface-2: #0e1723;
  --line: rgba(128, 214, 229, 0.16);
  --cyan: #00e5ff;
  --cyan-soft: #6ff2ff;
  --ultramarine: #182fca;
  --amber: #ffb44a;
  --danger: #ff2e4d;
  --radius: 3px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  font-family: "Archivo Lagoon", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 0%, rgba(0, 229, 255, 0.13), transparent 30rem),
    radial-gradient(circle at 8% 48%, rgba(24, 47, 202, 0.16), transparent 30rem),
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.34;
  background-image: linear-gradient(rgba(0,229,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(0,229,255,.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

a { color: inherit; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 10px 14px;
  color: var(--bg);
  background: var(--cyan);
  border-radius: 2px;
  transform: translateY(-140%);
}
.skip-link:focus { transform: translateY(0); }

.site-header,
footer {
  width: min(1400px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header {
  min-height: 80px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--cyan);
  background: rgba(0, 229, 255, .04);
  border: 1px solid rgba(0, 229, 255, 0.48);
  border-radius: 2px;
  box-shadow: inset 0 0 22px rgba(0, 229, 255, .08);
  font: 600 0.72rem/1 "Plex Lagoon", monospace;
}

.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: .84rem; letter-spacing: .12em; }
.brand-copy small { color: var(--dim); font: 400 .56rem/1.2 "Plex Lagoon", monospace; letter-spacing: .08em; }

.protocol-state {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font: 400 0.7rem/1.4 "Plex Lagoon", monospace;
}

.pulse {
  width: 8px;
  height: 8px;
  background: var(--amber);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(255, 200, 104, 0.6);
}
.protocol-state.is-live .pulse { background: var(--cyan); box-shadow: 0 0 16px rgba(0, 229, 255, 0.8); }

#workspace {
  width: min(1400px, calc(100% - 40px));
  margin: 0 auto;
  outline: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  gap: clamp(40px, 8vw, 120px);
  align-items: end;
  padding: clamp(72px, 10vw, 144px) 0 72px;
}

.eyebrow,
.step {
  margin: 0 0 14px;
  color: var(--cyan);
  font: 600 0.68rem/1.4 "Plex Lagoon", monospace;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 960px;
  margin-bottom: 24px;
  font-size: clamp(3rem, 7.7vw, 7.8rem);
  font-weight: 760;
  font-stretch: 72%;
  line-height: 0.84;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  line-height: 1.65;
}

.state-card {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 190px 22px 16px;
  background: rgba(10, 16, 24, 0.88);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.state-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 168px;
  content: "";
  background:
    linear-gradient(to bottom, transparent 58%, rgba(10, 16, 24, 1)),
    linear-gradient(110deg, rgba(0,229,255,.08), rgba(24,47,202,.18)),
    url("../assets/still-terminal.webp") center 58% / cover;
  filter: saturate(.78) contrast(1.08);
}
.state-card::after {
  position: absolute;
  top: 14px;
  right: 14px;
  content: "LIVE INPUT";
  padding: 5px 7px;
  color: var(--cyan);
  background: rgba(5,6,10,.78);
  border: 1px solid rgba(0,229,255,.28);
  font: 600 .52rem/1 "Plex Lagoon", monospace;
  letter-spacing: .12em;
}
.state-card div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.state-card div:last-child { border: 0; }
.state-card dt { color: var(--dim); font: 400 .68rem/1.3 "Plex Lagoon", monospace; }
.state-card dd { margin: 0; text-align: right; font-size: .78rem; font-weight: 650; }

.journey-progress {
  margin: -26px 0 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.journey-progress ol { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 0; list-style: none; }
.journey-progress li {
  position: relative;
  padding: 15px 12px;
  color: var(--dim);
  border-right: 1px solid var(--line);
  font: 600 .58rem/1 "Plex Lagoon", monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.journey-progress li:last-child { border: 0; }
.journey-progress li::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; content: ""; background: transparent; }
.journey-progress li span { margin-right: 8px; color: var(--dim); }
.journey-progress li.complete { color: var(--muted); }
.journey-progress li.complete span, .journey-progress li.active { color: var(--cyan); }
.journey-progress li.active::after { background: var(--cyan); box-shadow: 0 0 18px rgba(0,229,255,.65); }

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
  padding-bottom: 120px;
}

.learning-column { display: grid; gap: 24px; min-width: 0; }

.panel,
.collaboration {
  background: linear-gradient(145deg, rgba(14, 23, 35, .94), rgba(7, 11, 18, .97));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel { padding: clamp(24px, 4vw, 48px); }
.collaboration { position: sticky; top: 20px; overflow: hidden; }

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

h2 { margin-bottom: 0; font-size: clamp(1.65rem, 3vw, 2.6rem); font-weight: 720; font-stretch: 76%; letter-spacing: -.035em; text-transform: uppercase; }
h3 { margin-bottom: 10px; font-size: 1.15rem; }
.panel-copy { max-width: 700px; color: var(--muted); line-height: 1.65; }
.boundary, .score {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--cyan-soft);
  background: rgba(0, 229, 255, .07);
  border: 1px solid rgba(0, 229, 255, .2);
  border-radius: 999px;
  font: 600 .64rem/1 "Plex Lagoon", monospace;
}
.score { color: var(--cyan); border-color: rgba(0, 229, 255, .22); }

.mission-deck { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 28px 0 30px; }
.mission-card {
  display: grid;
  min-height: 150px;
  padding: 18px;
  color: var(--ink);
  background: linear-gradient(145deg, rgba(0,229,255,.035), rgba(3,7,13,.72));
  border: 1px solid var(--line);
  border-radius: 3px;
  text-align: left;
}
.mission-card:hover, .mission-card.selected { border-color: rgba(0,229,255,.56); background: linear-gradient(145deg, rgba(0,229,255,.1), rgba(3,7,13,.8)); }
.mission-card span { align-self: start; color: var(--cyan); font: 600 .55rem/1.4 "Plex Lagoon", monospace; letter-spacing: .09em; text-transform: uppercase; }
.mission-card strong { align-self: center; max-width: 16ch; font-size: 1.05rem; line-height: 1.08; text-transform: uppercase; }
.mission-card small { align-self: end; color: var(--dim); font: 400 .6rem/1 "Plex Lagoon", monospace; }

label { display: grid; gap: 9px; color: var(--muted); font-size: .8rem; font-weight: 650; }
textarea, input {
  width: 100%;
  color: var(--ink);
  background: rgba(3, 7, 13, .72);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
}
textarea { padding: 18px; resize: vertical; line-height: 1.6; }
input { padding: 12px 14px; }
textarea:focus, input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 229, 255, .1); }

.form-row, .actions, .trial-footer, .human-gate { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.form-row { margin-top: 18px; }
.form-row label { min-width: 180px; }
.button {
  min-height: 44px;
  padding: 0 18px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-weight: 680;
}
.button:hover { border-color: var(--cyan); transform: translateY(-1px); }
.button.primary { color: #02070a; background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 24px rgba(0,229,255,.12); }
.button.ghost { color: var(--muted); }
.button.small { min-height: 36px; padding: 0 12px; font-size: .75rem; }

.goal-quote, .challenge {
  padding: 22px 24px;
  margin-bottom: 22px;
  background: rgba(3, 7, 13, .72);
  border-left: 3px solid var(--cyan);
  border-radius: 0 16px 16px 0;
}
.goal-quote span, .challenge span, .feedback span, .tools-block > span {
  color: var(--dim);
  font: 600 .64rem/1 "Plex Lagoon", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.goal-quote p, .challenge p, .feedback p { margin: 8px 0 0; line-height: 1.65; }
.route-reason { display: flex; gap: 12px; margin: 0 0 28px; color: var(--muted); }
.route-reason span { color: var(--cyan); }

.world-visual {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(24,47,202,.14), transparent 36%),
    linear-gradient(rgba(0,229,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,.025) 1px, transparent 1px),
    rgba(3, 7, 13, .58);
  background-size: auto, 36px 36px, 36px 36px, auto;
  border: 1px solid var(--line);
}
.world-telemetry {
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 18px;
  display: grid;
  gap: 5px;
  text-align: right;
}
.world-telemetry span { color: var(--cyan); font: 600 .55rem/1 "Plex Lagoon", monospace; letter-spacing: .12em; text-transform: uppercase; }
.world-telemetry strong { color: var(--dim); font: 400 .56rem/1 "Plex Lagoon", monospace; }
.route-lines { position: absolute; inset: 88px 2% 35px; z-index: 0; width: 96%; height: calc(100% - 123px); overflow: visible; }
.route-lines path { fill: none; stroke-linecap: square; stroke-linejoin: bevel; vector-effect: non-scaling-stroke; }
.route-base { stroke: rgba(111,242,255,.14); stroke-width: 2; }
.route-live { stroke: var(--cyan); stroke-width: 2; stroke-dasharray: .06 .94; stroke-dashoffset: 0; filter: drop-shadow(0 0 6px rgba(0,229,255,.75)); }
.concept-grid { position: absolute; inset: 0; z-index: 2; }
.concept {
  position: absolute;
  width: 22%;
  min-width: 178px;
  min-height: 176px;
  padding: 17px;
  background: rgba(6, 11, 18, .94);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 18px 44px rgba(0,0,0,.28);
  backdrop-filter: blur(10px);
}
.concept.node-1 { left: 2%; top: 43%; }
.concept.node-2 { left: 21%; top: 9%; }
.concept.node-3 { left: 40%; top: 58%; }
.concept.node-4 { right: 20%; top: 17%; }
.concept.node-5 { right: 2%; top: 62%; }
.concept.node-6 { left: 2%; top: 6%; }
.concept.recommended { border-color: rgba(0, 229, 255, .7); background: linear-gradient(145deg, rgba(0, 229, 255, .13), rgba(6, 11, 18, .96)); box-shadow: 0 0 0 1px rgba(0,229,255,.1), 0 0 42px rgba(0,229,255,.12); }
.concept.recommended::before { position: absolute; inset: -5px; content: ""; border: 1px solid rgba(0,229,255,.18); pointer-events: none; }
.concept-top { display: flex; align-items: start; justify-content: space-between; min-height: 40px; margin-bottom: 11px; color: var(--dim); font: 600 .54rem/1.3 "Plex Lagoon", monospace; text-transform: uppercase; }
.concept h3 { max-width: 15ch; font-size: 1rem; line-height: 1.08; text-transform: uppercase; }
.concept p { min-height: 50px; margin-bottom: 13px; color: var(--muted); font-size: .7rem; line-height: 1.4; }
.mastery-dial { position: relative; display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; margin-top: -5px; }
.mastery-dial svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.mastery-dial circle { fill: none; stroke-width: 3; }
.dial-track { stroke: rgba(255,255,255,.08); }
.dial-value { stroke: var(--cyan); stroke-linecap: square; }
.mastery-dial strong { position: relative; color: var(--cyan-soft); font: 600 .62rem/1 "Plex Lagoon", monospace; }
.text-button { padding: 0; color: var(--cyan); background: none; border: 0; font-size: .76rem; font-weight: 650; text-align: left; }
.text-button:hover { color: white; }

.trial textarea { margin: 10px 0 24px; }
.trial-footer { align-items: center; }
.trial-footer ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .78rem; line-height: 1.7; }

.evidence blockquote { margin: 0 0 22px; padding: 22px; color: var(--ink); background: rgba(3, 7, 13, .72); border: 1px solid var(--line); border-radius: 3px; line-height: 1.7; }
.feedback { padding: 20px; margin-bottom: 22px; background: rgba(0,229,255,.06); border: 1px solid rgba(0,229,255,.16); border-radius: 3px; }
.feedback.has-gap { background: rgba(255,200,104,.07); border-color: rgba(255,200,104,.2); }
.human-gate { align-items: center; padding-top: 22px; border-top: 1px solid var(--line); }
.human-gate p, .committed > p { margin: 6px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.committed .button { margin-top: 24px; }

.aside-heading { padding: 25px 25px 20px; border-bottom: 1px solid var(--line); }
.aside-heading h2 { font-size: 1.35rem; }
.tools-block { padding: 20px 25px; border-bottom: 1px solid var(--line); }
.tools-block ul { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; }
.tools-block code { display: inline-block; padding: 6px 8px; color: var(--cyan-soft); background: rgba(0,229,255,.06); border-radius: 2px; font: 400 .62rem/1.2 "Plex Lagoon", monospace; }
.activity-list { display: grid; gap: 0; max-height: 440px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.activity-list li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 16px 25px; border-bottom: 1px solid var(--line); }
.activity-list li.empty { display: block; color: var(--dim); font-size: .76rem; line-height: 1.5; }
.activity-source { align-self: start; padding: 4px 5px; color: var(--muted); background: rgba(255,255,255,.05); border-radius: 2px; font: 600 .54rem/1 "Plex Lagoon", monospace; text-align: center; text-transform: uppercase; }
.activity-source.agent { color: var(--cyan); background: rgba(0,229,255,.07); }
.activity-list strong { display: block; font-size: .74rem; }
.activity-list p { margin: 4px 0; color: var(--muted); font-size: .66rem; line-height: 1.4; }
.activity-list time { color: var(--dim); font: .56rem/1 "Plex Lagoon", monospace; }
.simulator { padding: 18px 25px 24px; color: var(--muted); font-size: .72rem; }
.simulator summary { cursor: pointer; color: var(--ink); font-weight: 650; }
.simulator p { line-height: 1.5; }
#simulator-actions { display: grid; gap: 10px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: 420px; padding: 14px 18px; color: #02070a; background: var(--cyan-soft); border-radius: 2px; box-shadow: var(--shadow); font-weight: 700; }
.toast[data-kind="error"] { background: var(--danger); }

footer { padding: 28px 0 42px; color: var(--dim); border-top: 1px solid var(--line); font-size: .72rem; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .state-card { max-width: 460px; }
  .workspace-grid { grid-template-columns: 1fr; }
  .collaboration { position: static; }
  .activity-list { max-height: 300px; }
  .mission-card strong { font-size: .94rem; }
}

@media (max-width: 760px) {
  .mission-deck { grid-template-columns: 1fr; }
  .mission-card { min-height: 116px; }
  .mission-card strong { max-width: none; }
  .world-visual { min-height: 0; padding: 70px 14px 14px; }
  .world-telemetry { top: 20px; left: 18px; right: auto; text-align: left; }
  .route-lines { display: none; }
  .concept-grid { position: static; display: grid; gap: 12px; }
  .concept, .concept.node-1, .concept.node-2, .concept.node-3, .concept.node-4, .concept.node-5, .concept.node-6 { position: relative; top: auto; right: auto; left: auto; width: 100%; min-width: 0; min-height: 0; }
  .concept p { min-height: 0; }
}

@media (max-width: 680px) {
  .site-header, footer, #workspace { width: min(100% - 24px, 1400px); }
  .site-header { align-items: flex-start; padding: 16px 0; }
  .protocol-state { max-width: 145px; text-align: right; }
  .hero { padding: 70px 0 42px; }
  h1 { font-size: clamp(2.8rem, 15vw, 4.6rem); }
  .panel-heading, .form-row, .trial-footer, .human-gate, footer { align-items: stretch; flex-direction: column; }
  .actions { width: 100%; align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
  .journey-progress { margin-top: -12px; overflow: auto; }
  .journey-progress ol { min-width: 470px; }
  .boundary, .score { align-self: flex-start; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .skip-link, .mission-card, .concept { transition: transform .16s ease, border-color .16s ease, background .16s ease; }
  .mission-card:hover, .concept:hover { transform: translateY(-2px); }
  .panel, .collaboration, .state-card { animation: arrive .34s ease both; }
  .route-live { animation: route-signal 5s linear infinite; }
  .pulse { animation: breathe 2.2s ease-in-out infinite; }
  @keyframes breathe { 50% { opacity: .45; transform: scale(.8); } }
  @keyframes arrive { from { opacity: 0; transform: translateY(10px); } }
  @keyframes route-signal { to { stroke-dashoffset: -1; } }
  ::view-transition-old(root) { animation: scene-out .18s ease both; }
  ::view-transition-new(root) { animation: scene-in .32s ease both; }
  @keyframes scene-out { to { opacity: .3; transform: scale(.996); } }
  @keyframes scene-in { from { opacity: 0; transform: translateY(8px); } }
}
