/* ============================================================
   Antaresian Uplink — shared styling
   Fires in Antaresia · imperial arcane archive
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Spectral+SC:wght@400;500;600&display=swap');

:root {
  /* night & stone */
  /* base — deep oxblood & near-black, not navy */
  --night:      #14090b;   /* near-black with a red undertone */
  --night-2:    #1c0c0f;
  --stone:      #2a1114;   /* raised panel, oxblood */
  --stone-edge: #4a2226;
  --stone-hi:   #6e3138;   /* warm crimson edge */

  /* imperial gold — the primary accent */
  --gold:       #c8a860;   /* antique imperial gold */
  --gold-soft:  #e7d29c;
  --silver:     #f2e9df;   /* warm imperial white */
  --silver-dim: #b9a99c;   /* dimmed parchment */

  /* ink — warm off-white reading */
  --ink:        #ece2d6;
  --ink-dim:    #b39f92;
  --ink-faint:  #8a7166;

  /* imperial red — carries the identity, used with restraint */
  --seal:       #9e2b2b;   /* imperial red / wax-seal */
  --seal-soft:  #d98a7a;
  --seal-deep:  #6d1f22;

  --glass-glow: rgba(242,233,223,0.14);
  --gold-glow:  rgba(200,168,96,0.24);
  --red-glow:   rgba(158,43,43,0.28);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(ellipse at 50% -8%, rgba(200,168,96,0.10), transparent 55%),
    radial-gradient(ellipse at 50% 115%, rgba(158,43,43,0.16), transparent 55%),
    var(--night);
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

/* faint engraved lattice, like the mirror's frame etched behind everything */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    radial-gradient(circle at 50% 50%, transparent 60%, rgba(12,16,32,0.55) 100%);
  pointer-events: none; z-index: 0;
}

.wrap { position: relative; z-index: 1; max-width: 1060px; margin: 0 auto; padding: 0 30px; }

/* ---------- shared type ---------- */
.eyebrow {
  font-family: 'Spectral SC', serif;
  font-size: 0.74rem; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--gold); font-weight: 500;
}
.ink-dim { color: var(--ink-dim); }

/* ---------- interior header / masthead ---------- */
.masthead {
  padding: 40px 0 26px;
  border-bottom: 1px solid var(--stone-edge);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.masthead .crest { display: flex; align-items: center; gap: 16px; }
.masthead svg { width: 46px; height: 46px; flex-shrink: 0; }
.masthead .titles h1 {
  font-family: 'Cinzel', serif; font-weight: 600;
  font-size: 1.5rem; letter-spacing: 0.05em; color: var(--gold-soft); line-height: 1.1;
}
.masthead .titles p {
  font-family: 'Spectral SC', serif; font-size: 0.72rem; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--ink-faint); margin-top: 4px;
}
.masthead .attend {
  text-align: right; font-family: 'Cormorant Garamond', serif; font-style: italic;
  color: var(--ink-dim); font-size: 0.95rem; max-width: 240px;
}
.masthead .attend strong { display:block; font-style: normal; font-family:'Cinzel',serif;
  font-size: 0.82rem; letter-spacing: 0.14em; color: var(--silver); }

/* ---------- section heads ---------- */
.section-head { margin: 54px 0 6px; display: flex; align-items: baseline; gap: 20px; }
.section-head h2 {
  font-family: 'Cinzel', serif; font-weight: 600; font-size: 1.05rem;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--silver); white-space: nowrap;
}
.section-head .rule { flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--stone-hi), transparent); }
.section-sub { font-family:'Cormorant Garamond',serif; font-style: italic;
  color: var(--ink-dim); font-size: 1rem; margin-bottom: 30px; max-width: 720px; }

/* ---------- the Emperor's marginalia ---------- */
.marginalia {
  max-width: 680px; margin: 0 auto;
  padding: 20px 30px;
  border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold);
  background: linear-gradient(180deg, rgba(200,168,96,0.05), transparent 80%);
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  color: var(--gold-soft); font-size: 1.1rem; text-align: center;
}
.marginalia .attr {
  display: block; margin-top: 12px; font-style: normal;
  font-family: 'Spectral SC', serif; font-size: 0.66rem; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--gold); opacity: 0.85;
}

