@import url("codex-violet.css");
@import url("codex-buttons.css?v=1");
/* ══════════════════════════════════════════════════════════════════════
   CODEX UI  ·  Sacred Artifact Component Library
   The Relationship Codex™  ·  Shared across all member templates

   North star: warm candlelit chamber. Readable. Luxurious. Human.
   Minimum font sizes respected. Contrast accessible. Gold warm and bright.
   Secondary accent (violet, whisper) lives in codex-violet.css, imported above.
   ══════════════════════════════════════════════════════════════════════ */


/* ── Typography Scale ──────────────────────────────────────────────────
   Minimum readable sizes. Eyebrows/labels are legible. Body breathes.
   ──────────────────────────────────────────────────────────────────── */
:root {
  /* Obsidian backgrounds — landing page dark system (#040404 + violet atmosphere) */
  --bg-base:        #040404;
  --bg-card:        #0F0D14;
  --bg-card-warm:   #131019;
  --bg-panel:       #0A0B0F;

  /* Gold — brighter, more saturated than before */
  --gold:           #C8A76A;
  --gold-bright:    #E4C98A;
  --gold-dim:       #8E6B32;

  /* Text contrast — floor raised from opacity hell */
  --text-primary:   rgba(243,238,230,.94);
  --text-secondary: rgba(243,238,230,.72);
  --text-muted:     rgba(243,238,230,.52);
  --text-faint:     rgba(243,238,230,.36);
  --gold-label:     rgba(200,167,106,.78);
  --gold-muted:     rgba(200,167,106,.55);
  --gold-faint:     rgba(200,167,106,.38);

  /* Secondary accent · deep obsidian blue-violet (atmosphere only, never text) */
  --violet:         #2A2348;
  --violet-deep:    #181230;
  --violet-glow:    rgba(86,68,150,0.16);
  --violet-mist:    rgba(70,56,128,0.10);
  --violet-haze:    rgba(86,68,150,0.06);

  /* Typography floor — minimum 12px (0.75rem) for all visible text */
  --type-micro:     0.75rem;   /* 12px — absolute minimum for any label */
  --type-label:     0.8rem;    /* 12.8px — standard UI label */
  --type-body-sm:   0.88rem;   /* 14.1px — small body */
  --type-body:      1rem;      /* 16px */
  --type-lead:      1.1rem;    /* 17.6px */

  /* Border radius — all elements rounded (12px standard, 8px for small) */
  --radius-card:    12px;
  --radius-sm:      8px;
}


/* ── Global Page Atmosphere ────────────────────────────────────────────
   Landing page dark-violet system: obsidian #040404 with subtle violet
   atmosphere, gold glow, and ambient shimmer. Matches landing/about aesthetic.
   ──────────────────────────────────────────────────────────────────── */
.content {
  background:
    radial-gradient(ellipse 70% 50% at 50% -5%, rgba(214,176,107,.07) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 84% 22%, var(--violet-glow) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 30%, rgba(138,104,59,.05) 0%, transparent 50%),
    radial-gradient(ellipse 62% 50% at 14% 72%, var(--violet-mist) 0%, transparent 58%),
    repeating-linear-gradient(-52deg,
      rgba(200,167,106,.004) 0px, rgba(200,167,106,.004) 1px,
      transparent 1px, transparent 14px),
    var(--bg-base);
  background-color: var(--bg-base);
}


/* ── Page Hero ─────────────────────────────────────────────────────────
   Cinematic entrance title for every member page.
   ──────────────────────────────────────────────────────────────────── */
.codex-page-hero {
  position: relative;
  padding: 36px 36px 30px;
  margin-bottom: 28px;
  overflow: hidden;
  background:
    repeating-linear-gradient(-52deg,
      rgba(200,167,106,.005) 0px, rgba(200,167,106,.005) 1px,
      transparent 1px, transparent 14px),
    radial-gradient(ellipse 100% 180% at 50% -20%, rgba(200,167,106,.04) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-card-warm) 0%, var(--bg-base) 100%);
  border-top: 1px solid rgba(200,167,106,.18);
  border-bottom: 1px solid rgba(200,167,106,.05);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  box-shadow:
    0 2px 12px rgba(0,0,0,.28),
    0 12px 48px rgba(0,0,0,.2),
    0 0 80px rgba(200,167,106,.03) inset;
  animation: portalFadeIn .55s ease both;
}

