:root {
  --bg: #121416;
  --panel: rgba(255, 255, 255, 0.05);
  --panel-strong: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f1e8;
  --muted: rgba(244, 241, 232, 0.76);
  --soft: rgba(244, 241, 232, 0.58);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max: 1240px;

  --phase-1: #638372;
  --phase-2: #9c2d12;
  --phase-3: #3d5677;
  --phase-4: #491d8b;
  --phase-5: #c9a227;

  --phase-2-readable: #d96a4b;
  --phase-3-readable: #7d9fcb;
  --phase-4-readable: #b48cff;

  --cta-bg: rgba(255, 255, 255, 0.05);
  --cta-bg-strong: rgba(255, 255, 255, 0.07);
  --cta-border: var(--line-strong);
  --cta-text: var(--text);
  --cta-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.18),
    0 0 28px rgba(201, 162, 39, 0.16);

  --paper-tint: linear-gradient(
    180deg,
    rgba(201, 162, 39, 0.05) 0%,
    rgba(255, 255, 255, 0) 22%,
    rgba(73, 29, 139, 0.035) 100%
  );
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top center, rgba(201, 162, 39, 0.08), transparent 28%),
    radial-gradient(circle at bottom left, rgba(73, 29, 139, 0.08), transparent 26%),
    linear-gradient(180deg, #15181b 0%, #111315 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.22;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.45));
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 42%, rgba(0, 0, 0, 0.24) 100%);
  opacity: 0.75;
}

.brand-pill,
.browse-pill,
.mini-pill,
.entry-link,
.section-jump,
.cta-pill,
.phase-chip {
  border-radius: 999px;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

/* ==========================================================================
   Shared CTA System
   ========================================================================== */

.mini-pill,
.entry-link,
.section-jump,
.cta-pill,
.phase-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--cta-border);
  background: var(--cta-bg);
  color: var(--cta-text);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.mini-pill:hover,
.entry-link:hover,
.section-jump:hover,
.cta-pill:hover,
.phase-chip:hover {
  transform: translateY(-1px);
  background: var(--cta-bg-strong);
}

.mini-pill:focus-visible,
.entry-link:focus-visible,
.section-jump:focus-visible,
.cta-pill:focus-visible,
.phase-chip:focus-visible,
.brand-pill:focus-visible,
.browse-pill:focus-visible {
  outline: 2px solid rgba(201, 162, 39, 0.72);
  outline-offset: 2px;
}

.cta-pill.is-primary {
  background: rgba(201, 162, 39, 0.12);
  border-color: rgba(201, 162, 39, 0.4);
  color: #f2df9b;
}

.cta-pill.is-primary:hover {
  border-color: rgba(201, 162, 39, 0.72);
  box-shadow: var(--cta-shadow);
}

.mini-pill,
.entry-link,
.section-jump,
.cta-pill:not(.is-primary) {
  border-color: rgba(201, 162, 39, 0.72);
}

.mini-pill:hover,
.entry-link:hover,
.section-jump:hover,
.cta-pill:not(.is-primary):hover {
  box-shadow: var(--cta-shadow);
}

/* ==========================================================================
   Brand / Browse Pills
   ========================================================================== */

.brand-pill,
.browse-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.browse-pill {
  gap: 0;
  letter-spacing: 0;
  font-size: 0;
}

.browse-pill .browse-word,
.browse-pill .browse-dot {
  display: inline-block;
  font-size: 0.77rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.browse-pill .browse-word {
  letter-spacing: 0.14em;
}

.browse-pill .browse-dot {
  letter-spacing: 0;
  margin: 0;
  padding: 0;
}

.brand-pill:hover,
.browse-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(201, 162, 39, 0.72);
  box-shadow: var(--cta-shadow);
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 12px;
  background: linear-gradient(
    135deg,
    var(--phase-1),
    var(--phase-3) 42%,
    var(--phase-4) 72%,
    var(--phase-5)
  );
  box-shadow: 0 0 14px rgba(201, 162, 39, 0.32);
}

.dot-lock {
  display: inline;
  white-space: nowrap;
}

.gold-dot {
  display: inline;
  color: var(--phase-5);
}

/* ==========================================================================
   Surface Cards
   ========================================================================== */

.hero,
.section-card,
.index-card,
.quote-card,
.footer-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: var(--shadow);
}

.hero,
.footer-card {
  border-radius: 30px;
}