/* ---------- dossiers ---------- */
.dossiers { display: grid; gap: 22px; padding-bottom: 20px; }

.dossier {
  position: relative;
  background: linear-gradient(158deg, var(--stone), var(--night-2));
  border: 1px solid var(--stone-edge);
  border-radius: 4px;
  padding: 26px 32px 28px;
  transition: border-color .4s, transform .4s, box-shadow .4s;
}
.dossier:hover {
  border-color: var(--stone-hi);
  transform: translateY(-2px);
  box-shadow: 0 16px 42px rgba(6,9,20,0.55);
}

.dossier-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; flex-wrap: wrap; }
.faith-id { flex: 1; min-width: 230px; }
.faith-sphere { font-family:'Spectral SC',serif; font-size: 0.68rem; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 7px; }
.faith-name { font-family:'Cinzel',serif; font-weight: 600; font-size: 1.5rem;
  color: var(--gold-soft); line-height: 1.15; }
.faith-epithet { font-family:'Cormorant Garamond',serif; font-style: italic;
  color: var(--silver-dim); font-size: 1.02rem; margin-top: 3px; }

/* disposition badge — administrative posture, not threat level */
.disp { text-align: center; flex-shrink: 0; padding: 11px 18px; border-radius: 3px;
  border: 1px solid; min-width: 130px; }
.disp .k { font-family:'Spectral SC',serif; font-size: 0.58rem; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--ink-faint); }
.disp .v { font-family:'Cinzel',serif; font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.08em; margin-top: 4px; }
.disp.embrace  { border-color: #4c6b4a; }
.disp.embrace .v { color: #9cc196; }
.disp.tolerate { border-color: var(--stone-hi); }
.disp.tolerate .v { color: var(--silver); }
.disp.observe  { border-color: #6d5a2a; }
.disp.observe .v { color: var(--gold); }
.disp.restrain { border-color: #6e352c; }
.disp.restrain .v { color: var(--seal-soft); }

.faith-body { margin-top: 18px; color: var(--ink); font-size: 1.06rem; }
.faith-body p + p { margin-top: 12px; }

.intel { margin-top: 20px; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: 1px; background: var(--stone-edge); border: 1px solid var(--stone-edge);
  border-radius: 3px; overflow: hidden; }
.intel div { background: var(--night-2); padding: 12px 16px; }
.intel .k { font-family:'Spectral SC',serif; font-size: 0.6rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-faint); }
.intel .v { font-family:'Cormorant Garamond',serif; color: var(--ink); margin-top: 3px; font-size: 1rem; }

.policy { margin-top: 18px; padding: 13px 20px;
  border-left: 3px solid var(--gold);
  background: linear-gradient(90deg, rgba(200,168,96,0.06), transparent);
  font-family:'Cormorant Garamond',serif; font-style: italic; font-size: 1.02rem; color: var(--gold-soft); }
.policy strong { font-style: normal; font-family:'Spectral SC',serif; font-size: 0.62rem;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); display:block; margin-bottom: 5px; }

/* ---------- map vault placeholder ---------- */
.vault { margin: 8px 0 60px; border: 1px solid var(--stone-edge); border-radius: 5px;
  padding: 50px 30px; text-align: center;
  background: repeating-linear-gradient(45deg, transparent, transparent 16px,
    rgba(57,66,107,0.06) 16px, rgba(57,66,107,0.06) 32px); }
.vault .glyph { font-size: 2rem; color: var(--gold); opacity: 0.55; }
.vault h3 { font-family:'Cinzel',serif; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--silver); margin: 14px 0 6px; font-size: 1rem; }
.vault p { color: var(--ink-dim); font-family:'Cormorant Garamond',serif; font-style: italic;
  max-width: 480px; margin: 0 auto; font-size: 1.02rem; }

/* ---------- nexus / the settled Mirror ---------- */

/* locked single-viewport layout — no scroll */
body.nexus-body { overflow: hidden; height: 100dvh; }
.nexus-shell {
  position: relative; z-index: 1;
  height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(8px, 2vh, 22px);
  padding: clamp(16px, 3vh, 40px) 24px;
  text-align: center;
}

.nexus-intro { text-align: center; }
.nexus-intro .eyebrow { display: block; margin-bottom: 12px; }
.nexus-intro h1 {
  font-family:'Cinzel',serif; font-weight: 600; font-size: clamp(1.35rem, 3.4vw, 2.1rem);
  letter-spacing: 0.04em; color: var(--gold-soft); line-height: 1.14;
  text-shadow: 0 0 24px rgba(200,168,96,0.2);
}

/* the radial selector — sized off the smaller of width/height so it always fits */
.orrery {
  position: relative;
  width: min(540px, 84vw, 62vh);
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
}

/* faint concentric guide rings, like an astrolabe */
.orrery .rings {
  position: absolute; inset: 0; pointer-events: none;
}
.orrery .rings circle { fill: none; stroke: var(--stone-edge); }
.orrery .rings .r-orbit { stroke: var(--stone-hi); stroke-dasharray: 2 7; opacity: 0.6; animation: orbit-turn 120s linear infinite; transform-origin: center; }
@keyframes orbit-turn { to { transform: rotate(360deg); } }

/* each node is absolutely positioned via inline custom props --x / --y (percentages) */
.node {
  position: absolute;
  left: var(--x); top: var(--y);
  transform: translate(-50%, -50%);
  width: 92px; height: 92px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none;
  cursor: pointer;
}
.node .disc {
  width: 66px; height: 66px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 38%, var(--stone), var(--night-2));
  border: 1px solid var(--stone-edge);
  transition: border-color .35s, box-shadow .35s, transform .35s, background .35s;
}
.node .disc svg { width: 32px; height: 32px; stroke: var(--silver-dim); fill: none; stroke-width: 1.3; transition: stroke .35s; }
.node .label {
  position: absolute; top: 100%; margin-top: 4px;
  font-family:'Spectral SC',serif; font-size: 0.72rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold-soft); white-space: nowrap;
  opacity: 0; transform: translateY(-4px); transition: opacity .3s, transform .3s;
  pointer-events: none;
}

