/* =============================================
   TYPE LAB — style.css
   Single stylesheet for all 7 pages
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@100..900&family=Roboto+Flex:opsz,slnt,wdth,wght,GRAD@8..144,-10..0,25..151,100..1000,-200..150&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── Design tokens ─────────────────────────── */
:root {
  --radius: 0.625rem;

  /* Brand palette */
  --c-yellow:   #fbd530;
  --c-blue:     #135ae4;
  --c-coral:    #ff6853;
  --c-pink:     #ffa3cf;
  --c-green:    #269e5f;
  --c-laven: #cba6e8;
  --c-bone:     #f6f5f0; /*selected color*/
  /*--c-stone:    #f2eeeb;
  --c-cream:    #faf3e3;*/
  --c-ink:      #1e1c19;

  /* Semantic tokens */
  --background:        var(--c-bone);
  --foreground:        var(--c-ink);
  --card:              var(--c-cream);
  --card-foreground:   var(--c-ink);
  --primary:           var(--c-ink);
  --primary-fg:        var(--c-bone);
  --secondary:         var(--c-stone);
  --muted:             var(--c-stone);
  --muted-fg:          #53534e;
  --accent:            var(--c-blue);
  --accent-fg:         var(--c-bone);
  --border:            #e0ddd7;
  --destructive:       var(--c-coral);

  --radius-sm:  calc(var(--radius) - 4px);
  --radius-md:  calc(var(--radius) - 2px);
  --radius-lg:  var(--radius);
  --radius-xl:  calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);
  --radius-3xl: calc(var(--radius) + 12px);
  --radius-4xl: calc(var(--radius) + 16px);

  /* Canvas height: full viewport minus iOS status bar */
  --canvas-h: calc(100vh - env(safe-area-inset-top, 0px));
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-color: var(--border);
}

html {
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top, 0px);
  overflow: hidden;
  overscroll-behavior: none;
  background-color: var(--background);
  color: var(--foreground);
  font-family: 'Urbanist', ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography helpers ─────────────────────── */
/*font-family: system-ui, -apple-system, sans-serif;*/

.font-display {
  font-family: 'Urbanist', ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
}

.font-showcase {
  font-family: 'Roboto Flex', 'Inter', system-ui, sans-serif;
  font-optical-sizing: auto;
}

.font-mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}