.section-card,
.index-card,
.quote-card {
  border-radius: 26px;
}

.hero {
  padding: clamp(24px, 4vw, 42px);
  background:
    var(--paper-tint),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
  margin-bottom: 18px;
}

.hero::before,
.section-card::before,
.index-card::before,
.quote-card::before,
.footer-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.028),
    transparent 30%,
    transparent 70%,
    rgba(255, 255, 255, 0.015)
  );
  opacity: 0.9;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 38px;
  padding: 0 14px;
  margin-bottom: 18px;
  border: 1px solid rgba(201, 162, 39, 0.28);
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.09);
  color: #f2df9b;
  font-size: 0;
  letter-spacing: 0;
  text-transform: uppercase;
  font-weight: 700;
}

.kicker .kicker-word,
.kicker .kicker-dot {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.kicker .kicker-word {
  color: #f2df9b;
  letter-spacing: 0.16em;
}

.kicker .kicker-dot {
  color: var(--text);
  letter-spacing: 0.16em;
  margin: 0;
  padding: 0;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2.35rem, 6vw, 4.7rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-transform: none;
}

.hero h1 > span {
  display: block;
}

.hero-copy {
  max-width: 68ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 22px;
}

.hero-actions,
.mini-pills,
.section-links,
.spine-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.hero-actions .cta-pill {
  flex: 0 0 auto;
}

.hero-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.quote-card,
.index-card {
  padding: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.quote-label,
.index-label,
.section-label,
.footer-label {
  margin: 0 0 10px;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
}

.quote-text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
}

.quote-sub {
  margin-top: 12px;
  color: var(--soft);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mini-pills {
  display: grid;
  grid-template-columns: repeat(6, max-content);
  justify-content: center;
  column-gap: 12px;
  row-gap: 12px;
}

.mini-pills .mini-pill:nth-child(1) {
  border-color: rgba(99, 131, 114, 0.45);
  grid-column: 1 / 3;
  justify-self: center;
}

.mini-pills .mini-pill:nth-child(2) {
  border-color: rgba(156, 45, 18, 0.45);
  grid-column: 3 / 5;
  justify-self: center;
}

.mini-pills .mini-pill:nth-child(3) {
  border-color: rgba(61, 86, 119, 0.45);
  grid-column: 5 / 7;
  justify-self: center;
}

.mini-pills .mini-pill:nth-child(4) {
  border-color: rgba(73, 29, 139, 0.45);
  grid-column: 2 / 4;
  justify-self: center;
}

.mini-pills .mini-pill:nth-child(5) {
  border-color: rgba(201, 162, 39, 0.45);
  grid-column: 4 / 6;
  justify-self: center;
}

/* ==========================================================================
   Main Content
   ========================================================================== */

.main-grid {
  display: grid;
  gap: 18px;
}

.section-card {
  padding: 24px;
  background: rgba(255, 255, 255, 0.042);
}

.section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.medallion {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.02)
  );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 10px 24px rgba(0, 0, 0, 0.22);
}

.medallion--gold {
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 235, 160, 0.24),
    rgba(201, 162, 39, 0.14) 42%,
    rgba(255, 255, 255, 0.02)
  );
  border-color: rgba(201, 162, 39, 0.32);
}

.medallion--rainbow {
  background: conic-gradient(
    from 180deg,
    var(--phase-1),
    var(--phase-3),
    var(--phase-4),
    var(--phase-5),
    var(--phase-2),
    var(--phase-1)
  );
  position: relative;
}

.medallion--rainbow::after {
  content: "I";
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  display: grid;
  place-items: center;
  background: #16191b;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title-wrap h2 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 2.3vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.section-title-wrap p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.section-links {
  margin-top: 18px;
}

.index-grid,
.entry-grid,
.site-grid {
  display: grid;
  gap: 14px;
}

.index-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.entry-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#the-phases .entry-grid > .entry-card:last-child {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, calc(50% - 7px));
}

.site-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.index-card h3,
.entry-card h3,
.site-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.2;
}

.index-card p,
.entry-card p,
.site-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.65;
}

.entry-card,
.site-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: var(--shadow);
}

.site-card {
  display: flex;
  flex-direction: column;
}

.entry-card::before,
.site-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0));
}

.entry-card[data-phase="1"]::before,
.site-card[data-phase="1"]::before {
  background: linear-gradient(
    90deg,
    rgba(99, 131, 114, 0.2),
    var(--phase-1),
    rgba(99, 131, 114, 0.2)
  );
}

