/* ============================================================
   SANDBOX — design tokens
   Palette: charcoal/slate structure, warm sand surfaces,
   one vibrant forest green accent. Display type: League Spartan.
   Body type: Inter.
   ============================================================ */

:root {
  /* LIGHT SAGE SANCTUARY PALETTE */
  --bg-sage: #c5d1c5;                  /* Soft, tranquil sage background */
  --text-dark: #67a275;                /* Deep forest charcoal for high-contrast copy */
  --text-muted: #4a5d50;               /* Muted forest green for secondary text */
  --gold-accent: #d6b987;              /* Warm gold filigree & accent glows */
  --gold-glow: rgba(200, 157, 83, 0.25);
  
  /* FROSTED GLASS SURFACES */
  --glass-surface: rgba(145, 231, 216, 0.479); /* Sea-glass card background */
  --glass-border: rgba(255, 255, 255, 0.5);   /* Crisp glass outline */
  --radius-dossier: 12px;

  /* type */
  --font-display: 'League Spartan', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* layout */
  --max-width: 1180px;
  --gutter: clamp(1.5rem, 5vw, 4rem);
  --radius: 14px;

  /* type */
  --font-display: 'League Spartan', sans-serif;
  --font-body: 'Inter', sans-serif;

body {
  background-color: var(--bg-sage);
  color: var(--text-dark);
}
  /* layout */
  --max-width: 1180px;
  --gutter: clamp(1.5rem, 5vw, 4rem);
  --radius: 14px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-white);
  background: var(--sand-cream);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

a {
  color: inherit;
  text-decoration: none;
}

img { max-width: 100%; display: block; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--gold-accent);
  color: var(--text-white);
  padding: 0.6rem 1rem;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

:focus-visible {
  outline: 3px solid var(--sky-deep);
  outline-offset: 3px;
}

.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 0.75rem;
  display: block;
}
.eyebrow--on-dark { color: var(--sage); }

.section-title {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}
.section-title--on-dark { color: var(--sage); }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn--accent {
  background: var(--gold-accent);
  color: var(--text-white);
}
.btn--accent:hover {
  background: var(--gold-accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(62, 143, 179, 0.35);
}
.btn--outline {
  background: transparent;
  border-color: var(--sand-cream);
  color: var(--text-white);
}
.btn--outline:hover {
  border-color: var(--gold-accent);
  color: var(--gold-accent);
  transform: translateY(-1px);
}
.btn--wide {
  width: 100%;
  text-align: center;
  padding: 0.95rem 1.6rem;
}

/* ============================================================
   HEADER
   ============================================================ */

/* ==========================================================================
   FROSTED SEA-GLASS HEADER
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  
  /* Sea-glass semi-transparent backdrop */
  background: rgba(21, 36, 27, 0.85);; 
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(200, 157, 83, 0.25);
  
  /* Hairline glass border & shadow */
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;

  .site-header a {
  color: #f4efe6 !important;
}
.site-header .nav-cta {
  background: #c89d53 !important;
  color: #15241b !important;
}
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
  font-weight: 500;
  font-size: 0.95rem;
}

.header-nav a:not(.nav-cta) {
  position: relative;
  padding-bottom: 0.2rem;
}
.header-nav a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--bg-midnight);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.header-nav a:not(.nav-cta):hover::after { transform: scaleX(1); }

.nav-cta {
  background: var(--bg-midnight);
  color: var(--sand-paper);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
}
.nav-cta:hover { background: var(--gold-accent); color: var(--text-white); }



/* ============================================================
   HERO + SIGN TOGGLE (signature element)
   ============================================================ */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 8vw, 6rem) var(--gutter) clamp(3rem, 6vw, 4.5rem);
  background: radial-gradient(circle at 50% 20%, #22382c 0%, #15241b 100%);
  color: #f4efe6;
  transition: background 0.5s ease;
}

.starfield-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 700;
  line-height: 1.08;
  color: #f4efe6;
  margin: 0 0 1.5rem;
}

.hero-sub {
  max-width: 640px;
  margin: 0 auto 2.75rem;
  font-size: 1.1rem;
  color: #a3b8aa;
}

/* BRIGHT ENHANCED SHOOTING STAR */
.shooting-star {
  position: absolute;
  width: 150px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 215, 128, 1), rgba(200, 157, 83, 0.8), transparent);
  border-radius: 50%;
  filter: drop-shadow(0 0 8px rgba(255, 215, 128, 0.9));
  opacity: 0;
  transform: rotate(-35deg);
  animation: shoot 2.2s ease-out infinite;
}

