/* =========================================================
   Hands-On Workshop — shared styles
   Tokens follow the project palette spec (light + dark).
   Every color is driven by a CSS custom property on
   :root + [data-theme="light"] / [data-theme="dark"].
   ========================================================= */

/* Fonts are loaded via parallel <link> + preconnect in each page's <head>
   (not @import here) so they fetch alongside this stylesheet instead of
   after it — avoids a render-blocking round-trip on every navigation. */

/* ===== TOKENS — shared across themes ===== */
:root {
  /* type */
  --font-display: "Inter Tight", "Inter", "Noto Sans TC", "PingFang TC",
                  "微軟正黑體", system-ui, sans-serif;
  --font-body:    "Inter", "Inter Tight", "Noto Sans TC", "PingFang TC",
                  "微軟正黑體", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --font-cjk:     "Noto Sans TC", "PingFang TC", "微軟正黑體", sans-serif;

  /* metrics */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
  --space-5: 20px;  --space-6: 24px;  --space-8: 32px;  --space-10: 40px;
  --space-12: 48px; --space-16: 64px; --space-20: 80px; --space-24: 96px;

  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 140ms;
  --dur-base: 220ms;

  --nav-h: 64px;
  --max-w: 1280px;

  /* always-dark code surface (terminal-style, both themes) */
  --code-bg:        #08071a;
  --code-head-bg:   #11102a;
  --code-border:    #2a2541;
  --code-text:      #ECEAF7;
  --code-text-dim:  #837DA8;
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
  --bg:             #fbf9fc;
  --bg-2:           #f5f0fa;
  --surface:        #ffffff;
  --surface-2:      #ebe4f4;
  --border:         #e0d6ec;
  --border-strong:  #d3c5e6;

  --text:           #1c1530;
  --text-2:         #6b5d85;
  --text-3:         #9690b3;

  --accent:         #7e5be0;
  --accent-deep:    #6a47c8;
  --on-accent:      #ffffff;
  --accent-text:    var(--accent-deep);

  --c-pink:         #e15ba3;
  --c-lavender:     #7e5be0;
  --c-blue:         #2e7adb;

  --highlight:      #2e7adb;
  --success:        #1a8f6e;
  --warn:           #b4761a;
  --danger:         #c63a3a;

  --gradient-text:  linear-gradient(100deg, #e15ba3 0%, #b65bc4 30%, #7e5be0 55%, #2e7adb 100%);
  --gradient-bg:    linear-gradient(135deg, rgba(225,91,163,0.08) 0%, rgba(126,91,224,0.06) 50%, rgba(46,122,219,0.08) 100%);
  --gradient-btn:   linear-gradient(135deg, #e15ba3 0%, #7e5be0 100%);

  --shadow:         0 1px 2px rgba(28,21,48,0.06), 0 14px 40px rgba(28,21,48,0.10);
  --shadow-elevated:0 1px 2px rgba(28,21,48,0.06), 0 22px 60px rgba(28,21,48,0.14);
  --grid-line:      rgba(126,91,224,0.05);

  /* derived */
  --nav-bg:           rgba(251, 249, 252, 0.78);
  --nav-border:       rgba(224, 214, 236, 0.7);
  --surface-hover:    rgba(28, 21, 48, 0.04);
  --surface-active:   rgba(28, 21, 48, 0.07);
  --accent-bg-soft:   rgba(126, 91, 224, 0.06);
  --accent-bg:        rgba(126, 91, 224, 0.10);
  --accent-bg-strong: rgba(126, 91, 224, 0.14);
  --kbd-bg:           rgba(28, 21, 48, 0.05);

  --c-lavender-bg:    rgba(126, 91, 224, 0.07);
  --c-lavender-border:rgba(126, 91, 224, 0.22);
  --c-blue-bg:        rgba(46, 122, 219, 0.07);
  --c-blue-border:    rgba(46, 122, 219, 0.22);
  --c-amber:          #d18e1a;
  --c-amber-bg:       rgba(209, 142, 26, 0.08);
  --c-amber-border:   rgba(209, 142, 26, 0.25);
  --c-pink-bg:        rgba(225, 91, 163, 0.07);
  --c-pink-border:    rgba(225, 91, 163, 0.22);
}

/* ===== DARK THEME ===== */
[data-theme="dark"] {
  --bg:             #0b0a13;
  --bg-2:           #13111d;
  --surface:        #1a1727;
  --surface-2:      #221d35;
  --border:         #2a2541;
  --border-strong:  #3a3357;

  --text:           #ece9f5;
  --text-2:         #9690b3;
  --text-3:         #5f5a7a;

  --accent:         #b69cf5;
  --accent-deep:    #9170e8;
  --on-accent:      #14101f;
  --accent-text:    var(--accent);

  --c-pink:         #f8a5d8;
  --c-lavender:     #b69cf5;
  --c-blue:         #7ab8ff;

  --highlight:      #7ab8ff;
  --success:        #7ee0c5;
  --warn:           #f4c97b;
  --danger:         #f08585;

  --gradient-text:  linear-gradient(100deg, #f8a5d8 0%, #e6a0ea 28%, #b69cf5 55%, #7ab8ff 100%);
  --gradient-bg:    linear-gradient(135deg, rgba(248,165,216,0.12) 0%, rgba(182,156,245,0.10) 50%, rgba(122,184,255,0.12) 100%);
  --gradient-btn:   linear-gradient(135deg, #f8a5d8 0%, #b69cf5 100%);

  --shadow:         0 1px 2px rgba(0,0,0,0.4), 0 18px 50px rgba(0,0,0,0.5);
  --shadow-elevated:0 1px 2px rgba(0,0,0,0.4), 0 30px 80px rgba(0,0,0,0.55);
  --grid-line:      rgba(182,156,245,0.05);

  /* derived */
  --nav-bg:           rgba(11, 10, 19, 0.72);
  --nav-border:       rgba(58, 50, 112, 0.5);
  --surface-hover:    rgba(255, 255, 255, 0.04);
  --surface-active:   rgba(255, 255, 255, 0.07);
  --accent-bg-soft:   rgba(182, 156, 245, 0.06);
  --accent-bg:        rgba(182, 156, 245, 0.10);
  --accent-bg-strong: rgba(182, 156, 245, 0.18);
  --kbd-bg:           rgba(255, 255, 255, 0.06);

  --c-lavender-bg:    rgba(182, 156, 245, 0.10);
  --c-lavender-border:rgba(182, 156, 245, 0.30);
  --c-blue-bg:        rgba(122, 184, 255, 0.08);
  --c-blue-border:    rgba(122, 184, 255, 0.28);
  --c-amber:          #f4c97b;
  --c-amber-bg:       rgba(244, 201, 123, 0.06);
  --c-amber-border:   rgba(244, 201, 123, 0.28);
  --c-pink-bg:        rgba(248, 165, 216, 0.10);
  --c-pink-border:    rgba(248, 165, 216, 0.30);
}

/* Default = dark (matches iQ-Studio reference). Toggle via [data-theme]. */
:root { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }
[data-theme="dark"]  { color-scheme: dark; }

/* ===== KEYFRAMES — cute animations ===== */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes float-tilt {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-10px) rotate(1.5deg); }
}
@keyframes blink {
  0%, 92%, 96%, 100% { transform: scaleY(1); }
  94%                { transform: scaleY(0.1); }
}
@keyframes wobble {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3deg); }
}
@keyframes sparkle-pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.55; }
  50%      { transform: scale(1.15); opacity: 1; }
}
@keyframes sticker-drift {
  0%, 100% { transform: rotate(var(--rot, 0deg)) translateY(0); }
  50%      { transform: rotate(var(--rot, 0deg)) translateY(-8px); }
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  20%, 40%      { transform: rotate(20deg); }
}
@keyframes pop-in {
  0%   { transform: scale(0) rotate(var(--rot, 0deg)); opacity: 0; }
  60%  { transform: scale(1.15) rotate(var(--rot, 0deg)); opacity: 1; }
  100% { transform: scale(1) rotate(var(--rot, 0deg)); opacity: 1; }
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100vh;
  background:
    var(--gradient-bg),
    var(--bg);
  background-attachment: fixed;
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 80%);
  z-index: 0;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ===== TOP NAV ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 var(--space-8);
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--nav-border);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--text);
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient-btn);
  display: grid;
  place-items: center;
  color: var(--on-accent);
  flex-shrink: 0;
  box-shadow: 0 6px 18px var(--accent-bg-strong), inset 0 0 0 1px rgba(255,255,255,0.25);
  transition: transform var(--dur-base) var(--ease-out);
}
.brand-mark svg { width: 22px; height: 22px; overflow: visible; }
.brand-mark .eye {
  transform-origin: center;
  transform-box: fill-box;
  animation: blink 5.5s ease-in-out infinite;
}
.brand-mark .eye-r { animation-delay: 40ms; }
.brand:hover .brand-mark { animation: wobble 0.45s ease-in-out; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text .top { font-size: 14px; font-weight: 700; }
.brand-text .sub {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: var(--space-4);
}
.nav-link {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 8px;
  transition: color var(--dur-fast), background var(--dur-fast);
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--surface-hover); }
.nav-link.active {
  color: var(--text);
  background: var(--accent-bg);
}