/* ── Layout helpers ─────────────────────────── */
.min-h-screen  { height: 100vh; }
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-1        { flex: 1; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-5  { gap: 1.25rem; }
.gap-6  { gap: 1.5rem; }
.gap-8  { gap: 2rem; }
.gap-10 { gap: 2.5rem; }

/* ── Grid helpers ───────────────────────────── */
.grid { display: grid; }
.grid-12 { grid-template-columns: repeat(12, 1fr); }
.grid-3  { grid-template-columns: repeat(3, 1fr); }
.grid-2  { grid-template-columns: repeat(2, 1fr); }
.col-span-2  { grid-column: span 2; }
.col-span-3  { grid-column: span 3; }
.col-span-4  { grid-column: span 4; }
.col-span-5  { grid-column: span 5; }
.col-span-6  { grid-column: span 6; }
.col-span-7  { grid-column: span 7; }
.col-span-8  { grid-column: span 8; }
.col-span-9  { grid-column: span 9; }

/* ── Spacing helpers ────────────────────────── */
.p-4  { padding: 1rem; }
.p-5  { padding: 1.25rem; }
.p-6  { padding: 1.5rem; }
.p-8  { padding: 2rem; }
.p-10 { padding: 2.5rem; }
.px-4  { padding-inline: 1rem; }
.px-8  { padding-inline: 2rem; }
.px-10 { padding-inline: 2.5rem; }
.px-12 { padding-inline: 3rem; }
.py-3  { padding-block: 0.75rem; }
.py-4  { padding-block: 1rem; }
.py-10 { padding-block: 2.5rem; }
.py-12 { padding-block: 3rem; }
.pt-10 { padding-top: 2.5rem; }
.pb-6  { padding-bottom: 1.5rem; }
.pb-12 { padding-bottom: 3rem; }
.mt-1  { margin-top: 0.25rem; }
.mt-2  { margin-top: 0.5rem; }
.mt-3  { margin-top: 0.75rem; }
.mt-4  { margin-top: 1rem; }
.mt-5  { margin-top: 1.25rem; }
.mt-6  { margin-top: 1.5rem; }
.mb-2  { margin-bottom: 0.5rem; }
.mb-3  { margin-bottom: 0.75rem; }
.mb-4  { margin-bottom: 1rem; }
.mb-8  { margin-bottom: 2rem; }
.ml-auto { margin-left: auto; }

/* ── Text helpers ───────────────────────────── */
.text-xs   { font-size: 0.75rem; }
.text-sm   { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg   { font-size: 1.125rem; }
.text-xl   { font-size: 1.25rem; }
.text-2xl  { font-size: 1.5rem; }
.text-3xl  { font-size: 1.875rem; }
.text-4xl  { font-size: 2.25rem; }
.text-5xl  { font-size: 3rem; }
.text-6xl  { font-size: 3.75rem; }
.text-7xl  { font-size: 4.5rem; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.tracking-widest { letter-spacing: 0.2em; }
.uppercase   { text-transform: uppercase; }
.underline   { text-decoration: underline; }
.leading-none  { line-height: 1; }
.leading-tight { line-height: 1.25; }
.leading-snug  { line-height: 1.375; }
.leading-relaxed { line-height: 1.625; }

/* ── Color helpers ──────────────────────────── */
.text-muted    { color: var(--muted-fg); }
.text-accent   { color: var(--accent); }
.text-bg       { color: var(--background); }
.text-fg       { color: var(--foreground); }
.bg-background { background-color: var(--background); }
.bg-card       { background-color: var(--card); }
.bg-muted      { background-color: var(--muted); }
.bg-foreground { background-color: var(--foreground); }
.bg-accent     { background-color: var(--accent); }

/* ── Border / shape helpers ─────────────────── */
.rounded-full  { border-radius: 9999px; }
.rounded-xl    { border-radius: calc(var(--radius) + 4px); }
.rounded-2xl   { border-radius: calc(var(--radius) + 8px); }
.rounded-3xl   { border-radius: calc(var(--radius) + 12px); }
.border        { border: 1px solid var(--border); }
.border-t      { border-top: 1px solid var(--border); }
.border-b      { border-bottom: 1px solid var(--border); }
.border-r      { border-right: 1px solid var(--border); }
.border-dashed { border-style: dashed; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky   { position: sticky; }
.inset-0  { inset: 0; }
.z-30 { z-index: 30; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.shadow-sm  { box-shadow: 0 1px 3px rgba(0,0,0,0.07); }
.shadow-xl  { box-shadow: 0 20px 40px rgba(0,0,0,0.15); }
.opacity-40 { opacity: 0.4; }
.opacity-60 { opacity: 0.6; }
.opacity-70 { opacity: 0.7; }
.opacity-80 { opacity: 0.8; }
.transition { transition: all 0.2s ease; }

/* ── Backdrop / blur header ─────────────────── */
.backdrop-blur {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(246, 245, 240, 0.85);
}

/* ─────────────────────────────────────────────
   SHARED COMPONENTS
   ───────────────────────────────────────────── */

/* Chapter header (shared across all chapter pages) */
.chapter-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: #f6f5f0d9;
  border-bottom: 1px solid var(--border);
}

.chapter-header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  position: relative;
}

/* Hidden data elements — kept in DOM for overlay.js */
.chapter-num,
.chapter-title-label { display: none; }

/* Right section — absolute so nav stays centered */
.chapter-header-right {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

/* Chapter nav (rendered by renderDots into #progress-dots) */
.progress-dots {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chapter-nav-start {
  font-family: 'Urbanist', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-fg);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  transition: color 0.2s;
}
.chapter-nav-start:hover { color: var(--foreground); }

.chapter-nav-sep {
  width: 1px;
  height: 1rem;
  background: rgba(30,28,25,0.2);
  margin: 0 0.35rem;
  flex-shrink: 0;
}

.chapter-nav-tab {
  font-family: 'Urbanist', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted-fg);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}
.chapter-nav-tab.current {
  background: var(--foreground);
  color: var(--background);
}
.chapter-nav-tab.done {
  color: var(--foreground);
  cursor: pointer;
}
.chapter-nav-tab.done:hover {
  background: rgba(30, 28, 25, 0.08);
}

/* Complete button */
.btn-complete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 9999px;
  font-family: 'Urbanist', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: var(--foreground);
  color: var(--background);
  transition: opacity 0.2s;
}
.btn-complete:hover { opacity: 0.85; }
.btn-complete.done  { background: var(--foreground); color: var(--background); }
.btn-complete svg   { width: 14px; height: 14px; }

/* Chapter title pill — header left, added by overlay.js */
.chapter-title-pill {
  position: absolute;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Urbanist', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  pointer-events: none;
  white-space: nowrap;
}

/* Eyebrow — hidden; text still readable by overlay.js */
.chapter-eyebrow { display: none; }

/* ── Per-chapter accent colors (nav active tab + complete button) ── */
.ch1-header .chapter-nav-tab.current,
.ch1-header .btn-complete,
.ch1-header .btn-complete.done { background: var(--c-blue);  color: #ffffff; }

.ch2-header .chapter-nav-tab.current,
.ch2-header .btn-complete,
.ch2-header .btn-complete.done { background: var(--c-pink);  color: var(--foreground); }

.ch3-header .chapter-nav-tab.current,
.ch3-header .btn-complete,
.ch3-header .btn-complete.done { background: var(--c-green); color: #ffffff; }

.ch4-header .chapter-nav-tab.current,
.ch4-header .btn-complete,
.ch4-header .btn-complete.done { background: var(--c-yellow); color: var(--foreground); }

.ch5-header .chapter-nav-tab.current,
.ch5-header .btn-complete,
.ch5-header .btn-complete.done { background: var(--c-coral); color: #ffffff; }

.ch6-header .chapter-nav-tab.current,
.ch6-header .btn-complete,
.ch6-header .btn-complete.done { background: var(--c-laven); color: var(--foreground); }

/* Main content area */
.chapter-main {
  flex: 1;
  overflow-y: auto;
}

/* ── Panel card ─────────────────────────────── */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 8px);
  padding: 1.25rem;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.688rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-fg);
  margin-bottom: 1rem;
}

/* ── Slider ─────────────────────────────────── */
.slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 20px;
}

.slider-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 9999px;
  overflow: visible;
  touch-action: none;
  cursor: pointer;
}

.slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--foreground);
  border-radius: 9999px;
  pointer-events: none;
}

.slider-thumb {
  position: absolute;
  top: 50%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--foreground);
  border: 1px solid var(--foreground);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transform: translate(-50%, -50%);
  cursor: grab;
  transition: box-shadow 0.15s;
  z-index: 2;
}
.slider-thumb:active { cursor: grabbing; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }

.slider-native {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  pointer-events: none;
}

/* ── Switch ─────────────────────────────────── */
.switch {
  display: inline-flex;
  width: 36px;
  height: 20px;
  border-radius: 9999px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
  outline: none;
  flex-shrink: 0;
}
.switch.on { background: var(--foreground); }
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s, background 0.2s;
}
.switch.on::after { transform: translateX(16px); }
.ch1-mode-row #dark-mode-switch.on::after { background: #1e1c19; }

/* ─────────────────────────────────────────────
   CHAPTER-PAGE OVERVIEW (chapterpage.html)
   ───────────────────────────────────────────── */

.home-header {
  padding: 2.5rem 2.5rem 1.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.home-header-left {}

.home-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.688rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

.home-headline {
  font-family: 'Urbanist', ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  font-size: 4.5rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-top: -1rem;
  margin-bottom: 1rem;
  max-width: 60rem;
}

.home-progress {
  text-align: right;
}

.home-progress-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.688rem;
  color: var(--muted-fg);
}

.home-progress-count {
  font-family: 'Urbanist'; font-weight: 800;
  font-size: 1.4rem;
  margin-top: 0.25rem;
}

.home-progress-count span { color: var(--muted-fg); }

.home-reset {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.688rem;
  color: var(--muted-fg);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.home-reset:hover { color: var(--foreground); }

/* Chapter grid */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  padding: 0 2.5rem 3rem;
}

/* Chapter card */
.chapter-card {
  aspect-ratio: 4/3;
  border-radius: calc(var(--radius) + 12px);
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
  position: relative;
  text-decoration: none;
  display: block;
  transition: border-color 0.2s;
  animation: cardIn 0.5s ease both;
}
.chapter-card:hover { filter: brightness(0.96); }

