/* ============================================================
   SITE.CSS — AetherForge Worldbuilding Hub
   Unified stylesheet for quantumstoryforge.io
   ============================================================ */

/* Google Fonts — Cormorant Garamond for display headings */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ============================================================
   1. ROOT VARIABLES
   ============================================================ */
:root {
  /* Core theme */
  --bg-main: #050608;
  --bg-alt: #0d1015;
  --panel: #171a22;
  --accent: #c28f3f;
  --accent-soft: #f3d5a1;
  --accent-red: #b84b3c;
  --text-main: #f5f2e9;
  --text-muted: #c7c1b0;
  --border-soft: rgba(242, 209, 145, 0.3);
  --header-height: 84px;

  /* Extended palette (tool pages) */
  --bg-panel: #151317;
  --bg-panel-alt: #1c181f;
  --accent-brass: var(--accent);
  --accent-brass-soft: #a4762d;
  --accent-amber: #e0a63e;
  --accent-green: #3ba464;
  --shadow-soft: 0 0 20px rgba(0, 0, 0, 0.8);

  /* Type stacks */
  --body-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display-font: "Cormorant Garamond", "Cinzel", "Georgia", serif;
  --mono: "Fira Mono", "Consolas", "Courier New", monospace;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--body-font);
  background: radial-gradient(circle at top, #26293a 0, #050608 45%, #020304 100%);
  color: var(--text-main);
  line-height: 1.6;
  padding-top: var(--header-height);
}

a {
  color: var(--accent-soft);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Custom selection highlight */
::selection {
  background: rgba(194, 143, 63, 0.35);
  color: #f5f2e9;
}

::-moz-selection {
  background: rgba(194, 143, 63, 0.35);
  color: #f5f2e9;
}

/* Themed scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #0a0b10;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #c28f3f 0%, #6b4f1f 100%);
  border-radius: 6px;
  border: 2px solid #0a0b10;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #f3d5a1 0%, #c28f3f 100%);
}

/* Firefox scrollbar */
html {
  scrollbar-color: #7a5a24 #0a0b10;
  scrollbar-width: thin;
}

/* ============================================================
   3. SITE HEADER & NAVIGATION
   ============================================================ */
header {
  border-bottom: 1px solid var(--border-soft);
  background: radial-gradient(circle at top left, #26293a 0, #050608 55%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 9999;
  isolation: isolate;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  text-decoration: none;
}

.brand:hover,
.brand:focus-visible {
  text-decoration: none;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  box-shadow:
    0 0 6px rgba(194, 143, 63, 0.7),
    inset 0 0 6px rgba(0, 0, 0, 0.9);
  position: relative;
  background: radial-gradient(circle at 30% 20%, #f3d5a1 0, #a06d25 40%, #1c140a 100%);
  flex-shrink: 0;
}

.brand-icon::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  border: 1px dashed rgba(9, 9, 11, 0.8);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.brand-name {
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
  white-space: nowrap;
}

.brand-sub {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Main nav ---------------------------------------------------- */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  max-width: 100%;
}

.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  cursor: pointer;
  width: 30px;
  height: 22px;
  position: relative;
  flex-shrink: 0;
}

.nav-toggle-label span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-soft);
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease, bottom 0.25s ease;
}

.nav-toggle-label span:nth-child(1) { top: 0; }
.nav-toggle-label span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav-toggle-label span:nth-child(3) { bottom: 0; }

.nav-toggle:checked + .nav-toggle-label span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.nav-toggle:checked + .nav-toggle-label span:nth-child(2) {
  opacity: 0;
}

.nav-toggle:checked + .nav-toggle-label span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: 1rem;
  max-width: 100%;
}

.nav-item {
  position: relative;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0;
  color: var(--accent-soft);
  text-decoration: none;
  position: relative;
  transition: color 0.25s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 1.5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  width: 100%;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: #fff;
  text-decoration: none;
}

.nav-link .caret {
  font-size: 0.7rem;
  opacity: 0.8;
  transition: transform 0.25s ease;
}

.nav-item.dropdown:hover .nav-link .caret {
  transform: rotate(180deg);
}