.nav-spacer { flex: 1; }

/* Mobile menu (hamburger) — hidden until the ≤720px breakpoint below */
.nav-burger {
  display: none;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: var(--text-2);
  flex-shrink: 0;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.nav-burger:hover { color: var(--text); background: var(--surface-hover); }
.nav-burger svg { width: 20px; height: 20px; }

.mobile-nav-panel {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  z-index: 49;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3);
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: var(--shadow);
}
.mobile-nav-panel a {
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 8px;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.mobile-nav-panel a:hover { color: var(--text); background: var(--surface-hover); }
.mobile-nav-panel a.active { color: var(--text); background: var(--accent-bg); }

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
  width: 260px;
  min-width: 0;
  flex-shrink: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-3);
  font-size: 13px;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.nav-search:hover { border-color: var(--border-strong); }
.nav-search svg { width: 14px; height: 14px; flex-shrink: 0; }
.nav-search .label {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-search .kbd {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  background: var(--kbd-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-2);
}

.nav-icons { display: flex; align-items: center; gap: 2px; }
.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  border-radius: 9px;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.icon-btn:hover { color: var(--text); background: var(--surface-hover); }
.icon-btn svg { width: 16px; height: 16px; }

/* Theme toggle (sun/moon) — same dimensions as icon-btn */
.theme-toggle {
  position: relative;
  width: 60px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.theme-toggle:hover { border-color: var(--border-strong); }
.theme-toggle .thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 22px; height: 22px;
  background: var(--gradient-btn);
  border-radius: 999px;
  display: grid; place-items: center;
  color: var(--on-accent);
  transition: transform var(--dur-base) var(--ease-out);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.theme-toggle .thumb svg { width: 12px; height: 12px; }
.theme-toggle .thumb .icon-sun { display: none; }
.theme-toggle .thumb .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .thumb { transform: translateX(32px); }
[data-theme="light"] .theme-toggle .thumb .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .thumb .icon-moon { display: none; }

/* Language toggle */
.lang-toggle {
  display: flex;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.lang-toggle button {
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  border-radius: 6px;
  letter-spacing: 0.04em;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.lang-toggle button.on {
  color: var(--on-accent);
  background: var(--gradient-btn);
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--on-accent);
  background: var(--gradient-btn);
  border-radius: 10px;
  box-shadow: 0 10px 30px -8px var(--accent-bg-strong), inset 0 0 0 1px rgba(255,255,255,0.25);
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
  white-space: nowrap;
}
.btn-cta:hover { transform: translateY(-1px); box-shadow: 0 14px 36px -8px var(--accent-bg-strong), inset 0 0 0 1px rgba(255,255,255,0.35); }
.btn-cta:active { transform: translateY(0); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-hover);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.btn-ghost:hover { background: var(--surface-active); border-color: var(--accent); }

/* ===== LAYOUT ===== */
.shell {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-8);
}
.shell--narrow { max-width: 980px; }

.page { padding: var(--space-16) 0 var(--space-24); }
.page--with-side {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-12);
  align-items: start;
}

/* ===== EYEBROW + TITLES ===== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gradient-btn);
  box-shadow: 0 0 12px var(--accent-bg-strong);
}

h1.display, h2.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.04;
  margin: var(--space-5) 0 0;
  color: var(--text);
}
h1.display { font-size: clamp(40px, 6vw, 76px); }
h2.display { font-size: clamp(32px, 4.4vw, 56px); }

.grad-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.lead {
  margin: var(--space-6) 0 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 60ch;
  text-wrap: pretty;
}

/* ===== HERO ===== */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-12);
  align-items: center;
  min-height: 540px;
}