.card-ch-1 {
  background-color: var(--c-blue);
  border: 2px solid var(--c-blue);
}
.card-ch-1 .chapter-card-name,
.card-ch-1 .chapter-card-num  { color: #ffffff; }
.card-ch-1 .chapter-card-sub  { color: rgba(255,255,255,0.7); }

.card-ch-2 {
  background-color: var(--c-pink);
  border: 2px solid var(--c-pink);
}
.card-ch-2 .chapter-card-name,
.card-ch-2 .chapter-card-num  { color: var(--foreground); }

.card-ch-3 {
  background-color: var(--c-green);
  border: 2px solid var(--c-green);
}
.card-ch-3 .chapter-card-name,
.card-ch-3 .chapter-card-num  { color: #ffffff; }
.card-ch-3 .chapter-card-sub  { color: rgba(255,255,255,0.7); }

.card-ch-4 {
  background-color: var(--c-yellow);
  border: 2px solid var(--c-yellow);
}
.card-ch-4 .chapter-card-name,
.card-ch-4 .chapter-card-num  { color: var(--foreground); }

.card-ch-5 {
  background-color: var(--c-coral);
  border: 2px solid var(--c-coral);
}
.card-ch-5 .chapter-card-name,
.card-ch-5 .chapter-card-num  { color: #ffffff; }
.card-ch-5 .chapter-card-sub  { color: rgba(255,255,255,0.7); }

.card-ch-6 {
  background-color: var(--c-laven);
  border: 2px solid var(--c-laven);
}
.card-ch-6 .chapter-card-name,
.card-ch-6 .chapter-card-num  { color: var(--foreground); }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chapter-card:nth-child(1) { animation-delay: 0ms; }
.chapter-card:nth-child(2) { animation-delay: 50ms; }
.chapter-card:nth-child(3) { animation-delay: 100ms; }
.chapter-card:nth-child(4) { animation-delay: 150ms; }
.chapter-card:nth-child(5) { animation-delay: 200ms; }
.chapter-card:nth-child(6) { animation-delay: 250ms; }

.chapter-card-locked {
  aspect-ratio: 4/3;
  border-radius: calc(var(--radius) + 12px);
  border: 1px dashed var(--border);
  background: color-mix(in srgb, var(--muted) 30%, transparent);
  overflow: hidden;
  position: relative;
  animation: cardIn 0.5s ease both;
}

.chapter-card-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.chapter-card-body {
  position: absolute;
  inset: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.chapter-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.chapter-card-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.688rem;
  letter-spacing: 0.2em;
  color: var(--muted-fg);
}

.chapter-card-icon {
  width: 20px;
  height: 20px;
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
}
.chapter-card:hover .chapter-card-icon { opacity: 1; transform: rotate(12deg); }

.chapter-card-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-ch-2 .chapter-card-check,
.card-ch-4 .chapter-card-check,
.card-ch-5 .chapter-card-check {
  background: rgba(30,28,25,0.15);
  color: var(--foreground);
}

.chapter-card-foot {
  margin-top: auto;
}

.chapter-card-name {
  font-family: 'Urbanist', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: 2.1rem;
  line-height: 1.25;
  color: var(--foreground);
}

.chapter-card-sub {
  font-size: 0.875rem;
  color: var(--muted-fg);
  margin-top: 0.25rem;
}

.chapter-card-locked .chapter-card-body { opacity: 0.4; }

.chapter-lock-msg {
  position: absolute;
  bottom: 1rem;
  left: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.688rem;
  color: var(--muted-fg);
}

/* Chapter art backgrounds */
.art-1 {
  background: linear-gradient(135deg, #f6f5f0, #f2eeeb);
}
.art-1-inner {
  position: absolute;
  inset: 3rem 3.5rem;
  border-radius: 6px;
  background: #faf3e3;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  border: 1px solid rgba(0,0,0,0.06);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.art-1-line {
  height: 6px;
  border-radius: 9999px;
  background: rgba(30,28,25,0.7);
}

.art-2 {
  background: linear-gradient(135deg, #f2eeeb, #f6f5f0);
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-2-cards {
  display: flex;
  gap: 12px;
}
.art-2-card {
  width: 80px;
  height: 112px;
  border-radius: 12px;
  background: #faf3e3;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Urbanist', sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
}

.art-3 {
  background: #faf3e3;
}
.art-3-line {
  position: absolute;
  left: 24px;
  top: 24px;
  bottom: 24px;
  width: 1px;
  background: rgba(30,28,25,0.3);
}

.art-4 {
  background: linear-gradient(135deg, #f6f5f0, #f2eeeb);
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-4-letter {
  font-family: 'Urbanist', sans-serif;
  font-size: 8rem;
  line-height: 1;
  font-weight: 800;
}

.art-5 {
  background: var(--c-blue);
  color: var(--c-bone);
  overflow: hidden;
}
.art-5-label {
  position: absolute;
  left: 24px;
  bottom: 24px;
  font-family: 'Urbanist', sans-serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: #faf3e3;
}

.art-6 {
  background: #f6f5f0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  padding: 24px;
}
.art-6-cell { border-radius: 6px; }

/* ─────────────────────────────────────────────
   CHAPTER 1 — E-Reader Simulator
   ───────────────────────────────────────────── */
.ch1-header{}

.ch1-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  padding: 2rem;
  max-width: 1500px;
  margin: 0 auto;
  .slider-track, .slider-fill {
      background: var(--c-blue);      
    }
    .slider-thumb {
      background: var(--c-green);
      border-color: var(--c-green);
    }
}

.ch1-device-wrap {
  border-radius: 2rem;
  background: #08080791;
  border: 1px solid var(--border);
  padding: 1rem;
  box-shadow: 0 1px 3px #00000012;
}

.ch1-screen {
  border-radius: 1.4rem;
  overflow: hidden;
  aspect-ratio: 4/3;
  transition: filter 0.3s;
}

.ch1-screen-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: padding 0.3s;
}

.ch1-screen-bar {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.688rem;
  opacity: 0.6;
}

.ch1-text {
  flex: 1;
  margin-top: 1.5rem;
  overflow: hidden;
  font-family: 'Roboto Flex', sans-serif;
  font-optical-sizing: auto;
  transition: font-size 0.2s, line-height 0.2s, letter-spacing 0.2s, font-weight 0.2s;
}

.ch1-text p { margin-bottom: 1rem; }

.ch1-screen-foot {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.688rem;
  opacity: 0.5;
  margin-top: 1rem;
}

.ch1-controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ch1-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.ch1-theme-btn {
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: border-color 0.2s;
  font-family: 'Urbanist', sans-serif;
}
.ch1-theme-btn:hover,
.ch1-theme-btn.active { border-color: var(--foreground); }

.ch1-theme-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.control-row {
  margin-bottom: 1rem;
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
}

.control-label-row span:last-child {
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted-fg);
}

.brightness-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brightness-row svg { color: var(--muted-fg); flex-shrink: 0; }

.ch1-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  #dark-mode-switch {
    background: var(--c-green); }
  #dark-mode-switch::after {
    background: #ffffff;
  }
}

.ch1-mode-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.ch1-mode-icon {
  display: flex;
  align-items: center;
  color: var(--muted-fg);
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   CHAPTER 2 — Flashcards
   ───────────────────────────────────────────── */

.ch2-header {}

.ch2-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(var(--canvas-h) - 120px);
  overflow: hidden;
  --card: var(--c-pink);
  --card-foreground: var(--c-blue);
}

.ch2-carousel {
  position: relative;
  width: 100%;
  height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1600px;
}

.ch2-card-wrap {
  position: absolute;
  transition: transform 0.5s cubic-bezier(0.22,1,0.36,1), opacity 0.4s;
  pointer-events: none;
}
.ch2-card-wrap.active { pointer-events: auto; cursor: pointer; }

.ch2-card {
  width: 340px;
  height: 440px;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.ch2-card.flipped { transform: rotateY(180deg); }

.ch2-face {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--radius) + 12px);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 20px 40px #00000026;
}

.ch2-face-front {
  background: var(--card);
  border: 1px solid var(--border);
}

.ch2-face-back {
  background: var(--c-blue);
  color: var(--background);
  transform: rotateY(180deg);
  justify-content: center;
}

.ch2-face-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.688rem;
  letter-spacing: 0.2em;
  color: var(--muted-fg);
  align-self: flex-start;
}
.ch2-face-back .ch2-face-tag {
  position: absolute;
  top: 2rem;
  left: 2rem;
  color: rgba(246,245,240,0.6);
}

