/* ============================================================
   SudoLab — Design System
   Typography : Space Grotesk (display) / Plus Jakarta Sans (body) / JetBrains Mono (code)
   Palette    : Deep teal neutrals + a single cyan accent
   ============================================================ */

:root {
  --bg: #f5fafb;
  --surface: #ffffff;
  --surface-2: #eaf6f8;
  --text: #08343d;
  --text-strong: #04232a;
  --muted: #4e7178;
  --brand: #0fc4dc;
  --brand-strong: #067388;
  --brand-deep: #045766;
  --on-brand: #012227;
  --border: rgba(4, 87, 102, 0.14);
  --border-strong: rgba(4, 87, 102, 0.26);
  --shadow: 0 24px 60px -20px rgba(4, 55, 64, 0.28);
  --shadow-sm: 0 10px 26px -12px rgba(4, 55, 64, 0.22);
  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --max-width: 1240px;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", ui-monospace, monospace;
  --ease: cubic-bezier(.19,1,.22,1);
}

html[data-theme="dark"] {
  --bg: #061417;
  --surface: #0b2328;
  --surface-2: #0f2e34;
  --text: #e3f7fa;
  --text-strong: #f4fdff;
  --muted: #8fb9c0;
  --brand: #35e3f4;
  --brand-strong: #2bc3d6;
  --brand-deep: #8af1fa;
  --on-brand: #012227;
  --border: rgba(138, 241, 250, 0.14);
  --border-strong: rgba(138, 241, 250, 0.26);
  --shadow: 0 28px 70px -20px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 12px 30px -12px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  transition: background .3s ease, color .3s ease;
  position: relative;
  /* clip (not hidden) so the body never becomes a scroll container */
  overflow-x: clip;
}

/* browser surfaces carry the palette too */
html {
  accent-color: var(--brand-strong);
  scrollbar-color: color-mix(in srgb, var(--brand-strong) 40%, transparent) var(--bg);
}

::selection {
  background: color-mix(in srgb, var(--brand) 32%, transparent);
  color: var(--text-strong);
}

input,
textarea {
  caret-color: var(--brand-strong);
}

/* faint fixed backdrop: soft glow + grid — reinforces the "lab" feel without any per-frame repaint cost */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% 6%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 32rem),
    radial-gradient(circle at 4% 70%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 34rem),
    linear-gradient(var(--bg), var(--bg));
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .5;
  background-image:
    linear-gradient(color-mix(in srgb, var(--brand-strong) 6%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--brand-strong) 6%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, black, transparent 78%);
}

a {
  color: inherit;
  text-decoration: none;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text-strong);
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
  transition: top .2s var(--ease);
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px 4vw;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: opacity .2s ease;
}

.brand:hover { opacity: .82; }

.brand img {
  height: 40px;
  width: auto;
  display: block;
  margin-top: 10px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  position: relative;
  padding: 10px 4px;
  margin: 0 10px;
  color: var(--muted);
  font-size: .93rem;
  font-weight: 600;
  transition: color .2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
  transition: right .28s var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-strong);
}

.nav-link:hover::after,
.nav-link.active::after {
  right: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  font: inherit;
  font-size: .84rem;
  font-weight: 700;
  transition: transform .18s var(--ease), border-color .2s ease, background .2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
}

.theme-toggle:active {
  transform: translateY(0) scale(.97);
}

.theme-icon {
  display: inline-grid;
}

.theme-icon svg {
  display: block;
}

/* show the mode you can switch to */
.theme-icon .icon-sun,
html[data-theme="dark"] .theme-icon .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-icon .icon-sun {
  display: block;
}

/* phone menu button: hidden until the nav collapses (see the 680px breakpoint) */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  order: 2;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
}

.nav-toggle .nav-toggle-close,
.nav-toggle[aria-expanded="true"] .nav-toggle-open {
  display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-close {
  display: inline;
}

/* ---------- Hero ---------- */

.hero {
  width: min(var(--max-width), 92vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 5vw, 72px);
  /* sized to its content: a full-height hero left a large empty band above the headline */
  padding: clamp(56px, 9vh, 96px) 0 clamp(64px, 10vh, 112px);
}

.hero-copy {
  max-width: 620px;
}

/* sized so each sentence holds one line at desktop widths */
.hero .hero-copy h1 {
  font-size: clamp(2.4rem, 3.1vw, 3rem);
}

.hero-copy h1 span {
  display: inline-block;
}

.hero h1,
.page-intro h1 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(2.6rem, 4.6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -.04em;
}

.hero h1 span {
  color: var(--brand-strong);
}

.hero-text {
  max-width: 600px;
  margin: 26px 0 36px;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .96rem;
  border: 1px solid transparent;
  transition: transform .16s var(--ease), box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0) scale(.97);
}