/* ===== MASCOT (homepage hero character) ===== */
.mascot-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 440px;
  padding: var(--space-6) var(--space-4);
  overflow: clip;
}
.mascot {
  position: relative;
  width: 100%;
  max-width: 320px;
  animation: float-tilt 5s ease-in-out infinite;
  filter: drop-shadow(0 24px 36px rgba(126,91,224,0.18));
}
[data-theme="dark"] .mascot { filter: drop-shadow(0 24px 36px rgba(0,0,0,0.5)); }
.mascot .eye {
  transform-origin: center;
  transform-box: fill-box;
  animation: blink 6s ease-in-out infinite;
}
.mascot .eye-r { animation-delay: 60ms; }
.mascot .hand {
  transform-origin: 60% 90%;
  transform-box: fill-box;
  animation: wave 3.2s ease-in-out infinite;
  animation-delay: 0.8s;
}

.sticker {
  --rot: 0deg;
  position: absolute;
  padding: 7px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  box-shadow: var(--shadow);
  white-space: nowrap;
  transform: rotate(var(--rot));
  animation: sticker-drift 3.5s ease-in-out infinite;
  z-index: 2;
}
.sticker.accent {
  background: var(--gradient-btn);
  color: var(--on-accent);
  border: 0;
}
.sticker-1 { --rot: -8deg; top: 4%;   left: 2%;    animation-delay: 0.1s; }
.sticker-2 { --rot: 7deg;  top: 32%;  right: 2%;    animation-delay: 0.7s; }
.sticker-3 { --rot: -4deg; bottom: 8%; left: 4%;    animation-delay: 1.2s; }

.sparkle {
  position: absolute;
  color: var(--c-pink);
  animation: sparkle-pulse 2.4s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}
.sparkle svg { display: block; }
.sparkle-1 { top: 18%; right: 12%; color: var(--c-pink);     animation-delay: 0s; }
.sparkle-2 { top: 60%; left: -2%;  color: var(--c-lavender); animation-delay: 0.6s; }
.sparkle-3 { bottom: 4%; right: 8%; color: var(--c-blue);     animation-delay: 1.1s; }
.sparkle-4 { top: 8%;  left: 36%;  color: var(--c-lavender); animation-delay: 1.6s; }