.ch2-glyph {
  font-family: 'Urbanist', sans-serif;
  font-weight: 600;
  font-size: 9rem;
  line-height: 1;
  letter-spacing: -0.01em;
}

.ch2-glyph-icon {
  width: 100%;
  height: auto;
  max-height: 9rem;
  object-fit: contain;
}

.ch2-card-term {
  font-family: 'Urbanist'; font-weight: 800;
  font-size: 1.25rem;
}

.ch2-card-def {
  font-family: 'Urbanist', sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.375;
}

.ch2-card-term-back {
  font-family: 'Urbanist', sans-serif;
  font-size: 1rem;
  opacity: 0.6;
}

.ch2-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.ch2-btn-nav {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}
.ch2-btn-nav:hover { border-color: var(--foreground); }
.ch2-btn-nav svg { width: 20px; height: 20px; }

.ch2-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: var(--muted-fg);
  width: 64px;
  text-align: center;
}

.ch2-btn-flip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: var(--c-green);
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: 'Urbanist', sans-serif;
  font-weight: 500;
}
.ch2-btn-flip svg { width: 14px; height: 14px; }

/* ─────────────────────────────────────────────
   CHAPTER 3 — Timeline
   ───────────────────────────────────────────── */
.ch3-header {}

.ch3-scroll-area {
  height: calc(var(--canvas-h) - 120px);
  overflow-y: auto;
  position: relative;
}

.ch3-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 2rem;
}

.ch3-main {
  padding: 3rem 3rem 3rem 0;
  position: relative;
}

.ch3-timeline-line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.ch3-entry {
  position: relative;
  padding-left: 2.5rem;
  padding-bottom: 6rem;
}