.codex-page-hero::before {
  content: '';
  position: absolute; bottom: -1px; left: -1px;
  width: 20px; height: 20px;
  border-bottom: 1px solid rgba(200,167,106,.3);
  border-left: 1px solid rgba(200,167,106,.3);
  pointer-events: none;
}

.codex-page-hero::after {
  content: '';
  position: absolute; bottom: -1px; right: -1px;
  width: 20px; height: 20px;
  border-bottom: 1px solid rgba(200,167,106,.3);
  border-right: 1px solid rgba(200,167,106,.3);
  pointer-events: none;
}

.codex-page-hero__eyebrow {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: var(--type-micro); letter-spacing: .45em; text-transform: uppercase;
  color: var(--gold-muted);
  margin-bottom: 8px;
}

.codex-page-hero__title {
  font-family: 'Cinzel', serif;
  font-size: 1.75rem; font-weight: 400; letter-spacing: .05em;
  background: linear-gradient(135deg, #f0e8d0 0%, #c8a76a 55%, #a77c32 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin: 0 0 8px; line-height: 1.25;
}

.codex-page-hero__sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-size: 1.05rem; font-weight: 400;
  color: var(--text-secondary); line-height: 1.7;
  margin: 0;
}

.codex-page-hero__meta {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px; flex-wrap: wrap;
}


/* ── Section Head ──────────────────────────────────────────────────────
   Ornamental section divider.
   ──────────────────────────────────────────────────────────────────── */
.codex-section-head {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 0 8px;
  font-family: 'Cinzel', serif;
  font-size: var(--type-micro); letter-spacing: .42em; text-transform: uppercase;
  color: var(--gold-muted);
  white-space: nowrap;
}

.codex-section-head::before {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, rgba(200,167,106,.18));
}

.codex-section-head::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(to left, transparent, rgba(200,167,106,.18));
}

.codex-section-head--left {
  padding: 18px 0 6px;
  justify-content: flex-start;
}
.codex-section-head--left::before { display: none; }
.codex-section-head--left::after { max-width: 120px; }


/* ── Card System ───────────────────────────────────────────────────────
   Rounded corners, warm backgrounds, cinematic shadows.
   ──────────────────────────────────────────────────────────────────── */
.codex-card,
.codex-card--tome,
.codex-card--glass {
  position: relative;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(200,167,106,.03) 0%, transparent 60%),
    linear-gradient(155deg, var(--bg-card-warm) 0%, var(--bg-card) 60%, var(--bg-base) 100%);
  border: 1px solid rgba(200,167,106,.08);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow:
    0 4px 16px rgba(0,0,0,.4),
    0 16px 48px rgba(0,0,0,.32),
    inset 0 1px 0 rgba(200,167,106,.05);
  transition:
    border-color .35s ease,
    transform .35s cubic-bezier(.16,1,.3,1),
    box-shadow .35s ease;
}

.codex-card:hover {
  border-color: rgba(200,167,106,.18);
  transform: translateY(-3px);
  box-shadow:
    0 4px 16px rgba(0,0,0,.32),
    0 16px 48px rgba(0,0,0,.28),
    0 0 40px rgba(200,167,106,.05),
    0 0 0 1px rgba(200,167,106,.045) inset;
}

.codex-card--tome {
  background:
    radial-gradient(ellipse 80% 60% at 30% 0%, rgba(200,167,106,.04) 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-card-warm) 0%, var(--bg-card) 100%);
  border-color: rgba(200,167,106,.1);
}

.codex-card--tome:hover {
  border-color: rgba(200,167,106,.22);
  box-shadow:
    0 4px 16px rgba(0,0,0,.38),
    0 16px 48px rgba(0,0,0,.3),
    0 0 48px rgba(200,167,106,.07);
}