@media (prefers-reduced-motion: reduce) {
  .mascot, .sticker, .sparkle, .brand-mark .eye, .mascot .eye, .mascot .hand,
  .console-head .live::before, .ghost-dots span { animation: none !important; }
}
.hero-cta-row {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--space-8);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.hero-meta::before { content: '•'; color: var(--c-pink); }

/* Hero visual: a "console" panel — always darker than page */
.console {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  color: var(--code-text);
}
.console::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 9px);
}
.console-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--code-text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
.console-head .live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f2a8dc;
}
.console-head .live::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #f2a8dc;
  box-shadow: 0 0 10px #f2a8dc;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

.console-body {
  position: relative;
  min-height: 280px;
  border-radius: var(--radius-md);
  background:
    radial-gradient(600px 200px at 20% 0%, rgba(244,181,226,0.10), transparent 60%),
    radial-gradient(500px 200px at 100% 100%, rgba(156,197,249,0.10), transparent 60%),
    #07061a;
  border: 1px solid #2a2541;
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: 12px;
  color: #B6B1D6;
}
.console-foot {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--code-border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--code-text);
}
.console-foot .pipe { color: #B6A4F4; margin-right: 6px; }
.console-foot .arrow { color: #f2a8dc; margin: 0 6px; }

.tag {
  position: absolute;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(244, 181, 226, 0.12);
  border: 1px solid rgba(244, 181, 226, 0.35);
  color: #f2a8dc;
  border-radius: 5px;
  white-space: nowrap;
}

/* ===== SECTION ===== */
.section { padding: var(--space-20) 0; }
.section-head { margin-bottom: var(--space-12); max-width: 800px; }

/* ===== CARD GRID — "Pick your path" ===== */
.path-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
.path-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur-base), transform var(--dur-base), background var(--dur-base);
  min-height: 220px;
  overflow: hidden;
  color: var(--text);
}
.path-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: var(--gradient-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base);
}
.path-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.path-card:hover::after { opacity: 1; }
.path-card .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.12em;
}
.path-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--text);
}
.path-card p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.55;
  flex: 1;
}
.path-card .go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}
.path-card .go svg { width: 14px; height: 14px; transition: transform var(--dur-fast); }
.path-card:hover .go svg { transform: translateX(3px); }
.path-card .icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--accent-bg);
  border: 1px solid var(--c-pink-border);
  border-radius: 10px;
  color: var(--accent-text);
}
.path-card .icon svg { width: 18px; height: 18px; }

/* ===== TIMELINE / STATUS STRIP ===== */
.status-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}
.status-bar .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}
.status-bar .progress {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.status-bar .progress-fill {
  height: 100%;
  background: var(--gradient-btn);
  border-radius: 999px;
  transition: width var(--dur-base) var(--ease-out);
}

/* ===== SIDEBAR ===== */
.side-nav {
  position: sticky;
  top: calc(var(--nav-h) + var(--space-8));
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: var(--space-4);
  border-right: 1px solid var(--border);
}
.side-nav-head {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 12px;
  margin-bottom: var(--space-3);
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-2);
  border-radius: 8px;
  transition: color var(--dur-fast), background var(--dur-fast);
  border-left: 2px solid transparent;
  margin-left: -2px;
}
.side-nav a:hover { color: var(--text); background: var(--surface-hover); }
.side-nav a.active {
  color: var(--text);
  background: var(--accent-bg-soft);
  border-left-color: var(--accent);
}
.side-nav .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  width: 18px;
}
.side-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-3);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-bg-soft);
  border: 1px solid var(--accent-bg-strong);
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.side-nav-btn:hover { background: var(--accent-bg-strong); }
.side-nav-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ===== TABS (Windows / Ubuntu) ===== */
.tabs {
  display: inline-flex;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  gap: 2px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  border-radius: 7px;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.tab svg { width: 14px; height: 14px; }
.tab:hover { color: var(--text); }
.tab.on {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

/* ===== STEP ===== */
.step {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: var(--space-6);
  padding: var(--space-8) 0;
  border-bottom: 1px dashed var(--border);
}
.step:last-child { border-bottom: 0; }
.step-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  color: transparent;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  letter-spacing: -0.02em;
  line-height: 1;
}
.step-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--text);
}
.step-body .sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-3);
}
.step-body p {
  margin: var(--space-3) 0 0;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
}
.step-body strong { color: var(--text); font-weight: 600; }

.step-help-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-5);
  padding: 5px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--dur-fast), border-color var(--dur-fast), background var(--dur-fast);
}
.step-help-link:hover {
  color: var(--c-amber);
  border-color: var(--c-amber-border);
  background: var(--c-amber-bg);
}
.step-help-link svg { width: 12px; height: 12px; flex-shrink: 0; color: var(--c-amber); }