.ch3-dot {
  position: absolute;
  left: -6px;
  top: 0.5px;
  width: 15px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--foreground);
}

.ch3-year {
  font-family: 'Urbanist', sans-serif;
  font-weight: 800;
  font-size: 4.5rem;
  line-height: 1;
  letter-spacing: -0.02em;
  color: rgba(38, 158, 95, 0.55);
  margin-bottom: 1rem;
}

.ch3-entry-title {
  font-family: 'Urbanist'; font-weight: 800;
  font-size: 2rem;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.ch3-entry-text {
  font-size: 1rem;
  color: rgba(30,28,25,0.8);
  line-height: 1.625;
  max-width: 40rem;
}

.ch3-entry-glyph {
  margin-top: 1.5rem;
  font-family: 'Urbanist', sans-serif;
  font-size: 4.5rem;
  color: #269e5f83;
}

.ch3-sidebar {
  padding: 3rem 0;
  position: relative;
}

.ch3-sidebar-inner {
  position: sticky;
  top: 3rem;
  will-change: transform;
}

.ch3-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ch3-swatch-card {
  aspect-ratio: 4/3;
  border-radius: calc(var(--radius) + 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}

.ch3-swatch-glyph {
  font-family: 'Urbanist', sans-serif;
  font-size: 6rem;
  line-height: 0.85;
}

.ch3-swatch-year {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  opacity: 0.7;
  white-space: nowrap;
}

.ch3-swatch-label {
  position: absolute;
  bottom: 12px;
  right: 12px;
  max-width: 68%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-align: right;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch3-swatch-card.has-image .ch3-swatch-label {
  color: #ffffff;
  opacity: 1;
}

.ch3-swatch-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ch3-swatch-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 55%);
}

.ch3-swatch-card.has-image .ch3-swatch-year {
  color: #ffffff;
  opacity: 1;
}


.ch3-entry-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ─────────────────────────────────────────────
   CHAPTER 4 — Variable Font Playground
   ───────────────────────────────────────────── */
.ch4-header {}

.ch4-layout {
  max-width: 1500px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  .slider-track, .slider-fill {
      background: var(--c-yellow);
    }
    .slider-thumb {
      background: var(--c-green);
      border-color: var(--c-green);
    }
}

.ch4-axis-card {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 12px);
  overflow: hidden;
  background: var(--card);
  display: grid;
  grid-template-columns: 2fr 1fr;
}

.ch4-axis-left {
  padding: 2.5rem;
  border-right: 1px solid var(--border);
  min-width: 0;
}

.ch4-axis-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.ch4-axis-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.688rem;
  letter-spacing: 0.2em;
  color: var(--muted-fg);
}

.ch4-axis-name {
  font-family: 'Urbanist'; font-weight: 800;
  font-size: 1.2rem;
  margin-top: 0.25rem;
}

.ch4-axis-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
}

.ch4-sample {
  font-family: 'Roboto Flex', sans-serif;
  font-optical-sizing: auto;
  font-size: 4.5rem;
  line-height: 1;
  margin-bottom: 2rem;
  transition: font-variation-settings 0.1s;
  white-space: nowrap;
}

.ch4-slider-minmax {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  color: var(--muted-fg);
}

.ch4-axis-right {
  padding: 2.5rem;
  background: color-mix(in srgb, var(--muted) 30%, transparent);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.ch4-axis-desc-title {
  font-family: 'Urbanist'; font-weight: 800;
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.ch4-axis-desc-text {
  font-size: 1rem;
  color: rgba(30,28,25,0.8);
  line-height: 1.625;
  max-width: 28rem;
}

.ch4-code-tag {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted-fg);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 0.5rem;
}

/* ─────────────────────────────────────────────
   CHAPTER 5 — Generative Inputs
   ───────────────────────────────────────────── */
.ch5-header {}

.ch5-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1500px;
  margin: 0 auto;
  height: calc(var(--canvas-h) - 160px);
    .slider-track,
      .slider-fill {
        background: var(--c-coral);
      }
    
      .slider-thumb {
        background: var(--c-green);
        border-color: var(--c-green);
      }

      .switch.on {
        background: var(--c-green);
      }
      .switch.on::after {
        background: #ffffff;
      }
}

.ch5-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ch5-toggle-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: left;
}
.ch5-toggle-row.on {
  border-color: var(--foreground);
  background: rgba(30,28,25,0.03);
}

.ch5-toggle-row-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}
.ch5-toggle-row-left svg { width: 16px; height: 16px; }

