/* ==========================================================================
   铭砚数码 · AI 制作学院 V12
   Cinematic Blue-Tech Web Academy (Zero PPT Feel · Frosted Glass · Blue Flow)
   ========================================================================== */

:root {
  color-scheme: dark;
  --ground: #030712;
  --ground-2: #060e1e;
  --glass: rgba(11, 24, 48, 0.44);
  --glass-strong: rgba(8, 19, 38, 0.72);
  --glass-border: rgba(110, 186, 255, 0.22);
  --glass-specular: rgba(210, 238, 255, 0.18);

  --ink: #f4f8ff;
  --ink-soft: #bfd0e6;
  --muted: #7e96b5;
  --subtle: #556c8a;

  --blue: #5cb6ff;
  --cyan: #8ce4ff;
  --blue-deep: #2468e5;
  --accent: #6ec6ff;

  --top-h: 66px;
  --bottom-h: 56px;
  --sidebar-w: 272px;
  --ease: cubic-bezier(0.2, 0.72, 0.25, 1);
}

[data-theme="gold"] {
  --accent: #d6b58b;
  --blue: #d6b58b;
  --cyan: #f0d7b4;
  --glass-border: rgba(214, 181, 139, 0.26);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top-h) + 18px);
  background: var(--ground);
}
body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  background: var(--ground);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.82;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[hidden] { display: none !important; }
h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
img, video { max-width: 100%; display: block; }
a { color: var(--ink-soft); text-decoration: none; transition: color 0.18s; }
a:hover { color: #fff; }
a, button, select, summary { -webkit-tap-highlight-color: transparent; }
button, select, input { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 1.5px solid var(--cyan);
  outline-offset: 3px;
}

/* Fixed Mingyan Tech-Line Canvas (Topography / GridScan) */
#bg-silk {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.95;
}

/* Subtle Atmospheric Blue Backdrop underneath the vertical light streams */
.page-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 75% 20%, rgba(28, 92, 188, 0.14), transparent 68%),
    url('media/bg-tech-horizon.webp') center / cover no-repeat;
  opacity: 0.18;
  filter: saturate(1.1);
}

#top, #home, #reader-shell, #bottom { position: relative; z-index: 2; }

/* ==========================================================================
   Signature Frosted Glass + Subtle Blue Flowing Border Shimmer (蓝色流光)
   ========================================================================== */
@property --flow-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.glass-flow {
  position: relative;
  isolation: isolate;
  background: linear-gradient(145deg, rgba(215, 235, 255, 0.14), rgba(22, 38, 66, 0.56) 52%, rgba(12, 22, 42, 0.72));
  border: 1px solid rgba(182, 222, 255, 0.28);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 1px 0 0 rgba(210, 236, 255, 0.14),
    0 16px 38px rgba(0, 6, 20, 0.52);
  -webkit-backdrop-filter: blur(24px) saturate(1.55) brightness(1.08);
  backdrop-filter: blur(24px) saturate(1.55) brightness(1.08);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.22s var(--ease), border-color 0.28s, box-shadow 0.3s;
}

.glass-flow:hover {
  border-color: rgba(188, 232, 255, 0.58);
  box-shadow:
    0 12px 38px rgba(105, 200, 255, 0.30),
    0 0 22px rgba(180, 236, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.glass-flow::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle 280px at var(--mx, 50%) var(--my, 20%), rgba(220, 242, 255, 0.16), transparent 70%);
  opacity: 0;
  transition: opacity 0.24s;
}
.glass-flow:hover::before { opacity: 1; }

/* Razor-thin rotating perimeter edge-light (slowly orbits at rest, illuminates on hover) */
.glass-flow::after,
.slide::after,
.ae-code::after,
.media::after,
.cover-visual::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.2px;
  pointer-events: none;
  background: conic-gradient(
    from var(--flow-angle),
    transparent 0deg,
    rgba(110, 204, 255, 0.72) 22deg,
    rgba(240, 250, 255, 0.98) 44deg,
    rgba(110, 204, 255, 0.65) 66deg,
    transparent 118deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.52;
  animation: blue-flow 10s linear infinite;
  transition: opacity 0.28s;
}

.glass-flow:nth-child(even)::after,
.slide:nth-child(even)::after,
.media:nth-child(even)::after {
  animation-direction: reverse;
  animation-duration: 12s;
}

.glass-flow:hover::after,
.slide:hover::after,
.ae-code:hover::after,
.media:hover::after,
.cover-visual:hover::after {
  opacity: 1;
}

