/* ── NAVIGATION ───────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  background: rgba(246, 241, 231, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--s6);
  max-width: 1200px;
  margin: 0 auto;
}
.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-weight: 900;
  font-size: var(--t-lg);
  letter-spacing: -.03em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.nav__logo-mark {
  display: inline-block;
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: var(--r-sm);
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--s1);
  list-style: none;
  padding: 0;
}
.nav__links a {
  display: block;
  padding: var(--s2) var(--s3);
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
  text-decoration: none;
  border-radius: var(--r);
  transition: background var(--tf), color var(--tf);
}
.nav__links a:hover,
.nav__links a.active { background: var(--surface); color: var(--accent); text-decoration: none; }
.nav__links a.active { background: var(--accent); color: #fff; }

.nav__daily-btn {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  background: var(--accent);
  color: #fff !important;
  border-radius: var(--r);
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: background var(--tf), transform var(--tf), box-shadow var(--tf);
}
.nav__daily-btn:hover {
  background: var(--accent-h);
  transform: translateY(-1px);
  box-shadow: var(--sh);
  color: #fff !important;
}

/* Hamburger */
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--s2);
  border-radius: var(--r);
  transition: background var(--tf);
}
.nav__burger:hover { background: var(--border-2); }
.nav__burger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--t), opacity var(--tf);
}
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.nav__mobile {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: var(--bg);
  z-index: 999;
  padding: var(--s8) var(--s6);
  flex-direction: column;
  gap: var(--s2);
  overflow-y: auto;
  border-top: 1px solid var(--border);
}
.nav__mobile.open { display: flex; }
.nav__mobile a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s4) var(--s5);
  font-size: var(--t-lg);
  font-weight: 700;
  color: var(--text);
  border-radius: var(--r-md);
  border: 1px solid var(--border-2);
  background: var(--surface);
  text-decoration: none;
  transition: border-color var(--tf), box-shadow var(--tf);
}
.nav__mobile a:hover { border-color: var(--accent); box-shadow: var(--sh-sm); text-decoration: none; }
.nav__mobile a .arrow { font-size: var(--t-sm); color: var(--text-muted); }

@media (max-width: 1023px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
}

/* ── QUEST LABELS ─────────────────────────────────────────── */
.quest-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.quest-tag--gold  { color: var(--gold); }
.quest-tag--green { color: var(--green); }
.quest-tag--navy  { color: var(--navy); }
.quest-tag::before {
  content: '◆';
  font-size: .5rem;
  opacity: .7;
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: var(--s3) var(--s6);
  border-radius: var(--r);
  font-family: var(--font);
  font-size: var(--t-sm);
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--tf), color var(--tf), border-color var(--tf),
              transform var(--tf), box-shadow var(--tf);
  text-decoration: none;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-h);
  border-color: var(--accent-h);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(199,64,26,.30);
  color: #fff;
  text-decoration: none;
}
.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--outline:hover {
  background: var(--surface);
  border-color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
  text-decoration: none;
  color: var(--text);
}
.btn--ghost {
  background: transparent;
  color: var(--accent);
  border-color: transparent;
}
.btn--ghost:hover {
  background: var(--surface-3);
  text-decoration: none;
  color: var(--accent-h);
}
.btn--lg { padding: var(--s4) var(--s8); font-size: var(--t-base); }
.btn--sm { padding: var(--s2) var(--s4); font-size: var(--t-xs); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; }

/* ── CARD SYSTEM ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--t), transform var(--t);
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--sh); }

/* Content card (fixed height, scrollable body) */
.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
  height: var(--ch);
}
.content-card--lg { height: var(--ch-lg); }
.content-card--sm { height: var(--ch-sm); }

.card-badge {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4) var(--s6) var(--s3);
  border-bottom: 1px solid var(--border-2);
  background: var(--surface-2);
  flex-shrink: 0;
}
.card-badge .quest-tag { margin: 0; }
.card-badge__title {
  font-size: var(--t-lg);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
  flex: 1;
  line-height: 1.2;
}
.card-badge__emoji {
  font-size: 1.2rem;
  line-height: 1;
}

.card-body {
  padding: var(--s6);
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.card-body h3 {
  font-size: var(--t-xl);
  margin-bottom: var(--s3);
}
.card-body h4 {
  font-size: var(--t-lg);
  margin: var(--s5) 0 var(--s3);
}
.card-body h5 {
  font-size: var(--t-base);
  margin: var(--s4) 0 var(--s2);
  color: var(--text);
}
.card-body p { margin-bottom: var(--s3); }
.card-body ul,
.card-body ol { margin-bottom: var(--s4); }
.card-body blockquote { margin: var(--s4) 0; }
.card-body table { margin: var(--s4) 0; }

/* ── CAROUSEL ─────────────────────────────────────────────── */
.carousel { position: relative; }

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
  min-width: 100%;
  scroll-snap-align: start;
  padding: 0 var(--s1);
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: var(--s4);
  margin-top: var(--s4);
  justify-content: flex-end;
}
.carousel-counter {
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-muted);
  min-width: 40px;
  text-align: center;
}
.carousel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  font-size: var(--t-base);
  transition: background var(--tf), border-color var(--tf), color var(--tf), transform var(--tf);
  flex-shrink: 0;
}
.carousel-btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.05);
}
.carousel-btn:disabled {
  opacity: .3;
  cursor: default;
}

