:root {
  --bg: #0b0f17;
  --surface: #121824;
  --surface-2: #1b2336;
  --surface-3: #242f47;
  --line: #1e293b;
  --line-focus: #3b4f6e;
  --text: #edf3f1;
  --muted: #8fa0b5;
  --accent: #5e8ded;
  --accent-2: #84a9f3;
  --accent-glow: rgba(94, 141, 237, 0.2);
  --accent-soft: rgba(94, 141, 237, 0.14);
  --success: #76c5a5;
  --success-glow: rgba(118, 197, 165, 0.2);
  --success-soft: rgba(118, 197, 165, 0.12);
  --warning: #d6a061;
  --warning-glow: rgba(214, 160, 97, 0.2);
  --warning-soft: rgba(214, 160, 97, 0.12);
  --danger: #c9696f;
  --danger-glow: rgba(201, 105, 111, 0.2);
  --danger-soft: rgba(201, 105, 111, 0.12);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  --radius-lg: 10px;
  --radius-md: 7px;
  --radius-sm: 4px;
  --header-h: 76px;
}

/* Light Mode (Toggled via body not having .dark) */
body:not(.dark) {
  --bg: #eef1f4;
  --surface: #fbfcfd;
  --surface-2: #e5eaee;
  --surface-3: #dce4e8;
  --line: #cbd4da;
  --line-focus: #8fa9ad;
  --text: #162631;
  --muted: #687781;
  --accent: #1d52ae;
  --accent-2: #2b66ca;
  --accent-glow: rgba(29, 82, 174, 0.16);
  --accent-soft: rgba(29, 82, 174, 0.08);
  --success: #1d7e67;
  --success-glow: rgba(29, 126, 103, 0.16);
  --success-soft: rgba(29, 126, 103, 0.08);
  --warning: #9c6b2b;
  --warning-glow: rgba(156, 107, 43, 0.16);
  --warning-soft: rgba(156, 107, 43, 0.08);
  --danger: #a64451;
  --danger-glow: rgba(166, 68, 81, 0.16);
  --danger-soft: rgba(166, 68, 81, 0.08);
  --shadow: 0 10px 24px rgba(28, 54, 65, 0.08);
}

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

body {
  margin: 0;
  min-width: 320px;
  background-color: var(--bg);
  color: var(--text);
  font-family:
    "Plus Jakarta Sans",
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  line-height: 1.6;
  transition:
    background-color 200ms ease,
    color 200ms ease;
}

button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.text-mono {
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  border-radius: var(--radius-md);
  background: var(--text);
  color: var(--bg);
  padding: 8px 16px;
  text-decoration: none;
  font-family: "Space Mono", monospace;
  font-size: 0.8rem;
  font-weight: 700;
  transition: transform 150ms ease;
}
.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

/* Site Header */
.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: max(16px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 200ms ease;
}
body.dark .site-header {
  background: rgba(17, 26, 32, 0.92);
}
body:not(.dark) .site-header {
  background: rgba(238, 241, 244, 0.92);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  min-width: 0;
  color: var(--text);
}
.header-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--muted);
  transition: all 150ms ease;
  padding: 0;
}
.icon-button:hover {
  color: var(--text);
  border-color: var(--line-focus);
  background: var(--surface-3);
}

.theme-icon {
  grid-area: 1 / 1;
  width: 16px;
  height: 16px;
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
}

/* Light theme: show moon icon (to switch to dark), hide sun */
body:not(.dark) .theme-icon-sun {
  opacity: 0;
  transform: scale(0.5) rotate(45deg);
}
body:not(.dark) .theme-icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Dark theme: show sun icon (to switch to light), hide moon */
body.dark .theme-icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
body.dark .theme-icon-moon {
  opacity: 0;
  transform: scale(0.5) rotate(-45deg);
}

.sound-icon {
  width: 16px;
  height: 16px;
}
.sound-wave {
  opacity: 0.35;
  transition: opacity 150ms ease;
}
.sound-enabled .sound-wave {
  opacity: 1;
}

