/* ============================
   Timescape — Core Theme
   ============================ */

:root {
  --bg-main: #050611;
  --bg-main-alt: #050814;
  --bg-panel: #111320;
  --bg-panel-soft: #181b2a;
  --bg-chip: #151621;

  --accent-gold: #f4c56c;
  --accent-gold-soft: #f6d48d;
  --accent-gold-deep: #dca64a;

  --accent-rites: #f08ab6;        /* GMRO – warm rose */
  --accent-enchantment: #7dd0ff;  /* DP/EV – jade/sky */
  --accent-odyssey: #9fd38a;      /* Odyssey – laurel green */

  --text-main: #f6f2e9;
  --text-muted: #b6b3c8;
  --text-soft: #8d8aa4;
  --text-gold: #f6d48d;

  --border-soft: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --shadow-soft: 0 28px 60px rgba(0, 0, 0, 0.75);
  --shadow-chip: 0 14px 35px rgba(0, 0, 0, 0.75);

  --radius-lg: 22px;
  --radius-pill: 999px;

  --font-display: "Cinzel", "Georgia", serif;
  --font-body: "EB Garamond", "Georgia", serif;
}

/* ============================
   Global Layout & Typography
   ============================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body.ts-body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, #1b1730 0, transparent 50%),
    radial-gradient(circle at bottom right, #1d223c 0, transparent 55%),
    linear-gradient(180deg, #050611 0, #020308 50%, #050611 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-gold-soft);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.ts-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

@media (min-width: 1280px) {
  .ts-page {
    padding: 28px 12px 48px;
  }
}

/* ============================
   Top Bar & Navigation
   ============================ */

.ts-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 18px;
  margin-bottom: 22px;
  border-radius: 999px;
  background:
   linear-gradient(135deg, #060613, #111320);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
/* Make the whole brand block clickable */
.ts-brand-link {
  text-decoration: none;
  color: inherit;
}

.ts-topbar-left {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
/* Orb container */
.ts-glyph {
  position: relative;
  width: 3.75rem;   /* 60px – matches your 75px source with some padding */
  height: 3.75rem;
  flex-shrink: 0;
}

/* Both orb states stacked on top of each other */
.ts-glyph-orb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}

/* Default: outer orb visible, inner orb hidden */
.ts-glyph-orb--default {
  opacity: 1;
}

.ts-glyph-orb--hover {
  opacity: 0;
}

/* On hover/focus, fade to the "inner" glowing version */
.ts-brand-link:hover .ts-glyph-orb--default,
.ts-brand-link:focus-visible .ts-glyph-orb--default {
  opacity: 0;
  transform: scale(0.97);
}

.ts-brand-link:hover .ts-glyph-orb--hover,
.ts-brand-link:focus-visible .ts-glyph-orb--hover {
  opacity: 1;
  transform: scale(1.02);
}
/* Kill underlines on the brand link in all states */
.ts-brand-link,
.ts-brand-link:hover,
.ts-brand-link:focus,
.ts-brand-link:focus-visible {
  text-decoration: none;
}

.ts-brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
   justify-content: center;
}

.ts-brand-title {
  font-family: "Cinzel", serif; /* or whatever you’re using now */
  font-size: 1.4rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.ts-brand-sub {
   font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.8;
  color: var(--text-soft);
}

/* Nav pills */

.ts-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ts-nav-pill {
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: var(--text-muted);
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 60%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition:
    color 140ms ease-out,
    background 140ms ease-out,
    border-color 140ms ease-out,
    box-shadow 140ms ease-out,
    transform 70ms ease-out;
}

.ts-nav-pill:hover {
  border-color: rgba(244, 197, 108, 0.8);
  color: #fffbe8;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7);
  transform: translateY(-1px);
}

.ts-nav-pill--active {
  background: radial-gradient(circle at top left, #f9e2b8 0, #f4c56c 35%, #c8832a 80%);
  color: #130b05;
  border-color: rgba(244, 197, 108, 0.95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.9);
}

/* ============================
   Hero Section + Oracle Icon
   ============================ */

.ts-main {
  margin-top: 6px;
}

.ts-hero {
  border-radius: var(--radius-lg);
  padding: 26px 26px 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 70%),
    radial-gradient(circle at bottom right, rgba(250, 212, 143, 0.07), transparent 65%),
    linear-gradient(145deg, #151729, #060712);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  margin-bottom: 26px;
}

.ts-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(220px, 1fr);
  gap: 2.2rem;
  align-items: stretch;
}

.ts-hero-title {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.ts-hero-text {
  margin: 0 0 14px;
  color: var(--text-muted);
}

.ts-hero-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 18px;
}

.ts-hero-image {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Make sure nothing is clipping */
  overflow: visible;
}

.ts-oracle-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;        /* no cropping */
  display: block;
}