.step-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-4);
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast);
  user-select: none;
}
.step-checkbox:hover { color: var(--text); background: var(--surface-hover); }
.step-checkbox .box {
  width: 14px; height: 14px;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.step-checkbox .box svg { width: 10px; height: 10px; color: var(--on-accent); opacity: 0; transition: opacity var(--dur-fast); }
.step-checkbox.done .box { background: var(--gradient-btn); border-color: transparent; }
.step-checkbox.done .box svg { opacity: 1; }
.step-checkbox.done {
  color: var(--success);
  border-color: color-mix(in oklab, var(--success) 35%, transparent);
  background: color-mix(in oklab, var(--success) 8%, transparent);
}

.tab-panels { margin-top: var(--space-4); }
.tab-panel { display: none; }
.tab-panel.on { display: block; }

/* ===== VIDEO CARD ===== */
.video-card {
  margin-top: var(--space-8);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  padding: var(--space-6);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 36%),
    linear-gradient(135deg, var(--accent-bg-strong) 0%, rgba(255,255,255,0.02) 100%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.video-card::before {
  content: '';
  position: absolute;
  inset: -20% auto auto -10%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 70%);
  pointer-events: none;
}
.video-card__badge {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: var(--gradient-btn);
  color: var(--on-accent);
  box-shadow: 0 14px 30px -12px var(--accent-bg-strong);
  animation: float-y 3.2s ease-in-out infinite;
}
.video-card__body { min-width: 0; }
.video-card__body h3 {
  margin: 0 0 var(--space-2);
  font-size: clamp(20px, 2.3vw, 26px);
  line-height: 1.2;
}
.video-card__eyebrow {
  display: inline-block;
  margin-bottom: var(--space-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.video-card__body p {
  margin: 0 0 var(--space-4);
  color: var(--text-2);
}
.video-card__hint {
  margin-top: var(--space-3);
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.6;
}
.video-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--accent-text);
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  width: fit-content;
}
.video-card__link:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 16px 34px -14px var(--accent-bg-strong);
}
.video-card__link svg {
  width: 14px;
  height: 14px;
  transition: transform var(--dur-fast) var(--ease-out);
}
.video-card__link:hover svg {
  transform: translateX(3px);
}

/* ===== PREREQ CARD ===== */
.prereq {
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
  padding: var(--space-6);
  margin-top: var(--space-8);
  background:
    linear-gradient(var(--surface), var(--surface)),
    var(--gradient-bg);
  border: 1px solid var(--c-pink-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.prereq .badge-ring {
  width: 46px; height: 46px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--gradient-btn);
  color: var(--on-accent);
}
.prereq .badge-ring svg { width: 22px; height: 22px; }
.prereq .body { flex: 1; min-width: 0; }
.prereq .k {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.prereq h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.015em;
  margin: 4px 0 6px;
  color: var(--text);
}
.prereq p { margin: 0; font-size: 14.5px; color: var(--text-2); line-height: 1.65; }
.link {
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--c-pink-border);
  text-underline-offset: 2px;
  overflow-wrap: break-word;
  transition: text-decoration-color var(--dur-fast);
}
.link:hover { text-decoration-color: var(--accent); }

/* ===== SOFTWARE OVERVIEW TABLE ===== */
.soft-table-wrap {
  margin-top: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.soft-scroll { overflow-x: auto; }
.soft-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14px;
}
.soft-table thead th {
  text-align: left;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.soft-table thead th:nth-child(3),
.soft-table thead th:nth-child(4) { text-align: center; width: 130px; }
.soft-table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}
.soft-table tbody tr:last-child td { border-bottom: 0; }
.soft-table tbody tr:hover td { background: var(--surface-hover); }
.soft-table .tool {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.soft-table td:nth-child(3),
.soft-table td:nth-child(4) { text-align: center; }
.cell-yes {
  display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
}
.cell-yes .check {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: color-mix(in oklab, var(--success) 16%, transparent);
  color: var(--success);
}
.cell-yes .check svg { width: 13px; height: 13px; }
.cell-yes .note {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}
.cell-na {
  display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--text-3);
}
.cell-na .dash {
  width: 22px; height: 2px; border-radius: 2px; background: var(--border-strong);
}
.cell-na .note { font-family: var(--font-mono); font-size: 10px; }
.cell-alt {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
  padding: 4px 10px;
  background: var(--accent-bg);
  border-radius: 999px;
}

/* ===== ORDERED STEP LIST ===== */
.step-list {
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: stepitem;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.step-list > li {
  position: relative;
  padding-left: 34px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
  counter-increment: stepitem;
}
.step-list > li::before {
  content: counter(stepitem);
  position: absolute;
  left: 0; top: 1px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-bg);
  border-radius: 999px;
}
.step-list code, .step-body p code, .step-list a {
  font-family: var(--font-mono);
}
.step-list code {
  font-size: 12.5px;
  padding: 1px 6px;
  background: var(--surface-2);
  border-radius: 4px;
  color: var(--accent-text);
  word-break: break-word;
}
.step-sub-inline {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0;
}

/* ===== SCREENSHOT FIGURES ===== */
/* Reset the browser's default figure margin (normally ~40px left/right) —
   without this, screenshots render narrower than their surrounding card. */
.shot {
  margin: var(--space-4) 0 0;
}
.shot-img {
  width: 100%;
}

