:root {
  --bg: #04050c;
  --panel: rgba(16, 20, 40, 0.72);
  --panel-border: rgba(140, 160, 230, 0.18);
  --text: #e8ecf7;
  --muted: #9ba7c6;
  --accent: #ffb45c;      /* warm, like sunlight on a planet */
  --accent-cool: #7cc8ff; /* cool, like a blue star */
  --radius: 14px;
  --header-h: 88px;
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  /* Faint nebula glow behind the stars */
  background-image:
    radial-gradient(ellipse 80% 60% at 85% 10%, rgba(90, 60, 170, 0.28), transparent 60%),
    radial-gradient(ellipse 70% 50% at 10% 70%, rgba(30, 90, 160, 0.22), transparent 60%),
    radial-gradient(ellipse 60% 40% at 60% 100%, rgba(170, 70, 90, 0.14), transparent 60%);
  background-attachment: fixed;
}

#starfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.masthead, main, .site-footer { position: relative; z-index: 1; }

a { color: var(--accent-cool); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Sticky header ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(4, 5, 12, 0.92), rgba(4, 5, 12, 0.78));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, padding 0.3s;
}
.masthead.is-scrolled { border-bottom-color: var(--panel-border); }

.masthead-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transition: padding 0.3s;
}
.masthead.is-scrolled .masthead-inner { padding-top: 10px; padding-bottom: 10px; }

.brand { text-decoration: none; display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.15;
  transition: font-size 0.3s;
}
.brand-tagline {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.masthead.is-scrolled .brand-name { font-size: 1.25rem; }

.section-nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.section-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.section-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.section-nav a.is-active { color: var(--bg); background: var(--accent); }

/* ---------- Hero ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.hero { padding: 96px 0 72px; max-width: 820px; }
.hero-kicker {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-cool);
}
.hero-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  line-height: 1.08;
  margin: 0 0 24px;
}
.hero-title .accent {
  background: linear-gradient(90deg, var(--accent), #ff7a8a 60%, var(--accent-cool));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-intro { font-size: 1.12rem; color: #c9d1e6; margin: 0 0 28px; }
.hero-story {
  position: relative;
  margin: 0 0 32px;
  padding: 20px 24px 22px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
}
/* Thin warm-to-cool stripe down the left edge, echoing the headline gradient */
.hero-story::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), #ff7a8a 55%, var(--accent-cool));
}
.hero-story[hidden] { display: none; }
.hero-story-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-story-text { margin: 0; color: #c9d1e6; font-size: 1rem; line-height: 1.7; }
.hero-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; flex-wrap: wrap; }
.pill {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: border-color 0.2s, transform 0.2s;
}
.pill:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ---------- Sections and grid ---------- */
.gallery-section { padding: 48px 0 32px; }
.section-head { margin-bottom: 28px; max-width: 760px; }
.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.section-title::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px 3px rgba(255, 180, 92, 0.55);
  flex: none;
}
.section-intro { margin: 0; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr));
  gap: 24px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.card:hover {
  border-color: rgba(255, 180, 92, 0.45);
  box-shadow: 0 10px 40px -12px rgba(120, 140, 255, 0.35);
}
.card-body { padding: 18px 20px 22px; }
.card-title { font-family: var(--font-head); font-size: 1.2rem; line-height: 1.3; margin: 0 0 4px; }
.card-role {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.card-desc { margin: 0; color: #c3cbe0; font-size: 0.95rem; }

.video-frame { position: relative; width: 100%; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.media-link { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #0b0e1c; }
.media-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.media-link:hover img { transform: scale(1.04); }
.media-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
}
.media-link:hover .media-badge, .media-link:focus-visible .media-badge { opacity: 1; transform: none; }
@media (hover: none) { .media-badge { opacity: 1; transform: none; } }

/* Stand-in PDF cover, used when documents.json has no thumb */
.doc-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px 28px;
  background:
    radial-gradient(circle at 85% 20%, rgba(124, 200, 255, 0.25), transparent 45%),
    radial-gradient(circle at 15% 90%, rgba(255, 180, 92, 0.2), transparent 50%),
    linear-gradient(160deg, #141a36, #0a0d1e);
  border-bottom: 1px solid var(--panel-border);
}
.doc-kind { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-cool); }
.doc-cover-title { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--text); }
.doc-type {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border: 1px solid var(--muted);
  border-radius: 4px;
  color: var(--muted);
}

.notice {
  margin: 40px 0;
  padding: 18px 22px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 180, 92, 0.5);
  background: var(--panel);
}

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 56px 24px 48px; color: var(--muted); font-size: 0.85rem; }

/* ---------- Lightbox text ---------- */
.glightbox-clean .gslide-description { background: #0d1124; }
.glightbox-clean .gslide-title { font-family: var(--font-head); color: var(--text); font-size: 1.1rem; }
.glightbox-clean .gslide-desc { color: #c3cbe0; font-family: var(--font-body); font-size: 0.95rem; line-height: 1.55; }
.glightbox-clean .gdesc-inner { padding: 18px 22px; }

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  :root { --header-h: 120px; }
  .masthead-inner { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 16px; }
  .masthead.is-scrolled .masthead-inner { padding: 8px 16px; }
  .brand-name { font-size: 1.3rem; }
  .masthead.is-scrolled .brand-name { font-size: 1.1rem; }
  .brand-tagline { font-size: 0.7rem; letter-spacing: 0.05em; }
  .section-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
    scrollbar-width: none;
    margin: 0 -4px;
  }
  .section-nav::-webkit-scrollbar { display: none; }
  .section-nav a { padding: 4px 10px; font-size: 0.82rem; }
  main { padding: 0 16px; }
  .hero { padding: 56px 0 40px; }
  .hero-story { padding: 16px 18px 18px 20px; }
  .grid { grid-template-columns: 1fr; gap: 18px; }
}
