/* ==========================================================================
   Tellzzang Class — Apple Keynote Clean + Dynamic Motion Multi-Page Engine
   Themes: apple (default crisp Apple.com mix) | dark (Pro Obsidian) | warm
   ========================================================================== */

:root {
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  /* Apple Light Default */
  --bg: #fbfbfd;
  --bg-alt: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-dark: #0a0b10;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 113, 227, 0.35);
  --text: #1d1d1f;
  --text-muted: #6e6e73;
  --accent: #0071e3;
  --accent-2: #5e5ce6;
  --accent-3: #00c7be;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.09);
  --radius: 24px;
  --radius-sm: 16px;
  --container: 1120px;
  --ease-apple: cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="dark"] {
  --bg: #000000;
  --bg-alt: #0b0c12;
  --surface: rgba(24, 24, 29, 0.78);
  --surface-solid: #141418;
  --surface-dark: #0e1017;
  --surface-glass: rgba(16, 16, 20, 0.75);
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(41, 151, 255, 0.45);
  --text: #f5f5f7;
  --text-muted: #a1a1a6;
  --accent: #2997ff;
  --accent-2: #7c8cff;
  --accent-3: #32d74b;
  --accent-soft: rgba(41, 151, 255, 0.14);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.6);
}

html[data-theme="warm"] {
  --bg: #f8f5ef;
  --bg-alt: #efeae0;
  --surface: rgba(255, 253, 249, 0.88);
  --surface-solid: #fffdf9;
  --surface-dark: #1c1917;
  --surface-glass: rgba(248, 245, 239, 0.82);
  --border: rgba(28, 25, 23, 0.1);
  --border-strong: rgba(180, 83, 9, 0.4);
  --text: #1c1917;
  --text-muted: #57534e;
  --accent: #b45309;
  --accent-2: #0f766e;
  --accent-3: #be123c;
  --accent-soft: rgba(180, 83, 9, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.45s var(--ease-apple), color 0.45s var(--ease-apple);
}

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

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* Smooth Page Transition Overlay */
.page-curtain {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s var(--ease-apple);
}

.page-curtain.is-leaving {
  opacity: 1;
}

/* Reading Progress Bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  z-index: 150;
  transition: width 0.08s linear;
}

/* Frosted Apple Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: var(--surface-glass);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 46px;
}

.apple-ribbon {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 1rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text);
}

.apple-ribbon a {
  color: var(--accent);
  font-weight: 600;
}

.apple-ribbon a:hover {
  text-decoration: underline;
}

/* Apple.com/kr Iconic 12px-Gutter Promo Tiles */
.apple-showcase-stack {
  display: grid;
  gap: 12px;
  padding: 12px 0;
}

.apple-hero-banner {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(3.6rem, 7vw, 5.8rem) 1.25rem clamp(3rem, 6vw, 4.6rem);
}

.apple-hero-dark {
  background: #000000;
  color: #f5f5f7;
}

.apple-hero-dark .hero-desc,
.apple-hero-dark .eyebrow {
  color: #a1a1a6;
}

.apple-hero-dark .eyebrow {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.apple-hero-light {
  background: var(--bg-alt);
  color: var(--text);
}

.apple-hero-banner .hero-content {
  margin-inline: auto;
}

.apple-hero-banner .hero-desc {
  margin-inline: auto;
}

.apple-hero-banner .hero-buttons {
  justify-content: center;
}

.apple-tile-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 12px;
}

.apple-promo-tile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(2.4rem, 4.5vw, 3.8rem) 1.5rem 2.2rem;
  min-height: 430px;
  justify-content: space-between;
  transition: transform 0.35s var(--ease-apple);
}

.apple-promo-tile:hover {
  transform: scale(0.994);
}

.tile-dark {
  background: #000000;
  color: #f5f5f7;
}

.tile-dark p {
  color: #a1a1a6;
}

.tile-light {
  background: var(--bg-alt);
  color: var(--text);
}

.tile-light p {
  color: var(--text-muted);
}