/* hover / focus wake */
.node:hover .disc, .node:focus-visible .disc {
  border-color: var(--gold);
  box-shadow: 0 0 22px var(--gold-glow), inset 0 0 14px rgba(200,168,96,0.12);
  transform: scale(1.08);
  background: radial-gradient(circle at 50% 38%, var(--stone-hi), var(--night-2));
}
.node:hover .disc svg, .node:focus-visible .disc svg { stroke: var(--gold-soft); }
.node:hover .label, .node:focus-visible .label { opacity: 1; transform: translateY(0); }

/* dormant nodes still glow and label, just no destination yet */
.node.dormant { cursor: default; }
.node.dormant:hover .disc { border-color: var(--stone-hi); box-shadow: 0 0 16px rgba(57,66,107,0.4); }
.node.dormant:hover .disc svg { stroke: var(--silver); }
.node.dormant:hover .label { color: var(--silver-dim); }

/* central map hub — larger, the destination */
.node.hub { width: 150px; height: 150px; }
.node.hub .disc {
  width: 118px; height: 118px;
  background: radial-gradient(circle at 50% 36%, rgba(226,205,151,0.14), var(--night-2) 70%);
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 30px rgba(200,168,96,0.14), inset 0 0 22px rgba(6,9,20,0.7);
}
.node.hub .disc svg { width: 54px; height: 54px; stroke: var(--gold-soft); }
.node.hub .label {
  top: auto; bottom: 100%; margin-bottom: 6px; margin-top: 0;
  font-size: 0.74rem; color: var(--gold); opacity: 0.85; transform: none;
}
.node.hub:hover .disc, .node.hub:focus-visible .disc {
  transform: scale(1.06);
  box-shadow: 0 0 42px var(--gold-glow), inset 0 0 22px rgba(6,9,20,0.6);
}
.node.hub:hover .label, .node.hub:focus-visible .label { opacity: 1; color: var(--gold-soft); }