/* Hero Section */
.hero {
  padding-block: 48px 24px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 800;
}
h2 {
  margin-bottom: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
}
h3 {
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 750;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: "Space Mono", monospace;
}
.hero-text {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

/* Request Console */
.request-console {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.console-label {
  display: block;
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}
.url-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}
.url-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.secure-icon {
  width: 15px;
  height: 15px;
  color: var(--success);
}
.url-row input {
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 0.88rem;
  width: 100%;
  outline: none;
}
.console-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.control-group label {
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  color: var(--muted);
}
.console-options select {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 0.8rem;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
}
.console-options select:focus {
  border-color: var(--accent);
}

/* Buttons */
.primary-button,
.secondary-button,
.text-button {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 7px;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
  border: 1px solid transparent;
  text-decoration: none;
}
.primary-button {
  background: var(--accent);
  color: var(--bg);
  box-shadow: none;
}
.primary-button:hover {
  background: var(--accent-2);
  box-shadow: none;
}
.secondary-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.secondary-button:hover {
  background: var(--surface-3);
  border-color: var(--line-focus);
}
.secondary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.text-button {
  background: transparent;
  color: var(--muted);
  border: 0;
  padding-inline: 8px;
}
.text-button:hover {
  color: var(--text);
}
.inline-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.15em;
}

/* Layout Grid and Panels */
.section {
  padding-block: 48px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 6px 12px;
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 0.76rem;
  font-weight: 700;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(127, 143, 164, 0.12);
}
.status-pill.is-running .status-dot {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
  animation: pulse-glow 1.2s infinite alternate;
}
.status-pill.is-done .status-dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

@keyframes pulse-glow {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 1;
  }
}

.journey-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 20px;
  align-items: stretch;
}
.visual-panel,
.stage-card,
.quiz-card,
.packet-lab,
.tab-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.visual-panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Network Map Oscilloscope Chassis */
.network-map {
  position: relative;
  height: 400px;
  overflow: hidden;
  background-color: #17252b;
  border-bottom: 1px solid var(--line);
}
body:not(.dark) .network-map {
  background-color: #e8edef;
}

.oscilloscope-hud {
  display: none;
}
.hud-item {
  position: absolute;
}
.pos-top-left {
  top: 8px;
  left: 12px;
}
.pos-top-right {
  top: 8px;
  right: 12px;
}
.pos-bottom-left {
  bottom: 8px;
  left: 12px;
}
.pos-bottom-right {
  bottom: 8px;
  right: 12px;
}

/* SVG Connection Lines */
.connection-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}
.connection-lines path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 200ms ease;
}
body:not(.dark) .connection-lines path {
  stroke: rgba(30, 74, 216, 0.08);
}
.connection-lines #routePath {
  stroke-dasharray: 6 8;
}
.status-pill.is-running ~ .journey-layout #routePath {
  stroke: var(--accent);
  stroke-dasharray: 6 8;
  animation: signal-tracer 25s linear infinite;
}
.connection-lines .return-line {
  stroke-dasharray: 6 8;
  opacity: 0.25;
}
.status-pill.is-running ~ .journey-layout .return-line {
  stroke: var(--success);
  opacity: 1;
  animation: signal-tracer-reverse 20s linear infinite;
}

@keyframes signal-tracer {
  to {
    stroke-dashoffset: -500;
  }
}
@keyframes signal-tracer-reverse {
  to {
    stroke-dashoffset: 500;
  }
}

/* Network Nodes (Hardware style) */
.network-node {
  position: absolute;
  z-index: 3;
  width: 108px;
  height: 84px;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
  transition: all 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: 6px;
}
.network-node:hover {
  transform: translate(-50%, -50%) translateY(-2px);
  border-color: var(--accent);
  box-shadow: none;
}
.network-node.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: none;
}
.network-node.is-complete {
  border-color: var(--success);
}
.node-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  color: var(--muted);
  transition: color 150ms ease;
  margin-bottom: 4px;
}
.network-node:hover .node-icon-wrapper,
.network-node.is-active .node-icon-wrapper {
  color: var(--accent-2);
}
.node-svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}
.node-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text);
}
.node-sub {
  color: var(--muted);
  font-size: 0.6rem;
  text-align: center;
  white-space: nowrap;
}