.codex-card--glass {
  background: rgba(10,10,18,.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: rgba(200,167,106,.10);
  border-radius: var(--radius-card);
  box-shadow: 0 16px 56px rgba(0,0,0,.55), inset 0 1px 0 rgba(200,167,106,.06);
}

.codex-card--glass:hover {
  border-color: rgba(200,167,106,.22);
}

.codex-card--accented::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background: linear-gradient(90deg, transparent, rgba(200,167,106,.35), transparent);
}


/* ── Quest Card — Pathway / Course ────────────────────────────────────
   ──────────────────────────────────────────────────────────────────── */
.codex-quest-card {
  position: relative;
  background:
    repeating-linear-gradient(-48deg,
      rgba(200,167,106,.007) 0px, rgba(200,167,106,.007) 1px,
      transparent 1px, transparent 12px),
    radial-gradient(ellipse 70% 80% at 15% 0%, rgba(200,120,30,.045) 0%, transparent 50%),
    linear-gradient(155deg, var(--bg-card-warm) 0%, var(--bg-card) 80%, var(--bg-base) 100%);
  border: 1px solid rgba(200,167,106,.09);
  border-radius: var(--radius-card);
  padding: 22px;
  overflow: hidden;
  box-shadow:
    0 2px 8px rgba(0,0,0,.28),
    0 8px 32px rgba(0,0,0,.2);
  transition:
    border-color .35s ease,
    transform .35s cubic-bezier(.16,1,.3,1),
    box-shadow .35s ease;
}

.codex-quest-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background: linear-gradient(90deg, transparent, rgba(200,167,106,.28), transparent);
}

.codex-quest-card:hover {
  border-color: rgba(200,167,106,.2);
  transform: translateY(-3px);
  box-shadow:
    0 4px 16px rgba(0,0,0,.35),
    0 16px 48px rgba(0,0,0,.28),
    0 0 40px rgba(200,167,106,.05);
}

.codex-quest-card__badge {
  font-family: 'Cinzel', serif;
  font-size: var(--type-micro); letter-spacing: .35em; text-transform: uppercase;
  color: var(--gold-muted);
  margin-bottom: 8px; display: block;
}

.codex-quest-card__title {
  font-family: 'Cinzel', serif;
  font-size: .92rem; font-weight: 400; letter-spacing: .06em;
  color: var(--text-primary);
  margin-bottom: 6px; line-height: 1.4;
}

.codex-quest-card__sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-size: 1rem;
  color: var(--text-muted); line-height: 1.6;
  margin-bottom: 14px;
}

.codex-quest-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; flex-wrap: wrap; gap: 8px;
}


/* ── Seal Tile ─────────────────────────────────────────────────────────
   ──────────────────────────────────────────────────────────────────── */
.codex-seal-tile {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 22px 14px 18px;
  background: rgba(200,167,106,.022);
  border: 1px solid rgba(200,167,106,.08);
  border-radius: var(--radius-card);
  text-align: center;
  cursor: pointer;
  position: relative; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.22), 0 6px 24px rgba(0,0,0,.16);
  transition:
    border-color .35s ease,
    background .35s ease,
    box-shadow .35s ease,
    transform .35s cubic-bezier(.16,1,.3,1);
}

.codex-seal-tile::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,167,106,.32), transparent);
  opacity: 0; transition: opacity .35s;
}

.codex-seal-tile:hover::before { opacity: 1; }

.codex-seal-tile--earned {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(200,167,106,.055) 0%, transparent 60%),
    rgba(200,167,106,.035);
  border-color: rgba(200,167,106,.18);
  box-shadow:
    0 2px 12px rgba(0,0,0,.24),
    0 0 28px rgba(200,167,106,.05);
}

.codex-seal-tile--earned:hover {
  border-color: rgba(200,167,106,.35);
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(200,167,106,.1) 0%, transparent 60%),
    rgba(200,167,106,.07);
  box-shadow:
    0 0 32px rgba(200,167,106,.15),
    0 10px 40px rgba(0,0,0,.38);
  transform: translateY(-4px);
}