@keyframes shoot {
  0% {
    transform: translateX(0) translateY(0) rotate(-35deg);
    opacity: 1;
    width: 0px;
  }
  35% {
    width: 160px;
    opacity: 0.9;
  }
  100% {
    transform: translateX(-650px) translateY(450px) rotate(-35deg);
    opacity: 0;
    width: 0px;
  }
}

/* The sign toggle reads as a literal hanging sign split into two
   panels rather than a UI switch — it flips which door you walk
   through, it doesn't hide content. */
.sign-toggle {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  background: var(--bg-midnight);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(35, 38, 39, 0.18);
}

.sign-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.6rem 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(64, 38, 8, 0.952);
  font-family: var(--font-body);
  transition: background 0.25s ease, color 0.25s ease;
}

.sign-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.sign-label {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.sign-btn.is-active {
  background: var(--sky);
  color: var(--charcoal);
}
.sign-btn.is-active .sign-eyebrow { color: var(--charcoal-soft); }

.sign-btn:not(.is-active):hover {
  color: var(--sand);
  background: rgba(255, 255, 255, 0.06);
}

.sign-divider {
  width: 2px;
  background: rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}
/* SEAGLASS BACKDROP FOR THE SIGN / TOGGLE CONTAINER */
.sign-container,
.seaglass-card {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(44, 62, 80, 0.12);
  transition: all 0.35s ease;
}

/* GOLD HOVER ACCENT FOR THE CONTAINER */
.sign-container:hover,
.seaglass-card:hover {
  border-color: var(--gold-accent, #c89d53);
  box-shadow: 0 12px 35px rgba(200, 157, 83, 0.22);
}

/* ============================================================
   MISSION
   ============================================================ */

.mission {
  background: var(--charcoal);
  padding: clamp(3.5rem, 7vw, 5.5rem) var(--gutter);
}

.mission-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.mission-body {
  font-size: 1.1rem;
  color: rgba(58, 41, 7, 0.986);
  max-width: 640px;
  margin: 0 auto;
}

/* ============================================================
   LAB / TAPROOM PANELS
   ============================================================ */

.panel {
  padding: clamp(4rem, 8vw, 6rem) var(--gutter);
  border-bottom: 1px solid var(--line);
}

.panel--lab { background: var(--sand-paper); }
.panel--taproom { background: var(--sand); }

.panel-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}

.panel-inner--reverse { direction: rtl; }
.panel-inner--reverse > * { direction: ltr; }

.panel-lede {
  font-size: 1.08rem;
  color: var(--slate);
  margin-bottom: 2rem;
  max-width: 520px;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  margin-bottom: 2.25rem;
}

.feature-list h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.02rem;
  margin-bottom: 0.3rem;
}

.feature-list p {
  color: var(--slate);
  font-size: 0.97rem;
  max-width: 480px;
}

.feature-list li {
  padding-left: 1.1rem;
  border-left: 3px solid var(--sky);
}

/* --- Lab visual: a readout panel of scored candidates --- */
.panel-visual--lab {
  background: var(--charcoal);
  border-radius: var(--radius);
  padding: 2rem;
}

.lab-readout {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.readout-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: 'Inter', monospace;
  font-size: 0.82rem;
  color: rgba(115, 79, 16, 0.918);
}

.readout-row span:first-child {
  flex-shrink: 0;
  width: 100px;
}

.readout-bar {
  flex: 1;
  height: 8px;
  background: rgba(115, 79, 16, 0.918);
  border-radius: 999px;
  overflow: hidden;
}

.readout-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--sky-deep), var(--sky));
  border-radius: 999px;
}

.readout-caption {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: rgba(115, 79, 16, 0.918);
  font-style: italic;
}

/* --- Taproom visual: a tap board --- */
.panel-visual--taproom {
  background: var(--charcoal);
  border-radius: var(--radius);
  padding: 2rem;
}

.tap-board {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.tap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.9rem;
  border-bottom: 1px dashed rgb(31, 114, 64);
  font-family: var(--font-display);
  color: var(--dark-teal);
  font-size: 1.05rem;
  font-weight: 600;
}

.tap-row:last-of-type { border-bottom: none; }

.tap-tag {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--dark-teal);
}