/* ===== CODE BLOCK (always-dark terminal style) ===== */
.code {
  position: relative;
  margin-top: var(--space-4);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--code-text-dim);
  background: var(--code-head-bg);
  border-bottom: 1px solid var(--code-border);
  letter-spacing: 0.04em;
}
.code-head .lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.code-head .lang::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: #7ab8ff;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #B6B1D6;
  border-radius: 5px;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.copy-btn:hover { color: var(--code-text); background: rgba(255,255,255,0.06); }
.copy-btn svg { width: 12px; height: 12px; }
.copy-btn.copied { color: #7ee0c5; }

.code pre {
  margin: 0;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--code-text);
  overflow-x: auto;
  white-space: pre;
}
.code pre .c-prompt  { color: #f2a8dc; user-select: none; }
.code pre .c-comment { color: #5A547A; font-style: italic; }
.code pre .c-key     { color: #B6A4F4; }
.code pre .c-str     { color: #7ee0c5; }
.code pre .c-flag    { color: #7ab8ff; }

/* ===== CALLOUT ===== */
.callout {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  margin-top: var(--space-4);
  background: var(--c-lavender-bg);
  border: 1px solid var(--c-lavender-border);
  border-left: 3px solid var(--c-lavender);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}
.callout--warn {
  background: var(--c-amber-bg);
  border-color: var(--c-amber-border);
  border-left-color: var(--c-amber);
}
.callout--info {
  background: var(--c-blue-bg);
  border-color: var(--c-blue-border);
  border-left-color: var(--c-blue);
}
.callout--success {
  background: color-mix(in oklab, var(--success) 10%, transparent);
  border-color: color-mix(in oklab, var(--success) 32%, transparent);
  border-left-color: var(--success);
  color: var(--success);
}
.callout .icon { color: var(--c-lavender); flex-shrink: 0; margin-top: 1px; }
.callout--warn .icon { color: var(--c-amber); }
.callout--info .icon { color: var(--c-blue); }
.callout--success .icon { color: var(--success); }
.callout strong { color: var(--text); font-weight: 600; }
.callout--success strong { color: var(--success); }
.callout code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 1px 6px;
  background: var(--surface-2);
  border-radius: 4px;
  color: var(--accent-text);
}

/* Collapsible success-message callout */
details.callout { display: block; }
details.callout summary {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-weight: 600;
}
details.callout summary::-webkit-details-marker { display: none; }
details.callout summary::marker { content: ''; }
details.callout summary .icon { margin-top: 0; }
details.callout summary .chev {
  margin-left: auto;
  width: 16px; height: 16px;
  flex-shrink: 0;
  transition: transform var(--dur-base) var(--ease-out);
}
details.callout[open] summary .chev { transform: rotate(180deg); }
details.callout[open] summary { margin-bottom: 8px; }
details.callout .success-body {
  padding-left: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
}

/* ===== FAQ(x) ===== */
.faq-list { display: flex; flex-direction: column; gap: 8px; margin-top: var(--space-8); }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--dur-base);
}
.faq-item:hover { border-color: var(--border-strong); }
.faq-item.open { border-color: var(--accent); }
.faq-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  cursor: pointer;
  letter-spacing: -0.005em;
}
.faq-summary .badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin-right: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-lavender);
  background: var(--c-lavender-bg);
  border: 1px solid var(--c-lavender-border);
  border-radius: 4px;
}
.faq-summary .chev {
  width: 18px; height: 18px;
  color: var(--text-3);
  transition: transform var(--dur-base) var(--ease-out);
  flex-shrink: 0;
}
.faq-item.open .chev { transform: rotate(180deg); color: var(--accent-text); }
.faq-body {
  display: none;
  padding: 0 22px 22px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-2);
}
.faq-item.open .faq-body { display: block; }
.faq-item--warn { background: var(--c-amber-bg); border-color: var(--c-amber-border); }
.faq-item--warn:hover { border-color: var(--c-amber); }
.faq-item--warn.open { border-color: var(--c-amber); }
.faq-item--warn .faq-summary { gap: 12px; font-size: 15px; }
.faq-item--warn .faq-summary .icon { display: flex; color: var(--c-amber); flex-shrink: 0; }
.faq-item--warn .faq-summary .label { display: flex; align-items: center; gap: 10px; }
.faq-item--warn .chev { color: var(--c-amber); }
.faq-item--warn.open .chev { color: var(--c-amber); }
.faq-body code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 1px 6px;
  background: var(--surface-2);
  border-radius: 4px;
  color: var(--accent-text);
}
.faq-body strong { color: var(--text); font-weight: 600; }

/* ===== MATERIAL CARD (handouts) ===== */
.mat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-8);
}
.mat-card {
  display: flex;
  gap: var(--space-5);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-base), transform var(--dur-base);
  color: var(--text);
}
.mat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.mat-card .thumb {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  background: var(--gradient-bg);
  border: 1px solid var(--c-pink-border);
  border-radius: 10px;
  color: var(--accent-text);
  flex-shrink: 0;
}
.mat-card .thumb svg { width: 28px; height: 28px; }
.mat-card .meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.mat-card .kind {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.mat-card h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}
.mat-card p { font-size: 13px; color: var(--text-2); margin: 0; }
.mat-card .actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}
.mat-card .mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 5px;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.mat-card .mini:hover { color: var(--text); border-color: var(--border-strong); }