.button.primary {
  color: var(--on-brand);
  background: var(--brand);
  box-shadow: var(--shadow-sm);
}

.button.primary:hover {
  background: color-mix(in srgb, var(--brand) 88%, var(--text-strong));
  box-shadow: var(--shadow);
}

/* one visible focus style for every interactive element */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 3px;
  border-radius: 6px;
}

.button.secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}

.button.secondary:hover {
  border-color: var(--brand);
}

/* real screenshot of the interpreter, framed like a window */
.hero-preview {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: rise-in .8s .1s var(--ease) both;
}

.hero-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

/* ---------- Shared section frame ---------- */

.lab-section,
.syllabus-section,
.closing-band,
.page-shell {
  width: min(var(--max-width), 92vw);
  margin: 0 auto;
}

.section-title {
  max-width: 22ch;
  margin: 0 0 40px;
  font-weight: 600;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.03em;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.lab-grid > *,
.team-grid > *,
.lesson-grid > * {
  animation: rise-in .6s var(--ease) both;
}

.lab-grid > *:nth-child(2),
.team-grid > *:nth-child(2),
.lesson-grid > *:nth-child(2) { animation-delay: .08s; }
.lab-grid > *:nth-child(3),
.team-grid > *:nth-child(3),
.lesson-grid > *:nth-child(3) { animation-delay: .16s; }
.lesson-grid > *:nth-child(4) { animation-delay: .24s; }

/* ---------- Home: the lab (asymmetric tiles) ---------- */

.lab-section {
  padding: 40px 0 110px;
}

/* Practice is the main product, so it takes the tall left column */
.lab-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  grid-template-rows: auto auto;
  gap: 20px;
}

.lab-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s ease;
}

.lab-tile:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.lab-tile:active {
  transform: translateY(-1px) scale(.99);
}

.lab-tile h3 {
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -.02em;
}

.lab-tile p {
  max-width: 42ch;
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.7;
}

.tile-link {
  margin-top: auto;
  color: var(--brand-strong);
  font-weight: 700;
  font-size: .95rem;
}

.tile-link span {
  display: inline-block;
  transition: transform .2s var(--ease);
}

.lab-tile:hover .tile-link span {
  transform: translateX(4px);
}

.lab-tile--practice {
  grid-row: span 2;
  min-height: 380px;
  justify-content: flex-end;
  background:
    radial-gradient(circle at 85% 12%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 55%),
    linear-gradient(160deg, var(--surface-2), var(--surface));
}

.tile-code {
  margin: 0 0 auto;
  padding-bottom: 32px;
  overflow-x: auto;
  color: var(--brand-strong);
  font-family: var(--font-mono);
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.8;
}

.lab-tile--practice h3 {
  font-size: clamp(2rem, 3.4vw, 2.8rem);
}

.lab-tile--practice .tile-link {
  margin-top: 0;
}

.lab-tile--build {
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}

/* ---------- Home: syllabus coverage ---------- */

.syllabus-section {
  padding: 0 0 110px;
}

.syllabus-intro {
  max-width: 680px;
}

.syllabus-intro .section-title {
  margin-bottom: 16px;
}

