/* ═══════════════════════════════════════════════════════
   THE PSYCHOLOGY OF SUCCESS, v4
   Light premium. Apple inspired. Library of Alexandria voice.
   Warm cream paper. Refined gold accent. Generous whitespace.
   ═══════════════════════════════════════════════════════ */

:root {
  /* v7 palette: richer parchment + burgundy accent for emphasis + brass gold */
  --bg:           #F1EAD6;     /* aged parchment, deeper warmth */
  --bg-alt:       #E8DFC5;
  --bg-card:      #FCF8EC;     /* parchment white card */
  --bg-card-2:    #F8F1DC;     /* gently warmed card */
  --bg-deep:      #DCD2B6;     /* deep aged paper */
  --bg-hover:     #EDE3CC;
  --bg-glass:     rgba(252, 248, 236, 0.62);
  --bg-glass-2:   rgba(252, 248, 236, 0.42);

  --ink-1:        #14110D;     /* deep warm ink */
  --ink-2:        #3A2F22;     /* sepia */
  --ink-3:        #6B5C46;     /* warm gray */
  --ink-4:        #9A8B71;     /* faded ink */
  --ink-5:        #C8BD9F;     /* paper shadow */

  --gold:         #8B5A1A;     /* brass gold, deeper and richer */
  --gold-deep:    #6E4514;
  --gold-light:   #B7791F;
  --gold-soft:    #C49B5E;
  --gold-bg:      rgba(139, 90, 26, 0.08);
  --gold-bg-2:    rgba(139, 90, 26, 0.14);
  --gold-border:  rgba(139, 90, 26, 0.28);
  --gold-strong:  rgba(139, 90, 26, 0.55);
  --gold-glow:    0 0 0 6px rgba(139, 90, 26, 0.12);
  --gold-shimmer: linear-gradient(135deg, rgba(183, 121, 31, 0.18) 0%, rgba(139, 90, 26, 0.08) 50%, rgba(196, 155, 94, 0.22) 100%);

  /* Burgundy, used sparingly for emphasis */
  --wine:         #6B1F1B;
  --wine-deep:    #4D1311;
  --wine-bg:      rgba(107, 31, 27, 0.06);
  --wine-border:  rgba(107, 31, 27, 0.22);

  /* Forest, optional secondary */
  --forest:       #3F5840;
  --forest-bg:    rgba(63, 88, 64, 0.08);

  --crimson:      #A03830;
  --crimson-deep: #7C2820;
  --crimson-bg:   rgba(160, 56, 48, 0.06);
  --crimson-border:rgba(160, 56, 48, 0.22);

  --moss:         #5A7A50;
  --moss-bg:      rgba(90, 122, 80, 0.08);
  --moss-border:  rgba(90, 122, 80, 0.28);

  --border-soft:    #ECE8DA;
  --border-med:     #DFD9C7;
  --border-strong:  #C1BBA8;

  --shadow-xs:  0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-sm:  0 2px 6px rgba(28, 25, 23, 0.05);
  --shadow-md:  0 6px 18px rgba(28, 25, 23, 0.06);
  --shadow-lg:  0 16px 40px rgba(28, 25, 23, 0.08);
  --shadow-xl:  0 28px 60px rgba(28, 25, 23, 0.12);
  --shadow-gold: 0 4px 20px rgba(176, 122, 48, 0.18);

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  22px;
  --radius-2xl: 30px;

  /* Inter only, per user override. Simple, modern, readable. Hierarchy via weight and size. */
  --font-serif:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, monospace;

  /* Liquid Glass timing per skill recommendation: 400-600ms fluid curves */
  --t-fast:   0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --t-med:    0.32s cubic-bezier(0.32, 0.72, 0.2, 1);
  --t-slow:   0.55s cubic-bezier(0.32, 0.72, 0.2, 1);
  --t-fluid:  0.45s cubic-bezier(0.34, 1.16, 0.4, 1);  /* spring-like */
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(183, 121, 31, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 80% 100%, rgba(107, 31, 27, 0.05) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(196, 155, 94, 0.06) 0%, transparent 60%);
  color: var(--ink-1);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* Liquid Glass animated gradient layer, very subtle */
body::before {
  content: '';
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 30% 20%, rgba(202, 138, 4, 0.04) 0%, transparent 35%),
    radial-gradient(circle at 70% 70%, rgba(161, 98, 7, 0.03) 0%, transparent 40%);
  animation: liquidShift 24s ease-in-out infinite alternate;
}
@keyframes liquidShift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(2%, 1%) rotate(0.5deg); }
  100% { transform: translate(-1%, -2%) rotate(-0.5deg); }
}
button { font-family: inherit; cursor: pointer; border: none; background: transparent; color: inherit; }
input, textarea, select { font-family: inherit; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.022em; color: var(--ink-1); line-height: 1.15; }
h1 { font-weight: 800; letter-spacing: -0.028em; }
em { font-style: normal; color: var(--gold-deep); font-weight: 600; }
.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.muted { color: var(--ink-3); }
strong { color: var(--ink-1); font-weight: 600; }
em { font-style: italic; color: var(--ink-2); }
code {
  background: var(--bg-deep);
  border: 1px solid var(--border-med);
  padding: 1px 6px;
  font-size: 0.83em;
  color: var(--gold-deep);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

/* ═══ HUD, Liquid Glass top bar ═════════════════════ */
.app-hud {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding: 0.85rem 2rem;
  background: rgba(250, 250, 249, 0.72);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 8px 32px rgba(28, 25, 23, 0.04);
}
.hud-brand {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink-1);
  letter-spacing: 0.01em;
  padding-right: 1rem;
  border-right: 1px solid var(--border-med);
  margin-right: 0.4rem;
}
.hud-stat { display: flex; flex-direction: column; gap: 1px; min-width: 50px; }
.hud-stat-num {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ink-1);
  letter-spacing: -0.01em;
}
.hud-stat-label {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--ink-3);
  text-transform: uppercase;
  font-weight: 500;
}
.hud-reset {
  margin-left: auto;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-med);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  background: var(--bg-card);
  transition: all var(--t-fast);
}
.hud-reset:hover { color: var(--crimson); border-color: var(--crimson-border); background: var(--crimson-bg); }