.tile-copy h3 {
  margin: 0.25rem 0 0.4rem;
  font-size: clamp(1.55rem, 2.8vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.tile-copy p {
  margin: 0 0 1rem;
  font-size: 0.98rem;
  max-width: 420px;
}

.tile-links {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

.tile-visual {
  width: min(100%, 420px);
  margin-top: 1.5rem;
}

@media (max-width: 820px) {
  .apple-tile-pair {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .apple-promo-tile {
    min-height: 360px;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.025em;
}

.brand-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-item {
  padding: 0.38rem 0.78rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: var(--accent-soft);
}

.nav-item.active {
  color: var(--accent);
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease-apple), border-color 0.2s ease;
}

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

.cta-sm {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.88rem;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  transition: opacity 0.2s ease, transform 0.2s var(--ease-apple);
}

.cta-sm:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* Apple Hero with Dynamic Motion Canvas */
.hero-stage {
  position: relative;
  overflow: hidden;
  padding: clamp(3.4rem, 7vw, 6.2rem) 0 clamp(2.8rem, 6vw, 4.6rem);
  border-bottom: 1px solid var(--border);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.85;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.34rem 0.82rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.7); }
  70% { box-shadow: 0 0 0 9px rgba(48, 209, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
}

.hero-title {
  margin: 0 0 1.05rem;
  font-size: clamp(2.15rem, 5.5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.038em;
}

.text-gradient {
  background: linear-gradient(125deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  margin: 0 0 1.8rem;
  font-size: clamp(1rem, 1.8vw, 1.22rem);
  color: var(--text-muted);
  max-width: 680px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.btn-apple-primary,
.btn-apple-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 46px;
  padding: 0.75rem 1.45rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s var(--ease-apple), box-shadow 0.25s ease, background 0.2s ease;
}

.btn-apple-primary {
  border: none;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(0, 113, 227, 0.25);
}

.btn-apple-primary:hover {
  transform: translateY(-2px) scale(1.01);
}

.btn-apple-secondary {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  backdrop-filter: blur(10px);
}

.btn-apple-secondary:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

/* Urgent Callout Glass Bar */
.notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}

.notice-icon {
  font-size: 1.4rem;
  line-height: 1.3;
}

.notice-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 159, 10, 0.16);
  color: #ff9f0a;
  margin-left: 0.4rem;
}

/* Breadcrumb on Sub-pages */
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

.breadcrumb a:hover {
  color: var(--accent);
}

/* Section Spacing & Headers */
.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  margin-bottom: 2rem;
}

.section-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.section-head h2 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.6rem, 3.2vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* Apple Dark Feature Strip (Dramatic Contrast Section) */
.keynote-band {
  background: var(--surface-dark);
  color: #f5f5f7;
  padding: clamp(3.2rem, 6vw, 5.2rem) 0;
}

.keynote-band .section-sub {
  color: #a1a1a6;
}

/* Bento & Sub-page Link Cards */
.subpage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.subpage-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.38s var(--ease-apple), box-shadow 0.38s var(--ease-apple), border-color 0.25s ease;
}

.subpage-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.card-motion-art {
  height: 112px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  margin-bottom: 1.2rem;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card-motion-art svg {
  width: 84%;
  height: 80%;
}

.subpage-card h3 {
  margin: 0.3rem 0 0.5rem;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.subpage-card p {
  margin: 0 0 1.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
}

.card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent);
}

.subpage-card:hover .card-arrow {
  gap: 0.55rem;
}

/* Animated SVG Path Draw on Scroll */
.draw-line {
  stroke-dasharray: 420;
  stroke-dashoffset: 420;
  transition: stroke-dashoffset 1.3s var(--ease-apple);
}

.is-visible .draw-line {
  stroke-dashoffset: 0;
}

/* Worksheets Toolbar & Rows */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.3rem;
}

.filter-scroll {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 0.2rem;
  scrollbar-width: none;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.pill-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text-muted);
  padding: 0.44rem 0.9rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-btn.active,