.syllabus-intro p {
  margin: 0 0 40px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.syllabus-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px 28px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.syllabus-group h3 {
  margin: 0 0 14px;
  font-size: 1.02rem;
  font-weight: 600;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.keyword-list li {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 600;
}

/* ---------- Home: closing band ---------- */

.closing-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 72px;
  padding: 16px 16px 16px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.closing-line {
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(.95rem, 1.4vw, 1.1rem);
}

.closing-band .button {
  min-height: 42px;
  padding: 0 18px;
  font-size: .9rem;
}

.closing-line > span:first-child {
  margin-right: 12px;
  color: var(--brand-strong);
}

/* ---------- Cards (team / lessons) ---------- */

.team-grid,
.lesson-grid {
  display: grid;
  gap: 20px;
}

.video-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s ease;
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.video-info h2 {
  margin: 0 0 10px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.video-info p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.cursor {
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ---------- Page shell (interpreter / lessons / team) ---------- */

.page-shell {
  padding: 76px 0 100px;
}

.page-intro {
  max-width: 820px;
  margin-bottom: 48px;
}

.page-intro h1 {
  font-weight: 600;
  font-size: clamp(2.4rem, 4.2vw, 3.6rem);
}

.page-intro > p:last-child {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 680px;
  margin-top: 20px;
}

/* ---------- Contact (team page) ---------- */

.contact-section {
  margin-top: 88px;
}

.contact-section h2 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.03em;
}

.contact-section p {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.contact-section a {
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.contact-section a:hover {
  color: var(--brand-deep);
}

/* ---------- Interpreter embed ---------- */

.embed-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-toolbar {
  min-height: 62px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: .88rem;
}

.local-tip {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: .9rem;
}

.local-tip a {
  margin-left: 6px;
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--brand-strong) 40%, transparent);
  text-underline-offset: 3px;
  white-space: nowrap;
  transition: text-decoration-color .2s ease;
}

.local-tip a:hover {
  text-decoration-color: currentColor;
}

/* ---------- Full screen toggle ---------- */

.fullscreen-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 700;
  transition: transform .18s var(--ease), border-color .2s ease, background .2s ease;
}

.fullscreen-btn:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
}

.fullscreen-btn:active {
  transform: translateY(0) scale(.97);
}

.fullscreen-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.fullscreen-btn .fs-icon-exit { display: none; }
.fullscreen-btn[aria-pressed="true"] .fs-icon-enter { display: none; }
.fullscreen-btn[aria-pressed="true"] .fs-icon-exit { display: block; }

/* Panel while in full screen (native API or CSS fallback) */
.embed-panel:fullscreen,
.embed-panel.is-fullscreen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: 0;
  background: var(--surface);
}

.embed-panel.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  height: 100dvh;
}

.embed-panel:fullscreen .panel-toolbar,
.embed-panel.is-fullscreen .panel-toolbar {
  flex-shrink: 0;
}

.embed-panel:fullscreen .iframe-wrap,
.embed-panel.is-fullscreen .iframe-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

/* the "run it locally" link points at the page below, which full screen hides */
.embed-panel:fullscreen .local-tip,
.embed-panel.is-fullscreen .local-tip,
.embed-panel:fullscreen .overlay-local,
.embed-panel.is-fullscreen .overlay-local {
  display: none;
}

.embed-panel:fullscreen .fullscreen-btn,
.embed-panel.is-fullscreen .fullscreen-btn {
  margin-left: auto;
}

body.fs-lock { overflow: hidden; }

.muted,
.toolbar-hint,
.mini-note {
  color: var(--muted);
  font-size: .84rem;
}

/* fills the screen once scrolled to, leaving room for the nav bar and toolbar */
.iframe-wrap {
  position: relative;
  height: clamp(460px, calc(100dvh - 200px), 860px);
  background: #071114;
  color: #e5fbff;
}

.iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}

.iframe-placeholder,
.iframe-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 30px;
  background:
    linear-gradient(rgba(4, 15, 18, .95), rgba(4, 15, 18, .95)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(53, 227, 244, .08) 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(53, 227, 244, .08) 32px);
  color: #e5fbff;
}

/* ---------- Interpreter loading overlay ---------- */

.iframe-overlay {
  gap: 4px;
  transition: opacity .5s var(--ease), visibility .5s var(--ease);
}

.iframe-overlay[data-hidden] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* skeleton of the editor (code pane + output pane) behind the message */
.overlay-skeleton {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  text-align: left;
}

.sk-pane {
  padding: 56px 28px 28px;
  border-top: 40px solid rgba(255, 255, 255, .025);
}

.sk-pane--out {
  border-left: 1px solid rgba(53, 227, 244, .1);
}

.sk-pane span {
  display: block;
  width: var(--w);
  height: 10px;
  margin: 0 0 15px calc(var(--i, 0) * 28px);
  border-radius: 999px;
  background: rgba(53, 227, 244, .1);
  animation: sk-pulse 1.6s ease-in-out infinite alternate;
}