/* ═══ TAB NAV, Liquid Glass ═════════════════════════ */
.tab-nav {
  position: sticky;
  top: 53px;
  z-index: 70;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: rgba(250, 250, 249, 0.72);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--border-soft);
  padding: 0.7rem 2rem;
}
.tab-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.2rem;
  border-radius: var(--radius-lg);
  color: var(--ink-3);
  transition: all var(--t-fluid);
  text-align: left;
  position: relative;
  margin: 0 4px;
  overflow: hidden;
}
.tab-nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold-shimmer);
  opacity: 0;
  transition: opacity var(--t-med);
  pointer-events: none;
}
.tab-nav-btn:hover { background: rgba(255, 255, 255, 0.55); color: var(--ink-1); transform: translateY(-1px); }
.tab-nav-btn:hover::before { opacity: 0.45; }
.tab-nav-btn.active {
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-1);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--border-med), 0 0 0 4px rgba(161, 98, 7, 0.04);
  backdrop-filter: blur(8px);
}
.tab-nav-btn.active::before { opacity: 0.5; }
.tab-nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--gold);
  transition: transform var(--t-med);
}
.tab-nav-btn:hover .tab-nav-icon { transform: translateY(-1px); }
.tab-nav-btn.active .tab-nav-icon { color: var(--gold-deep); }
.tab-nav-text { display: flex; flex-direction: column; gap: 1px; }
.tab-nav-label {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: 0;
}
.tab-nav-desc {
  font-size: 0.7rem;
  color: var(--ink-3);
  font-weight: 400;
}
.tab-nav-btn.active .tab-nav-desc { color: var(--ink-2); }

/* ═══ TAB HOST ═════════════════════════════════════ */
.tab-host {
  max-width: 1320px;
  margin: 0 auto;
  padding: 3rem 2.5rem 8rem;
  min-height: calc(100vh - 200px);
}
.tab-empty {
  padding: 5rem 2rem;
  text-align: center;
  color: var(--ink-3);
  font-family: var(--font-sans);
}

/* ═══ HERO ═════════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 2rem 1rem 3rem;
  max-width: 880px;
  margin: 0 auto 3rem;
  border-bottom: 1px solid var(--border-soft);
}
.hero-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  font-weight: 500;
  color: var(--gold-deep);
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}
.hero-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink-1);
  margin-bottom: 1rem;
}
.hero-title em { font-style: italic; color: var(--gold-deep); }
.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--ink-2);
  line-height: 1.5;
  max-width: 640px;
  margin: 0 auto 2rem;
}
.hero-body {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--ink-2);
  max-width: 640px;
  margin: 0 auto 2rem;
}
.hero-howto {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
  text-align: left;
}
.hero-howto-step {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow-xs);
}
.hero-howto-num {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--gold-deep);
  margin-bottom: 0.4rem;
  line-height: 1;
}
.hero-howto-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-1);
  margin-bottom: 0.4rem;
}
.hero-howto-desc {
  font-size: 0.8rem;
  color: var(--ink-3);
  line-height: 1.6;
}

.hero-body {
  text-align: left;
  max-width: 920px;
  margin: 0 auto 2.5rem;
}
.hero-body p {
  font-size: 1.1rem;
  line-height: 1.78;
  color: var(--ink-2);
  margin-bottom: 1.2rem;
}
.hero-body p:last-child { margin-bottom: 0; }
.hero-body p strong { color: var(--ink-1); font-weight: 600; }

.hero-why {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: 2.4rem 2.8rem;
  margin: 2.5rem auto;
  max-width: 920px;
  text-align: left;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}
.hero-why::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
}
.hero-why-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--gold-deep);
  margin-bottom: 1rem;
}
.hero-why p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-2);
  margin-bottom: 0.9rem;
}
.hero-why p:last-child { margin-bottom: 0; }

.hero-promise {
  background: linear-gradient(135deg, var(--gold-bg) 0%, var(--bg-card-2) 100%);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-xl);
  padding: 2.4rem 2.8rem;
  margin: 2.5rem auto 0;
  max-width: 920px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}
.hero-promise-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1rem;
}
.hero-promise p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-2);
  margin-bottom: 0.9rem;
}
.hero-promise p:last-child { margin-bottom: 0; }

.intro-body p {
  font-size: 1.05rem;
  line-height: 1.78;
  color: var(--ink-2);
  margin-bottom: 1.1rem;
  text-align: left;
}
.intro-body p:last-child { margin-bottom: 0; }
.intro-body p strong { color: var(--ink-1); font-weight: 600; }
.intro-body { text-align: left; max-width: 880px; margin: 0 auto; }
.intro { max-width: 920px; }

/* ATLAS, VIEW TOGGLE */
.atlas-view-toggle {
  display: inline-flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 100px;
  padding: 4px;
  margin: 1.5rem auto 0;
  box-shadow: var(--shadow-xs);
}
.atlas-toggle-btn {
  padding: 0.55rem 1.2rem;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--t-med);
}
.atlas-toggle-btn:hover { color: var(--ink-1); }
.atlas-toggle-btn.active {
  background: var(--ink-1);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
}
.atlas-toggle-btn svg { width: 16px; height: 16px; }

/* ATLAS, TREE VIEW */
.tree-view {
  position: relative;
  margin-top: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.tree-controls {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tree-ctrl {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-med);
  color: var(--ink-1);
  font-size: 1.1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  box-shadow: var(--shadow-xs);
}
.tree-ctrl:hover { background: var(--gold-bg); border-color: var(--gold); }
.tree-hint {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--ink-3);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  padding: 0.5rem 0.9rem;
  border-radius: 100px;
  margin-left: 0.4rem;
}
.tree-viewport {
  position: relative;
  height: 720px;
  overflow: hidden;
  cursor: grab;
  background:
    radial-gradient(circle at 25% 30%, rgba(176, 122, 48, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 75% 70%, rgba(160, 56, 48, 0.03) 0%, transparent 40%),
    var(--bg-card);
}
.tree-canvas {
  position: relative;
  transform-origin: 0 0;
  transition: transform 0.05s linear;
  will-change: transform;
}
.tree-svg {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
}
.tree-svg path { transition: stroke 0.2s, stroke-width 0.2s; }
.tree-node {
  position: absolute;
  background: var(--bg-card);
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-lg);
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  transition: all var(--t-med);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.tree-node::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--layer-tint, var(--gold));
  opacity: 0.7;
}
.tree-node:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: var(--layer-tint, var(--gold));
  z-index: 3;
}
.tree-node.locked {
  opacity: 0.36;
  cursor: not-allowed;
  background: var(--bg-alt);
}
.tree-node.locked:hover { transform: none; box-shadow: var(--shadow-xs); }
.tree-node.unlocked { border-color: var(--gold-border); }
.tree-node.fully-completed {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--gold-bg) 100%);
  border-color: var(--gold);
}
.tree-node.on-path {
  border-color: var(--layer-tint, var(--gold));
  box-shadow: 0 0 0 3px var(--gold-bg-2), var(--shadow-md);
  z-index: 4;
}
.tree-node-layer {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--layer-tint, var(--ink-3));
  text-transform: uppercase;
}
.tree-node-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.25;
  color: var(--ink-1);
}
.tree-node-progress {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-top: auto;
}
.tree-node-lock {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border-med);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
}
.tree-node-lock svg { width: 8px; height: 8px; }