@keyframes blue-flow {
  to { --flow-angle: 360deg; }
}

/* ==========================================================================
   Top Bar — Clean Frosted Glass Nav
   ========================================================================== */
#top {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 11px clamp(20px, 4vw, 56px);
  background: rgba(4, 10, 22, 0.62);
  border-bottom: 1px solid rgba(116, 186, 255, 0.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  white-space: nowrap;
}
.wordmark-logo { height: 26px; width: auto; object-fit: contain; filter: url(#logoWhite); }
.wordmark-text {
  display: flex; flex-direction: column; line-height: 1.1;
  font-size: 13.5px; font-weight: 600; letter-spacing: 0.14em;
}
.wordmark-text span {
  font-size: 9px; font-weight: 450; letter-spacing: 0.22em;
  color: var(--muted); margin-top: 3px;
}

.nav-center { margin-inline: auto; display: flex; align-items: center; gap: 36px; }
.nav-link {
  font-size: 13.5px; color: var(--ink-soft); background: none; border: 0;
  padding: 6px 2px; cursor: pointer; letter-spacing: 0.05em; transition: color 0.18s;
}
.nav-link:hover { color: var(--cyan); }

.top-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
body:has(#home:not([hidden])) .top-right { margin-left: 0; }

.theme-switch {
  display: inline-flex; align-items: center; padding: 3px; border-radius: 999px;
  border: 1px solid rgba(120, 190, 255, 0.2); background: rgba(12, 26, 52, 0.45);
  backdrop-filter: blur(12px);
}
.theme-switch button {
  border: 0; background: transparent; color: var(--muted); font-size: 12px;
  padding: 4px 11px; border-radius: 999px; cursor: pointer; transition: background 0.2s, color 0.2s;
}
.theme-switch button.active { background: var(--accent); color: #040b18; font-weight: 620; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 5px 15px; border-radius: 999px;
  border: 1px solid rgba(120, 190, 255, 0.22);
  background: rgba(14, 30, 60, 0.45);
  backdrop-filter: blur(14px);
  color: var(--ink-soft); font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.18s;
}
.btn:hover:not(:disabled) {
  border-color: rgba(140, 212, 255, 0.58);
  background: rgba(26, 56, 108, 0.62);
  color: #fff;
  box-shadow: 0 0 20px rgba(72, 168, 255, 0.22);
}
.btn:disabled { opacity: 0.28; cursor: not-allowed; }
.btn[aria-pressed="true"] {
  border-color: var(--cyan); color: #fff; background: rgba(46, 118, 224, 0.48);
}

/* Frosted Ice-Blue Glass CTA (Replaces harsh flat white buttons!) */
.btn-glass-primary {
  position: relative;
  border: 1px solid rgba(164, 224, 255, 0.52);
  background: linear-gradient(135deg, rgba(164, 222, 255, 0.28), rgba(68, 148, 255, 0.24));
  color: #ffffff;
  font-weight: 600;
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 0 28px rgba(78, 174, 255, 0.28);
}
.btn-glass-primary:hover:not(:disabled) {
  border-color: rgba(210, 242, 255, 0.85);
  background: linear-gradient(135deg, rgba(186, 232, 255, 0.38), rgba(78, 162, 255, 0.34));
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 0 38px rgba(102, 198, 255, 0.42);
}

.selectors { display: flex; align-items: center; gap: 8px; min-width: 0; }
.selectors select {
  min-height: 34px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid rgba(120, 190, 255, 0.22); background: rgba(8, 18, 36, 0.82);
  color: var(--ink); font-size: 12.5px; cursor: pointer; min-width: 0;
}
#chapter { width: clamp(130px, 15vw, 210px); }
#jump { width: clamp(130px, 16vw, 225px); }

#progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 0;
  background: linear-gradient(90deg, #2563eb, #60c5ff, #b8eeff);
  box-shadow: 0 0 12px rgba(96, 197, 255, 0.7);
  transition: width 0.22s var(--ease);
}

/* ==========================================================================
   Hero — Full-Bleed Perspective Sci-Fi Artwork + Bottom 4-Pillar Strip
   ========================================================================== */
.wrap {
  width: min(1280px, calc(100% - clamp(44px, 8vw, 130px)));
  margin-inline: auto;
}

.hero {
  position: relative;
  min-height: calc(100svh - var(--top-h));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-bottom: 1px solid rgba(116, 186, 255, 0.14);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(3, 7, 18, 0.92) 0%, rgba(3, 7, 18, 0.68) 40%, rgba(3, 7, 18, 0.16) 72%, rgba(3, 7, 18, 0.34) 100%),
    linear-gradient(180deg, rgba(3, 7, 18, 0.35) 0%, transparent 25%, transparent 72%, rgba(3, 7, 18, 0.96) 100%),
    url('media/hero-tech-portal.webp') right center / cover no-repeat;
  transform: scale(1.02);
}

.hero-main {
  flex: 1;
  display: flex;
  align-items: center;
  padding-block: clamp(72px, 11vh, 130px) clamp(48px, 7vh, 80px);
}

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

.hero-pill {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 11px; font-weight: 550; letter-spacing: 0.18em; color: var(--ink-soft);
  padding: 6px 15px; border-radius: 999px;
  border: 1px solid rgba(124, 198, 255, 0.25);
  background: rgba(10, 24, 48, 0.55);
  backdrop-filter: blur(14px);
}
.hero-pill i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
}

.hero h1 {
  margin-top: 26px;
  font-size: clamp(46px, 5.4vw, 80px);
  font-weight: 760;
  line-height: 1.06;
  letter-spacing: -0.025em;
  background: linear-gradient(180deg, #ffffff 35%, #a8d4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin-top: 22px;
  font-size: clamp(19px, 1.8vw, 26px);
  font-weight: 540;
  color: #eef5ff;
}

.hero-desc {
  margin-top: 14px;
  max-width: 31em;
  font-size: 14.5px;
  line-height: 1.88;
  color: var(--ink-soft);
}

.hero-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 22px; margin-top: 38px;
}
.hero-actions .btn-glass-primary { min-height: 46px; padding: 0 28px; font-size: 14.5px; }
.hero-text-link {
  font-size: 13.5px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px;
}
.hero-text-link:hover { color: var(--cyan); }

.resume-inline {
  margin-top: 24px; font-size: 12.5px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.resume-inline button {
  background: none; border: 0; color: var(--cyan); cursor: pointer;
  padding: 0; font-size: 12.5px; text-decoration: underline; text-underline-offset: 4px;
}

/* Bottom 4-Pillar Bar (Matches Reference Screenshot Footer Strip) */
.hero-pillars {
  border-top: 1px solid rgba(120, 190, 255, 0.12);
  background: rgba(4, 11, 24, 0.48);
  backdrop-filter: blur(18px);
}
.hero-pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.pillar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 14px;
  background: transparent;
  border: 0;
  border-right: 1px solid rgba(120, 190, 255, 0.08);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.pillar-btn:last-child { border-right: 0; }
.pillar-btn:hover { color: #fff; background: rgba(96, 178, 255, 0.08); }
.pillar-btn span { font: 600 11px/1 Consolas, monospace; color: var(--blue); }

/* ==========================================================================
   Spacious Home Sections (Scaled Back, Airy, Frosted Glass with Blue Flow)
   ========================================================================== */
.path-section {
  padding-block: 112px 64px;
}
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 44px; flex-wrap: wrap;
}
.section-head .kicker {
  display: block; font-size: 11px; letter-spacing: 0.22em; color: var(--blue); margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(22px, 2.2vw, 32px); font-weight: 640; }
.section-head p { font-size: 13.5px; color: var(--muted); }

.stage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.stage-item {
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.24s var(--ease);
}
.stage-item:hover { transform: translateY(-3px); }
.stage-tag { font: 600 11px/1 Consolas, monospace; letter-spacing: 0.14em; color: var(--cyan); }
.stage-item h3 { font-size: 15.5px; font-weight: 620; color: #fff; }
.stage-item p { font-size: 13px; line-height: 1.78; color: var(--ink-soft); }
.stage-meta { margin-top: auto; padding-top: 10px; font-size: 11.5px; color: var(--muted); }

/* 9-Chapter Catalogue — Generous Spacing & Slightly Scaled Down Cards */
.catalogue-section {
  padding-block: 64px 128px;
}
#cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px;
}

.course-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}
.course-card:hover {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-5px);
  box-shadow: 0 24px 50px rgba(0, 8, 26, 0.68), 0 0 34px rgba(110, 200, 255, 0.22);
}
.course-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background: rgba(6, 14, 30, 0.82);
  border-bottom: 1px solid rgba(180, 220, 255, 0.22);
}
.course-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s var(--ease), filter 0.3s;
}
.course-card:hover .course-thumb img { transform: scale(1.04); filter: brightness(1.05); }
.card-arrow {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(14, 26, 46, 0.65);
  backdrop-filter: blur(10px);
  color: #f4f8ff;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.24s var(--ease), background 0.24s;
}
.course-card:hover .card-arrow {
  transform: translate(2px, -2px);
  background: rgba(34, 78, 138, 0.85);
}
.course-num {
  position: absolute; top: 12px; left: 12px;
  font: 600 11px/1 Consolas, monospace; letter-spacing: 0.1em;
  padding: 5px 9px; border-radius: 999px;
  background: rgba(6, 16, 36, 0.68);
  border: 1px solid rgba(132, 206, 255, 0.34);
  backdrop-filter: blur(10px);
  color: var(--cyan);
}
.course-body {
  padding: 22px 24px 24px;
  display: flex; flex-direction: column; gap: 8px; flex: 1;
}
.course-body h3 { font-size: 15.5px; font-weight: 620; line-height: 1.48; color: #fff; }
.course-body p {
  font-size: 12.8px; line-height: 1.75; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.course-meta {
  margin-top: auto; padding-top: 12px;
  display: flex; justify-content: space-between; font-size: 12px; color: var(--muted);
}
.course-card:hover .course-meta span:last-child { color: var(--cyan); }

.home-footer {
  padding-block: 34px 48px;
  border-top: 1px solid rgba(116, 186, 255, 0.12);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 12px; color: var(--subtle);
}

/* ==========================================================================
   Reader Shell — Modern Editorial Web Course (NOT a Stacked PowerPoint!)
   ========================================================================== */
#reader-shell {
  display: flex;
  min-height: calc(100svh - var(--top-h));
}

#sidebar {
  position: sticky; top: var(--top-h); height: calc(100svh - var(--top-h));
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  display: flex; flex-direction: column;
  background: rgba(5, 13, 28, 0.72);
  border-right: 1px solid rgba(116, 186, 255, 0.14);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
  z-index: 25;
  transition: margin-left 0.25s var(--ease), transform 0.25s var(--ease);
}
body.sidebar-collapsed #sidebar { margin-left: calc(var(--sidebar-w) * -1); }