.node-browser {
  left: 8.5%;
  top: 49%;
}
.node-dns {
  left: 24.5%;
  top: 22%;
}
.node-router {
  left: 40.5%;
  top: 49%;
}
.node-internet {
  left: 56.5%;
  top: 22%;
}
.node-edge {
  left: 72.5%;
  top: 49%;
}
.node-server {
  left: 88.5%;
  top: 22%;
}
.node-data {
  left: 88.5%;
  top: 77%;
}

/* Packet Tracer */
.packet {
  position: absolute;
  z-index: 5;
  left: calc(8.2% - 18px);
  top: calc(49% - 18px);
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 2px solid var(--success);
  border-radius: 50%;
  background: var(--bg);
  color: var(--success);
  box-shadow: none;
  opacity: 0;
  font-size: 0.65rem;
  font-weight: 700;
  pointer-events: none;
  transition: opacity 150ms ease;
}
.packet.is-visible {
  opacity: 1;
}

/* Timeline and dots */
.timeline {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.timeline-track {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface-2);
}
.timeline-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 280ms ease;
}
.stage-buttons {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.stage-dot-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 2px;
  font-size: 0.68rem;
  font-family: "Space Mono", monospace;
  font-weight: 500;
  cursor: pointer;
  transition: color 150ms ease;
}
.stage-dot-button span {
  display: block;
  width: 8px;
  height: 8px;
  margin: 0 auto 6px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  transition: all 150ms ease;
}
.stage-dot-button:hover {
  color: var(--text);
}
.stage-dot-button.is-active {
  color: var(--text);
  font-weight: 700;
}
.stage-dot-button.is-active span {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

/* Stage Diagnostic Card */
.stage-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
}
.stage-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.stage-number {
  color: var(--accent);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.stage-tag {
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  color: var(--accent-2);
  padding: 3px 8px;
  font-size: 0.68rem;
  font-family: "Space Mono", monospace;
  font-weight: 700;
}
.stage-card h3 {
  margin-bottom: 6px;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  font-weight: 750;
}
.stage-summary {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 12px;
}
.stage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.stage-param {
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 8px 12px;
}
.stage-param p {
  margin-bottom: 0;
  font-size: 0.78rem;
  color: var(--text);
  margin-top: 4px;
}
.micro-label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: "Space Mono", monospace;
}
.concept-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 4px 0 16px;
}
.concept-chip {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 3px 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-family: "Space Mono", monospace;
}
.latency-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 0.8rem;
}
.latency-row span {
  color: var(--muted);
}
.latency-row strong {
  color: var(--text);
}
.stage-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

/* Tabs Navigation */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  overflow-x: auto;
}
.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  transition: all 150ms ease;
  white-space: nowrap;
}
.tab:hover {
  color: var(--text);
  background: var(--surface-2);
}
.tab.is-active {
  border-color: var(--line-focus);
  background: var(--accent-soft);
  color: var(--accent-2);
}
.tab-panel {
  padding: 24px;
}

.explainer-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 32px;
  align-items: start;
}
.panel-kicker {
  margin-bottom: 4px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: "Space Mono", monospace;
}
.explainer-copy h3 {
  margin-bottom: 6px;
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.explainer-copy p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* DNS Simulator */
.dns-simulator {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lookup-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: all 180ms ease;
}
.step-num {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  border: 1px solid var(--line);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}
.lookup-row strong {
  font-size: 0.84rem;
  display: block;
  color: var(--text);
}
.lookup-row small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}
.status-indicator {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  text-transform: uppercase;
  text-align: center;
  min-width: 86px;
}
.status-indicator.waiting {
  color: var(--muted);
  background: var(--surface-2);
}
.status-indicator.querying {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: rgba(255, 159, 28, 0.2);
  box-shadow: 0 0 8px var(--warning-glow);
}
.status-indicator.done {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(0, 229, 153, 0.2);
}
.lookup-row.is-active {
  border-color: var(--warning);
  background: rgba(255, 159, 28, 0.04);
}
.lookup-row.is-complete {
  border-color: var(--success-glow);
}
.lookup-result {
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--success);
  padding: 10px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
}