/* ATLAS, PYRAMID VIEW */
.pyramid-view {
  margin-top: 1rem;
}
.pyramid-breadcrumb {
  position: sticky;
  top: 100px;
  z-index: 5;
  background: rgba(250, 247, 239, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.9rem 1.4rem;
  border: 1px solid var(--border-soft);
  border-radius: 100px;
  margin: 0 auto 1.5rem;
  max-width: 760px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-med);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.bc-empty { color: var(--ink-3); font-style: italic; font-family: var(--font-serif); }
.bc-item {
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.bc-item.current { color: var(--ink-1); font-weight: 600; }
.bc-layer {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  background: var(--gold-bg);
  color: var(--gold-deep);
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  border: 1px solid var(--gold-border);
}
.bc-sep { color: var(--ink-4); margin: 0 0.3rem; }

.pyramid-band {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  padding: 2rem 2rem 2.4rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-xs);
  transition: all var(--t-med);
}
.pyramid-band::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 3px;
  background: var(--layer-tint, var(--gold));
  border-radius: 100px;
}
.pyramid-band-head {
  text-align: center;
  margin-bottom: 1.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.pyramid-band-name {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--layer-tint, var(--gold-deep));
  margin-bottom: 0.5rem;
}
.pyramid-band-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--ink-1);
  margin-bottom: 0.4rem;
}
.pyramid-band-desc {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.96rem;
  color: var(--ink-2);
  line-height: 1.55;
}
.pyramid-band-nodes {
  display: grid;
  gap: 0.7rem;
  margin: 0 auto;
}
.pyramid-band-nodes[data-cols="1"] { grid-template-columns: minmax(0, 320px); justify-content: center; }
.pyramid-band-nodes[data-cols="2"] { grid-template-columns: repeat(2, 1fr); max-width: 720px; }
.pyramid-band-nodes[data-cols="3"] { grid-template-columns: repeat(3, 1fr); max-width: 900px; }
.pyramid-band-nodes[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
.pyramid-band-nodes[data-cols="5"] { grid-template-columns: repeat(5, 1fr); }
.pyramid-band-nodes[data-cols="6"] { grid-template-columns: repeat(6, 1fr); }

.pyramid-node {
  background: var(--bg-card);
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-lg);
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  transition: all var(--t-med);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  position: relative;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  min-height: 96px;
}
.pyramid-node::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--layer-tint, var(--gold));
  opacity: 0;
  transition: opacity var(--t-fast);
}
.pyramid-node:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--layer-tint, var(--gold));
}
.pyramid-node:hover::after { opacity: 1; }
.pyramid-node.locked { opacity: 0.42; cursor: not-allowed; background: var(--bg-alt); }
.pyramid-node.locked:hover { transform: none; box-shadow: var(--shadow-xs); }
.pyramid-node.unlocked { border-color: var(--gold-border); }
.pyramid-node.fully-completed { background: linear-gradient(135deg, var(--bg-card) 0%, var(--gold-bg) 100%); border-color: var(--gold); }
.pyramid-node-title { font-family: var(--font-serif); font-weight: 600; font-size: 0.95rem; line-height: 1.3; color: var(--ink-1); }
.pyramid-node-sub { font-family: var(--font-sans); font-size: 0.75rem; color: var(--ink-3); line-height: 1.45; }
.pyramid-node-progress { font-family: var(--font-sans); font-size: 0.6rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-deep); margin-top: auto; }
.pyramid-node.locked .pyramid-node-progress { color: var(--ink-4); }
.pyramid-node-lock {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border-med);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
}
.pyramid-node-lock svg { width: 10px; height: 10px; }

.node-detail-breadcrumb {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin-bottom: 0.6rem;
}

/* ═══════════════════════════════════════════════════
   ATLAS v6, clean layer-by-layer with Liquid Glass
   Following ui-ux-pro-max recommendations.
   ═══════════════════════════════════════════════════ */

.atlas-breadcrumb {
  position: sticky;
  top: 100px;
  z-index: 5;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  padding: 0.85rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 100px;
  margin: 0 auto 2rem;
  max-width: 820px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  text-align: center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 4px 20px rgba(28, 25, 23, 0.06);
  transition: all var(--t-med);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.atlas-breadcrumb--inline {
  position: static;
  margin: 0 0 1rem;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  backdrop-filter: none;
  justify-content: flex-start;
  text-align: left;
  min-height: 0;
}
.atlas-bc-empty {
  color: var(--ink-3);
  font-size: 0.85rem;
}
.atlas-bc-item {
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
}
.atlas-bc-item.is-current { color: var(--ink-1); font-weight: 600; }
.atlas-bc-layer {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--gold-bg-2);
  color: var(--gold-deep);
  padding: 0.18rem 0.55rem;
  border-radius: 100px;
  border: 1px solid var(--gold-border);
}
.atlas-bc-sep {
  width: 14px;
  height: 14px;
  color: var(--ink-4);
}

.atlas-layers {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.atlas-layer {
  position: relative;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-2) 100%);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-2xl);
  padding: 2rem 2rem 2.2rem;
  box-shadow: 0 4px 14px rgba(20, 17, 13, 0.05);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  overflow: hidden;
}
.atlas-layer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 80px;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(161, 98, 7, 0.06) 0%, transparent 70%);
  pointer-events: none;
}
.atlas-layer.is-active {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(254, 248, 232, 0.78) 100%);
  border-color: rgba(161, 98, 7, 0.32);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 16px 36px rgba(161, 98, 7, 0.10);
}
.atlas-layer.is-active::before {
  background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(161, 98, 7, 0.18) 0%, transparent 70%);
}
.atlas-layer.is-locked {
  opacity: 0.55;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(232, 229, 220, 0.5) 100%);
}

.atlas-layer-head {
  text-align: center;
  margin-bottom: 1.6rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}