/* Dropdown (desktop) */
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.3rem);
  min-width: 220px;
  list-style: none;
  padding: 0.5rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: radial-gradient(circle at top, #23242f 0, #050608 80%);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.9),
    0 0 1px rgba(194, 143, 63, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  z-index: 10000;
  max-width: 100vw;
}

.dropdown-menu li {
  margin: 4px 0;
}

.dropdown-menu a {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-main);
  white-space: normal;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.dropdown-menu a:hover,
.dropdown-menu a:focus-visible {
  background: rgba(194, 143, 63, 0.12);
  color: var(--accent-soft);
  padding-left: 1rem;
  text-decoration: none;
}

.nav-item.dropdown:hover .dropdown-menu,
.nav-item.dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ============================================================
   4. HERO — FULL-WIDTH BANNER (index, council)
   ============================================================ */
.hero {
  border-bottom: 1px solid rgba(63, 63, 70, 0.7);
  background:
    radial-gradient(circle at 12% 0, rgba(194, 143, 63, 0.23) 0, transparent 55%),
    radial-gradient(circle at 85% 100%, rgba(184, 75, 60, 0.25) 0, transparent 55%);
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-banner-frame {
  width: 100%;
  max-width: 1200px;
  border-radius: 18px;
  border: 1px solid rgba(242, 209, 145, 0.3);
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1px rgba(0, 0, 0, 0.8);
  background: #050608;
  position: relative;
}

.hero-banner-frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(194, 143, 63, 0.5) 0%,
    transparent 30%,
    transparent 70%,
    rgba(194, 143, 63, 0.3) 100%
  );
  background-size: 200% 200%;
  animation: heroShimmer 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
}

@keyframes heroShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-banner-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 600;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.hero-banner-frame:hover .hero-banner-image {
  transform: scale(1.015);
}

/* ============================================================
   5. PAGE HERO — CARD WITH OVERLAY (peregrine, stardate)
   ============================================================ */
.page-hero {
  margin: 2rem auto;
  max-width: 1200px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  position: relative;
  background: radial-gradient(circle at top, #2b2227 0, #050307 70%);
}

.page-hero .hero-media {
  position: relative;
  width: 100%;
}

.page-hero .hero-media::before {
  content: "";
  display: block;
  padding-top: 50%; /* 1200x600 = 2:1 */
}

.page-hero .hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.page-hero .hero-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.1rem 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.4), transparent);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hero-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-brass-soft);
  opacity: 0.9;
}

.hero-title {
  font-family: var(--display-font);
  font-size: 1.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f8ecd4;
}

.hero-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 480px;
}

/* ============================================================
   6. GENERIC CONTENT
   ============================================================ */
main {
  background: radial-gradient(circle at bottom, rgba(184, 75, 60, 0.12) 0, transparent 55%);
}

/* Index hub section */
#worldbuilding-hub {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 2.5rem;
}

#worldbuilding-hub h2 {
  font-size: 1.7rem;
  margin-bottom: 0.75rem;
  color: var(--accent-soft);
}

#worldbuilding-hub h3 {
  font-size: 1.1rem;
  margin-top: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--accent-soft);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#worldbuilding-hub p {
  max-width: 46rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

/* Feature cards grid (homepage dashboard) */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-card {
  background:
    radial-gradient(circle at 0 0, rgba(194, 143, 63, 0.1), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(184, 75, 60, 0.12), transparent 55%),
    var(--panel);
  border-radius: 14px;
  border: 1px solid rgba(242, 209, 145, 0.18);
  padding: 1.5rem 1.4rem 1.6rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(194, 143, 63, 0.5) 30%,
    rgba(243, 213, 161, 0.6) 50%,
    rgba(194, 143, 63, 0.5) 70%,
    transparent
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover,
.feature-card:focus-visible {
  transform: translateY(-4px);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.9),
    0 0 20px rgba(194, 143, 63, 0.2);
  border-color: rgba(242, 209, 145, 0.45);
  text-decoration: none;
}

.feature-card:hover::before,
.feature-card:focus-visible::before {
  opacity: 1;
}

.feature-card-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.feature-card-title {
  font-family: var(--display-font);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.feature-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.feature-card-arrow {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: auto;
  padding-top: 0.5rem;
  transition: letter-spacing 0.25s ease;
}

.feature-card:hover .feature-card-arrow {
  letter-spacing: 0.24em;
}

@media (max-width: 640px) {
  .feature-cards {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
}

/* ============================================================
   7. FOOTER
   ============================================================ */
footer {
  border-top: 1px solid rgba(63, 63, 70, 0.8);
  background: #020307;
  color: var(--text-muted);
  padding: 1rem 1.5rem 1.4rem;
  font-size: 0.78rem;
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(194, 143, 63, 0.5) 30%,
    rgba(243, 213, 161, 0.6) 50%,
    rgba(194, 143, 63, 0.5) 70%,
    transparent
  );
  pointer-events: none;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.footer-copy {
  max-width: 60ch;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
}

.footer-links a {
  color: var(--accent-soft);
  text-decoration: none;
  position: relative;
  padding-bottom: 1px;
}

.footer-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent-soft);
  transition: width 0.2s ease;
}