.nexus-note {
  text-align: center; font-family:'Cormorant Garamond',serif; font-style: italic;
  color: var(--ink-faint); font-size: 1rem; margin: 0 auto; max-width: 560px;
}
.nexus-note a { color: var(--silver-dim); text-decoration: none; border-bottom: 1px solid var(--stone-edge); }
.nexus-note a:hover { color: var(--gold); }

@media (max-width: 560px) {
  .node { width: 78px; height: 78px; }
  .node .disc { width: 56px; height: 56px; }
  .node .disc svg { width: 27px; height: 27px; }
  .node.hub { width: 128px; height: 128px; }
  .node.hub .disc { width: 100px; height: 100px; }
  .node .label { font-size: 0.64rem; letter-spacing: 0.12em; }
  /* labels always visible on touch, since there's no hover */
  .node .label { opacity: 1; transform: none; }
}

/* ---------- collapsible categories (player resource) ---------- */
.category { margin-bottom: 18px; border: 1px solid var(--stone-edge); border-radius: 5px;
  overflow: hidden; background: linear-gradient(158deg, var(--stone), var(--night-2)); }

.category > summary {
  list-style: none; cursor: pointer; padding: 22px 26px;
  display: flex; align-items: center; gap: 18px;
  transition: background .3s;
}
.category > summary::-webkit-details-marker { display: none; }
.category > summary:hover { background: rgba(158,43,43,0.08); }

.cat-mark {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%;
  border: 1px solid var(--gold); display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-family:'Cinzel',serif; font-size: 0.9rem;
  transition: transform .35s, background .35s;
}
.category[open] .cat-mark { transform: rotate(90deg); background: rgba(200,168,96,0.12); }

.cat-titles { flex: 1; }
.cat-titles h2 {
  font-family:'Cinzel',serif; font-weight: 600; font-size: 1.35rem;
  letter-spacing: 0.03em; color: var(--gold-soft); line-height: 1.15;
}
.cat-titles .cat-sub {
  font-family:'Spectral SC',serif; font-size: 0.64rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-faint); margin-top: 3px;
}
.cat-count {
  font-family:'Spectral SC',serif; font-size: 0.66rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--seal-soft);
  border: 1px solid var(--seal-deep); border-radius: 20px; padding: 4px 12px; flex-shrink: 0;
}

.cat-body { padding: 4px 26px 22px; border-top: 1px solid var(--stone-edge); }

/* individual faith entries within a category */
.entry { padding: 20px 0; border-bottom: 1px solid rgba(74,34,38,0.5); }
.entry:last-child { border-bottom: none; }
.entry-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.entry-name { font-family:'Cinzel',serif; font-weight: 600; font-size: 1.18rem; color: var(--gold-soft); }
.entry-epithet { font-family:'Cormorant Garamond',serif; font-style: italic; color: var(--silver-dim); font-size: 0.98rem; }
.entry-body { margin-top: 8px; color: var(--ink); font-size: 1.04rem; }
.entry-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.entry-tags span {
  font-family:'Spectral SC',serif; font-size: 0.58rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-dim);
  border: 1px solid var(--stone-edge); border-radius: 3px; padding: 3px 9px;
}

.placeholder-note {
  font-family:'Cormorant Garamond',serif; font-style: italic;
  color: var(--ink-faint); font-size: 0.98rem;
}

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--stone-edge); padding: 26px 0 48px; text-align: center;
  font-family:'Spectral SC',serif; font-size: 0.72rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-faint); line-height: 1.9; }
footer a { color: var(--silver-dim); text-decoration: none; border-bottom: 1px solid var(--stone-edge); }
footer a:hover { color: var(--gold); }

/* ---------- accessibility floor ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px;
}

@media (max-width: 560px) {
  body { font-size: 18px; }
  .wrap { padding: 0 18px; }
  .dossier { padding: 22px 20px; }
  .masthead { padding: 30px 0 22px; }
  .masthead .attend { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
