/* =========================
   Fonts
   ========================= */
@font-face {
  font-family: 'Play';
  src: local('Play Regular'), local('Play-Regular'),
       url('fonts/play/Play-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Play';
  src: local('Play Bold'), local('Play-Bold'),
       url('fonts/play/Play-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Orbitron';
  src: local('Orbitron Bold'), local('Orbitron-Bold'),
       url('fonts/orbitron/Orbitron-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* =========================
   Design Tokens
   ========================= */
:root {
  --bg: #050A0F;
  --text: #E6EDF2;
  --primary: #CCA14A;
  --secondary: #72C3C3;
  --muted: #9AA0A6;

  --container-max: 960px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;

  --header-h: 64px; /* overridden on mobile */
}

/* =========================
   Base
   ========================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Play', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--header-h); /* offset for fixed header */
}
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-4) var(--space-3);
  flex: 1;
}

/* Links */
a {
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 400;
}
a:hover { color: var(--primary); text-decoration: none; }
a:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }

/* Headings */
h1, h2 {
  color: var(--primary);
  margin-bottom: 1rem;
  margin-top: 2rem;
}
h1:first-child { margin-top: 0; }

/* Lists */
ul, ol {
  margin: 1rem 0 1.5rem 0;
  padding-left: 1.25rem;
  list-style-position: inside;
}
li { margin-bottom: 0.5rem; }

/* =========================
   Header (fixed/pinned)
   ========================= */
.site-header {
  background: var(--bg);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-2);
  height: var(--header-h);
  padding: 0 var(--space-4);
}
.brand img {
  height: calc(var(--header-h) - 20px);
  width: auto; display: block; margin-top: 5px;
}

/* Mobile menu button (hidden on desktop) */
.menu-toggle {
  display: none;
  border: none; background: transparent; color: var(--secondary);
  padding: 0.5rem 0.6rem; border-radius: 10px; cursor: pointer; line-height: 0;
}

/* Navigation */
.nav {
  display: flex; gap: 1.5rem; align-items: center; font-weight: 400;
}
.nav a {
  color: var(--secondary); font-weight: 400;
  padding: 0.25rem 0.1rem;
}
.nav a:hover { color: var(--primary); }
.nav a[aria-current="page"] { color: var(--primary); }

/* =========================
   Footer
   ========================= */
.site-footer {
  background: var(--bg);
  padding: var(--space-4);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
  gap: .75rem;
}
.footer-contact { color: var(--text); font-weight: 400; }
.footer-contact a { color: var(--secondary); font-weight: 400; }
.footer-copy { color: var(--muted); font-size: 0.875rem; }

.footer-bottom {
  display: flex; flex-wrap: wrap;
  gap: 1.5rem; align-items: center; justify-content: flex-start;
}

/* Keep footer inline items from shifting vertically */
.site-footer a, .site-footer span { line-height: 1; }

/* Social icons (shared) */
.social-links {
  justify-self: center;
  display: flex; gap: 0.75rem; align-items: center;
}
.social-links a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; line-height: 0;
}
.social-links svg { width: 18px; height: 18px; display: block; }

/* Manage Cookies link */
.footer-bottom .manage-cookies,
[data-toggle-cookie-consent].manage-cookies {
  color: var(--secondary); text-decoration: none; font-weight: 400;
}
.footer-bottom .manage-cookies:hover { color: var(--primary); }
.footer-email:hover { color: var(--primary); }

/* =========================
   Home page
   ========================= */
.home { text-align: center; }
.home p { margin-top: 1rem; font-size: 1.125rem; }
.home h1 {
  font-family: 'Orbitron', Arial, sans-serif;
  font-weight: 700;
  font-size: 2.5rem;
  letter-spacing: 0.05em;
  margin-top: 2rem; margin-bottom: 4rem;
}

/* Typewriter */
.home .typewriter {
  font-family: 'Courier New', monospace;
  font-size: 1.125rem;

  display: flex; flex-direction: column; align-items: center;
  gap: 2rem; text-align: center;
}
.home .typewriter span {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  max-width: 100%;
}
.home .typewriter span.caret {
  border-right: 2px solid #00ffe5;
  animation: blink 0.8s step-end infinite;
}
@keyframes blink { 0%,100%{border-color:transparent;} 50%{border-color:#00ffe5;} }

/* === Generic Section System (fade-in on first reveal) === */
section[id] {
  transition: opacity 1.2s ease;          /* persistent transition */
  text-align: center;
  margin-top: 6rem;
  margin-bottom: 6rem;
}
section[aria-hidden="true"] { opacity: 0; } /* start hidden */
section.reveal { opacity: 1; }              /* fade to visible */

/* Ensure anchored sections leave room for the fixed header (shows the title) */
section[id] {
  scroll-margin-top: calc(var(--header-h) + 12px); /* header height + a bit of breathing room */
}

/* Titles (supports legacy classnames too) */
.section-title,
#crew .crew-title,
#launchpad .launchpad-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary);
  font-size: 2rem;
  margin-bottom: 3rem;
  text-align: center;
}

/* Grids (generic + aliases) */
.section-grid,
.crew-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 3rem;
  align-items: stretch;
  justify-items: center;
  margin-inline: auto;
  max-width: 760px;
  text-align: left;
}