.codex-seal-tile--locked {
  opacity: .32;
  filter: saturate(0.15);
  cursor: default;
}

.codex-seal-tile--locked:hover {
  opacity: .4;
  filter: saturate(0.22);
  transform: none;
}

.codex-seal-tile__glyph {
  font-size: 2.6rem; line-height: 1;
  filter: drop-shadow(0 0 8px rgba(200,167,106,.0));
  transition: filter .35s;
}

.codex-seal-tile--earned .codex-seal-tile__glyph {
  filter: drop-shadow(0 0 12px rgba(200,167,106,.5));
}

.codex-seal-tile--earned:hover .codex-seal-tile__glyph {
  filter: drop-shadow(0 0 20px rgba(200,167,106,.78));
}

.codex-seal-tile__name {
  font-family: 'Cinzel', serif;
  font-size: var(--type-micro); letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted); line-height: 1.4;
}

.codex-seal-tile--earned .codex-seal-tile__name {
  color: var(--gold-label);
}

.codex-seal-tile__date {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--type-micro); letter-spacing: .04em; text-transform: uppercase;
  color: var(--gold-faint); margin-top: 2px;
}

.codex-seal-tile__lock {
  font-size: 1rem; opacity: .35; margin-top: 2px;
}


/* ── Oracle Card — C.O.D.E.X ───────────────────────────────────────────
   ──────────────────────────────────────────────────────────────────── */
.codex-oracle-card {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(-52deg,
      rgba(200,167,106,.007) 0px, rgba(200,167,106,.007) 1px,
      transparent 1px, transparent 12px),
    radial-gradient(ellipse 65% 95% at 25% 55%, rgba(91,15,26,.16) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 75% 20%, rgba(14,10,28,.6) 0%, transparent 55%),
    linear-gradient(140deg, var(--bg-card-warm) 0%, var(--bg-base) 100%);
  border: 1px solid rgba(200,167,106,.1);
  border-radius: var(--radius-card); padding: 28px 32px;
  box-shadow:
    0 2px 12px rgba(0,0,0,.28),
    0 12px 48px rgba(0,0,0,.22);
  transition: border-color .35s, box-shadow .35s;
}

.codex-oracle-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background: linear-gradient(90deg, transparent, rgba(200,167,106,.3), transparent);
}

.codex-oracle-card:hover {
  border-color: rgba(200,167,106,.22);
  box-shadow:
    0 0 50px rgba(91,15,26,.12),
    0 10px 48px rgba(0,0,0,.32),
    0 0 28px rgba(200,167,106,.05);
}


/* ── Stat Tile ─────────────────────────────────────────────────────────
   ──────────────────────────────────────────────────────────────────── */
.codex-stat-tile {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 20px 14px;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(200,167,106,.03) 0%, transparent 60%),
    rgba(200,167,106,.018);
  border: 1px solid rgba(200,167,106,.07);
  border-radius: var(--radius-card);
  text-align: center;
  box-shadow:
    0 2px 10px rgba(0,0,0,.24),
    0 6px 28px rgba(0,0,0,.18);
  transition: border-color .3s, background .3s, box-shadow .3s;
  position: relative; overflow: hidden;
}

.codex-stat-tile::before {
  content: '';
  position: absolute; top: 0; left: 15%; right: 15%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,167,106,.2), transparent);
}

.codex-stat-tile:hover {
  border-color: rgba(200,167,106,.18);
  background:
    radial-gradient(ellipse 100% 70% at 50% 0%, rgba(200,167,106,.055) 0%, transparent 60%),
    rgba(200,167,106,.04);
  box-shadow:
    0 4px 16px rgba(0,0,0,.28),
    0 0 32px rgba(200,167,106,.05);
}

.codex-stat-tile__icon {
  font-size: 1.3rem; line-height: 1;
  margin-bottom: 2px;
}