.atlas-layer-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  justify-content: center;
}
.atlas-layer-num {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.atlas-layer-badge {
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.22rem 0.6rem;
  border-radius: 100px;
  background: var(--gold-bg-2);
  color: var(--gold-deep);
  border: 1px solid var(--gold-border);
}
.atlas-layer-badge--locked {
  background: rgba(120, 113, 108, 0.10);
  color: var(--ink-3);
  border-color: rgba(120, 113, 108, 0.22);
}
.atlas-layer-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: -0.022em;
  color: var(--ink-1);
  margin-bottom: 0.4rem;
}
.atlas-layer-desc {
  font-family: var(--font-sans);
  font-size: 0.96rem;
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 540px;
  margin: 0 auto;
}

.atlas-nodes {
  display: grid;
  gap: 0.85rem;
  position: relative;
  z-index: 1;
}
.atlas-nodes[data-count="1"] { grid-template-columns: minmax(0, 360px); justify-content: center; }
.atlas-nodes[data-count="2"] { grid-template-columns: repeat(2, 1fr); max-width: 760px; margin: 0 auto; }
.atlas-nodes[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
.atlas-nodes[data-count="4"] { grid-template-columns: repeat(4, 1fr); }
.atlas-nodes[data-count="5"] { grid-template-columns: repeat(5, 1fr); }
.atlas-nodes[data-count="6"], .atlas-nodes[data-count="7"], .atlas-nodes[data-count="8"], .atlas-nodes[data-count="9"], .atlas-nodes[data-count="10"], .atlas-nodes[data-count="11"], .atlas-nodes[data-count="12"] { grid-template-columns: repeat(6, 1fr); }

.atlas-node {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem 1.2rem;
  cursor: pointer;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 110px;
  box-shadow: 0 1px 2px rgba(20, 17, 13, 0.04);
  overflow: hidden;
}
.atlas-node::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold-shimmer);
  opacity: 0;
  transition: opacity var(--t-med);
  pointer-events: none;
}
.atlas-node:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 14px 30px rgba(28, 25, 23, 0.08),
    0 0 0 1px var(--gold-border);
  border-color: rgba(255, 255, 255, 1);
}
.atlas-node:hover::before { opacity: 0.6; }
.atlas-node.locked {
  opacity: 0.45;
  cursor: not-allowed;
  background: linear-gradient(180deg, rgba(248, 245, 238, 0.78) 0%, rgba(232, 229, 220, 0.55) 100%);
}
.atlas-node.locked:hover { transform: none; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, var(--shadow-xs); }
.atlas-node.locked:hover::before { opacity: 0; }
.atlas-node.unlocked {
  border-color: rgba(161, 98, 7, 0.20);
}
.atlas-node.fully-completed {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(254, 244, 220, 0.78) 100%);
  border-color: rgba(161, 98, 7, 0.36);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 8px 20px rgba(161, 98, 7, 0.14);
}
.atlas-node-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.012em;
  color: var(--ink-1);
  line-height: 1.25;
  position: relative;
  z-index: 1;
}
.atlas-node-sub {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--ink-3);
  line-height: 1.5;
  position: relative;
  z-index: 1;
}
.atlas-node-meta {
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-top: auto;
  padding-top: 0.4rem;
  position: relative;
  z-index: 1;
}
.atlas-node.locked .atlas-node-meta { color: var(--ink-4); }
.atlas-node-lock {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(120, 113, 108, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  z-index: 2;
}
.atlas-node-lock svg { width: 10px; height: 10px; }
.atlas-node-check {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 8px rgba(161, 98, 7, 0.32);
  z-index: 2;
}
.atlas-node-check svg { width: 13px; height: 13px; }

@media (max-width: 1100px) {
  .atlas-nodes[data-count="5"], .atlas-nodes[data-count="6"], .atlas-nodes[data-count="7"], .atlas-nodes[data-count="8"], .atlas-nodes[data-count="9"], .atlas-nodes[data-count="10"], .atlas-nodes[data-count="11"], .atlas-nodes[data-count="12"] { grid-template-columns: repeat(4, 1fr); }
  .atlas-nodes[data-count="3"], .atlas-nodes[data-count="4"] { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .atlas-nodes { grid-template-columns: 1fr !important; }
  .atlas-breadcrumb { top: 90px; margin: 0 auto 1.5rem; }
  .atlas-layer { padding: 1.5rem 1.3rem 1.7rem; }
  .atlas-layer-title { font-size: 1.4rem; }
}

/* ═══════════════════════════════════════════════════
   JOURNEY, Duolingo-style winding path
   ═══════════════════════════════════════════════════ */

.journey {
  margin: 5rem auto 3rem;
  max-width: 760px;
}
.journey-head { text-align: center; margin-bottom: 2.5rem; }
.journey-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.8rem;
}
.journey-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.022em;
  color: var(--ink-1);
  margin-bottom: 0.6rem;
}
.journey-sub {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink-3);
  max-width: 540px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}
.journey-progress-track {
  height: 8px;
  background: var(--bg-deep);
  border-radius: 100px;
  overflow: hidden;
  max-width: 480px;
  margin: 0 auto 0.6rem;
  box-shadow: inset 0 1px 2px rgba(20, 17, 13, 0.08);
}
.journey-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
  border-radius: 100px;
  transition: width 0.8s var(--t-fluid);
}
.journey-stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--ink-3);
  align-items: center;
}
.journey-stats-dot { color: var(--ink-4); }