.footer-links a:hover::after,
.footer-links a:focus-visible::after {
  width: 100%;
}

.footer-sep {
  opacity: 0.5;
}

/* ============================================================
   8. BASE RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .hero-inner {
    padding: 1.8rem 1.3rem 1.8rem;
  }
  #worldbuilding-hub {
    padding: 2rem 1.3rem 2.3rem;
  }
}

@media (max-width: 768px) {
  .top-bar {
    align-items: flex-start;
  }

  .main-nav {
    flex-direction: column;
    align-items: flex-end;
    width: 100%;
    max-width: 100%;
  }

  .nav-toggle-label {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    margin-left: 0;
    margin-top: 0.6rem;
    width: 100%;
    background: rgba(5, 6, 8, 0.98);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.9);
  }

  .nav-toggle:checked ~ .nav-list {
    display: flex;
  }

  .nav-item {
    width: 100%;
    text-align: left;
    white-space: normal;
  }

  .nav-link {
    justify-content: space-between;
    width: 100%;
  }

  .dropdown-menu {
    position: static;
    margin-top: 0.25rem;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    background: transparent;
    border-radius: 8px;
    border: none;
    width: 100%;
    min-width: 0;
    padding: 0.1rem 0 0.25rem;
  }

  .dropdown-menu a {
    display: block;
    padding: 0.2rem 0.2rem 0.2rem 0.4rem;
    white-space: normal;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  header,
  .shell,
  .top-bar,
  .main-nav,
  .nav-list {
    max-width: 100%;
    overflow-x: hidden;
  }
}

@media (max-width: 640px) {
  .shell,
  footer {
    padding-inline: 1.1rem;
  }
  .hero-inner {
    padding: 1.5rem 1.1rem 1.6rem;
  }
  #worldbuilding-hub {
    padding-inline: 1.1rem;
  }
}

/* Page hero small-screen tweaks */
@media (max-width: 600px) {
  .page-hero .hero-overlay {
    padding: 0.85rem 0.95rem;
  }
  .hero-title {
    font-size: 1.25rem;
  }
  .hero-subtitle {
    font-size: 0.8rem;
  }
}

/* Mobile touch-target & readability improvements */
@media (max-width: 480px) {
  .nav-link {
    padding: 0.5rem 0;
    min-height: 44px;
  }
  .dropdown-menu a {
    padding: 0.45rem 0.4rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .btn {
    padding: 0.7rem 1rem;
    min-height: 44px;
    width: 100%;
    text-align: center;
  }
  .tab-btn {
    padding: 0.7rem 0.8rem;
    min-height: 44px;
    flex: 1 1 0;
    text-align: center;
  }
  .page {
    padding: 1.5rem 1rem 2.5rem;
  }
  .panel {
    padding: 1.25rem 1rem 1.5rem;
  }
  .footer-links {
    gap: 1rem;
  }
  .footer-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* ============================================================
   9. COUNCIL OF 8 PAGE
   ============================================================ */
#aetherforge-council-of-8 {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 2.5rem;
}

#aetherforge-council-of-8 h2 {
  font-size: 1.7rem;
  margin-bottom: 0.75rem;
  color: var(--accent-soft);
}

#aetherforge-council-of-8 h3 {
  font-size: 1.1rem;
  margin-top: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--accent-soft);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#aetherforge-council-of-8 p {
  max-width: 46rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

.council-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 2.5rem;
  align-items: flex-start;
}

.council-copy h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--accent-soft);
}

.council-copy h3 {
  margin-top: 1.6rem;
  margin-bottom: 0.6rem;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.council-copy p {
  margin-bottom: 0.9rem;
}

.council-portraits h3 {
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 1.2rem;
  text-align: center;
}

.council-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.3rem 1.1rem;
}

.council-card {
  background:
    radial-gradient(circle at 0 0, rgba(194, 143, 63, 0.15), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(184, 75, 60, 0.18), transparent 55%),
    var(--panel);
  border-radius: 0.9rem;
  border: 1px solid rgba(242, 209, 145, 0.24);
  padding: 0.8rem 0.8rem 0.9rem;
  text-align: center;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.9);
  position: relative;
  overflow: hidden;
  transition:
    transform 170ms ease-out,
    box-shadow 170ms ease-out,
    border-color 170ms ease-out,
    background 170ms ease-out;
  cursor: pointer;
}