/* Handshake / Connection */
.telemetry-display {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
}
.handshake-diagram {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 230px;
}
.handshake-row {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  align-items: center;
  gap: 12px;
  opacity: 0.2;
  transition: all 180ms ease;
}
.handshake-row.is-active {
  opacity: 1;
  transform: translateY(0);
}
.handshake-endpoint {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  padding: 6px;
  text-align: center;
  font-size: 0.72rem;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  color: var(--text);
}
.handshake-arrow {
  position: relative;
  text-align: center;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-family: "Space Mono", monospace;
  font-weight: 700;
}
.handshake-arrow::after {
  content: "";
  display: block;
  height: 1px;
  background: currentColor;
  margin-top: 4px;
}
.handshake-arrow.left {
  color: var(--success);
}

.choice-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 0;
  padding: 0;
  margin-bottom: 16px;
}
.choice {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 150ms ease;
}
.choice:hover {
  border-color: var(--line-focus);
  background: var(--surface-2);
}
.choice input[type="radio"] {
  accent-color: var(--accent);
  margin: 0;
}
.choice span {
  font-family: "Space Mono", monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

/* HTTP Code Windows */
.http-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}
.code-window {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.code-title {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
  background: var(--surface-2);
}
.code-title h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}
.code-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.code-dot.response {
  background: var(--success);
}
pre {
  margin: 0;
  overflow: auto;
  padding: 14px;
}
pre code {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text);
  font-family: "Space Mono", monospace !important;
}
.code-method {
  color: var(--accent-2);
  font-weight: 700;
}
.code-status {
  font-weight: 700;
}
.code-status.status-200 {
  color: var(--success);
}
.code-status.status-301 {
  color: var(--warning);
}
.code-status.status-404,
.code-status.status-500 {
  color: var(--danger);
}

.exchange-arrow-wrapper {
  color: var(--accent);
  display: flex;
  justify-content: center;
}
.exchange-svg {
  width: 22px;
  height: 22px;
}

.http-controls {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.http-controls .control-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.http-controls label {
  font-family: "Space Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}
.http-controls select {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 0.8rem;
  padding: 6px 12px;
  outline: none;
  cursor: pointer;
}
.http-controls select:focus {
  border-color: var(--accent);
}

/* Rendering Pipeline & Mini Browser */
.render-pipeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr;
  gap: 6px;
  align-items: center;
  margin-block: 20px;
}
.render-step {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 8px 6px;
  text-align: center;
  opacity: 0.35;
  transition: all 180ms ease;
}
.render-step.is-active {
  opacity: 1;
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: none;
}
.render-step span {
  display: block;
  font-weight: 700;
  font-size: 0.76rem;
  color: var(--text);
}
.render-step small {
  color: var(--muted);
  font-size: 0.65rem;
  display: block;
  margin-top: 2px;
}
.pipeline-connector {
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 0.8rem;
}

.mini-browser {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: none;
}
.mini-browser-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 8px 14px;
}
.window-dots {
  display: flex;
  gap: 5px;
}
.window-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}
.mini-browser-bar span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.75rem;
}
.mini-browser-page {
  min-height: 170px;
  padding: 18px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.skeleton {
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  transition: all 300ms ease;
}
.skeleton.title {
  width: 44%;
  height: 18px;
}
.skeleton.text {
  width: 90%;
  height: 10px;
}
.skeleton.text.short {
  width: 62%;
}
.skeleton.cards {
  height: 48px;
}
.mini-browser.is-built .skeleton.title {
  background: var(--accent);
}
.mini-browser.is-built .skeleton.text {
  background: var(--text);
  opacity: 0.25;
}
.mini-browser.is-built .skeleton.cards {
  background: var(--accent-soft);
  border: 1px dashed rgba(46, 98, 255, 0.25);
}

/* Packet Lab */
.packet-lab {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 32px;
  padding: 24px;
}
.packet-copy p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.packet-control-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
}
.packet-control-box input[type="range"] {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--accent);
}
.packet-display {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.packet-pieces {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 130px;
  align-content: flex-start;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 14px;
  border: 1px solid var(--line);
}
.packet-piece {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 46px;
  border: 1px solid rgba(46, 98, 255, 0.25);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 0.65rem;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  line-height: 1.25;
  animation: packet-in 200ms both;
}
@keyframes packet-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(4px);
  }
}
.router-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 8px 12px;
  font-size: 0.72rem;
}
.router-node {
  color: var(--text);
  font-weight: 700;
}
.router-arrow {
  color: var(--muted);
}