/* ===== FOOTER ===== */
.foot {
  margin-top: var(--space-24);
  padding: var(--space-12) 0 var(--space-16);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.foot-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-8);
  flex-wrap: wrap;
}

/* ===== SEARCH OVERLAY ===== */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
}
.search-overlay.on { display: flex; align-items: flex-start; justify-content: center; padding-top: 10vh; }
.search-panel {
  width: min(640px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
}
.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.search-input-row svg { color: var(--text-3); width: 16px; height: 16px; flex-shrink: 0; }
.search-input-row input {
  flex: 1;
  background: none;
  border: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
}
.search-input-row input::placeholder { color: var(--text-3); }
.search-input-row .esc {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  background: var(--kbd-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-2);
}
.search-results {
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px;
}
.search-result {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.search-result:hover, .search-result.on { background: var(--accent-bg-soft); }
.search-result .r-page {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.search-result .r-title { font-weight: 600; font-size: 14px; color: var(--text); }
.search-result .r-body { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.search-result mark { background: var(--accent-bg-strong); color: var(--text); padding: 0 2px; border-radius: 2px; }
.search-empty {
  padding: 30px 18px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

/* ===== GENERIC MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 5vw;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
}
.modal-overlay.on { display: flex; }
.modal-panel {
  width: min(760px, 100%);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-head h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  margin: 0;
}
.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur-fast);
}
.modal-close:hover { background: var(--surface-hover); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body {
  padding: 20px;
  overflow-y: auto;
}

/* ===== TROUBLESHOOTING FLOW (inside modal-body) ===== */
.flow-summary {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.7;
}
.flow-summary .arrow { margin: 0 4px; color: var(--text-3); }
code.badge {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 1px 6px;
  background: var(--surface-2);
  border-radius: 4px;
  color: var(--accent-text);
}
.flow-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--danger);
  margin: var(--space-6) 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flow-title::before {
  content: '';
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}
.flow { position: relative; padding-left: 40px; }
.flow::before {
  content: '';
  position: absolute;
  left: 13px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--border);
}
.flow-step { position: relative; padding-bottom: 22px; }
.flow-step:last-child { padding-bottom: 0; }
.flow-num {
  position: absolute;
  left: -40px; top: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flow-head {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 28px;
}
.flow-desc {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 8px;
  line-height: 1.6;
}
.term {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--code-text);
  padding: 11px 13px;
  overflow-x: auto;
  white-space: pre;
}
.term .u { color: #4ade80; }
.term .p { color: #4a90e2; }
.term .hl { color: #7ee0c5; }

/* ===== IMAGE GALLERY + LIGHTBOX ===== */
.img-gallery {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-top: var(--space-2);
}
.img-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--accent-text);
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-body);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--accent-text) 40%, transparent);
  text-underline-offset: 3px;
  cursor: zoom-in;
  transition: text-decoration-color var(--dur-fast);
}
.img-link:hover { text-decoration-color: var(--accent-text); }
.img-link svg { width: 14px; height: 14px; flex-shrink: 0; }
.img-link-placeholder {
  color: var(--text-3);
  font-size: 13px;
  font-style: italic;
}

.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  padding: 6vh 6vw;
}
.img-lightbox.on { display: flex; }
.img-lightbox img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
}
.img-lightbox-caption {
  max-width: 640px;
  text-align: center;
  color: var(--code-text);
  font-size: 14.5px;
  line-height: 1.6;
}
.img-lightbox-caption:empty { display: none; }
.img-lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  cursor: pointer;
}
.img-lightbox-close:hover { background: var(--surface-hover); }
.img-lightbox-close svg { width: 18px; height: 18px; }