.tap-caption {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: rgb(241, 27, 73);
  font-style: italic;
}

/* ============================================================
   JOIN FORM
   ============================================================ */

.join {
  background: var(--charcoal);
  padding: clamp(4rem, 8vw, 6rem) var(--gutter);
}

.join-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.join-sub {
  color: rgb(16, 58, 143);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

.join-form {
  text-align: left;
  background: var(--sand-deep);
  border: 1px solid var(--line-on-dark);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: none;
  padding: 0;
  margin: 0;
}

.field label,
.field legend {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sand);
  padding: 0;
}

.optional {
  font-weight: 400;
  color: var(--slate-soft);
}

.field input[type="text"],
.field input[type="email"],
.field textarea {
  background: var(--charcoal);
  border: 1px solid var(--dark-teal);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.97rem;
  color: var(--sand-paper);
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--slate-soft);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--sky);
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--charcoal);
  border: 1px solid var(--dark-teal);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--sand);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.choice:hover { border-color: var(--sky); }

.choice input { accent-color: var(--sky); }

.form-status {
  min-height: 1.2em;
  font-size: 0.92rem;
  color: var(--sky);
  font-weight: 500;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  background: var(--charcoal);
  border-top: 1px solid var(--dark-teal);
  padding: 2.5rem var(--gutter);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--dark-teal);
  margin-bottom: 0.4rem;
}

.footer-line {
  color: rgba(61, 42, 13, 0.852);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.footer-meta {
  color: rgba(61, 42, 13, 0.852);
  font-size: 0.82rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 860px) {
  .panel-inner,
  .panel-inner--reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }
  .panel-visual--lab,
  .panel-visual--taproom {
    order: -1;
  }
}

@media (max-width: 640px) {
  .header-nav {
    gap: 0.85rem;
    font-size: 0.85rem;
  }
  .nav-cta { padding: 0.45rem 0.85rem; }

  .sign-toggle { flex-direction: column; }
  .sign-divider { width: 100%; height: 2px; }

  .choice-row { flex-direction: column; align-items: stretch; }
}

/* SPARKLE ANIMATION STYLES */
.sparkle-trigger {
  position: relative;
  overflow: visible;
}

.sparkle-particle {
  position: absolute;
  pointer-events: none;
  background: radial-gradient(circle, #ffffff 0%, #c89d53 70%, transparent 100%);
  border-radius: 50%;
  box-shadow: 0 0 6px #c89d53, 0 0 10px #ffffff;
  animation: sparkle-fade 0.7s linear forwards;
  z-index: 10;
}

@keyframes sparkle-fade {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
    opacity: 1;
  }
  50% {
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -100px) scale(1.4) rotate(180deg);
    opacity: 0;
  }
}

/* HERO STATUS TAG */
.hero-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #c89d53;
  margin-bottom: 1rem;
}

/* TOGGLE CARD CONTAINER */
.hero-toggle-card {
  background: rgba(244, 239, 230, 0.65);
  border: 1.5px solid rgba(200, 157, 83, 0.4);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 0.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

/* ACTIVE SEGMENT GLOW */
.hero-toggle-card .active-tab {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #c89d53;
  box-shadow: 0 0 12px rgba(200, 157, 83, 0.25);
  border-radius: 14px;
}

/* QUEST HUB STYLING */
.expeditions-hub {
  max-width: var(--max-width);
  margin: 4rem auto;
  padding: 0 var(--gutter);
  text-align: center;
}

.hub-header h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--text-dark);
  margin: 0.5rem 0;
}

.hub-header p {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.quest-card {
  background: var(--glass-surface, rgba(255, 255, 255, 0.35));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.5));
  backdrop-filter: blur(12px);
  padding: 2rem 1.5rem;
  border-radius: 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.quest-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-accent, #c89d53);
  box-shadow: 0 10px 25px rgba(200, 157, 83, 0.15);
}

.card-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-accent, #c89d53);
  margin-bottom: 0.75rem;
}

.quest-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.quest-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.quest-btn {
  background: var(--text-dark, #1b2e23);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.2s ease;
}

.quest-btn:hover {
  background: var(--gold-accent, #c89d53);
}

/* LIGHT FROSTED SEA-GLASS CARDS */
.quest-card {
  background: rgba(255, 255, 255, 0.45);
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 2rem 1.75rem;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.quest-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.65);
  border-color: #c89d53;
  box-shadow: 0 12px 30px rgba(200, 157, 83, 0.2);
}

/* CARD TYPOGRAPHY FOR LIGHT BACKGROUND */
.card-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #c89d53; /* Warm gold eyebrow */
  margin-bottom: 0.5rem;
}