.codex-stat-tile__value {
  font-family: 'Cinzel', serif;
  font-size: 1.7rem; font-weight: 400; line-height: 1;
  background: linear-gradient(135deg, #e8d090 0%, #c8a76a 55%, #a77c32 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.codex-stat-tile__label {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--type-micro); letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold-muted);
}

.codex-stat-tile__sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-size: var(--type-body-sm);
  color: var(--text-muted);
}


/* ── Entry Card — Journal / Reflection ────────────────────────────────
   ──────────────────────────────────────────────────────────────────── */
.codex-entry-card {
  padding: 18px 20px 16px;
  border-left: 2px solid rgba(200,167,106,.18);
  background:
    radial-gradient(ellipse 60% 80% at 0% 50%, rgba(200,120,30,.035) 0%, transparent 55%),
    rgba(200,167,106,.015);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.16);
  transition: border-left-color .3s, background .3s;
}

.codex-entry-card:hover {
  border-left-color: rgba(200,167,106,.42);
  background:
    radial-gradient(ellipse 80% 80% at 0% 50%, rgba(200,120,30,.055) 0%, transparent 55%),
    rgba(200,167,106,.042);
}

.codex-entry-card__date {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--type-micro); letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold-muted); margin-bottom: 5px; display: block;
}

.codex-entry-card__prompt {
  font-family: 'Cinzel', serif;
  font-size: .8rem; letter-spacing: .04em;
  color: var(--text-secondary); margin-bottom: 6px; display: block;
}

.codex-entry-card__body {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-size: 1.05rem; line-height: 1.75;
  color: var(--text-secondary);
}


/* ── Activity Timeline ─────────────────────────────────────────────────
   ──────────────────────────────────────────────────────────────────── */
.codex-timeline {
  display: flex; flex-direction: column;
}

.codex-timeline-item {
  display: flex; gap: 14px; padding: 10px 0;
  position: relative;
}

.codex-timeline-item:not(:last-child)::after {
  content: '';
  position: absolute; left: 5.5px; top: 26px; bottom: -10px;
  width: 1px;
  background: linear-gradient(180deg, rgba(200,167,106,.18), transparent);
}

.codex-timeline-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  margin-top: 3px;
  background: radial-gradient(circle, rgba(200,167,106,.8), rgba(200,167,106,.3));
  box-shadow: 0 0 10px rgba(200,167,106,.3);
  border: 1px solid rgba(200,167,106,.4);
}

.codex-timeline-action {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--type-body-sm); color: var(--text-secondary); line-height: 1.5;
}

.codex-timeline-when {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: var(--type-micro); letter-spacing: .04em; text-transform: uppercase;
  color: var(--gold-faint); margin-top: 2px;
}


/* ── Arc Journey Map ───────────────────────────────────────────────────
   ──────────────────────────────────────────────────────────────────── */
.codex-arc-journey {
  display: flex; align-items: flex-start;
  gap: 0; padding: 8px 0;
  position: relative;
}

.codex-arc-stage {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; gap: 8px; position: relative; z-index: 1;
}

.codex-arc-stage:not(:last-child)::after {
  content: '';
  position: absolute; top: 10px; left: 50%; right: -50%;
  height: 1px;
  background: rgba(200,167,106,.12);
  z-index: 0;
}

.codex-arc-node {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid rgba(200,167,106,.15);
  background: rgba(10,8,6,.95);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  transition: border-color .35s, box-shadow .35s, transform .35s;
}

.codex-arc-node--done {
  border-color: rgba(200,167,106,.42);
  background: rgba(200,167,106,.1);
}

.codex-arc-node--done::after {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(200,167,106,.65);
}

.codex-arc-node--current {
  border-color: #c8a76a;
  background: rgba(200,167,106,.12);
  box-shadow: 0 0 16px rgba(200,167,106,.42), 0 0 32px rgba(200,167,106,.16);
  width: 28px; height: 28px;
  animation: chamberUnlock .7s cubic-bezier(.16,1,.3,1) forwards;
  margin-top: -3px;
}