/* ── SECTION LAYOUT ───────────────────────────────────────── */
.site-section {
  padding: var(--s16) 0;
}
.site-section + .site-section {
  padding-top: 0;
}
.section-header {
  margin-bottom: var(--s8);
}
.section-header .quest-tag {
  display: block;
  margin-bottom: var(--s3);
}
.section-header h2 {
  margin-bottom: var(--s3);
}
.section-header p {
  font-size: var(--t-lg);
  max-width: 56ch;
}

/* ── HERO ─────────────────────────────────────────────────── */
.page-hero {
  padding: calc(var(--nav-h) + var(--s16)) 0 var(--s16);
}
.page-hero--sm {
  padding: calc(var(--nav-h) + var(--s10)) 0 var(--s10);
}

/* ── QUOTE CARD ───────────────────────────────────────────── */
.quote-card {
  background: var(--text);
  color: #fff;
  border-radius: var(--r-lg);
  padding: var(--s8) var(--s10);
  position: relative;
  overflow: hidden;
  min-height: var(--ch-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.quote-card::before {
  content: '\201C';
  position: absolute;
  top: var(--s4);
  left: var(--s6);
  font-size: 8rem;
  line-height: .8;
  color: rgba(255,255,255,.07);
  font-family: Georgia, serif;
  pointer-events: none;
}
.quote-card__text {
  font-size: clamp(var(--t-lg), 2.5vw, var(--t-2xl));
  font-weight: 600;
  font-style: italic;
  line-height: 1.5;
  color: #fff;
  position: relative;
  z-index: 1;
}
.quote-card__source {
  font-size: var(--t-xs);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-top: var(--s6);
  font-style: normal;
}

/* ── STAT CHIPS ───────────────────────────────────────────── */
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--text-2);
}

/* ── PILL TAGS ────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  padding: var(--s1) var(--s3);
  border-radius: 999px;
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.pill--accent  { background: rgba(199,64,26,.12); color: var(--accent); }
.pill--gold    { background: rgba(212,147,8,.12);  color: var(--gold);   }
.pill--green   { background: rgba(40,92,62,.12);   color: var(--green);  }
.pill--navy    { background: rgba(26,63,107,.12);  color: var(--navy);   }
.pill--muted   { background: var(--surface-3); color: var(--text-muted); }

/* ── ARCHETYPE / ENCOUNTER CARD ───────────────────────────── */
.archetype-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s6);
  height: var(--ch);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  overflow: hidden;
}
.archetype-card__header {
  display: flex;
  align-items: flex-start;
  gap: var(--s4);
}
.archetype-card__icon {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.archetype-card__name {
  font-size: var(--t-xl);
  font-weight: 800;
}
.archetype-card__difficulty {
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .07em;
  text-transform: uppercase;
}
.archetype-card__section-label {
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s2);
}
.archetype-card__text {
  font-size: var(--t-sm);
  line-height: 1.65;
  color: var(--text-2);
}
.archetype-card__handle {
  margin-top: auto;
  padding-top: var(--s4);
  border-top: 1px solid var(--border-2);
}

/* ── FLIP CARD (rapid fire) ───────────────────────────────── */
.flip-card {
  perspective: 1200px;
  height: var(--ch);
  cursor: pointer;
}
.flip-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.4,0,.2,1);
}
.flip-card.flipped .flip-card__inner { transform: rotateY(180deg); }
.flip-card__front,
.flip-card__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--s8);
  text-align: center;
}
.flip-card__front {
  background: var(--surface);
  border: 2px solid var(--border);
}
.flip-card__back {
  background: var(--text);
  color: #fff;
  transform: rotateY(180deg);
}
.flip-card__q-num {
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s4);
}
.flip-card__question {
  font-size: clamp(var(--t-lg), 2.5vw, var(--t-2xl));
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.flip-card__tap-hint {
  margin-top: var(--s6);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.flip-card__answer {
  font-size: var(--t-lg);
  font-weight: 500;
  color: rgba(255,255,255,.9);
  line-height: 1.6;
  overflow-y: auto;
  max-height: 260px;
}
.flip-card__answer-label {
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: var(--s4);
}

/* ── QOTD CARD ────────────────────────────────────────────── */
.qotd-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
}
.qotd-card__header {
  padding: var(--s5) var(--s6);
  background: var(--accent);
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.qotd-card__header-label {
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.75);
}
.qotd-card__header-title {
  font-size: var(--t-lg);
  font-weight: 800;
  color: #fff;
}
.qotd-card__body {
  padding: var(--s6);
}
.qotd-card__question {
  font-size: var(--t-xl);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: var(--s5);
}
.qotd-card__reveal-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s5);
  background: var(--surface-3);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: background var(--tf), border-color var(--tf);
}
.qotd-card__reveal-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.qotd-card__answer {
  display: none;
  margin-top: var(--s5);
  padding: var(--s5);
  background: var(--surface-2);
  border-radius: var(--r-md);
  border-left: 3px solid var(--accent);
}
.qotd-card__answer.visible { display: block; }
.qotd-card__answer p {
  font-size: var(--t-base);
  line-height: 1.7;
}