/* ===== WORKSHOP HISTORY ===== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.history-card {
  padding: var(--space-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.history-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.history-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--gradient-btn);
  border-radius: 999px;
}
.history-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-3);
}
.history-card h2 {
  margin: var(--space-3) 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: -0.01em;
  color: var(--text);
}
.history-desc {
  margin-top: var(--space-3);
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
}
.history-photos { margin-top: var(--space-5); }
.history-photos-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--space-2);
}
.history-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-4);
}
.history-photo { margin: 0; }
.history-photo button {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color var(--dur-fast), transform var(--dur-fast);
}
.history-photo button:hover { border-color: var(--accent); transform: translateY(-2px); }
.history-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.history-photo .cap {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.5;
}
.history-slides { margin-top: var(--space-5); }
.history-slide-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}
.history-slide-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--accent-text);
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast);
}
.history-slide-link:hover {
  border-color: var(--accent);
  background: var(--accent-bg-soft);
  transform: translateY(-1px);
}
.history-slide-link svg { width: 15px; height: 15px; flex-shrink: 0; }

.history-card--ghost {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  background: transparent;
  border: 1.5px dashed var(--border-strong);
  box-shadow: none;
}
.ghost-dots {
  display: flex;
  gap: 9px;
}
.ghost-dots span {
  display: inline-flex;
  width: 15px;
  height: 15px;
  color: var(--c-pink);
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.ghost-dots span svg { width: 100%; height: 100%; display: block; }
.ghost-dots span:nth-child(2) { color: var(--c-lavender); animation-delay: 0.15s; }
.ghost-dots span:nth-child(3) { color: var(--c-blue); animation-delay: 0.3s; }
@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-6px); opacity: 1; }
}
.history-card--ghost .ghost-text {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(17px, 2vw, 20px);
  color: var(--text-2);
}
.history-card--ghost .ghost-sub {
  font-size: 13px;
  color: var(--text-3);
}

/* ===== STEP TUTORIAL VIDEO ===== */
.step-video-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: var(--space-3) 0 0;
  padding: 5px 10px;
  background: color-mix(in oklab, var(--accent-text) 12%, var(--surface-2));
  border: 1px solid color-mix(in oklab, var(--accent-text) 35%, var(--border-strong));
  border-radius: 999px;
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.step-video-link:hover {
  background: color-mix(in oklab, var(--accent-text) 22%, var(--surface-2));
  border-color: var(--accent-text);
}
.step-video-link svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ===== EN/ZH visibility ===== */
[data-lang="en"] .zh-only { display: none !important; }
[data-lang="zh"] .en-only { display: none !important; }

/* ===== AGENDA (homepage bottom) ===== */
.ag-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.ag-meta .chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
}
.ag-meta .chip svg { width: 15px; height: 15px; color: var(--accent-text); flex-shrink: 0; }
.ag-meta .chip b { color: var(--text); font-weight: 600; }

.timeline { margin-top: var(--space-8); position: relative; }
.ag-row {
  display: grid;
  grid-template-columns: 124px 1fr;
  gap: var(--space-6);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--border);
}
.ag-row:last-child { border-bottom: 1px solid var(--border); }
.ag-time {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-text);
  letter-spacing: 0.01em;
  padding-top: 2px;
  white-space: nowrap;
}
.ag-body { min-width: 0; }
.ag-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.ag-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
  text-wrap: pretty;
}
.ag-nums { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.ag-nums li {
  display: flex; gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}
.ag-nums li .n { color: var(--accent-text); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.ag-speaker {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-top: 10px;
}
.ag-speaker .org { font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.ag-speaker .org .en {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.ag-speaker .who {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-2);
}
.ag-speaker .who .name { color: var(--text); font-weight: 600; }
.ag-speaker .who .divider { width: 1px; height: 13px; background: var(--border-strong); }
.ag-speaker .who .role { color: var(--text-3); }
.ag-row.is-break .ag-label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-3);
  letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 8px;
}
.ag-row.is-break .ag-label::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border-strong);
}
.ag-row.is-lab .ag-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--on-accent);
  background: var(--gradient-btn);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
@media (max-width: 720px) {
  .ag-row { grid-template-columns: 1fr; gap: var(--space-2); }
  .ag-time { padding-top: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1180px) {
  .nav-search { width: 200px; }
  .nav-search .kbd { display: none; }
  .nav-icons { display: none; }
  .brand-text .sub { display: none; }
  .nav .btn-cta { display: none; }
}
@media (max-width: 1024px) {
  .nav-search { width: 44px; padding: 7px; }
  .nav-search .label { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .path-grid { grid-template-columns: 1fr; }
  .mat-grid { grid-template-columns: 1fr; }
  .page--with-side { grid-template-columns: 1fr; }
  .side-nav { position: static; border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 var(--space-4); margin-bottom: var(--space-6); flex-direction: row; flex-wrap: wrap; }
  .side-nav-head { width: 100%; }
}
@media (max-width: 720px) {
  .nav { padding: 0 var(--space-4); }
  .shell { padding: 0 var(--space-4); }
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .mobile-nav-panel.on { display: flex; }
  .nav-search { display: none; }
  .lang-toggle button { padding: 4px 8px; }
  .btn-cta { padding: 8px 12px; font-size: 13px; }
  .step { grid-template-columns: 40px minmax(0, 1fr); gap: var(--space-3); }
  .step-num { font-size: 24px; }
  .video-card { grid-template-columns: 1fr; }
  .theme-toggle { display: none; }

  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-panel { width: 100%; max-height: 88vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-body { padding: 16px; }
  .flow { padding-left: 32px; }
  .flow::before { left: 9px; }
  .flow-num { left: -32px; width: 24px; height: 24px; font-size: 12px; }
  .term { font-size: 11.5px; }

  .search-overlay.on { padding-top: 0; align-items: flex-end; }
  .search-panel { width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

  .side-nav-btn { font-size: 12px; }
  .soft-table thead th, .soft-table tbody td { padding: 12px 14px; }
}

@media (max-width: 420px) {
  .brand-text .top { font-size: 14px; }
  .step-num { font-size: 20px; }
  .step { grid-template-columns: 30px minmax(0, 1fr); }
  .lang-toggle button { padding: 3px 6px; font-size: 10px; }
}