.quest-card h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #1b2e23; /* Deep forest charcoal for high contrast */
  margin-bottom: 0.75rem;
}

.quest-card p {
  font-size: 0.95rem;
  color: #4a5d50; /* Muted forest green body copy */
  line-height: 1.5;
  margin-bottom: 2rem;
}

/* GOLD PILL BUTTON (ON LIGHT CARDS) */
.quest-btn {
  background: #c89d53;
  color: #1b2e23;
  border: none;
  padding: 0.85rem 1.75rem;
  border-radius: 50px;
  font-family: var(--font-display, 'League Spartan', sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 12px rgba(200, 157, 83, 0.25);
  transition: all 0.25s ease;
}

.quest-btn:hover {
  background: #d8ae64;
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(200, 157, 83, 0.45);
}

/* ==========================================
   S.H.I.E.L.D. HANDBOOK OVERLAY STYLES
   ========================================== */

/* 1. FULL-SCREEN FIXED GLASS BACKDROP */
.terminal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(27, 46, 35, 0.88); /* Deep forest background tint */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              visibility 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 2. HANDBOOK CONTAINER CARD */
.handbook-container {
  width: 100%;
  max-width: 500px;
  background: rgba(244, 239, 230, 0.95); /* Frosted warm parchment surface */
  border: 1.5px solid #c89d53; /* Warm gold filigree outline */
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), 
              0 0 30px rgba(200, 157, 83, 0.25);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* 3. CLASSIFIED HEADER & PULSING STATUS */
.handbook-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed rgba(200, 157, 83, 0.4);
}

.classification-tag {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #c89d53;
}

.pulsing-dot {
  width: 6px;
  height: 6px;
  background-color: #c89d53;
  border-radius: 50%;
  box-shadow: 0 0 8px #c89d53;
  animation: pulse-glow 1.5s infinite ease-in-out;
}

.realm-stamp {
  color: #4a5d50;
}

/* 4. TYPOGRAPHY & SEAL */
.file-seal {
  font-size: 2.2rem;
  color: #c89d53;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.handbook-title {
  font-family: var(--font-display, 'League Spartan', sans-serif);
  font-size: 2rem;
  color: #1b2e23;
  letter-spacing: 0.04em;
  margin: 0;
  text-transform: uppercase;
}

.handbook-subtitle {
  font-size: 0.85rem;
  color: #4a5d50;
  margin-top: 0.3rem;
  margin-bottom: 1.75rem;
}

/* 5. FORM & INPUT FIELD */
.agent-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #1b2e23;
  margin-bottom: 0.5rem;
}

.input-group input {
  width: 100%;
  padding: 0.85rem 1.2rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1.5px solid rgba(200, 157, 83, 0.5);
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: #1b2e23;
  outline: none;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

.input-group input:focus {
  background: #ffffff;
  border-color: #c89d53;
  box-shadow: 0 0 14px rgba(200, 157, 83, 0.35);
}

/* 6. GOLD ACTION BUTTON */
.terminal-enter-btn {
  background: #c89d53;
  color: #1b2e23;
  border: none;
  padding: 0.9rem 1.8rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(200, 157, 83, 0.35);
  transition: all 0.25s ease;
}

.terminal-enter-btn:hover {
  background: #d8ae64;
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(200, 157, 83, 0.5);
}

.terminal-enter-btn:active {
  transform: scale(0.98);
}

/* 7. FOOTER DETAILS */
.handbook-footer {
  margin-top: 1.75rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: #8a9e90;
  letter-spacing: 0.05em;
}

/* 8. UNLOCK ANIMATION TRIGGER */
.terminal-overlay.is-unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}
/* TERMINAL OVERLAY BASE */
.terminal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(7, 59, 27, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

/* UNLOCK STATE (FADES OUT AND DISABLES CLICKS) */
.terminal-overlay.is-unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
/* STARFIELD BACKDROP CONTAINER */
.hero {
  position: relative;
  overflow: hidden; /* Keeps shooting stars within hero bounds */
}

.starfield-container {
  position: absolute;
  inset: 0;
  pointer-events: none; /* Keeps clicks working on buttons */
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2; /* Ensures text floats safely above stars */
}

/* SINGLE SHOOTING STAR STYLING */
.shooting-star {
  position: absolute;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, rgba(200, 157, 83, 1), transparent);
  border-radius: 50%;
  filter: drop-shadow(0 0 6px rgba(200, 157, 83, 0.8));
  opacity: 0;
  transform: rotate(-35deg);
  animation: shoot 2.5s ease-out infinite;
}