/* ── LANDING QUEST GRID ───────────────────────────────────── */
.quest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s5);
}
.quest-node {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s6);
  text-decoration: none;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
  overflow: hidden;
  min-height: 200px;
}
.quest-node:hover {
  border-color: var(--accent);
  box-shadow: var(--sh-md);
  transform: translateY(-4px);
  text-decoration: none;
}
.quest-node__num {
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s3);
}
.quest-node__title {
  font-size: var(--t-xl);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: var(--s3);
  line-height: 1.2;
}
.quest-node__desc {
  font-size: var(--t-sm);
  color: var(--text-2);
  line-height: 1.6;
  flex: 1;
}
.quest-node__arrow {
  margin-top: var(--s5);
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.quest-node--accent {
  background: var(--accent);
  border-color: var(--accent);
}
.quest-node--accent .quest-node__num,
.quest-node--accent .quest-node__title,
.quest-node--accent .quest-node__desc,
.quest-node--accent .quest-node__arrow { color: #fff; }
.quest-node--accent:hover {
  background: var(--accent-h);
  border-color: var(--accent-h);
}
.quest-node__bg {
  position: absolute;
  bottom: -12px;
  right: -8px;
  font-size: 6rem;
  opacity: .04;
  pointer-events: none;
  line-height: 1;
}

/* ── DIVIDER ──────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--s12) 0;
}

/* ── LOOT-DROP / CALLOUT BOX ──────────────────────────────── */
.callout {
  border-radius: var(--r-lg);
  padding: var(--s6) var(--s8);
  margin: var(--s8) 0;
}
.callout--accent  { background: rgba(199,64,26,.07); border-left: 4px solid var(--accent); }
.callout--gold    { background: rgba(212,147,8,.07);  border-left: 4px solid var(--gold);   }
.callout--green   { background: rgba(40,92,62,.08);   border-left: 4px solid var(--green);  }
.callout--dark    { background: var(--text); border-left: 4px solid var(--gold); }
.callout--dark *  { color: rgba(255,255,255,.85); }
.callout--dark strong { color: #fff; }
.callout__label {
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: var(--s3);
}
.callout--accent .callout__label  { color: var(--accent); }
.callout--gold .callout__label    { color: var(--gold); }
.callout--green .callout__label   { color: var(--green); }
.callout--dark .callout__label    { color: var(--gold); }

/* ── PROGRESS / XP BAR ────────────────────────────────────── */
.xp-bar {
  height: 4px;
  background: var(--border-2);
  border-radius: 2px;
  overflow: hidden;
}
.xp-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

/* ── FOOTER ───────────────────────────────────────────────── */
.footer {
  padding: var(--s12) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--s16);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s4);
}
.footer__copy {
  font-size: var(--t-sm);
  color: var(--text-muted);
}
.footer__links {
  display: flex;
  gap: var(--s5);
  list-style: none;
}
.footer__links a {
  font-size: var(--t-sm);
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: .04em;
}
.footer__links a:hover { color: var(--accent); text-decoration: none; }

/* ── RECENCY NOTE / SOURCE TABLE ──────────────────────────── */
.recency-note {
  display: flex;
  gap: var(--s3);
  padding: var(--s4) var(--s5);
  background: var(--surface-3);
  border-radius: var(--r-md);
  font-size: var(--t-sm);
  color: var(--text-2);
  margin-top: var(--s6);
}
.recency-note::before {
  content: '⏱';
  flex-shrink: 0;
}

/* ── PAGE TRANSITION WRAPPER ──────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  padding-top: var(--nav-h);
}

/* ── RESPONSIVE HELPERS ───────────────────────────────────── */
@media (max-width: 639px) {
  :root {
    --ch:    340px;
    --ch-lg: 380px;
    --ch-sm: 200px;
  }
  .quote-card { padding: var(--s6); }
  .callout { padding: var(--s5); }
  .archetype-card { height: auto; min-height: var(--ch); }
  .flip-card { height: 320px; }
  .flip-card__front,
  .flip-card__back { padding: var(--s6); }
}

@media (max-width: 1023px) {
  .nav__daily-btn { display: none; }
}