.journey-path {
  position: relative;
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.journey-path::before {
  /* Faint center vertical guide */
  content: '';
  position: absolute;
  left: 50%;
  top: 1rem;
  bottom: 1rem;
  width: 2px;
  background: linear-gradient(180deg, transparent 0%, var(--ink-5) 8%, var(--ink-5) 92%, transparent 100%);
  transform: translateX(-50%);
  z-index: 0;
}

.journey-node {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin-bottom: 1.8rem;
  cursor: pointer;
  transform: translateX(var(--offset, 0));
  transition: transform 0.25s cubic-bezier(0.34, 1.16, 0.4, 1), box-shadow 0.25s;
  z-index: 1;
  background: var(--bg-card);
  border: 3px solid var(--ink-5);
  box-shadow: 0 4px 10px rgba(20, 17, 13, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.journey-node:hover {
  transform: translateX(var(--offset, 0)) translateY(-4px) scale(1.06);
  box-shadow: 0 12px 28px rgba(20, 17, 13, 0.18);
  z-index: 3;
}
.journey-node-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.journey-node-inner svg { width: 32px; height: 32px; color: currentColor; }
.journey-node-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.journey-node.is-done {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  border-color: var(--gold-deep);
  color: white;
  box-shadow: 0 6px 16px rgba(139, 90, 26, 0.32), inset 0 2px 6px rgba(255, 255, 255, 0.5);
}
.journey-node.is-available {
  background: var(--bg-card);
  border-color: var(--gold);
  color: var(--gold-deep);
  box-shadow: 0 4px 12px rgba(139, 90, 26, 0.18);
}
.journey-node.is-current {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-2) 100%);
  border-color: var(--gold);
  color: var(--gold-deep);
  box-shadow:
    0 0 0 4px rgba(139, 90, 26, 0.18),
    0 0 0 12px rgba(139, 90, 26, 0.06),
    0 8px 24px rgba(139, 90, 26, 0.22);
  animation: journeyPulse 2.4s ease-in-out infinite;
}
@keyframes journeyPulse {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(139, 90, 26, 0.18),
      0 0 0 12px rgba(139, 90, 26, 0.06),
      0 8px 24px rgba(139, 90, 26, 0.22);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(139, 90, 26, 0.28),
      0 0 0 18px rgba(139, 90, 26, 0.08),
      0 10px 30px rgba(139, 90, 26, 0.30);
  }
}
.journey-node.is-locked {
  background: var(--bg-alt);
  border-color: var(--ink-5);
  color: var(--ink-4);
  cursor: not-allowed;
  opacity: 0.6;
}
.journey-node.is-locked:hover { transform: translateX(var(--offset, 0)); box-shadow: 0 4px 10px rgba(20, 17, 13, 0.08); }

.journey-node-label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
  width: 200px;
  text-align: left;
}
.journey-node[style*="--offset:-110"] .journey-node-label,
.journey-node[style*="--offset:-80"] .journey-node-label {
  left: calc(100% + 1rem);
}
.journey-node[style*="--offset:80"] .journey-node-label,
.journey-node[style*="--offset:110"] .journey-node-label {
  right: calc(100% + 1rem);
  text-align: right;
}
.journey-node[style*="--offset:0"] .journey-node-label {
  left: calc(100% + 1rem);
}
.journey-node:hover .journey-node-label { opacity: 1; }
.journey-node-layer {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.2rem;
}
.journey-node-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-1);
  line-height: 1.3;
}

.journey-more {
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--ink-3);
  margin-top: 1.5rem;
  font-style: italic;
}

.journey-chapters {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.journey-chapter {
  position: relative;
  margin-bottom: 1.5rem;
}

.journey-chapter-head {
  text-align: center;
  margin: 2rem auto 1.5rem;
  max-width: 580px;
  padding: 1.6rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 14px rgba(20, 17, 13, 0.05);
  position: relative;
}
.journey-chapter-head::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
}
.journey-chapter-num {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.5rem;
}
.journey-chapter-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.65rem;
  letter-spacing: -0.024em;
  color: var(--ink-1);
  margin-bottom: 0.4rem;
}
.journey-chapter-sub {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--ink-3);
  line-height: 1.55;
  margin-bottom: 1rem;
}
.journey-chapter-progress {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  max-width: 380px;
  margin: 0 auto;
}
.journey-chapter-progress-track {
  flex: 1;
  height: 6px;
  background: var(--bg-deep);
  border-radius: 100px;
  overflow: hidden;
}
.journey-chapter-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
  border-radius: 100px;
  transition: width 0.8s var(--t-fluid);
}
.journey-chapter-progress-text {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-deep);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.journey-fork {
  margin: 2.5rem auto 1.5rem;
  max-width: 560px;
  text-align: center;
}
.journey-fork-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.6rem;
}
.journey-fork-lines {
  margin: 0 auto;
  max-width: 320px;
}
.journey-fork-options {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin: -1rem auto 1rem;
  max-width: 320px;
}
.journey-fork-option {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.4;
}
.journey-fork-option strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink-1);
}
.journey-fork-note {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--ink-3);
  font-style: italic;
  line-height: 1.6;
  max-width: 460px;
  margin: 0 auto;
}

.journey-node-lock-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.journey-node-lock-overlay svg {
  width: 22px;
  height: 22px;
  color: var(--ink-3);
}
.journey-node.is-locked .journey-node-num { display: none; }

@media (max-width: 720px) {
  .journey-node { width: 72px; height: 72px; margin-bottom: 1.4rem; }
  .journey-node-num { font-size: 1.3rem; }
  .journey-node-inner svg { width: 26px; height: 26px; }
  .journey-node-label { display: none; }
  .journey-node { --offset: 0 !important; transform: none !important; }
  .journey-node:hover { transform: translateY(-3px) scale(1.04) !important; }
}

/* ═══ INTRO BLOCK (for non-home tabs) ═══════════════ */
.intro {
  max-width: 760px;
  margin: 0 auto 3rem;
  text-align: center;
  padding: 1rem;
}
.intro-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  font-weight: 500;
  color: var(--gold-deep);
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.intro-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 2.4rem;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--ink-1);
  margin-bottom: 1rem;
}
.intro-title em { font-style: italic; color: var(--gold-deep); }
.intro-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-2);
}

/* ═══ CURRICULUM, recommended quest card ════════════ */
.q-current {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.65) 100%);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-2xl);
  padding: 2.5rem 2.8rem;
  margin-bottom: 3rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(161, 98, 7, 0.06) inset,
    var(--shadow-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--t-fluid);
}
.q-current::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at top right, rgba(202, 138, 4, 0.10) 0%, transparent 50%),
    radial-gradient(ellipse 80% 40% at bottom left, rgba(161, 98, 7, 0.06) 0%, transparent 55%);
  pointer-events: none;
}
.q-current::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.9) 50%, transparent 100%);
  pointer-events: none;
}
.q-current:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, var(--shadow-xl); }
.q-current-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1rem;
  position: relative;
}
.q-current-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 2.2rem;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--ink-1);
  margin-bottom: 0.8rem;
  position: relative;
}
.q-current-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-bottom: 1.5rem;
  position: relative;
}
.q-current-meta-item { display: flex; align-items: center; gap: 0.4rem; }
.q-current-meta-item::before { content: '·'; color: var(--gold); font-size: 1.4rem; line-height: 0.4; }
.q-current-meta-item:first-child::before { display: none; }
.q-current-summary {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 620px;
  margin-bottom: 2rem;
  position: relative;
}
.btn-primary {
  background: var(--ink-1);
  color: var(--bg);
  padding: 0.85rem 1.7rem;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  transition: all var(--t-med);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}