/* SHOOTING STAR TRAIL ANIMATION */
@keyframes shoot {
  0% {
    transform: translateX(0) translateY(0) rotate(-35deg);
    opacity: 1;
    width: 0px;
  }
  30% {
    width: 140px;
    opacity: 0.8;
  }
  100% {
    transform: translateX(-600px) translateY(400px) rotate(-35deg);
    opacity: 0;
    width: 0px;
  }
}
.book-scene {
  /* Palette */
  --cream: #fbf5e3;
  --cream-deep: #e8dfc0;
  --sage: #6b9e78;
  --sage-soft: #c8d3c7;
  --gold: #d4ae55;
  --gold-soft: #ecd28d;
  --brown: #7a5636;
  --brown-deep: #46301f;

  /* Motion controls */
  --book-open: 14deg;
  --book-tilt: 28deg;

  position: relative;
  display: grid;
  place-items: center;
  width: min(90vw, 460px);
  aspect-ratio: 4 / 3;
  margin: 2rem auto;
  perspective: 1100px;
  cursor: pointer;
}

/* ---------- Glow ---------- */
.book-glow {
  position: absolute;
  inset: 18% 6%;
  background: radial-gradient(
    ellipse at center,
    rgba(232, 196, 104, 0.85) 0%,
    rgba(140, 186, 130, 0.5) 45%,
    rgba(140, 186, 130, 0) 75%
  );
  filter: blur(36px);
  opacity: 0.45;
  transform: scale(0.95);
  transition: opacity 0.8s ease, transform 0.8s ease, filter 0.8s ease;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Book ---------- */
.book {
  position: relative;
  width: 88%;
  height: 66%;
  transform-style: preserve-3d;
  transform: rotateX(var(--book-tilt)) rotateY(0deg);
  transition: transform 0.9s cubic-bezier(0.22, 0.9, 0.3, 1);
  z-index: 1;
}

/* Leather cover beneath the pages */
.book::before {
  content: "";
  position: absolute;
  inset: -4% -3%;
  background: linear-gradient(145deg, var(--brown), #5d4029 60%, var(--brown-deep));
  border: 2px solid var(--gold);
  border-radius: 14px;
  transform: translateZ(-14px);
  box-shadow:
    0 0 28px rgba(212, 174, 85, 0.45),
    inset 0 0 0 4px rgba(70, 48, 31, 0.6);
}

/* ---------- Pages ---------- */
.page {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, var(--cream) 0%, #efe6c8 60%, var(--cream-deep) 100%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 0 26px rgba(122, 86, 54, 0.22),
    0 0 14px rgba(212, 174, 85, 0.35);
  transition: transform 0.9s cubic-bezier(0.22, 0.9, 0.3, 1);
}

.page-left {
  right: 50%;
  border-radius: 12px 2px 2px 12px;
  transform-origin: 100% 50%;
  transform: rotateY(var(--book-open));
}

.page-right {
  left: 50%;
  border-radius: 2px 12px 12px 2px;
  transform-origin: 0% 50%;
  transform: rotateY(calc(var(--book-open) * -1));
  transform-style: preserve-3d; /* lets the leaves flip in 3D */
}

/* Faux lines of text */
.page-lines {
  position: absolute;
  inset: 14% 12%;
  background: repeating-linear-gradient(
    to bottom,
    rgba(107, 158, 120, 0.5) 0 2px,
    transparent 2px 14px
  );
  border-radius: 2px;
}

/* ---------- Flipping leaves ---------- */
.leaf {
  position: absolute;
  inset: 0;
  transform-origin: 0% 50%;
  transform-style: preserve-3d;
  transform: translateZ(var(--z)) rotateY(0deg);
}

.leaf-1 { --z: 2px; }
.leaf-2 { --z: 1px; }

.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 2px 12px 12px 2px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, var(--cream) 0%, #efe6c8 60%, var(--cream-deep) 100%);
  box-shadow: inset 0 0 22px rgba(122, 86, 54, 0.18);
}

.face.back {
  transform: rotateY(180deg);
  border-radius: 12px 2px 2px 12px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0)),
    linear-gradient(225deg, var(--cream) 0%, #efe6c8 60%, var(--cream-deep) 100%);
}