.sidebar-head {
  padding: 16px 18px; border-bottom: 1px solid rgba(116, 186, 255, 0.12);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-head strong { font-size: 11px; letter-spacing: 0.16em; color: var(--blue); }
.sidebar-list {
  flex: 1; overflow-y: auto; padding: 12px 10px 80px;
  scrollbar-width: thin; scrollbar-color: rgba(116, 186, 255, 0.22) transparent;
}
.sb-chapter { margin-bottom: 6px; }
.sb-chapter-btn {
  width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px;
  border: 0; background: transparent; color: var(--ink-soft); font-size: 13px;
  font-weight: 560; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.sb-chapter-btn:hover { background: rgba(96, 178, 255, 0.08); color: #fff; }
.sb-chapter.active > .sb-chapter-btn { color: #fff; background: rgba(96, 178, 255, 0.12); }
.sb-num { font: 600 11px/1 Consolas, monospace; color: var(--cyan); }
.sb-pages {
  display: none; padding: 4px 0 4px 12px; margin: 2px 0 6px 14px;
  border-left: 1px solid rgba(116, 186, 255, 0.16);
}
.sb-chapter.open > .sb-pages { display: block; }
.sb-page-btn {
  width: 100%; text-align: left; padding: 6px 10px; border-radius: 6px;
  border: 0; background: transparent; color: var(--muted); font-size: 12px;
  line-height: 1.5; cursor: pointer; display: block;
}
.sb-page-btn:hover { color: #fff; }
.sb-page-btn.active {
  color: var(--cyan); font-weight: 580; background: rgba(96, 192, 255, 0.12);
}

#sidebar-backdrop {
  display: none; position: fixed; inset: 0; z-index: 29;
  background: rgba(2, 6, 16, 0.72); backdrop-filter: blur(4px);
}

#reader {
  flex: 1;
  min-width: 0;
  padding: 20px clamp(20px, 4vw, 56px) calc(var(--bottom-h) + 48px);
}

/* De-PPT Editorial Sections: Flowing web lessons with airy vertical rhythm */
.slide {
  position: relative;
  isolation: isolate;
  scroll-margin-top: calc(var(--top-h) + 12px);
  width: 100%;
  max-width: 1180px;
  margin: 0 auto 36px;
  padding: clamp(36px, 4.2vw, 60px) clamp(28px, 4.5vw, 64px);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(16, 34, 68, 0.42), rgba(8, 18, 38, 0.48));
  border: 1px solid rgba(145, 208, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(232, 248, 255, 0.26),
    0 18px 44px rgba(2, 8, 24, 0.42);
  -webkit-backdrop-filter: blur(20px) saturate(1.48);
  backdrop-filter: blur(20px) saturate(1.48);
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
  transition: border-color 0.28s, box-shadow 0.3s;
}
.slide:hover {
  border-color: rgba(188, 232, 255, 0.46);
  box-shadow: 0 12px 38px rgba(105, 200, 255, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

/* Remove repetitive PPT header/footer chrome in normal web reading mode! */
.slide > header,
.slide > footer {
  display: none;
}
body.focus-mode #reader .slide { display: none; margin-top: 12px; }
body.focus-mode #reader .slide.is-active {
  display: flex;
  min-height: calc(100svh - var(--top-h) - var(--bottom-h) - 32px);
}

.slide > .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font: 550 11px/1.2 Consolas, monospace;
  letter-spacing: 0.14em;
  color: var(--cyan);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(56, 138, 240, 0.12);
  border: 1px solid rgba(116, 198, 255, 0.22);
  margin-bottom: 18px;
}

.slide > h1 {
  font-size: clamp(23px, 2.2vw, 32px);
  font-weight: 660;
  line-height: 1.38;
  margin-bottom: clamp(26px, 3vw, 40px);
  color: #fff;
  text-wrap: pretty;
}

.slide > .body { flex: 1; display: flex; align-items: center; min-width: 0; }

/* Beginner Guide Strip — Frosted Glass Pills */
.beginner-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(116, 186, 255, 0.14);
}
.bg-item {
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(14, 30, 60, 0.38);
  border: 1px solid rgba(116, 186, 255, 0.16);
}
.bg-item small { display: block; font-size: 11px; letter-spacing: 0.12em; color: var(--cyan); margin-bottom: 6px; }
.bg-item p { font-size: 13px; color: var(--ink-soft); line-height: 1.75; }

.lesson {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.36fr);
  gap: clamp(32px, 4.5vw, 64px);
  align-items: center;
}
.lesson-copy, .lesson-visual { min-width: 0; width: 100%; }

.lesson-copy .answer {
  font-size: clamp(16px, 1.2vw, 19px);
  font-weight: 460;
  line-height: 1.78;
  color: #f0f6ff;
  margin-bottom: 22px;
}

.lesson-copy section {
  padding: 10px 0 10px 16px;
  border-left: 1.5px solid rgba(110, 198, 255, 0.38);
  margin: 16px 0;
}
.lesson-copy h3 { font-size: 11.5px; font-weight: 620; letter-spacing: 0.12em; color: var(--cyan); margin-bottom: 6px; }
.lesson-copy p { font-size: 14.2px; line-height: 1.84; color: var(--ink-soft); }

/* High-Contrast Frosted Glass Panels + Rotating Edge-Light */
.say, .taskcard, .vflow, .inline-demo, .ae-code {
  position: relative;
  isolation: isolate;
  background: linear-gradient(135deg, rgba(212, 234, 255, 0.14), rgba(22, 40, 72, 0.62));
  border: 1px solid rgba(182, 222, 255, 0.28);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 12px 30px rgba(0, 8, 24, 0.42);
  -webkit-backdrop-filter: blur(22px) saturate(1.48);
  backdrop-filter: blur(22px) saturate(1.48);
  transition: border-color 0.28s, box-shadow 0.3s;
}
.ae-code:hover {
  border-color: rgba(188, 232, 255, 0.58);
  box-shadow: 0 12px 38px rgba(105, 200, 255, 0.30), 0 0 22px rgba(180, 236, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.say {
  padding: 18px 22px;
  margin: 18px 0;
  background: linear-gradient(135deg, rgba(224, 240, 255, 0.18), rgba(26, 46, 78, 0.68));
  border: 1px solid rgba(190, 228, 255, 0.38);
  border-left: 3px solid #9be7ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36), 0 12px 30px rgba(0, 8, 24, 0.42);
}
.say small, .say b { display: block; font-size: 11px; letter-spacing: 0.1em; color: #9be7ff; margin-bottom: 6px; }
.say p { color: #ffffff; font-size: 14.5px; line-height: 1.78; }

.taskcard { padding: 20px 22px; font-size: 15.5px; line-height: 1.8; }
.taskcard small { display: block; font-size: 11px; letter-spacing: 0.12em; color: var(--cyan); margin-bottom: 8px; }

.vflow { padding: 8px 20px; }
.vflow > div {
  display: grid; grid-template-columns: 28px minmax(88px, 0.78fr) minmax(0, 1.45fr);
  align-items: baseline; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid rgba(116, 186, 255, 0.10);
}
.vflow > div:last-child { border-bottom: 0; }
.vflow b { font: 600 12px/1 Consolas, monospace; color: var(--cyan); }
.vflow strong { font-size: 14.5px; font-weight: 600; color: #fff; }
.vflow span { font-size: 13.5px; line-height: 1.74; color: var(--ink-soft); }

/* Official-Site Inspired Media Frame + Rotating Edge-Light */
.media, .cover-visual {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(210, 232, 255, 0.14), rgba(18, 34, 62, 0.54));
  border: 1px solid rgba(180, 220, 255, 0.28);
  -webkit-backdrop-filter: blur(22px) saturate(1.45);
  backdrop-filter: blur(22px) saturate(1.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 16px 40px rgba(0, 8, 24, 0.48);
  transition: border-color 0.28s, box-shadow 0.3s;
}
.media:hover, .cover-visual:hover {
  border-color: rgba(188, 232, 255, 0.58);
  box-shadow:
    0 12px 38px rgba(105, 200, 255, 0.30),
    0 0 22px rgba(180, 236, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.media > img, .cover-visual img, .live-demo > img {
  width: auto; max-width: 100%; height: auto; max-height: 56svh;
  object-fit: contain; border-radius: 12px;
  border: 1px solid rgba(180, 220, 255, 0.20);
  background: rgba(6, 14, 30, 0.45);
}
.media > img { cursor: zoom-in; }
.media video {
  width: 100%; max-height: 56svh; aspect-ratio: 16 / 9;
  border-radius: 12px; background: #030814;
  border: 1px solid rgba(180, 220, 255, 0.24);
}
.media figcaption, .cover-visual figcaption {
  align-self: stretch; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--ink-soft);
}
.zoom-button {
  position: absolute;
  right: 22px;
  bottom: 48px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(14, 26, 46, 0.68);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  opacity: 0.78;
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
}
.media:hover .zoom-button, .zoom-button:focus-visible {
  opacity: 1;
  transform: scale(1.06);
  background: rgba(30, 68, 124, 0.86);
}

.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.duo .media > img { width: 100%; max-height: 46svh; object-fit: contain; }

@media (min-width: 960px) and (orientation: landscape) {
  .lesson:has(.lesson-visual > .duo) {
    display: flex; flex-direction: column; align-items: stretch; gap: 28px;
  }
  .lesson:has(.lesson-visual > .duo) .lesson-visual { order: -1; }
  .lesson:has(.lesson-visual > .duo) .lesson-copy {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px 28px; align-items: start; max-width: none;
  }
  .lesson:has(.lesson-visual > .duo) .lesson-copy > * { margin: 0; }
}

.picture-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.picture-grid .media > img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.focus-window { position: relative; overflow: hidden; border-radius: 12px; max-width: 100%; }
.focus-window img { cursor: zoom-in; }

.inline-demo, .live-demo { text-align: center; padding: 28px 22px; }
.live-demo > img { margin: 0 auto 16px; }
.inline-demo p, .live-demo p { color: var(--muted); margin-top: 10px; font-size: 13px; }
.start-demo {
  min-height: 42px; padding: 0 24px; border-radius: 999px;
  border: 1px solid rgba(154, 222, 255, 0.55);
  background: linear-gradient(135deg, rgba(136, 210, 255, 0.28), rgba(52, 132, 245, 0.34));
  backdrop-filter: blur(16px); color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.start-demo:hover { box-shadow: 0 0 28px rgba(88, 186, 255, 0.4); }

.ae-code { padding: 14px 16px; color: #dbeafe; }
.ae-code button {
  font-size: 11.5px; padding: 4px 12px; min-height: 28px; border-radius: 999px;
  border: 1px solid rgba(124, 198, 255, 0.28); background: rgba(16, 38, 76, 0.5);
  color: var(--cyan); cursor: pointer;
}
.ae-code pre { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: Consolas, monospace; font-size: 12px; line-height: 1.72; }
.ae-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ae-link {
  display: inline-flex; align-items: center; min-height: 34px; padding: 4px 14px; border-radius: 999px;
  border: 1px solid rgba(124, 198, 255, 0.26); background: rgba(14, 32, 64, 0.45);
  backdrop-filter: blur(12px); color: var(--ink-soft); font-size: 12px;
}
.ae-link:hover { border-color: var(--cyan); color: #fff; }
.ae-command-stack > details { margin-top: 10px; color: var(--ink-soft); }
.ae-command-stack > details summary { cursor: pointer; padding: 6px 0; font-size: 12.5px; }
.ae-case-media video { width: min(100%, calc(58svh * var(--ae-ratio, 16/9))); max-height: 58svh; aspect-ratio: var(--ae-ratio, 16/9); object-fit: contain; }
.ae-proof-image { position: relative; width: fit-content; max-width: 100%; margin-inline: auto; }
.ae-proof .ae-proof-image img { max-height: 54svh; width: auto; max-width: 100%; object-fit: contain; border-radius: 12px; }
.ae-pin { position: absolute; pointer-events: none; display: grid; place-items: center; width: 24px; aspect-ratio: 1; border-radius: 50%; border: 1.5px solid #fff; background: #2678e6; color: #fff; font: 700 11px/1 system-ui; box-shadow: 0 0 12px rgba(56, 152, 255, 0.7); }
.ae-pin-view { inset: 15% auto auto 36%; }
.ae-pin-layers { inset: 79% auto auto 4%; }
.ae-pin-timeline { inset: 79% auto auto 55%; }

/* Chapter Cover */
.cover-layout {
  display: grid; grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.22fr);
  gap: clamp(32px, 5vw, 72px); align-items: center; flex: 1;
}
.cover-kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-size: 11.5px; letter-spacing: 0.14em; color: var(--muted); }
.cover-kicker b {
  font: 650 15px/1 Consolas, monospace; color: var(--cyan);
  padding: 5px 10px; border-radius: 8px;
  border: 1px solid rgba(124, 198, 255, 0.3); background: rgba(30, 74, 148, 0.25);
}
.cover-text h1 { font-size: clamp(30px, 3.2vw, 44px); font-weight: 680; line-height: 1.22; margin-bottom: 12px; }
.cover-text h2 { font-size: clamp(16px, 1.45vw, 21px); font-weight: 450; color: var(--cyan); margin-bottom: 18px; }
.cover-goal { font-size: 14.5px; line-height: 1.88; color: var(--ink-soft); max-width: 32em; }
.cover-route {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid rgba(116, 186, 255, 0.14);
  font-size: 12.5px; color: var(--ink-soft);
}
.cover-route span {
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid rgba(116, 186, 255, 0.2); background: rgba(14, 32, 64, 0.45);
}
.cover-route i { font-style: normal; color: var(--cyan); }
.cover-visual img { width: 100%; max-height: 52svh; object-fit: contain; margin: auto; }
.cover-visual figcaption { margin-top: 10px; }

.slide > details.lesson-notes { margin-top: 22px; border-top: 1px solid rgba(116, 186, 255, 0.12); padding-top: 4px; }
.slide > details.lesson-notes summary { cursor: pointer; font-size: 12px; color: var(--muted); padding: 8px 0; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.slide > details.lesson-notes summary::before { content: "▸"; color: var(--cyan); transition: transform 0.2s; }
.slide > details.lesson-notes[open] summary::before { transform: rotate(90deg); }
.note-body { white-space: pre-wrap; padding: 6px 0 12px; font-size: 13.5px; line-height: 1.85; color: var(--ink-soft); max-width: 78ch; }
.note-in-slide { display: none; }

/* Bottom Floating Frosted Glass Pager */
#bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 35; min-height: var(--bottom-h);
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: rgba(5, 13, 28, 0.72); border-top: 1px solid rgba(116, 186, 255, 0.16);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
}
#status { font-size: 12.5px; color: var(--ink-soft); min-width: 120px; text-align: center; font-variant-numeric: tabular-nums; }

/* Frosted Glass Dialogs */
dialog {
  color: var(--ink); border: 1px solid rgba(124, 198, 255, 0.28); border-radius: 16px;
  background: rgba(7, 17, 36, 0.84);
  -webkit-backdrop-filter: blur(26px) saturate(1.35); backdrop-filter: blur(26px) saturate(1.35);
  padding: 20px; width: min(1240px, 94vw); max-width: 94vw; max-height: 90dvh;
  box-shadow: 0 24px 64px rgba(0, 6, 18, 0.78);
}
dialog::backdrop { background: rgba(2, 6, 16, 0.78); backdrop-filter: blur(8px); }
body.modal-open { overflow: hidden; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dialog-head h3 { font-size: 15.5px; font-weight: 620; }
#lightbox img { display: block; margin: auto; max-height: 74dvh; object-fit: contain; border-radius: 10px; }
#lightbox p { font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; }
#demo { height: 86dvh; }
#demo iframe { border: 0; width: 100%; height: calc(100% - 50px); border-radius: 10px; background: #030712; }
#searchDialog { width: min(680px, 94vw); }
#searchInput {
  width: 100%; padding: 11px 16px; border-radius: 999px;
  border: 1px solid rgba(124, 198, 255, 0.28); background: rgba(6, 14, 30, 0.72);
  color: #fff; font-size: 14px; margin-bottom: 14px;
}
#searchResults { max-height: 55dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.search-item {
  width: 100%; text-align: left; padding: 10px 14px; border-radius: 10px;
  border: 1px solid rgba(116, 186, 255, 0.14); background: rgba(12, 26, 52, 0.42);
  cursor: pointer; display: flex; flex-direction: column; gap: 2px;
}
.search-item:hover { border-color: var(--cyan); background: rgba(26, 56, 108, 0.55); }
.search-item small { font-size: 11px; color: var(--cyan); }
.search-item strong { font-size: 13.5px; color: #fff; }
.search-item span { font-size: 12px; color: var(--muted); }
#glossaryDialog { width: min(860px, 94vw); }
.glossary-scroll { max-height: 70dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }
.glossary-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.glossary-table th, .glossary-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(116, 186, 255, 0.14); }
.glossary-table th { color: var(--cyan); font-weight: 580; }
.glossary-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.glossary-card { padding: 14px 16px; border-radius: 10px; border: 1px solid rgba(116, 186, 255, 0.18); background: rgba(12, 26, 52, 0.42); }
.glossary-card strong { display: block; font-size: 13.5px; color: var(--cyan); margin-bottom: 5px; }
.glossary-card p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.7; }

/* Responsive */
@media (max-width: 1120px) {
  .stage-grid, #cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #sidebar { position: fixed; left: 0; top: var(--top-h); height: calc(100svh - var(--top-h)); z-index: 38; margin-left: 0 !important; transform: translateX(-105%); }
  body.sidebar-open #sidebar { transform: translateX(0); }
  body.sidebar-open #sidebar-backdrop { display: block; }
  .desktop-only { display: none !important; }
}

@media (orientation: portrait), (max-width: 760px) {
  :root { --top-h: 58px; --bottom-h: 56px; }
  #top { padding: 8px 14px; gap: 6px; }
  .nav-center, .selectors, .mobile-hide { display: none !important; }
  .wordmark-logo { height: 22px; }
  .wordmark-text { font-size: 12.5px; }
  .wordmark-text span { display: none; }
  body:has(#reader-shell:not([hidden])) .wordmark-text { display: none; }
  .btn { padding: 5px 10px; font-size: 12px; min-height: 32px; }
  .theme-switch button { padding: 3px 8px; font-size: 11px; }

  .hero { min-height: auto; }
  .hero-main { padding-block: 56px 40px; }
  .hero h1 { font-size: clamp(36px, 9.5vw, 52px); margin-top: 18px; }
  .hero-sub { font-size: 18px; margin-top: 14px; }
  .hero-pillars-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pillar-btn { padding: 14px 10px; font-size: 12px; border-bottom: 1px solid rgba(120, 190, 255, 0.08); }

  .path-section { padding-block: 56px 32px; }
  .catalogue-section { padding-block: 32px 72px; }
  .stage-grid, #cards, .beginner-guide, .glossary-cards, .duo { grid-template-columns: 1fr; gap: 20px; }
  #reader { padding: 14px 14px calc(var(--bottom-h) + 32px); }
  .slide { padding: 26px 20px 28px; margin-bottom: 20px; border-radius: 14px; }
  .slide > h1 { font-size: 22px; margin-bottom: 20px; }
  .lesson, .cover-layout { display: flex; flex-direction: column; gap: 24px; align-items: stretch; }
  .duo .media > img, .media > img, .cover-visual img, .ae-proof .ae-proof-image img { width: 100%; max-height: none; }
  .media video, .ae-case-media video { width: 100%; max-height: none; }
  .picture-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vflow > div { grid-template-columns: 26px minmax(0, 1fr); gap: 4px 10px; }
  .vflow b { grid-row: span 2; }
  .vflow span { grid-column: 2; }
  .cover-text h1 { font-size: 28px; }
  .cover-text h2 { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