/* Buttons */

.ts-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 24px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #1b0d06;
  background: radial-gradient(circle at top left, #ffecc7 0, #f6d48d 35%, #d79a3a 80%);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.8);
  transition:
    transform 80ms ease-out,
    box-shadow 80ms ease-out,
    filter 80ms ease-out;
}

.ts-primary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.95);
}

.ts-primary-btn:active {
  transform: translateY(0);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.85);
}

.ts-ghost-link {
  font-size: 13px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--text-soft);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  padding-bottom: 2px;
}

.ts-ghost-link:hover {
  color: var(--accent-gold-soft);
  border-color: var(--accent-gold-soft);
}

/* Hero – responsive */

@media (max-width: 600px) {
  .ts-topbar {
    flex-direction: column;
    align-items: flex-start;
    border-radius: 18px;
  }

  .ts-hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .ts-primary-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================
   Ten Stages Grid
   ============================ */

.ts-section {
  margin-top: 8px;
  margin-bottom: 20px;
}

.ts-section--wide {
  margin-top: 20px;
}

.ts-section-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.ts-section-sub {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-left: 8px;
}

.ts-stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1000px) {
  .ts-stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ts-stage-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ts-stage-card {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 65%),
    linear-gradient(145deg, #111320, #05060f);
  border-radius: 18px;
  padding: 14px 18px 15px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-chip);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ts-stage-card h3 {
  margin: 0 0 3px;
  font-size: 15px;
}

.ts-stage-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.ts-stage-number {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-right: 6px;
}
/* ---------- Stage cards: hover & active glow ---------- */

:root {
  /* Default stage glow (Trionfi / gold) */
  --stage-glow-color: rgba(247, 196, 108, 0.55);
}

/* Optional per-oracle palette (hooked via data attribute in JS below) */
:root[data-oracle="trionfi"] {
  --stage-glow-color: rgba(247, 196, 108, 0.55); /* warm gold */
}
:root[data-oracle="rites"] {
  --stage-glow-color: rgba(240, 138, 182, 0.60); /* ember / ritual */
}
:root[data-oracle="enchantment"] {
  --stage-glow-color: rgba(125, 208, 255, 0.60); /* moonlit blue */
}
:root[data-oracle="odyssey"] {
  --stage-glow-color: rgba(159, 211, 138, 0.60); /* sunlit bronze */
}

.ts-stage-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 180ms ease-out,
    box-shadow 180ms ease-out,
    border-color 180ms ease-out,
    background 200ms ease-out;
}

/* Soft lift + glow on rollover */
.ts-stage-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 24px var(--stage-glow-color);
  background: radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.05),
      transparent 55%
    );
}

/* Pulse class we toggle when "Choose a Stage" link is clicked */
@keyframes ts-stage-pulse {
  0% {
    box-shadow: 0 0 0 0 var(--stage-glow-color);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.1),
      0 0 32px var(--stage-glow-color);
    transform: translateY(-2px);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
    transform: translateY(0);
  }
}

.ts-stage-card.ts-stage-pulse {
  animation: ts-stage-pulse 900ms ease-out;
}
.ts-stage-card.ts-stage-selected {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 32px var(--stage-glow-color);
  border-color: var(--stage-glow-color);
  transform: translateY(-1px);
}

/* Tiny note style on the stage link */
.ts-ghost-note {
  opacity: 0.8;
  font-size: 0.9em;
}


/* ============================
   Body copy & links
   ============================ */

.ts-body-copy {
  margin: 0 0 12px;
  color: var(--text-muted);
}

.ts-link {
  font-size: 14px;
  border-bottom: 1px solid rgba(244, 197, 108, 0.6);
}

.ts-link:hover {
  border-color: var(--accent-gold-soft);
}

/* ============================
   Footer
   ============================ */

.ts-footer {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: var(--text-soft);
}

/* ============================
   Modal (Draw a Sign)
   ============================ */