.sk-pane span:nth-child(odd) {
  animation-delay: .4s;
}

@keyframes sk-pulse {
  from { opacity: .45; }
  to { opacity: 1; }
}

.overlay-message {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  max-width: 460px;
  padding: 28px 32px;
  border: 1px solid rgba(53, 227, 244, .16);
  border-radius: var(--radius-md);
  background: rgba(7, 19, 22, .9);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .7);
}

.overlay-fallback {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 10px;
}

a.overlay-retry {
  display: inline-block;
}

a.overlay-retry[hidden] {
  display: none;
}

.overlay-title {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  color: #f2feff;
  letter-spacing: .01em;
}

.overlay-dots span {
  display: inline-block;
  animation: blink 1.2s steps(1) infinite;
}

.overlay-dots span:nth-child(2) { animation-delay: .2s; }
.overlay-dots span:nth-child(3) { animation-delay: .4s; }

.overlay-hint {
  margin: 6px 0 0;
  max-width: 380px;
  color: #a8c7cc;
  font-size: .88rem;
  line-height: 1.6;
  transition: opacity .3s ease;
}

/* the "run it locally" pointer, set apart from the wait message by a hairline */
.overlay-local {
  max-width: 380px;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(53, 227, 244, .18);
  color: #c8e3e7;
  font-size: .9rem;
  line-height: 1.6;
}

.overlay-local a {
  display: table;
  margin: 12px auto 0;
  padding: 8px 14px;
  border: 1px solid rgba(53, 227, 244, .45);
  border-radius: var(--radius-sm);
  color: #8af1fa;
  font-family: var(--font-mono);
  font-size: .84rem;
  font-weight: 600;
  transition: background .2s ease, border-color .2s ease;
}

.overlay-local a:hover {
  background: rgba(53, 227, 244, .12);
  border-color: #35e3f4;
}

.overlay-local a:active {
  transform: scale(.98);
}

.overlay-retry {
  margin-top: 18px;
  padding: 10px 18px;
  border: 1px solid rgba(53, 227, 244, .35);
  border-radius: var(--radius-sm);
  background: rgba(53, 227, 244, .1);
  color: #8af1fa;
  font-family: var(--font-mono);
  font-size: .84rem;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.overlay-retry:hover {
  background: rgba(53, 227, 244, .18);
  border-color: rgba(53, 227, 244, .5);
}


.placeholder-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border: 1px solid rgba(53, 227, 244, .35);
  border-radius: 18px;
  color: #35e3f4;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
}

.iframe-placeholder h2 {
  margin: 0 0 10px;
  color: #f2feff;
}

.iframe-placeholder p {
  max-width: 560px;
  color: #a8c7cc;
  line-height: 1.7;
}

.iframe-placeholder code,
.edit-note code {
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: .88em;
}

.iframe-placeholder code {
  background: rgba(53, 227, 244, .12);
  color: #8af1fa;
}

.mini-note {
  margin-top: 10px;
  font-family: var(--font-mono);
}

/* ---------- Interpreter page: compact header ---------- */

.page-shell--tool {
  padding-top: 36px;
}

.tool-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px 32px;
  margin-bottom: 24px;
}

.tool-intro h1 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -.035em;
}

.tool-intro p {
  max-width: 62ch;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.tool-intro-link {
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand-strong);
  font-size: .9rem;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color .2s ease, background .2s ease;
}

.tool-intro-link:hover {
  border-color: var(--brand);
  background: var(--surface-2);
}

/* ---------- Interpreter page: quick reference ---------- */

.quick-ref {
  margin-top: 88px;
}

.quick-ref-head h2 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.03em;
}

.quick-ref-head p {
  max-width: 60ch;
  margin: 14px 0 28px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.ref-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ref-tab {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.ref-tab:hover {
  border-color: var(--border-strong);
  color: var(--text-strong);
}

.ref-tab[aria-selected="true"] {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
  color: var(--surface);
}

.ref-panel {
  margin-top: 20px;
}

.ref-panel:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 6px;
  border-radius: var(--radius-md);
}

.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* no card frame: the code boxes are the surface, the grid gap does the grouping */
.ref-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ref-card h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 600;
}