.ch5-influence-row { margin-bottom: 1.25rem; }
.ch5-influence-row:last-child { margin-bottom: 0; }

.ch5-influence-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}
.ch5-influence-label span:last-child {
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted-fg);
}

.ch5-meter {
  height: 4px;
  border-radius: 9999px;
  background: var(--border);
  overflow: hidden;
  margin-top: 0.5rem;
}
.ch5-meter-fill {
  height: 100%;
  background: var(--accent);
  transition: width 80ms linear;
  border-radius: 9999px;
}

.ch5-live-row {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.688rem;
  margin-bottom: 0.375rem;
}
.ch5-live-row span:first-child { color: var(--muted-fg); }

.ch5-stage {
  border-radius: calc(var(--radius) + 12px);
  background: var(--foreground);
  color: var(--background);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
}

.ch5-stage-label {
  position: absolute;
  top: 20px;
  left: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.688rem;
  letter-spacing: 0.2em;
  opacity: 0.5;
}

.ch5-display-text {
  font-family: 'Roboto Flex', sans-serif;
  font-optical-sizing: auto;
  text-align: center;
  padding: 0 3rem;
  line-height: 0.9;
  font-size: clamp(48px, 8vw, 160px);
  transition: font-variation-settings 150ms ease-out, letter-spacing 150ms ease-out;
  pointer-events: none;
  white-space: pre;
}

.ch5-stage-bottom {
  position: absolute;
  bottom: 20px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.ch5-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 160px;
}

.ch5-bar-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  opacity: 0.5;
}

.ch5-bar-track {
  height: 4px;
  border-radius: 9999px;
  background: rgba(246,245,240,0.15);
  overflow: hidden;
}

.ch5-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 80ms linear;
}

/* Input toggle: right side (status label + switch) */
.ch5-input-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ch5-status {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--muted-fg);
  min-width: 4.5rem;
  text-align: right;
  opacity: 0.7;
}

/* Camera preview picture-in-picture */
.ch5-cam-preview {
  position: absolute;
  top: 48px;
  right: 16px;
  width: 130px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(246,245,240,0.22);
  background: #000;
  display: none;
}
.ch5-cam-preview canvas {
  width: 100%;
  display: block;
}
.ch5-cam-label {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: rgba(246,245,240,0.55);
  pointer-events: none;
}

/* Smooth font-size transitions driven by face distance */
#ch5-text {
  transition: font-size 200ms ease-out,
              font-variation-settings 100ms ease-out,
              letter-spacing 100ms ease-out;
}

/* Stage no longer requires cursor suppression */
.ch5-stage { cursor: default; }

/* ─────────────────────────────────────────────
   CHAPTER 6 — Knowledge Hub
   ───────────────────────────────────────────── */
.ch6-header {}

.ch6-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.ch6-hero {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.ch6-hero-art {
  aspect-ratio: 16/10;
  border-radius: calc(var(--radius) + 12px);
  overflow: hidden;
  position: relative;
  background: var(--foreground);
}

.ch6-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ch6-hero-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ch6-hero-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.688rem;
  letter-spacing: 0.2em;
  color: var(--muted-fg);
}

.ch6-hero-title {
  font-family: 'Urbanist'; font-weight: 800;
  font-size: 2.4rem;
  line-height: 1.5;
  margin-top: 1rem;
}

.ch6-hero-excerpt {
  font-size: 1rem;
  color: rgba(30,28,25,0.7);
  margin-top: 1.25rem;
  line-height: 1.625;
}

.ch6-hero-read {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--foreground);
  text-decoration: none;
  border-bottom: 1px solid rgba(30,28,25,0.25);
  padding-bottom: 1px;
  transition: border-color 0.2s;
}
.ch6-hero-read:hover { border-color: var(--foreground); }

.ch6-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.ch6-article {
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.2s;
  cursor: pointer;
}
.ch6-article:hover { border-color: var(--foreground); }

.ch6-article-art {
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
  background: var(--foreground);
}

.ch6-article-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.ch6-article:hover .ch6-article-img { transform: scale(1.04); }

.ch6-article-body {
  padding: 1.5rem;
}

.ch6-article-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  color: var(--muted-fg);
}

.ch6-article-title {
  font-family: 'Urbanist'; font-weight: 800;
  font-size: 1.2rem;
  line-height: 1.8;
  margin-top: 0.5rem;
}

.ch6-article-excerpt {
  font-size: 0.875rem;
  color: rgba(30,28,25,0.7);
  margin-top: 0.75rem;
  line-height: 1.625;
}

.ch6-article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: var(--muted-fg);
}

.ch6-article-read {
  font-family: 'JetBrains Mono', monospace;
}