.entry-card[data-phase="2"]::before,
.site-card[data-phase="2"]::before {
  background: linear-gradient(
    90deg,
    rgba(156, 45, 18, 0.2),
    var(--phase-2),
    rgba(156, 45, 18, 0.2)
  );
}

.entry-card[data-phase="3"]::before,
.site-card[data-phase="3"]::before {
  background: linear-gradient(
    90deg,
    rgba(61, 86, 119, 0.2),
    var(--phase-3),
    rgba(61, 86, 119, 0.2)
  );
}

.entry-card[data-phase="4"]::before,
.site-card[data-phase="4"]::before {
  background: linear-gradient(
    90deg,
    rgba(73, 29, 139, 0.2),
    var(--phase-4),
    rgba(73, 29, 139, 0.2)
  );
}

.entry-card[data-phase="5"]::before,
.site-card[data-phase="5"]::before {
  background: linear-gradient(
    90deg,
    rgba(201, 162, 39, 0.2),
    var(--phase-5),
    rgba(201, 162, 39, 0.2)
  );
}

.entry-meta,
.site-meta {
  margin-bottom: 10px;
  font-size: 0.69rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
}

.entry-link,
.section-jump {
  margin-top: 14px;
  width: fit-content;
}

.site-card p {
  margin-bottom: 18px;
}

.site-card .section-jump {
  margin-top: auto;
}

.footer-card {
  margin-top: 18px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.045);
}

.footer-copy {
  color: var(--muted);
  line-height: 1.7;
}

/* ==========================================================================
   Spine / Phase Pills
   ========================================================================== */

.phase-chip {
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.7rem;
  color: var(--text);
}

.phase-chip::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
  box-shadow: 0 0 10px currentColor;
}

.phase-chip.phase-1 {
  color: var(--phase-1);
}

.phase-chip.phase-2 {
  color: var(--phase-2-readable);
}

.phase-chip.phase-3 {
  color: var(--phase-3-readable);
}

.phase-chip.phase-4 {
  color: var(--phase-4-readable);
}

.phase-chip.phase-5 {
  color: var(--phase-5);
}

.phase-chip.phase-1:hover {
  border-color: rgba(99, 131, 114, 0.72);
  box-shadow:
    0 0 0 1px rgba(99, 131, 114, 0.18),
    0 0 24px rgba(99, 131, 114, 0.26);
}

.phase-chip.phase-2:hover {
  border-color: rgba(217, 106, 75, 0.72);
  box-shadow:
    0 0 0 1px rgba(217, 106, 75, 0.18),
    0 0 24px rgba(217, 106, 75, 0.28);
}

.phase-chip.phase-3:hover {
  border-color: rgba(125, 159, 203, 0.72);
  box-shadow:
    0 0 0 1px rgba(125, 159, 203, 0.18),
    0 0 24px rgba(125, 159, 203, 0.28);
}

.phase-chip.phase-4:hover {
  border-color: rgba(180, 140, 255, 0.72);
  box-shadow:
    0 0 0 1px rgba(180, 140, 255, 0.18),
    0 0 24px rgba(180, 140, 255, 0.28);
}

.phase-chip.phase-5:hover {
  border-color: rgba(201, 162, 39, 0.72);
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.18),
    0 0 24px rgba(201, 162, 39, 0.28);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1120px) {
  .hero,
  .index-grid,
  .site-grid {
    grid-template-columns: 1fr;
  }

  .entry-grid {
    grid-template-columns: 1fr;
  }

  #the-phases .entry-grid > .entry-card:last-child {
    grid-column: auto;
    justify-self: stretch;
    width: auto;
  }
}

@media (max-width: 720px) {
  .hero,
  .section-card,
  .footer-card {
    padding: 18px;
  }

  .hero h1 {
    font-size: clamp(2rem, 12vw, 3rem);
  }

  .medallion {
    width: 58px;
    height: 58px;
  }

  .brand-pill,
  .browse-pill,
  .mini-pill,
  .entry-link,
  .section-jump,
  .cta-pill,
  .phase-chip {
    width: 100%;
  }

  .hero-actions,
  .section-links,
  .spine-nav {
    flex-direction: column;
  }

  .hero-actions {
    flex-wrap: wrap;
  }

  .hero-actions .cta-pill {
    flex: 1 1 auto;
  }

  .mini-pills {
    display: flex;
    flex-direction: column;
  }
}