.council-image-placeholder {
  width: 100%;
  height: auto;
  border-radius: 0.7rem;
  border: 1px solid rgba(242, 209, 145, 0.35);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(0, 0, 0, 0.55) inset;
  display: block;
  object-fit: cover;
  filter: grayscale(0.25);
  transform: translateY(0);
  transition:
    transform 180ms ease-out,
    box-shadow 180ms ease-out,
    filter 180ms ease-out,
    border-color 180ms ease-out;
}

.council-name {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  text-align: center;
  transition:
    color 160ms ease-out,
    letter-spacing 160ms ease-out;
  width: 100%;
  max-width: 100%;
  padding-inline: 0.25rem;
  box-sizing: border-box;
}

.council-name-main {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.council-name-main--long {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

.council-name-role {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(243, 213, 161, 0.75);
  opacity: 0.9;
}

.council-bio-link {
  margin-top: 0.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(243, 213, 161, 0.85);
  border-bottom: 1px dotted rgba(243, 213, 161, 0.4);
  padding-bottom: 0.05rem;
}

.council-bio-link::after {
  content: "\2197";
  font-size: 0.78rem;
  opacity: 0.9;
}

.council-bio-link:hover,
.council-bio-link:focus-visible {
  color: #ffffff;
  border-bottom-color: rgba(243, 213, 161, 0.9);
  text-decoration: none;
}

.council-card:hover,
.council-card:focus-within {
  transform: translateY(-3px);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 1),
    0 0 24px rgba(194, 143, 63, 0.25);
  border-color: rgba(242, 209, 145, 0.5);
  background:
    radial-gradient(circle at 0 0, rgba(194, 143, 63, 0.22), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(184, 75, 60, 0.25), transparent 55%),
    var(--panel);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.council-card:hover .council-image-placeholder,
.council-card:focus-within .council-image-placeholder {
  transform: translateY(-4px) scale(1.03);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 1),
    0 0 24px rgba(243, 213, 161, 0.7);
  filter: grayscale(0);
  border-color: rgba(243, 213, 161, 0.9);
}

.council-card:hover .council-name-main,
.council-card:focus-within .council-name-main,
.council-card:hover .council-name-role,
.council-card:focus-within .council-name-role {
  color: var(--accent-soft);
}

.council-card:hover .council-name-main,
.council-card:focus-within .council-name-main {
  letter-spacing: 0.2em;
}

/* Lightbox */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
}

.image-lightbox.is-visible {
  display: flex;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.95), #020308);
  opacity: 0.96;
}

.image-lightbox-content {
  position: relative;
  max-width: 96vw;
  max-height: 90vh;
  margin: 0;
  padding: 0.75rem 0.75rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(242, 209, 145, 0.4);
  background:
    radial-gradient(circle at 0 0, rgba(243, 213, 161, 0.25), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(184, 75, 60, 0.3), transparent 60%),
    #050608;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.95),
    0 0 32px rgba(194, 143, 63, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  box-sizing: border-box;
}

.image-lightbox-content img {
  max-width: 100%;
  max-height: 76vh;
  border-radius: 0.75rem;
  border: 1px solid rgba(242, 209, 145, 0.4);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 1),
    0 0 24px rgba(243, 213, 161, 0.55);
  display: block;
}

.image-lightbox-caption {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

.image-lightbox-close {
  position: absolute;
  top: 0.3rem;
  right: 0.6rem;
  border: none;
  background: transparent;
  color: var(--accent-soft);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.image-lightbox-close:hover,
.image-lightbox-close:focus-visible {
  color: #ffffff;
}

/* Council responsive */
@media (max-width: 960px) {
  #aetherforge-council-of-8 {
    padding: 1.8rem 1.3rem 2.2rem;
  }
  .council-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr);
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .council-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .council-portraits {
    margin-top: 1.5rem;
  }
  .council-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #aetherforge-council-of-8 {
    padding-inline: 1.1rem;
  }
}

@media (max-width: 520px) {
  .council-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============================================================
   10. TOOL PAGES — SHARED (peregrine, stardate)
   ============================================================ */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3.5rem;
}

.panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.8));
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  padding: 1.75rem 1.5rem 2rem;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(200, 155, 60, 0.15);
  pointer-events: none;
}