/* Launchpad is always single-column */
.launchpad-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-inline: auto;
  max-width: 760px;
  text-align: left;
}
@media (max-width: 1000px) {
  .section-grid, .crew-grid, .launchpad-grid { grid-template-columns: 1fr; }
}

/* Badge card (reused as-is) */
.badge {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.01);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);

  font-family: 'Courier New', Courier, monospace;
  font-size: 0.95rem; line-height: 1.5;
}
.badge-line { margin: 0 0 .4rem 0; }
.badge-brief { margin-bottom: 0.4rem; color: var(--text); opacity: 0.95; }
/* Label/value coloring */
.badge strong { color: var(--primary); font-weight: 600; }        /* "Callsign:" etc */
.badge-line b, .badge-brief b { color: var(--text); font-weight: 600; }  /* values */

/* =========================
   Cookie Consent Banner
   ========================= */
.cookie-banner {
  position: fixed; z-index: 1100;
  right: 1rem;
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-2));
  left: auto;

  width: 320px; max-width: calc(100vw - 2rem);
  background: rgba(5,10,15,0.95);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
  padding: var(--space-2);
  font-size: 0.85rem; line-height: 1.4;
}
.cookie-banner .cookie-text {
  text-align: center; font-size: 0.9rem; margin-bottom: 0.75rem;
}
.cookie-actions {
  display: flex; gap: 0.5rem; justify-content: center;
}
.btn {
  border-radius: 10px; padding: 0.3rem 0.5rem;
  border: 1px solid transparent; cursor: pointer; font: inherit; width: 100%;
}
.btn-ghost { background: transparent; border-color: rgba(255,255,255,0.25); color: var(--secondary); }
.btn-ghost:hover { border-color: var(--secondary); }
.btn-primary { background: var(--primary); color: #0b0b0b; font-weight: 700; }
.btn-primary:hover { filter: brightness(1.05); }

/* =========================
   Responsive
   ========================= */
@media (max-width: 1000px) {
  .cookie-banner .btn { min-height: 40px; }
  .section-grid, .crew-grid, .launchpad-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  :root { --header-h: 64px; }

  .container { padding: var(--space-3) var(--space-2); }
  .navbar { padding: 0 var(--space-3); height: var(--header-h); }
  .brand img { height: 44px; margin-top: 6px; }

  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .nav {
    display: none;
    flex-direction: column; align-items: flex-end;
    background: var(--bg);
    padding: var(--space-2); gap: 0.5rem;
    position: absolute; top: var(--header-h); right: 0;
    width: auto; min-width: 160px;
    border-left: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .nav.open { display: flex; }
  .nav a {
    display: block; width: 100%; text-align: right;
    padding: 0.75rem 0.5rem; min-height: 44px;
  }

  .home h1 { font-size: 1.9rem; }
  .home p { font-size: 1rem; }

  .cookie-banner {
    right: 1rem; bottom: var(--space-2); left: auto;
    transform: none; width: auto; max-width: 50%;
  }

  /* Typewriter tweaks */
  .home .typewriter { gap: 0.6rem; }
  .home .typewriter span { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
}

/* Landscape phone fixes (small height viewports) */
@media (orientation: landscape) and (max-height: 500px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

  .container h1, .home h1 {
    font-size: 1.6rem; margin-top: 1rem; margin-bottom: 2rem;
  }
  .container h2 {
    font-size: 1.25rem; margin-top: 1.25rem; margin-bottom: 0.75rem;
  }
  .container p, .container li { font-size: 0.95rem; line-height: 1.4; }

  .home .typewriter { font-size: 1rem; gap: 1rem; }
  .home .typewriter span { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }

  .section-title,
  #crew .crew-title,
  #launchpad .launchpad-title { font-size: 1.5rem; }

  .badge { font-size: 0.9rem; }
}