.ts-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.ts-modal.is-open {
  display: flex;
}

.ts-modal-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(15, 7, 27, 0.9), rgba(3, 2, 6, 0.98));
  backdrop-filter: blur(4px);
}

.ts-modal-dialog {
  position: relative;
  max-width: 460px;
  width: calc(100% - 32px);
  padding: 22px 22px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 70%),
    linear-gradient(145deg, #151729, #05060f);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.9);
  z-index: 50;
}

.ts-modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.ts-modal-text {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 15px;
}
#ts-modal-oracle-img {
  display: block;
  max-width: 240px;
  width: 60%;
  height: auto;
  margin: 0 auto 16px;
}

.ts-modal-text a {
  color: var(--accent-gold);
  text-decoration: underline;
  cursor: pointer;
}

.ts-modal-text a:hover {
  text-decoration: none;
}

.ts-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: 20px;
  cursor: pointer;
}

.ts-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(244, 197, 108, 0.8);
  background: transparent;
  color: var(--text-gold);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

/* ============================
   Oracle Color Themes
   ============================ */

/* base is Trionfi: we already use golden defaults */

/* --- Rites (GMRO) --- */

body.oracle-rites .ts-nav-pill[data-oracle="rites"],
body.oracle-rites .ts-nav-pill--active[data-oracle="rites"] {
  background: radial-gradient(circle at top left, #ffe0ed 0, #f08ab6 40%, #a83a74 90%);
  color: #1a0610;
  border-color: rgba(240, 138, 182, 0.9);
}

body.oracle-rites .ts-hero {
  background:
    radial-gradient(circle at top left, rgba(255, 192, 218, 0.16), transparent 70%),
    linear-gradient(145deg, #1a1121, #05040c);
}

body.oracle-rites .ts-stage-card {
  border-color: rgba(240, 138, 182, 0.18);
}
/* Hero layout wrapper */
.ts-hero-inner {
  display: flex;
  gap: 3.5rem;
  align-items: center;
}

/* Left & right columns */
.ts-hero-copy {
  flex: 3 1 0;
}

.ts-hero-image {
  flex: 2 1 0;
  display: flex;
  justify-content: center;
}

/* Oracle icon block */
.ts-oracle-hero {
  position: relative;
  max-width: 420px;           /* tweak as desired */
  width: 100%;
  aspect-ratio: 1 / 1;        /* keeps it perfectly circular */
}

/* Icon image itself */
.ts-oracle-hero-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
}

/* Caption under icon */
.ts-oracle-hero-caption {
  margin-top: 1.4rem;
  text-align: center;
  font-family: var(--ts-serif, "Cormorant Garamond", serif);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #f3e2bd;
}

/* Stack nicely on mobile */
@media (max-width: 960px) {
  .ts-hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .ts-hero-image {
    align-self: center;
    margin-top: 2rem;
  }
}

/* --- Enchantment (Dragon Pearl / Eternal Vessel) --- */

body.oracle-enchantment .ts-nav-pill[data-oracle="enchantment"],
body.oracle-enchantment .ts-nav-pill--active[data-oracle="enchantment"] {
  background: radial-gradient(circle at top left, #e2fbff 0, #8dd6ff 35%, #2276a8 90%);
  color: #03101a;
  border-color: rgba(125, 208, 255, 0.9);
}

body.oracle-enchantment .ts-hero {
  background:
    radial-gradient(circle at top left, rgba(141, 214, 255, 0.18), transparent 70%),
    linear-gradient(145deg, #101a24, #03040b);
}

body.oracle-enchantment .ts-stage-card {
  border-color: rgba(141, 214, 255, 0.18);
}

/* --- Odyssey --- */

body.oracle-odyssey .ts-nav-pill[data-oracle="odyssey"],
body.oracle-odyssey .ts-nav-pill--active[data-oracle="odyssey"] {
  background: radial-gradient(circle at top left, #ebffe4 0, #b9e99a 35%, #458b32 90%);
  color: #061503;
  border-color: rgba(159, 211, 138, 0.9);
}

body.oracle-odyssey .ts-hero {
  background:
    radial-gradient(circle at top left, rgba(159, 211, 138, 0.18), transparent 70%),
    linear-gradient(145deg, #131e14, #020408);
}

body.oracle-odyssey .ts-stage-card {
  border-color: rgba(159, 211, 138, 0.18);
}