.section-title {
  font-family: var(--display-font);
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.section-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.callout {
  border-radius: 8px;
  border: 1px solid rgba(250, 225, 180, 0.26);
  background: linear-gradient(135deg, rgba(255, 240, 210, 0.04), rgba(0, 0, 0, 0.6));
  padding: 0.75rem 0.9rem;
  font-size: 0.88rem;
  margin-top: 0.5rem;
}

.callout strong {
  color: #ffe4a6;
}

.mono {
  font-family: var(--mono);
  font-size: 0.86rem;
}

.btn {
  border-radius: 6px;
  border: 1px solid var(--accent-brass-soft);
  background: radial-gradient(circle at top, #3e2b1a 0, #171011 60%);
  color: var(--text-main);
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.btn:hover {
  background: radial-gradient(circle at top, #c89b3c 0, #a4762d 60%);
  color: #080809;
  box-shadow:
    0 0 14px rgba(200, 155, 60, 0.8),
    0 0 30px rgba(200, 155, 60, 0.3);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 0 8px rgba(200, 155, 60, 0.6);
}

/* Tool page typography */
.page h1 {
  margin: 0;
  font-family: var(--display-font);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-size: 1.75rem;
  color: var(--accent);
}

.page h2,
.page h3 {
  font-family: var(--display-font);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.page p {
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
}

.page ul {
  padding-left: 1.2rem;
  margin: 0.2rem 0 0.65rem;
}

.page li {
  margin-bottom: 0.22rem;
  font-size: 0.9rem;
}

.page label,
.page td,
.page th {
  font-size: 0.95rem;
}

.page table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.page th,
.page td {
  border: 1px solid var(--border-soft);
  padding: 0.6rem;
  color: var(--text-main);
}

.page th {
  background: rgba(200, 155, 60, 0.1);
  text-transform: uppercase;
  font-size: 0.8rem;
}

.page input,
.page select {
  width: 100%;
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-main);
  font-family: var(--mono);
}

.page section {
  margin-bottom: 1.5rem;
}

/* ============================================================
   11. PEREGRINE FIELD MANUAL
   ============================================================ */
.page-header {
  margin-bottom: 2rem;
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.title-block {
  flex: 1 1 250px;
}

.subtitle {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.tagline {
  margin-top: 0.4rem;
  font-style: italic;
  font-size: 0.9rem;
  color: #e8dcc2;
}

.badge-block {
  flex: 0 0 220px;
  align-self: stretch;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}

.spec-badge {
  border-radius: 999px;
  border: 1px solid var(--accent-brass-soft);
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: radial-gradient(circle at top, #3e2b1a 0, #171011 60%);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}

.spec-badge span.label {
  color: var(--text-muted);
}

.spec-badge span.value {
  color: #f6e6c0;
  font-weight: 600;
}

.spec-badge span.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(200, 155, 60, 0.8);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.65rem;
}

.meta-row span {
  opacity: 0.9;
}

.meta-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: var(--accent-brass-soft);
}

.meta-value {
  margin-left: 0.3rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
  gap: 1.75rem;
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.1rem 0.55rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Infographics */
.infographic {
  margin: 0.6rem 0 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: radial-gradient(circle at top, #2b2227 0, #0a0509 70%);
  padding: 0.75rem 0.9rem 0.9rem;
}

.infographic-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.hud-bar {
  margin-top: 0.4rem;
}

.hud-bar svg {
  width: 100%;
  max-width: 420px;
  display: block;
  margin: 0.2rem 0;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  margin-top: 0.45rem;
  font-size: 0.78rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
}

.legend-swatch {
  width: 14px;
  height: 8px;
  border-radius: 4px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
}

.swatch-green { background: var(--accent-green); }
.swatch-amber { background: var(--accent-amber); }
.swatch-red   { background: var(--accent-red); }

/* Mag status */
.mag-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.5rem;
  margin-top: 0.3rem;
  font-size: 0.8rem;
}

.mag-pill {
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.4);
}

.mag-pill span.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.mag-pill.green span.dot   { background: var(--accent-green);  box-shadow: 0 0 8px rgba(59, 164, 100, 0.9); }
.mag-pill.amber span.dot   { background: var(--accent-amber);  box-shadow: 0 0 8px rgba(224, 166, 62, 0.9); }
.mag-pill.red span.dot     { background: var(--accent-red);    box-shadow: 0 0 8px rgba(196, 73, 61, 0.9); }

.mag-pill span.label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
}

.mag-pill span.desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Graphs */
.graph {
  margin-top: 0.4rem;
}

.graph svg {
  width: 100%;
  max-width: 420px;
  display: block;
  margin: 0.2rem 0;
}

.graph-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Checklist */
.checklist {
  list-style: none;
}

.checklist li::before {
  content: "\2611";
  color: var(--accent);
  margin-right: 0.4rem;
  font-size: 0.85rem;
}

/* Fire modes */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.7rem;
  margin-top: 0.4rem;
}

.mode-card {
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.5);
  padding: 0.6rem 0.7rem;
  font-size: 0.82rem;
}

.mode-name {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-brass-soft);
  margin-bottom: 0.25rem;
}

.footer-note {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  padding-top: 0.7rem;
}

.gear-corner {
  position: absolute;
  right: -40px;
  top: -40px;
  width: 120px;
  height: 120px;
  opacity: 0.12;
  pointer-events: none;
}

.gear-corner svg {
  width: 100%;
  height: 100%;
}

/* ============================================================
   12. STARDATE CALCULATOR
   ============================================================ */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.tab-btn {
  border-radius: 8px;
  border: 1px solid var(--accent-brass-soft);
  background: radial-gradient(circle at top, #3e2b1a 0, #171011 60%);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-family: var(--display-font);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.2s ease;
}

.tab-btn.active,
.tab-btn:hover {
  background: radial-gradient(circle at top, #c89b3c 0, #a4762d 60%);
  color: #080809;
  font-weight: bold;
  box-shadow: 0 0 12px rgba(200, 155, 60, 0.6);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.stardate-display {
  background: radial-gradient(circle at top, #2b2227 0, #0a0509 70%);
  border: 1px solid var(--accent-brass-soft);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.stardate-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.stardate-value {
  font-family: var(--mono);
  font-size: 2.4rem;
  color: var(--accent-amber);
  text-shadow: 0 0 10px rgba(224, 166, 62, 0.6);
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: radial-gradient(circle at top, #c89b3c 0, #a4762d 60%);
  color: #080809;
  padding: 0.75rem 1.2rem;
  border-radius: 8px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 0 12px rgba(200, 155, 60, 0.5);
  z-index: 99999;
}

.notification.show {
  opacity: 1;
}

/* ============================================================
   13. CONTACT PAGE
   ============================================================ */
#contact-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 3rem;
}

#contact-page h2 {
  font-size: 1.7rem;
  margin-bottom: 0.75rem;
  color: var(--accent-soft);
}

#contact-page p {
  max-width: 46rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.45);
  color: var(--text-main);
  font-family: var(--body-font);
  font-size: 0.92rem;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 143, 63, 0.25);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(199, 193, 176, 0.5);
}

.contact-form select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c7c1b0' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form .btn {
  align-self: flex-start;
  margin-top: 0.5rem;
}

@media (max-width: 640px) {
  #contact-page {
    padding-inline: 1.1rem;
  }
}

@media (max-width: 480px) {
  .contact-form .btn {
    width: 100%;
    text-align: center;
  }
}

/* ============================================================
   14. COUNCIL BIO PAGES
   ============================================================ */
.council-bio-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.bio-breadcrumb {
  margin-bottom: 2rem;
}

.bio-breadcrumb a {
  font-size: 0.88rem;
  color: var(--accent-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

.bio-breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.bio-header {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.bio-portrait {
  flex-shrink: 0;
  border-radius: 12px;
  border: 2px solid var(--border-soft);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(194, 143, 63, 0.1);
}

.bio-header-text {
  min-width: 0;
}

.bio-header-text h1 {
  font-family: var(--display-font);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--accent-soft);
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.bio-role {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.bio-tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
}

.bio-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-soft);
}

.bio-section h2 {
  font-family: var(--display-font);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-soft);
  margin-bottom: 1.25rem;
}

.bio-section p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 1rem;
  max-width: 70ch;
}

.bio-traits {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(194, 143, 63, 0.06);
  border: 1px solid rgba(194, 143, 63, 0.15);
  border-radius: 10px;
}

.bio-traits p {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.bio-traits p:last-child {
  margin-bottom: 0;
}

.bio-traits strong {
  color: var(--accent-soft);
}

@media (max-width: 720px) {
  .bio-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }

  .bio-portrait {
    max-width: 280px;
    width: 100%;
    height: auto;
  }

  .council-bio-page {
    padding: 1.5rem 1rem 2.5rem;
  }
}