.codex-arc-node--current::after {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: #c8a76a;
  box-shadow: 0 0 10px rgba(200,167,106,.8);
}

.codex-arc-node--locked { opacity: .28; }

.codex-arc-label {
  font-family: 'Cinzel', serif;
  font-size: .6rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-faint); text-align: center;
  line-height: 1.3;
}

.codex-arc-label--current {
  color: var(--gold-label);
}

.codex-arc-range {
  font-family: 'DM Sans', sans-serif;
  font-size: .58rem; color: var(--text-faint);
  text-align: center;
}


/* ── Progress Bar ──────────────────────────────────────────────────────
   ──────────────────────────────────────────────────────────────────── */
.codex-progress-ritual {
  height: 3px;
  background: rgba(200,167,106,.08);
  border-radius: 2px;
  overflow: hidden;
}

.codex-progress-ritual__fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(200,167,106,.52), rgba(200,167,106,.95));
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(200,167,106,.35);
  transition: width 1.4s cubic-bezier(.16,1,.3,1);
}


/* ── Utilities ─────────────────────────────────────────────────────────  */

.codex-text-gradient {
  background: linear-gradient(135deg, #e8d090 0%, #c8a76a 55%, #a77c32 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.codex-ornament {
  color: rgba(200,167,106,.38);
  font-size: .7em;
  letter-spacing: 0;
  display: inline-block;
}

.codex-badge-arc {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px 3px;
  border: 1px solid rgba(200,167,106,.22);
  border-radius: var(--radius-sm);
  font-family: 'Cinzel', serif;
  font-size: var(--type-micro); letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold-label);
  background: rgba(200,167,106,.06);
}

.codex-divider {
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,167,106,.1), transparent);
  border: none; margin: 24px 0;
}

.page-enter { animation: portalFadeIn .55s ease both; }
.page-enter--slow { animation: portalFadeIn .9s ease both; }
.page-enter--delay { animation: portalFadeIn .55s ease .18s both; }
.page-enter--delay-2 { animation: portalFadeIn .55s ease .32s both; }