.ref-output {
  margin-top: 14px;
}

.ref-output-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}

.ref-typed {
  margin-left: 4px;
  font-weight: 500;
}

/* same box as the example code, minus the Copy button */
.code-block--output pre {
  padding-right: 18px;
}

/* ---------- Run locally ---------- */

.local-run {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
  margin-top: 96px;
  padding-top: 64px;
  border-top: 1px solid var(--border);
}

.local-run-intro {
  position: sticky;
  top: 112px;
}

.local-run-intro h2 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.03em;
}

.local-run-intro p {
  max-width: 44ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.local-run-intro p.local-run-time {
  margin: 12px 0 28px;
  color: var(--text);
  font-size: .94rem;
  font-weight: 600;
}

/* ---------- OS switch: only the visitor's commands are shown ---------- */

.os-picker {
  margin-bottom: 28px;
}

.os-picker-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
}

.os-picker-options {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}

.os-picker-options button {
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.os-picker-options button:hover {
  color: var(--text-strong);
}

.os-picker-options button[aria-pressed="true"] {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-strong);
  box-shadow: var(--shadow-sm);
}

html[data-os="windows"] [data-os="mac"],
html[data-os="mac"] [data-os="windows"] {
  display: none !important;
}

.run-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: run-step;
}

.run-step {
  position: relative;
  padding: 0 0 44px 64px;
  counter-increment: run-step;
}

/* step number */
.run-step::before {
  content: counter(run-step);
  position: absolute;
  top: -4px;
  left: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand-strong);
  font-family: var(--font-mono);
  font-size: .9rem;
  font-weight: 700;
}

/* rail joining the numbers */
.run-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 40px;
  bottom: 4px;
  left: 18px;
  width: 1px;
  background: var(--border-strong);
}

.run-step:last-child {
  padding-bottom: 0;
}

.run-step h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -.02em;
}

.run-step > p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.65;
}

.run-step > p.step-note {
  margin: 14px 0 0;
  font-size: .94rem;
}

.step-note a,
.step-callout a {
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.run-step > .code-block + p,
.run-step > .code-block + .code-block,
.run-step > .step-link + p {
  margin-top: 14px;
}

/* "do this" instructions, set apart from the explanations around them */
.run-step > p.step-howto {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  line-height: 1.7;
}

/* the one thing not to miss in a step */
.run-step > p.step-callout {
  margin: 14px 0 0;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--brand-strong) 35%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand) 9%, var(--surface));
  color: var(--text);
  line-height: 1.7;
}

.step-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand-strong);
  font-size: .9rem;
  font-weight: 700;
  transition: border-color .2s ease, background .2s ease, transform .15s var(--ease);
}

.step-link:hover {
  border-color: var(--brand);
  background: var(--surface-2);
}

.step-link:active {
  transform: scale(.97);
}

/* an example of what the line looks like, not something to copy */
.code-example {
  border-style: dashed;
  background: transparent;
}

.code-example pre {
  color: var(--muted);
}

.step-extra {
  margin-top: 14px;
}

.step-extra summary {
  width: fit-content;
  color: var(--brand-strong);
  font-weight: 700;
  font-size: .94rem;
  cursor: pointer;
}

.step-extra .code-block {
  margin-top: 12px;
}

.run-after {
  margin: 8px 0 0 64px;
  padding: 18px 22px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}

.run-after h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.run-after p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

/* ---------- FAQ: one question per row, opens in place ---------- */

.run-faq {
  margin: 48px 0 0 64px;
}

.run-faq h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -.02em;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  color: var(--text-strong);
  font-weight: 600;
  line-height: 1.5;
  list-style: none;
  cursor: pointer;
  transition: color .2s ease;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary:hover {
  color: var(--brand-strong);
}

/* plus that turns into a cross when the answer is open */
.faq-item summary::after {
  content: "+";
  flex: none;
  color: var(--brand-strong);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1;
  transition: transform .2s var(--ease);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  margin: 0;
  padding: 0 32px 18px 0;
  color: var(--muted);
  line-height: 1.65;
}

.run-faq code,
.run-faq kbd,
.run-after code {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: .86em;
}

.run-step code:not(pre code),
.run-step kbd {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: .86em;
}