/* Golden emblem on the top leaf */
.page-emblem {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  color: var(--cream);
  text-shadow: 0 0 8px var(--gold-soft), 0 0 20px var(--gold);
  background: radial-gradient(circle, rgba(212, 174, 85, 0.95), rgba(212, 174, 85, 0.6));
  padding: 0.15em 0.4em;
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(212, 174, 85, 0.6);
}

/* Little ornament on the back of the top leaf */
.page-ornament {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  color: var(--sage);
  background: rgba(251, 245, 227, 0.9);
  padding: 0.1em 0.35em;
  border-radius: 50%;
}

/* ---------- Spine ---------- */
.spine {
  position: absolute;
  top: -1%;
  bottom: -1%;
  left: 50%;
  width: 14px;
  translate: -50% 0;
  background: linear-gradient(to right, var(--brown-deep), #c69a4d 50%, var(--brown-deep));
  border-radius: 4px;
  box-shadow: 0 0 14px rgba(212, 174, 85, 0.7);
  transform: translateZ(6px);
  z-index: 3;
}

/* ---------- Sparkles ---------- */
.sparkles {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  font-size: var(--s, 1.4rem);
  color: var(--gold-soft);
  text-shadow: 0 0 6px var(--gold), 0 0 16px rgba(212, 174, 85, 0.8);
  opacity: 0.4;
  animation: twinkle 3s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

/* Every other sparkle is a soft sage instead of gold */
.sparkle:nth-child(even) {
  color: #e6efd9;
  text-shadow: 0 0 6px var(--sage), 0 0 16px rgba(107, 158, 120, 0.8);
}

.sparkle:nth-child(1) { top: 8%;  left: 14%; --s: 1.6rem; --d: 0s;   }
.sparkle:nth-child(2) { top: 18%; left: 82%; --s: 1.2rem; --d: 0.4s; }
.sparkle:nth-child(3) { top: 62%; left: 6%;  --s: 1rem;   --d: 0.9s; }
.sparkle:nth-child(4) { top: 74%; left: 88%; --s: 1.5rem; --d: 1.3s; }
.sparkle:nth-child(5) { top: 4%;  left: 50%; --s: 1.1rem; --d: 1.7s; }
.sparkle:nth-child(6) { top: 86%; left: 34%; --s: 1.3rem; --d: 2.1s; }
.sparkle:nth-child(7) { top: 40%; left: 94%; --s: 0.9rem; --d: 2.5s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50%      { opacity: 0.8;  transform: scale(1); }
}

@keyframes float-pulse {
  0%, 100% { opacity: 0.6; transform: translateY(0) scale(0.9) rotate(0deg); }
  50%      { opacity: 1;   transform: translateY(-16px) scale(1.3) rotate(25deg); }
}

/* Flip right-to-left, pause, then flip back.
   The "* 2" offsets the open-angle of the two pages so the
   leaf lands flush on the left page. */
@keyframes flip-leaf {
  0%, 6% {
    transform: translateZ(var(--z)) rotateY(0deg);
  }
  36%, 58% {
    transform: translateZ(var(--z)) rotateY(calc(-180deg + var(--book-open) * 2));
  }
  88%, 100% {
    transform: translateZ(var(--z)) rotateY(0deg);
  }
}

/* ---------- Hover state ---------- */
.book-scene:hover {
  --book-open: 26deg;
  --book-tilt: 16deg;
}

.book-scene:hover .book {
  transform: rotateX(var(--book-tilt)) rotateY(-6deg);
}

.book-scene:hover .book-glow {
  opacity: 1;
  transform: scale(1.2);
  filter: blur(48px);
}

.book-scene:hover .sparkle {
  animation: float-pulse 1.8s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.book-scene:hover .leaf {
  animation: flip-leaf 5s cubic-bezier(0.45, 0.05, 0.35, 1) infinite;
}

.book-scene:hover .leaf-2 {
  animation-delay: 0.7s; /* second page follows the first */
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  .book, .page, .book-glow { transition-duration: 0.01s; }
  .sparkle,
  .book-scene:hover .sparkle,
  .book-scene:hover .leaf { animation: none; }
  .sparkle { opacity: 0.7; }
}