/* Quiz */
.quiz-card {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 32px;
  padding: 24px;
}
.quiz-intro p {
  color: var(--muted);
  font-size: 0.9rem;
}
.quiz-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.quiz-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: start;
}
.quiz-choice {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.78rem;
  transition: all 150ms ease;
}
.quiz-choice:hover {
  border-color: var(--line-focus);
  background: var(--surface-3);
}
.quiz-choice.is-selected {
  border-color: rgba(0, 229, 153, 0.25);
  background: var(--success-soft);
  color: var(--success);
  cursor: not-allowed;
}
.quiz-choice.is-wrong {
  animation: shake-err 300ms;
  border-color: rgba(255, 77, 106, 0.25);
  background: var(--danger-soft);
  color: var(--danger);
}
@keyframes shake-err {
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}
.quiz-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.quiz-footer p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text);
}

/* Footer */
.site-footer {
  padding-block: 24px 36px;
  border-top: 1px solid var(--line);
}

/* CSO Digital Library integration overrides */
.logo-container {
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.brand .logo-container {
  width: 44px;
  height: 44px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.14);
}
.brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.brand span {
  display: grid;
  line-height: 1.05;
}
.brand strong {
  font-size: 1rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}
.library-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 700;
  transition:
    border-color 150ms ease,
    color 150ms ease,
    background 150ms ease;
}
.library-back:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--surface-2);
}
.library-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.library-footer a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}
.library-footer a:hover {
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 980px) {
  .hero,
  .journey-layout,
  .quiz-card {
    grid-template-columns: 1fr;
  }
  .hero {
    align-items: start;
  }
  .network-map {
    height: 420px;
  }
  .explainer-grid,
  .packet-lab {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 1180px);
  }
  .site-header {
    padding-inline: 12px;
  }
  .brand span {
    display: none;
  }
  .hero {
    padding-top: 24px;
    gap: 20px;
  }
  .url-row {
    grid-template-columns: auto 1fr;
  }
  .url-row .primary-button {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 4px;
  }

  .network-map {
    height: 500px;
  }
  .connection-lines {
    display: none;
  }
  .network-node {
    width: 104px;
    height: 76px;
  }

  /* Vertical schematic stacking for mobile screens */
  .node-browser {
    left: 24%;
    top: 12%;
  }
  .node-dns {
    left: 76%;
    top: 12%;
  }
  .node-router {
    left: 24%;
    top: 34%;
  }
  .node-internet {
    left: 76%;
    top: 34%;
  }
  .node-edge {
    left: 24%;
    top: 56%;
  }
  .node-server {
    left: 76%;
    top: 56%;
  }
  .node-data {
    left: 50%;
    top: 80%;
  }

  .packet {
    display: none;
  }
  .stage-buttons {
    grid-template-columns: repeat(4, 1fr);
  }

  .http-grid {
    grid-template-columns: 1fr;
  }
  .exchange-arrow-wrapper {
    transform: rotate(90deg);
    padding-block: 6px;
  }

  .render-pipeline {
    grid-template-columns: 1fr;
  }
  .pipeline-connector {
    transform: rotate(90deg);
    text-align: center;
    display: block;
    margin-block: 2px;
  }

  .quiz-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .library-back {
    display: none;
  }
  .library-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .section {
    padding-block: 32px;
  }
  .request-console,
  .tab-panel,
  .packet-lab,
  .quiz-card,
  .stage-card {
    padding: 16px;
  }
  .console-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .stage-grid {
    grid-template-columns: 1fr;
  }
  .lookup-row {
    grid-template-columns: 24px 1fr;
  }
  .status-indicator {
    grid-column: 2;
    margin-top: 4px;
    width: 100%;
    text-align: left;
  }
  .router-strip {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .status-pill.is-running ~ .journey-layout #routePath,
  .status-pill.is-running ~ .journey-layout .return-line {
    animation: none !important;
  }
}