/* code scrolls in column 1; the copy button keeps column 2, so long lines never run under it */
.code-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.code-block pre {
  margin: 0;
  padding: 16px 12px 16px 18px;
  overflow-x: auto;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: .88rem;
  font-weight: 500;
  line-height: 1.7;
  /* thin teal scrollbar for long commands (Firefox, Chrome, Edge) */
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--brand-strong) 45%, transparent) transparent;
}

/* Safari ignores scrollbar-color, so it gets the same look through the WebKit pseudo-elements */
.code-block pre::-webkit-scrollbar {
  height: 8px;
}

.code-block pre::-webkit-scrollbar-track {
  margin: 0 12px;
  background: transparent;
}

.code-block pre::-webkit-scrollbar-thumb {
  border: 2px solid var(--surface-2);
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-strong) 45%, transparent);
}

.code-block pre::-webkit-scrollbar-thumb:hover {
  background: var(--brand-strong);
}

.copy-button {
  align-self: start;
  margin: 10px 10px 0 0;
  min-width: 62px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, transform .16s var(--ease);
}

.copy-button:hover {
  border-color: var(--brand);
  color: var(--text-strong);
}

.copy-button:active {
  transform: scale(.96);
}

.copy-button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.copy-button[data-copied] {
  border-color: var(--brand);
  color: var(--brand-strong);
}

/* ---------- Lessons ---------- */

.lesson-grid {
  grid-template-columns: repeat(2, 1fr);
}

.video-card {
  overflow: hidden;
}

.video-frame {
  aspect-ratio: 16 / 9;
  background: #071114;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-info {
  padding: 24px;
}

.lesson-tag,
.role {
  display: block;
  margin-bottom: 10px;
  color: var(--brand-strong);
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.edit-note {
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  line-height: 1.6;
  font-size: .94rem;
}

/* ---------- Lessons: coming-soon overlay ---------- */

.coming-soon {
  position: relative;
}

/* blur the cards themselves: backdrop-filter is unreliable over cross-origin iframes */
.coming-soon .lesson-grid {
  filter: blur(7px);
  opacity: .55;
  pointer-events: none;
  user-select: none;
}

.coming-soon-overlay {
  position: absolute;
  inset: -12px;
  z-index: 5;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: 0 16px;
}

/* sticky, so the message stays in view while scrolling past the long single-column stack on phones */
.coming-soon-card {
  position: sticky;
  top: 120px;
  margin-top: clamp(48px, 12vw, 170px);
  width: min(460px, 100%);
  padding: 36px 32px 32px;
  text-align: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.coming-soon-card h2 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
  letter-spacing: -.03em;
}

.coming-soon-card p {
  margin: 12px auto 26px;
  max-width: 34ch;
  color: var(--muted);
  line-height: 1.65;
}

/* ---------- Team ---------- */

/* Portrait cards adapted from the Profile_Card design: a full-bleed photo in a
   thin rim, with name, role and bio on a frosted fade at the bottom. */

.team-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.member-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 380px;
  justify-self: center;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  isolation: isolate;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s ease;
}

.member-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

/* square, like the photos, so nothing gets cropped */
.member-media {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--brand) 28%, transparent), transparent 60%),
    linear-gradient(160deg, var(--surface-2), color-mix(in srgb, var(--brand-strong) 18%, var(--surface-2)));
}

/* shown until a photo file exists in assets/img/team/ */
.member-initials {
  position: absolute;
  inset: 0 0 22% 0;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--brand-strong) 55%, transparent);
  font-family: var(--font-display);
  font-size: 4.6rem;
  font-weight: 600;
  letter-spacing: -.04em;
}

.member-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: transform .6s var(--ease);
}

.member-photo[hidden] {
  display: none;
}

@media (hover: hover) {
  .member-card:hover .member-photo {
    transform: scale(1.02);
  }
}

/* sits under the photo and fades up over its bottom edge */
.member-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: -76px;
  padding: 64px 16px 14px;
  border-radius: 0 0 24px 24px;
}

/* frosted fade into the card colour, so text stays readable over any photo */
.member-body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(to bottom,
    transparent 0,
    color-mix(in srgb, var(--surface) 80%, transparent) 40px,
    var(--surface) 76px);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 76px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 76px);
}

.member-body h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.2;
}

.member-body .role {
  margin: 6px 0 0;
}

.member-body p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.5;
}