.btn-primary:hover { background: var(--gold-deep); transform: translateY(-1px); box-shadow: var(--shadow-gold); }
.btn-primary svg { width: 16px; height: 16px; }
.btn-secondary {
  background: var(--bg-card);
  color: var(--ink-1);
  padding: 0.85rem 1.7rem;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.92rem;
  border: 1px solid var(--border-med);
  margin-left: 0.6rem;
  transition: all var(--t-med);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--ink-3); }

/* Quest cards (available/locked/completed) */
.q-section-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 2.5rem 0 1.2rem;
}
.q-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1rem;
}
.q-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.75) 100%);
  backdrop-filter: saturate(170%) blur(12px);
  -webkit-backdrop-filter: saturate(170%) blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  cursor: pointer;
  transition: all var(--t-fluid);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 120px;
  position: relative;
  overflow: hidden;
}
.q-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold-shimmer);
  opacity: 0;
  transition: opacity var(--t-med);
  pointer-events: none;
}
.q-card:hover {
  transform: translateY(-3px) scale(1.005);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.95) inset, var(--shadow-lg);
  border-color: var(--gold-border);
}
.q-card:hover::before { opacity: 0.7; }
.q-card.locked { opacity: 0.5; cursor: not-allowed; background: var(--bg-alt); }
.q-card.locked:hover { transform: none; box-shadow: var(--shadow-xs); }
.q-card.completed { background: var(--bg-card-2); border-color: var(--gold-border); }
.q-card-tier {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.q-card-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--ink-1);
}
.q-card-meta {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-top: auto;
}
.q-card.completed .q-card-title::after { content: ' ✓'; color: var(--moss); font-size: 0.9rem; }
.q-card-lock-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border-med);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
}
.q-card-lock-badge svg { width: 12px; height: 12px; }

/* ═══ QUEST PLAYER ═════════════════════════════════ */
.quest-player {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(250, 247, 239, 0.96);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  overflow-y: auto;
  padding: 4rem 1.5rem 6rem;
}
.quest-player.hidden { display: none; }
.quest-shell {
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.quest-close {
  position: fixed;
  top: 1.4rem;
  right: 1.6rem;
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-med);
  border-radius: 50%;
  color: var(--ink-2);
  font-size: 1.2rem;
  transition: all var(--t-med);
  z-index: 110;
  box-shadow: var(--shadow-sm);
}
.quest-close:hover { color: var(--crimson); border-color: var(--crimson-border); }
.quest-head {
  padding: 3rem 3rem 2rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-card-2);
}
.quest-tag {
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1rem;
}
.quest-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 2.4rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink-1);
  margin-bottom: 1rem;
}
.quest-meta {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--ink-3);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.quest-body { padding: 0 3rem 2rem; }
.quest-chapter { padding: 2.4rem 0 2rem; border-bottom: 1px solid var(--border-soft); }
.quest-chapter:last-of-type { border-bottom: none; }
.quest-chapter-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--gold-deep);
  margin-bottom: 1.4rem;
  letter-spacing: -0.005em;
}
.quest-chapter-body {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--ink-1);
  white-space: pre-line;
  font-weight: 400;
}
.quest-action {
  background: var(--bg-card-2);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.6rem 1.8rem;
  margin: 2rem 0;
}
.quest-action-label {
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.7rem;
}
.quest-action-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink-1);
}
.quest-research {
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.4rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--ink-2);
  line-height: 1.7;
  margin-bottom: 2rem;
}
.quest-research-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.5rem;
}

/* ═══ TEST UI ══════════════════════════════════════ */
.quest-test-area {
  margin: 1rem 0 0;
  padding: 2rem 3rem 2.5rem;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-alt);
}
.quest-test-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1.5rem;
  text-align: center;
}
.test-q {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.8rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-xs);
}
.test-q-num {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 0.6rem;
}
.test-q-prompt {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.18rem;
  color: var(--ink-1);
  line-height: 1.5;
  margin-bottom: 1.2rem;
}
.test-q-options { display: flex; flex-direction: column; gap: 0.45rem; }
.test-q-option {
  background: var(--bg-card);
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.2rem;
  text-align: left;
  color: var(--ink-1);
  font-size: 0.95rem;
  line-height: 1.5;
  transition: all var(--t-fast);
}
.test-q-option:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--gold-bg);
  transform: translateX(2px);
}
.test-q-option:disabled { cursor: not-allowed; opacity: 0.65; }
.test-q-option.is-correct {
  background: var(--moss-bg);
  border-color: var(--moss-border);
  color: var(--ink-1);
}
.test-q-option.is-correct-reveal {
  background: var(--moss-bg);
  border-color: var(--moss-border);
  opacity: 0.78;
}
.test-q-option.is-wrong {
  background: var(--crimson-bg);
  border-color: var(--crimson-border);
}
.test-q-fill {
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-md);
  color: var(--ink-1);
  padding: 0.75rem 1.1rem;
  font-size: 1rem;
  margin-bottom: 0.7rem;
  transition: border-color var(--t-fast);
}
.test-q-fill:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px var(--gold-bg); }
.test-q-controls { margin-top: 0.8rem; }
.test-q-check {
  background: var(--ink-1);
  color: var(--bg);
  padding: 0.55rem 1.3rem;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--t-fast);
}
.test-q-check:hover:not(:disabled) { background: var(--gold-deep); }
.test-q-check:disabled { opacity: 0.5; cursor: not-allowed; }
.test-q-feedback { margin-top: 1rem; }
.test-q-explanation {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.65;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  border-left: 3px solid;
}
.test-q-explanation.right { color: var(--ink-1); background: var(--moss-bg); border-color: var(--moss); }
.test-q-explanation.wrong { color: var(--ink-1); background: var(--crimson-bg); border-color: var(--crimson); }
.test-q-order-list { display: flex; flex-direction: column; gap: 0.45rem; }
.test-q-order-item {
  background: var(--bg-card);
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  color: var(--ink-1);
  cursor: grab;
  user-select: none;
  font-size: 0.92rem;
  transition: all var(--t-fast);
}
.test-q-order-item:hover { border-color: var(--gold); }
.test-q-order-item.is-dragging { opacity: 0.4; }
.test-q-order-item.is-locked { background: var(--moss-bg); border-color: var(--moss-border); cursor: default; }
.test-q-match-grid { display: flex; flex-direction: column; gap: 0.6rem; }
.test-q-match-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 0.8rem; align-items: center; }
.test-q-match-left { background: var(--bg-card-2); padding: 0.65rem 0.9rem; border-radius: var(--radius-md); font-size: 0.9rem; }
.test-q-match-select { background: var(--bg-card); border: 1.5px solid var(--border-med); border-radius: var(--radius-md); padding: 0.6rem 0.9rem; font-size: 0.9rem; color: var(--ink-1); }
.test-q-match-select:focus { border-color: var(--gold); outline: none; }
.quest-submit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
  gap: 1rem;
}
.quest-submit-status {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--ink-3);
}
.quest-submit-btn {
  background: var(--ink-1);
  color: var(--bg);
  padding: 0.85rem 2rem;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.92rem;
  transition: all var(--t-med);
}
.quest-submit-btn:disabled { background: var(--ink-4); cursor: not-allowed; }
.quest-submit-btn:hover:not(:disabled) { background: var(--gold-deep); transform: translateY(-1px); box-shadow: var(--shadow-gold); }