.pill-btn:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.search-input {
  min-width: 230px;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-family: inherit;
  font-size: 0.86rem;
}

.ws-list {
  display: grid;
  gap: 0.85rem;
}

.ws-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease-apple), border-color 0.2s ease;
}

.ws-row:hover {
  transform: translateX(4px);
  border-color: var(--border-strong);
}

.ws-row[hidden] {
  display: none;
}

.ws-meta {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.ws-row h3 {
  margin: 0 0 0.25rem;
  font-size: 1.06rem;
}

.ws-row p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.status-chip {
  flex-shrink: 0;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
}

.chip-hot { background: rgba(255, 69, 58, 0.14); color: #ff453a; }
.chip-done { background: rgba(48, 209, 88, 0.14); color: #28cd41; }
.chip-soon { background: rgba(255, 159, 10, 0.16); color: #ff9f0a; }

/* Interactive Simulator & Motion Widgets (Sub-pages) */
.glass-panel {
  padding: clamp(1.3rem, 3vw, 2rem);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
}

.sim-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.6rem;
  align-items: center;
}

.sim-slider {
  width: 100%;
  accent-color: var(--accent);
  height: 8px;
  cursor: pointer;
}

.metric-bars {
  display: grid;
  gap: 1rem;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: var(--bg-alt);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s var(--ease-apple);
}

.fill-blue { background: linear-gradient(90deg, #0071e3, #5e5ce6); }
.fill-green { background: linear-gradient(90deg, #30d158, #00c7be); }
.fill-pink { background: linear-gradient(90deg, #ff375f, #ff9f0a); }

/* 3D Flip Concept Cards (/clinic/) */
.flip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

.flip-card {
  perspective: 1100px;
  min-height: 210px;
  cursor: pointer;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 210px;
  transform-style: preserve-3d;
  transition: transform 0.65s var(--ease-apple);
}

.flip-card.is-flipped .flip-inner {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.flip-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-solid));
  border-color: var(--border-strong);
}

/* Interactive Checklist */
.checklist-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}

.check-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.2s ease;
}

.check-label:hover {
  background: var(--accent-soft);
}

.check-label input {
  position: absolute;
  opacity: 0;
}

.check-ui {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid var(--border-strong);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.check-label input:checked + .check-ui {
  background: var(--accent);
  border-color: var(--accent);
}

.check-label input:checked + .check-ui::after {
  content: "✓";
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.check-label input:checked ~ .check-txt {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Prev / Next Sub-page Footer Navigation */
.pager-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.pager-card {
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  transition: transform 0.25s var(--ease-apple), border-color 0.2s ease;
}

.pager-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.pager-dir {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

/* Mobile Floating Bottom Tab Bar */
.mobile-dock {
  display: none;
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(26px) scale(0.985);
  transition: opacity 0.75s var(--ease-apple), transform 0.75s var(--ease-apple);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 160;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-box {
  position: relative;
  width: min(100%, 840px);
  max-height: 86vh;
  overflow-y: auto;
  padding: 1.7rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  cursor: pointer;
}

.source-pre {
  background: var(--bg-alt);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  white-space: pre-wrap;
  max-height: 360px;
  overflow: auto;
}

.site-footer {
  padding: 2.2rem 0 5.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--text-muted);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Responsive Mobile Perfection */
@media (max-width: 900px) {
  .subpage-grid,
  .sim-grid,
  .flip-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .desktop-nav,
  .brand-pill,
  .cta-sm {
    display: none;
  }

  .ws-row {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .search-input {
    width: 100%;
  }

  .mobile-dock {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    z-index: 120;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem;
    padding: 0.38rem;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: var(--surface-glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: var(--shadow-lg);
  }

  .dock-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    min-height: 46px;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
  }

  .dock-tab.active {
    background: var(--accent);
    color: #ffffff;
  }

  .dock-tab span:first-child {
    font-size: 1.05rem;
  }
}