.member-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
}

.connect-btn,
.follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-strong);
  font-size: .9rem;
  font-weight: 600;
  transition: border-color .2s ease, background .2s ease, transform .15s var(--ease);
}

.connect-btn svg {
  width: 17px;
  height: 17px;
  color: var(--brand-strong);
}

.connect-btn:hover {
  border-color: var(--brand);
  background: var(--surface-2);
}

.connect-btn:active,
.follow-btn:active {
  transform: scale(.97);
}

/* Instagram: the raised pill from the Profile_Card design */
.follow-btn {
  margin-left: auto;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.follow-btn svg {
  width: 17px;
  height: 17px;
  color: var(--text-strong);
}

.follow-btn .plus {
  width: 15px;
  height: 15px;
  color: var(--brand-strong);
}

.follow-btn:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
}

/* no Instagram link yet: shown, but not clickable */
.follow-btn[aria-disabled="true"] {
  opacity: .45;
  box-shadow: none;
  pointer-events: none;
}

@media (max-width: 380px) {
  .member-body {
    padding: 64px 12px 12px;
  }

  .connect-btn,
  .follow-btn {
    padding: 0 14px;
  }

  .member-body h2 {
    font-size: 1.3rem;
  }
}

/* ---------- Footer ---------- */

.footer {
  width: min(var(--max-width), 92vw);
  margin: 0 auto;
  padding: 32px 0 44px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .9rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 600;
}

.footer-brand img {
  border-radius: 8px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
}

.footer-links a {
  color: var(--muted);
  font-weight: 600;
  transition: color .2s ease;
}

.footer-links a:hover {
  color: var(--text-strong);
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: .84rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  .brand {
    margin-right: auto;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 4px;
  }

  .nav-link {
    white-space: nowrap;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 56px;
    min-height: auto;
  }

  .team-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .local-run {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .local-run-intro {
    position: static;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 10px 4vw;
  }

  .theme-label {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  /* links collapse behind the Menu button instead of scrolling off-screen */
  .nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    overflow: visible;
    padding: 6px 0 4px;
  }

  .topbar[data-nav-open] .nav {
    display: flex;
  }

  .nav-link {
    margin: 0;
    padding: 12px 4px;
    border-top: 1px solid var(--border);
    font-size: 1rem;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link.active {
    color: var(--brand-strong);
  }

  .hero {
    padding: 48px 0 64px;
  }

  .hero h1,
  .page-intro h1 {
    font-size: clamp(2.5rem, 12vw, 3.6rem);
  }

  .hero-preview {
    padding: 6px;
    border-radius: var(--radius-md);
  }

  .hero-preview img {
    border-radius: var(--radius-sm);
  }

  .lab-grid,
  .team-grid,
  .lesson-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .lab-tile--practice {
    grid-row: auto;
    min-height: 280px;
  }

  .lab-tile {
    padding: 26px;
  }

  .lab-section,
  .syllabus-section,
  .page-shell {
    padding-bottom: 64px;
  }

  .closing-band {
    margin-bottom: 56px;
    padding: 18px 20px;
  }

  /* title + Full Screen share the first row; the local tip wraps underneath */
  .panel-toolbar {
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 12px 16px;
  }

  .fullscreen-btn {
    padding: 8px 12px;
  }

  .local-tip {
    order: 3;
    width: 100%;
    margin: 0;
  }

  .local-tip a {
    margin-left: 0;
  }

  .iframe-wrap {
    height: clamp(420px, calc(100dvh - 170px), 720px);
  }

  .page-shell--tool {
    padding-top: 28px;
  }

  .tool-intro {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .tool-intro-link {
    justify-self: start;
  }

  .overlay-skeleton {
    grid-template-columns: minmax(0, 1fr);
  }

  .sk-pane--out {
    display: none;
  }

  .overlay-message {
    padding: 22px 20px;
  }

  .quick-ref {
    margin-top: 64px;
  }

  .ref-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .local-run {
    margin-top: 64px;
    padding-top: 48px;
  }

  .run-step {
    padding-left: 52px;
  }

  .run-after,
  .run-faq {
    margin-left: 0;
  }

  .run-step::before {
    width: 34px;
    height: 34px;
  }

  .run-step:not(:last-child)::after {
    left: 16px;
  }
}