.codex-depth-number {
  font-family: 'Cinzel', serif;
  font-size: 3rem; font-weight: 400; line-height: 1;
  background: linear-gradient(135deg, #f0e8d0 0%, #c8a76a 50%, #a07030 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: depthEmerge .8s cubic-bezier(.16,1,.3,1) both, goldPulse 2.4s ease-in-out 1s infinite;
}


/* ── Ritual Buttons ────────────────────────────────────────────────────
   ──────────────────────────────────────────────────────────────────── */
.btn-ritual--gold {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px;
  background: linear-gradient(135deg, #c8a76a, #e4c98a 45%, #a77c32);
  color: rgba(8,8,8,.92);
  font-family: 'Cinzel', serif;
  font-size: .65rem; letter-spacing: .28em; text-transform: uppercase;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none;
  transition: box-shadow .35s, transform .2s;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

.btn-ritual--gold:hover {
  box-shadow: 0 0 32px rgba(200,167,106,.42), 0 6px 24px rgba(0,0,0,.32);
  color: rgba(8,8,8,.96);
  transform: translateY(-1px);
}

.btn-ritual--gold:active { transform: scale(0.97); }

.btn-ritual--ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  background: transparent;
  border: 1px solid rgba(200,167,106,.22);
  border-radius: var(--radius-sm);
  color: var(--gold-label);
  font-family: 'Cinzel', serif;
  font-size: .65rem; letter-spacing: .22em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  transition: border-color .3s, color .3s, background .3s, box-shadow .3s;
}

.btn-ritual--ghost:hover {
  border-color: rgba(200,167,106,.5);
  color: var(--gold-bright);
  background: rgba(200,167,106,.05);
  box-shadow: 0 0 20px rgba(200,167,106,.07);
}

.btn-ritual--ghost:active { transform: scale(0.98); }


/* ── Flame Streak ──────────────────────────────────────────────────── */
.codex-streak {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Cinzel', serif;
  font-size: var(--type-label); letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-label);
}

.codex-streak__flame {
  font-size: 1.2rem; line-height: 1;
  animation: flicker 2.2s ease-in-out infinite;
  transform-origin: bottom center;
  display: inline-block;
}

.codex-streak__count {
  font-size: .95rem;
  background: linear-gradient(135deg, #e8d090, #c8a76a);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}


/* ── Tooltip ───────────────────────────────────────────────────────────
   ──────────────────────────────────────────────────────────────────── */
.codex-tooltip { position: relative; }

.codex-tooltip__body {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: rgba(14,11,8,.98);
  border: 1px solid rgba(200,167,106,.18);
  border-radius: var(--radius-sm); padding: 10px 14px;
  min-width: 160px; max-width: 240px;
  font-family: 'DM Sans', sans-serif; font-size: var(--type-body-sm);
  color: var(--text-secondary); line-height: 1.55;
  text-align: center; white-space: normal;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  transform: translateX(-50%) translateY(6px);
  z-index: 50;
  box-shadow: 0 4px 24px rgba(0,0,0,.45);
}

.codex-tooltip:hover .codex-tooltip__body {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ── Mobile base (≤ 860px) ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .codex-page-hero { padding: 20px 16px 18px; margin-bottom: 16px; }
  .codex-page-hero__title { font-size: 1.3rem; }
  .codex-page-hero__sub { font-size: .95rem; }
  .codex-section-head { font-size: .62rem; letter-spacing: .32em; padding: 14px 0 5px; }
  .codex-stat-tile { padding: 16px 10px; }
  .codex-stat-tile__value { font-size: 1.4rem; }
  .codex-depth-number { font-size: 2.4rem; }
  .codex-arc-journey { gap: 0; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .codex-arc-label { font-size: .58rem; }
  .content { padding-bottom: 82px; }
  .codex-card, .codex-card--tome, .codex-card--glass { padding: 18px; }
  .codex-quest-card { padding: 18px; }
  .codex-oracle-card { padding: 22px 20px; }
  .codex-entry-card { padding: 15px 16px 13px; }
  .btn-ritual--gold { padding: 12px 22px; font-size: .62rem; }
  .btn-ritual--ghost { padding: 10px 18px; font-size: .6rem; }
}

/* ── Small mobile (≤ 480px) ───────────────────────────────────────── */
@media (max-width: 480px) {
  .codex-page-hero__title { font-size: 1.15rem; }
  .codex-seal-tile__glyph { font-size: 2.1rem; }
  .codex-page-hero { padding: 16px 14px 14px; }
}

/* ── Desktop enrichment (> 860px) ─────────────────────────────────── */
@media (min-width: 861px) {
  .codex-card, .codex-card--tome { padding: 26px; }
  .codex-quest-card { padding: 26px; }
  .codex-oracle-card { padding: 32px 36px; }
  .codex-stat-tile { padding: 24px 16px; }
  .codex-page-hero { padding: 42px 40px 36px; }
  .codex-page-hero__title { font-size: 1.85rem; }
  .codex-page-hero__sub { font-size: 1.08rem; }
  .codex-seal-tile { padding: 26px 18px 22px; }
  .codex-seal-tile__glyph { font-size: 2.8rem; }
  .btn-ritual--gold { padding: 14px 32px; }
}

/* ── Global readable floor (applies always, no mode required) ───── */
/* Nothing readable should render below 13px. Tiny px labels get a floor. */
small,
.toggle-label small,
.panel-title,
.field label,
[class*="eyebrow"],
[class*="-eyebrow"],
[class*="section-label"],
.codex-card-eyebrow {
  font-size: clamp(12px, 0.8rem, 1rem);
}
.toggle-label small {
  font-size: clamp(13px, 0.875rem, 1rem);
  line-height: 1.6;
}

/* ── Accessibility: Large Text Mode ──────────────────────────────── */
/* Applied via .a11y-large on <html> — toggled by settings + localStorage.  */
/* Sets html base to 20px so all rem values scale up automatically.         */
/* Explicit !important overrides catch any element using absolute px values. */
html.a11y-large {
  font-size: 20px;
}
html.a11y-large body {
  font-size: 1rem;        /* 20px */
  line-height: 1.8;
}
/* Body text — explicit semantic elements only, not div/span (too nuclear) */
html.a11y-large p,
html.a11y-large li,
html.a11y-large td,
html.a11y-large .journal-body,
html.a11y-large .toggle-label { font-size: 1rem !important; line-height: 1.8 !important; }
/* ALL small / description / helper text — the main culprit */
html.a11y-large small,
html.a11y-large .toggle-label small,
html.a11y-large [class*="hint"],
html.a11y-large [class*="helper"],
html.a11y-large [class*="sub-text"],
html.a11y-large [class*="-sub"],
html.a11y-large [class*="caption"],
html.a11y-large [class*="note"],
html.a11y-large [class*="desc"] { font-size: 0.9rem !important; line-height: 1.75 !important; }
/* Labels and eyebrows */
html.a11y-large .panel-title,
html.a11y-large .field label,
html.a11y-large [class*="eyebrow"],
html.a11y-large [class*="-eyebrow"],
html.a11y-large .section-label,
html.a11y-large .codex-card-eyebrow { font-size: 0.75rem !important; letter-spacing: .18em !important; }
/* Headings */
html.a11y-large h1 { font-size: 2.2rem !important; }
html.a11y-large h2 { font-size: 1.7rem !important; }
html.a11y-large h3 { font-size: 1.4rem !important; }
/* Inputs */
html.a11y-large input,
html.a11y-large textarea,
html.a11y-large select { font-size: 1rem !important; }
/* Buttons */
html.a11y-large .btn-ritual--gold,
html.a11y-large .btn-save,
html.a11y-large button { font-size: 0.7rem !important; padding: 14px 28px !important; }
/* Mirror-specific */
html.a11y-large .mirror-header__title { font-size: 1.7rem !important; }
html.a11y-large .mirror-header__sub  { font-size: 1.1rem !important; }
html.a11y-large .mirror-stat__val    { font-size: 1.7rem !important; }

/* ══════════════════════════════════════════════════════════════════════
   GLOBAL STANDARD · rounded edges + frozen logo
   Linked on most pages — establishes the house radius and pauses every
   spinning RC mark (static placeholder until the new animated logo lands).
   ══════════════════════════════════════════════════════════════════════ */

/* ── Rounded edges · the house standard ──────────────────────────────
   8px on cards/panels/boxes, 6px on inputs/buttons/pills. Broad, low-risk
   selectors. Avatars / circular things keep their own 50% radius. */
.card, .panel, .box, .modal, .popup, .sheet, .tile,
.codex-card, .codex-card--tome, .codex-card--glass, .codex-quest-card,
.codex-oracle-card, .codex-stat-tile, .codex-seal-tile,
.member-card, .post-card, .offer-card, .pattern-card, .insight-card,
[class*="-card"], [class*="-panel"], [class*="-box"], [class*="-modal"] {
  border-radius: 10px;
}
input:not([type=checkbox]):not([type=radio]):not([type=range]),
textarea, select,
button, .btn, .btn-gold, .btn-ghost, .btn-outline, .btn-primary,
.btn-secondary, .btn-ritual--gold, .btn-ritual--ghost, .gold-btn,
.cta, .pill, .chip, .badge, .tag {
  border-radius: 8px;
}
img.rounded, .avatar-rounded, .thumb { border-radius: 10px; }

/* ── Logo rotation freeze · static placeholder, NOT loading spinners ── */
.sb-sigil-svg, .sb-sigil-ring,
.sigil-ring, .sigil-ring-svg,
.lc-outer-ring, .lc-inner-ring,
.rc-spin, .rc-spin-rev, .rc-ring-1, .rc-ring-2,
.orb-ring, .orb-ring.r1, .orb-ring.r2,
.adm-sigil-ring {
  animation: none !important;
}