.ch6-article-link {
  text-decoration: none;
  color: var(--muted-fg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  transition: color 0.2s;
}
.ch6-article:hover .ch6-article-link { color: var(--foreground); }

.ch6-footer {
  margin-top: 5rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.ch6-footer h2 {
  font-family: 'Urbanist', sans-serif;
  font-size: 1.5rem;
}

.ch6-footer p {
  font-size: 0.875rem;
  color: var(--muted-fg);
  margin-top: 0.5rem;
}

/* Art pieces for Chapter 6 */
.art-hero-type {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f6f5f0, #faf3e3, #fbd530);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.art-hero-type span {
  font-family: 'Urbanist', sans-serif;
  font-size: 10rem;
  font-weight: 800;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.art-sound {
  width: 100%;
  height: 100%;
  background: #1e1c19;
  position: relative;
  overflow: hidden;
}

.art-ai-type {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e1c19 0%, #135ae4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.art-ai-type span {
  font-family: 'Urbanist', sans-serif;
  font-weight: 800;
  font-size: 4.5rem;
  color: rgba(255,255,255,0.9);
  letter-spacing: -0.02em;
}

.art-stripes-warm {
  width: 100%;
  height: 100%;
  background: var(--c-yellow);
  position: relative;
  overflow: hidden;
}
.art-stripes-warm span {
  position: absolute;
  right: 16px;
  bottom: 8px;
  font-family: 'Urbanist', sans-serif;
  font-size: 3.5rem;
  font-weight: 600;
}

.art-dark-type {
  width: 100%;
  height: 100%;
  background: var(--c-blue);
  color: #faf3e3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-dark-type span {
  font-family: 'Urbanist', sans-serif;
  font-size: 4.5rem;
  font-weight: 700;
}

.art-yellow-type {
  width: 100%;
  height: 100%;
  background: var(--c-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-yellow-type span {
  font-family: 'Urbanist', sans-serif;
  font-size: 3.5rem;
  color: var(--c-blue);
}

.art-swatches {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.art-mono {
  width: 100%;
  height: 100%;
  background: var(--c-blue);
  color: var(--c-yellow);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.688rem;
  line-height: 1.5;
  padding: 1rem;
  overflow: hidden;
}

.art-gradient {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--c-laven), var(--c-pink), var(--c-coral));
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-gradient span {
  font-family: 'Urbanist', sans-serif;
  font-size: 4.5rem;
  font-weight: 700;
  color: #faf3e3;
}

/* ── Animations ─────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeIn 0.4s ease both;
}

/* ─────────────────────────────────────────────
   INSTRUCTION OVERLAY — Glassmorphism
   ───────────────────────────────────────────── */

@keyframes overlayCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.instruction-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 28, 25, 0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

.instruction-card {
  background: rgba(246, 245, 240, 0.78);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border: 1px solid rgba(246, 245, 240, 0.6);
  border-radius: calc(var(--radius) + 20px);
  padding: 3rem 3rem 2.5rem;
  max-width: 580px;
  width: 90%;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255,255,255,0.3) inset;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  animation: overlayCardIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.05s;
}

.instruction-card-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.688rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-fg);
  text-align: center;
}

.instruction-card-title {
  font-family: 'Urbanist'; font-weight: 800;
  font-size: 1.5rem;
  line-height: 2.8rem;
  color: var(--foreground);
  text-align: center;
  margin-top: -0.25rem;
}

/*.instruction-card-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}*/

.instruction-card-text {
  font-size: 1.5rem;
  line-height: 1.7;
  color: rgba(30, 28, 25, 0.82);
  text-align: center;
  max-width: 440px;
}

.instruction-btn-ok {
  margin-top: 0.75rem;
  padding: 0.875rem 3rem;
  border-radius: 9999px;
  background: var(--foreground);
  color: var(--background);
  border: none;
  font-family: 'Urbanist', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: opacity 0.2s, transform 0.15s;
}
.instruction-btn-ok:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}
.instruction-btn-ok:active {
  transform: translateY(0);
}

/* Info-Button (bottom-left, always visible) */
.info-btn {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9999;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(246, 245, 240, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.13);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-style: italic;
  font-weight: 600;
  color: var(--foreground);
  transition: box-shadow 0.2s, background 0.2s, transform 0.15s;
}
.info-btn:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  background: rgba(246, 245, 240, 0.97);
  transform: scale(1.08);
}

/* ── Index page splash entrance ─────────────────── */
@keyframes splash-enter {
  from {
    opacity: 0;
    transform: scale(0.55);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  opacity: 0;
  transform-origin: center center;
}

.splash-inner.is-loaded {
  animation: splash-enter 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