/* ═══ ATLAS, skill tree ═══════════════════════════ */
.atlas {
  position: relative;
}
.atlas-svg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.atlas-layer {
  position: relative;
  z-index: 1;
  margin-bottom: 4rem;
  padding: 2rem 0;
}
.atlas-layer-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(176, 122, 48, 0.05) 0%, transparent 60%);
  border-radius: var(--radius-2xl);
  pointer-events: none;
  z-index: -1;
}
.atlas-layer-head {
  text-align: center;
  margin-bottom: 2rem;
}
.atlas-layer-name {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.5rem;
}
.atlas-layer-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--ink-1);
  margin-bottom: 0.5rem;
}
.atlas-layer-desc {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-2);
  max-width: 560px;
  margin: 0 auto;
}
.atlas-row {
  display: grid;
  gap: 0.8rem;
  position: relative;
}
.atlas-row[data-cols="1"] { grid-template-columns: minmax(0, 280px); justify-content: center; }
.atlas-row[data-cols="2"] { grid-template-columns: repeat(2, 1fr); max-width: 780px; margin: 0 auto; }
.atlas-row[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.atlas-row[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
.atlas-row[data-cols="5"] { grid-template-columns: repeat(5, 1fr); }
.atlas-row[data-cols="6"] { grid-template-columns: repeat(6, 1fr); }

.atlas-node {
  background: var(--bg-card);
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: all var(--t-med);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 96px;
  z-index: 2;
  box-shadow: var(--shadow-xs);
}
.atlas-node:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--gold); }
.atlas-node.locked {
  opacity: 0.42;
  cursor: not-allowed;
  background: var(--bg-alt);
}
.atlas-node.locked:hover { transform: none; box-shadow: var(--shadow-xs); border-color: var(--border-med); }
.atlas-node.unlocked { border-color: var(--gold-border); }
.atlas-node.fully-completed {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--gold-bg) 100%);
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}
.atlas-node-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--ink-1);
}
.atlas-node-sub {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--ink-3);
  line-height: 1.45;
}
.atlas-node-progress {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-top: auto;
}
.atlas-node.locked .atlas-node-progress { color: var(--ink-4); }
.atlas-node-lock {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border-med);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
}
.atlas-node-lock svg { width: 10px; height: 10px; }

.pyr-detail {
  position: fixed; inset: 0;
  z-index: 95;
  background: rgba(250, 247, 239, 0.96);
  backdrop-filter: saturate(180%) blur(20px);
  padding: 4rem 1.5rem 4rem;
  overflow-y: auto;
}
.pyr-detail.hidden { display: none; }
.pyr-detail-shell {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.pyr-detail-head { padding: 2.2rem 2.4rem 1.6rem; background: var(--bg-card-2); border-bottom: 1px solid var(--border-soft); }
.pyr-detail-body { padding: 1.6rem 2.4rem 2.4rem; }

/* ═══ CODEX, book aesthetic ════════════════════════ */
.codex-book {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 3rem;
}
.codex-book-head {
  background: linear-gradient(180deg, var(--bg-card-2) 0%, var(--bg-card) 100%);
  padding: 2.5rem 3rem;
  text-align: center;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
}
.codex-book-head::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -1px;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: var(--gold);
}
.codex-book-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1rem;
}
.codex-book-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 2.4rem;
  letter-spacing: -0.01em;
  color: var(--ink-1);
  margin-bottom: 0.6rem;
}
.codex-book-title em { font-style: italic; color: var(--gold-deep); }
.codex-book-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-2);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.55;
}
.codex-book-progress {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-top: 1.2rem;
  letter-spacing: 0.08em;
}
.codex-book-progress strong { color: var(--gold-deep); font-weight: 600; }

.codex-entries {
  padding: 1rem 2rem 2.5rem;
  background: var(--bg-card);
  background-image:
    linear-gradient(90deg, transparent 0%, transparent calc(50% - 1px), var(--border-soft) calc(50% - 1px), var(--border-soft) calc(50% + 0px), transparent calc(50% + 0px));
}
@media (max-width: 760px) { .codex-entries { background-image: none; } }
.codex-entry {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.8rem;
  margin: 1.2rem 0;
  cursor: pointer;
  transition: all var(--t-med);
  position: relative;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 1.2rem;
  align-items: start;
}
.codex-entry:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--gold); }
.codex-entry.locked { opacity: 0.42; cursor: not-allowed; background: var(--bg-alt); }
.codex-entry.locked .codex-entry-body { filter: blur(2.5px); }
.codex-entry.locked:hover { transform: none; box-shadow: none; border-color: var(--border-soft); }
.codex-entry.completed { border-color: var(--gold-border); background: var(--bg-card-2); }
.codex-entry-numeral {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 2.2rem;
  color: var(--gold);
  line-height: 1;
  text-align: center;
}
.codex-entry.prohibition .codex-entry-numeral { color: var(--crimson); }
.codex-entry-body { display: flex; flex-direction: column; gap: 0.4rem; }
.codex-entry-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.18rem;
  color: var(--ink-1);
  line-height: 1.35;
}
.codex-entry-text {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  color: var(--ink-2);
  line-height: 1.55;
}
.codex-entry-meta {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  margin-top: 0.4rem;
}
.codex-entry-status {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-4);
  background: var(--bg-alt);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-med);
  align-self: start;
  white-space: nowrap;
}
.codex-entry.completed .codex-entry-status { background: var(--gold-bg-2); color: var(--gold-deep); border-color: var(--gold-border); }
.codex-entry-status-icon {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 0.3rem;
  background: currentColor;
}

/* ═══ PROFILE TAB ══════════════════════════════════ */
.personal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 1000px) { .personal-grid { grid-template-columns: 1fr; } }
.personal-block {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: 2.2rem 2.4rem;
  box-shadow: var(--shadow-xs);
}
.personal-block-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--ink-1);
  margin-bottom: 1.2rem;
}
.personal-profile-bars { display: flex; flex-direction: column; gap: 0.85rem; }
.personal-bar-row { display: grid; grid-template-columns: 50px 1fr 44px; gap: 0.9rem; align-items: center; }
.personal-bar-label { font-family: var(--font-sans); font-size: 0.78rem; font-weight: 500; color: var(--ink-2); letter-spacing: 0.05em; }
.personal-bar-track { background: var(--bg-deep); height: 10px; border-radius: 100px; overflow: hidden; }
.personal-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%); border-radius: 100px; transition: width 0.8s var(--t-slow); }
.personal-bar-val { font-family: var(--font-serif); font-weight: 600; font-size: 1rem; color: var(--gold-deep); text-align: right; }
.personal-empty { color: var(--ink-2); line-height: 1.7; font-size: 0.98rem; font-family: var(--font-serif); }

.side-quest-card {
  background: var(--bg-card-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.7rem;
  cursor: pointer;
  transition: all var(--t-med);
}
.side-quest-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: var(--gold-border); }
.side-quest-card.scaffold { opacity: 0.6; }
.side-quest-card.completed { background: var(--gold-bg); border-color: var(--gold-border); }
.side-quest-card-title { font-family: var(--font-serif); font-weight: 600; font-size: 1.02rem; color: var(--ink-1); margin-bottom: 0.3rem; }
.side-quest-card-meta { font-family: var(--font-sans); font-size: 0.7rem; color: var(--ink-3); letter-spacing: 0.06em; }
.side-quest-card-tags { font-size: 0.74rem; color: var(--ink-3); margin-top: 0.4rem; font-style: italic; font-family: var(--font-serif); }

/* QUIZ */
.quiz-panel { max-width: 760px; margin: 0 auto; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius-2xl); padding: 3rem; box-shadow: var(--shadow-md); }
.quiz-progress-bar { height: 4px; background: var(--bg-deep); border-radius: 100px; margin-bottom: 1.2rem; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: var(--gold); border-radius: 100px; transition: width 0.4s; }
.quiz-meta { font-family: var(--font-sans); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 1.5rem; }
.quiz-prompt { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 500; line-height: 1.4; margin-bottom: 1.8rem; color: var(--ink-1); }
.quiz-options { display: flex; flex-direction: column; gap: 0.5rem; }
.quiz-option { background: var(--bg-card); border: 1.5px solid var(--border-med); border-radius: var(--radius-md); color: var(--ink-1); padding: 0.85rem 1.2rem; text-align: left; font-size: 0.98rem; transition: all var(--t-fast); }
.quiz-option:hover { border-color: var(--gold); background: var(--gold-bg); }
.quiz-option.selected { border-color: var(--gold); background: var(--gold-bg-2); }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 1.8rem; }
.quiz-nav-btn { background: var(--bg-card); border: 1.5px solid var(--border-med); border-radius: 100px; color: var(--ink-2); padding: 0.75rem 1.5rem; font-family: var(--font-sans); font-size: 0.88rem; font-weight: 500; transition: all var(--t-fast); }
.quiz-nav-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-deep); }
.quiz-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.quiz-nav-btn.primary { background: var(--ink-1); color: var(--bg); border-color: var(--ink-1); }
.quiz-nav-btn.primary:hover:not(:disabled) { background: var(--gold-deep); border-color: var(--gold-deep); }

/* TOASTS */
.toast-host { position: fixed; top: 85px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 0.6rem; pointer-events: none; }
.toast { pointer-events: auto; background: var(--bg-card); border: 1px solid var(--border-med); border-radius: var(--radius-md); padding: 0.8rem 1.2rem; font-family: var(--font-sans); font-size: 0.88rem; color: var(--ink-1); min-width: 200px; max-width: 360px; opacity: 0; transform: translateX(20px); transition: all 0.3s; box-shadow: var(--shadow-md); }
.toast.toast-in { opacity: 1; transform: translateX(0); }
.toast.toast-out { opacity: 0; transform: translateX(20px); }
.toast-achievement { display: flex; gap: 0.9rem; align-items: center; background: linear-gradient(135deg, var(--bg-card-2) 0%, var(--bg-card) 100%); border-color: var(--gold-border); }
.toast-ach-icon { font-family: var(--font-serif); font-size: 1.8rem; color: var(--gold-deep); width: 32px; text-align: center; line-height: 1; }
.toast-ach-title { font-family: var(--font-sans); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 0.2rem; }
.toast-ach-name { font-family: var(--font-serif); font-size: 1rem; font-weight: 600; color: var(--ink-1); }

/* SCROLLBAR */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-med); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* SELECTION */
::selection { background: var(--gold-bg-2); color: var(--ink-1); }

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* MOBILE */
@media (max-width: 900px) {
  .app-hud { gap: 1rem; padding: 0.7rem 1rem; flex-wrap: wrap; }
  .hud-brand { font-size: 0.88rem; padding-right: 0.6rem; }
  .tab-nav { grid-template-columns: repeat(2, 1fr); padding: 0.6rem 1rem; }
  .tab-nav-btn { padding: 0.75rem 0.9rem; }
  .tab-nav-label { font-size: 0.92rem; }
  .tab-nav-desc { font-size: 0.65rem; }
  .tab-host { padding: 2rem 1.2rem 5rem; }
  .hero-howto { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .q-current { padding: 1.8rem 1.6rem; }
  .quest-shell { border-radius: var(--radius-lg); }
  .quest-head, .quest-body, .quest-test-area { padding-left: 1.5rem; padding-right: 1.5rem; }
  .codex-entry { grid-template-columns: 44px 1fr; }
  .codex-entry-status { grid-column: 1 / -1; justify-self: start; margin-top: 0.5rem; }
  .atlas-row[data-cols="4"], .atlas-row[data-cols="5"], .atlas-row[data-cols="6"] { grid-template-columns: repeat(2, 1fr); }
  .atlas-row[data-cols="3"] { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .atlas-row { grid-template-columns: 1fr !important; }
  .codex-book-title, .intro-title, .quest-title { font-size: 1.8rem; }
  .q-current-title { font-size: 1.7rem; }
  .hero-title { font-size: 2rem; }
  .hero-howto { grid-template-columns: 1fr; }
}
