/* ==========================================================================
   REGOLITH design system
   One stylesheet for the whole site. Tokens first, then base, then components.
   Fonts are self-hosted (Teko and Titillium Web, both SIL Open Font License).
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face { font-family: "Teko"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/teko-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Teko"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/teko-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Teko"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fonts/teko-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Titillium Web"; font-weight: 300; font-style: normal; font-display: swap;
  src: url("../fonts/titillium-web-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Titillium Web"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/titillium-web-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Titillium Web"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fonts/titillium-web-latin-600-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  /* Color: a black-and-white desert, plus one mineral accent */
  --void:      #08090b;  /* deepest background, hero and footer */
  --crater:    #111215;  /* default page background */
  --basalt:    #242424;  /* raised panels (the old site's background) */
  --ridge:     #34363c;  /* hairlines and borders */
  --dust:      #9a9ca3;  /* secondary text, captions */
  --regolith:  #d2d2ce;  /* body text */
  --highland:  #f4f4f2;  /* headings, logo */
  --helium:    #f0a53a;  /* the single accent: links, numerals, calls to action */
  --helium-deep: #c97f16;/* accent pressed / hover on light */
  --earthlight:#7fb8d6;  /* rare cool highlight, focus rings */

  /* Type */
  --font-display: "Teko", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-body: "Titillium Web", "Segoe UI", Arial, sans-serif;

  --text-xs:  0.8125rem;                         /* 13px  labels */
  --text-sm:  0.9375rem;                         /* 15px  captions */
  --text-md:  1.0625rem;                         /* 17px  body */
  --text-lg:  clamp(1.1875rem, 1rem + 0.7vw, 1.4375rem);   /* lede */
  --display-sm: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);    /* card titles */
  --display-md: clamp(2.5rem, 1.6rem + 3.6vw, 4.5rem);     /* section titles */
  --display-lg: clamp(2.75rem, 1.5rem + 4.6vw, 5.75rem);   /* hero line */

  /* Space: a 4px base, doubling as it grows */
  --space-1: 0.25rem;  --space-2: 0.5rem;  --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.5rem;   --space-6: 2rem;    --space-7: 3rem;    --space-8: 4rem;
  --space-9: 6rem;     --space-10: 8rem;

  /* Layout */
  --wrap: 75rem;        /* 1200px content width */
  --measure: 38rem;     /* comfortable reading width */
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 2px;        /* near-square: machined, not friendly */
  --header-h: 4rem;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--crater);
  color: var(--regolith);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--helium); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--highland); }
:focus-visible { outline: 2px solid var(--earthlight); outline-offset: 3px; }
strong { font-weight: 600; color: var(--highland); }
p { margin: 0 0 var(--space-4); max-width: var(--measure); }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--highland);
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
h2 { font-size: var(--display-md); }
h3 { font-size: var(--display-sm); line-height: 1; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: var(--space-4); top: -4rem; z-index: 100; padding: var(--space-2) var(--space-4);
  background: var(--helium); color: var(--void); font-weight: 600; }
.skip-link:focus { top: var(--space-4); }

/* ---------- Small parts ---------- */

/* Kicker: the small label above a title */
.kicker {
  display: block; margin: 0 0 var(--space-3);
  color: var(--helium);
  font-family: var(--font-body); font-size: var(--text-xs); font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; line-height: 1.4;
}
.kicker--quiet { color: var(--dust); }

.lede { font-size: var(--text-lg); line-height: 1.5; color: var(--highland); font-weight: 300; }
.caption { font-size: var(--text-sm); color: var(--dust); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 3rem; padding: 0.35em 1.4em 0.2em;
  border: 1px solid var(--helium); border-radius: var(--radius);
  background: var(--helium); color: var(--void);
  font-family: var(--font-display); font-size: 1.375rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; line-height: 1;
  cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--highland); border-color: var(--highland); color: var(--void); }
.btn--ghost { background: transparent; color: var(--highland); border-color: var(--dust); }
.btn--ghost:hover { background: transparent; border-color: var(--helium); color: var(--helium); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-4); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(8 9 11 / 0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ridge);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); min-height: var(--header-h); }
.site-header__logo { flex: none; display: block; }
.site-header__logo img { height: 2.5rem; width: auto; }
.nav { display: flex; gap: clamp(1rem, 2.4vw, 2rem); overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; padding: var(--space-2) 0; color: var(--regolith); text-decoration: none;
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--highland); border-bottom-color: var(--helium); }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; background: var(--void); overflow: hidden; }
.hero__art { position: absolute; inset: 0; z-index: -1; }
.hero__art img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.hero__art::after { content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgb(8 9 11 / 0.92) 0%, rgb(8 9 11 / 0.6) 38%, rgb(8 9 11 / 0) 68%),
    linear-gradient(0deg, var(--crater) 0%, rgb(17 18 21 / 0) 28%);
}
.hero__inner { min-height: min(88vh, 50rem); display: flex; flex-direction: column; justify-content: center; padding-block: var(--space-8); }
.hero__logo { width: clamp(8.5rem, 16vw, 13rem); margin-bottom: var(--space-5); }
.hero__title { font-size: var(--display-lg); font-weight: 500; }
.hero__title span { display: block; color: var(--helium); }
.hero .lede { margin-block: var(--space-5) var(--space-6); max-width: 34rem; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(4rem, 9vw, 8rem); border-top: 1px solid var(--ridge); }
.section--void { background: var(--void); }
.section__head { display: grid; gap: var(--space-2); margin-bottom: var(--space-7); }
.section__index { /* reel marker: "02 / THE MOON" */
  max-width: none; margin: 0;
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--dust); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
}
.section__index b { color: var(--helium); font-weight: 600; }
.section__index::after { content: ""; flex: 1; height: 1px; background: var(--ridge); }

.split { display: grid; gap: var(--space-7); align-items: center; }
@media (min-width: 56rem) { .split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--space-9); } }

/* Stats: facts of the world, set like instrument readouts */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: var(--space-7) 0 0; padding: 0; list-style: none;
  background: var(--ridge); border: 1px solid var(--ridge); }
@media (min-width: 48rem) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stats li { background: var(--crater); padding: var(--space-5); }
.section--void .stats li { background: var(--void); }
.stats__value { display: block; color: var(--highland); font-family: var(--font-display); font-size: var(--display-sm); font-weight: 500; line-height: 1; }
.stats__label { display: block; margin-top: var(--space-2); color: var(--dust); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; line-height: 1.4; }

/* ---------- Plate: any framed image ----------
   Four "+" marks sit in the corners, after the reseau crosses
   on Apollo-era NASA photographs. */
.plate { position: relative; display: block; overflow: hidden; margin: 0; background: var(--void); border: 1px solid var(--ridge); }
.plate img { width: 100%; height: 100%; object-fit: cover; }
.plate--contain img { object-fit: contain; padding: var(--space-5); }
.plate--top img { object-position: 50% 0; }
.plate::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.75;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 13 13'%3E%3Cpath d='M6.5 0v13M0 6.5h13' stroke='%23f4f4f2' stroke-width='1'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 13 13'%3E%3Cpath d='M6.5 0v13M0 6.5h13' stroke='%23f4f4f2' stroke-width='1'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 13 13'%3E%3Cpath d='M6.5 0v13M0 6.5h13' stroke='%23f4f4f2' stroke-width='1'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 13 13'%3E%3Cpath d='M6.5 0v13M0 6.5h13' stroke='%23f4f4f2' stroke-width='1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.75rem top 0.75rem, right 0.75rem top 0.75rem, left 0.75rem bottom 0.75rem, right 0.75rem bottom 0.75rem; }

/* Banner: a wide plate that opens a section */
.banner { aspect-ratio: 21 / 9; margin-bottom: var(--space-7); }
@media (max-width: 39.99rem) { .banner { aspect-ratio: 16 / 9; } }

/* ---------- Video cards ---------- */
.videos { display: grid; gap: var(--space-5); }
@media (min-width: 48rem) { .videos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.video { margin: 0; }
.video__frame { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--void); border: 1px solid var(--ridge); }
.video__frame img, .video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.video__frame img { transition: transform .5s ease, opacity .3s; opacity: 0.85; }
.video__frame:hover img { transform: scale(1.03); opacity: 1; }
.video__play { position: absolute; left: var(--space-5); bottom: var(--space-5); display: inline-flex; align-items: center; gap: var(--space-3);
  padding: 0.5em 1.1em 0.35em; background: var(--helium); color: var(--void);
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1; }
.video__play::before { content: ""; border-style: solid; border-width: 0.35em 0 0.35em 0.6em; border-color: transparent transparent transparent currentColor; margin-top: -0.15em; }
.video figcaption { margin-top: var(--space-3); }
.video figcaption h3 { font-size: 1.75rem; }

/* ---------- Story ---------- */
.story { display: grid; gap: var(--space-7); }
@media (min-width: 56rem) { .story { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); } }
.story h3 { margin-bottom: var(--space-4); }
.story__art { aspect-ratio: 16 / 9; margin-bottom: var(--space-5); }
.pullquote { margin: var(--space-8) 0 0; padding: var(--space-6) 0 0; border-top: 1px solid var(--ridge);
  color: var(--highland); font-family: var(--font-display); font-size: var(--display-md); font-weight: 400; line-height: 1; text-transform: uppercase; max-width: 22ch; text-wrap: balance; }
.pullquote em { font-style: normal; color: var(--helium); }

/* ---------- Colonists ---------- */
.colonists { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; background: var(--ridge); border: 1px solid var(--ridge); }
@media (min-width: 40rem) { .colonists { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .colonists { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.colonist { display: flex; flex-direction: column; background: var(--void); }
.colonist__art { aspect-ratio: 16 / 9; border: 0; }
.colonist__body { display: flex; flex-direction: column; flex: 1; padding: var(--space-5) var(--space-6) var(--space-6); }
.colonist__role { margin: 0 0 var(--space-4); }
.colonist__name { font-size: var(--display-sm); }
.colonist__epithet { margin: var(--space-1) 0 var(--space-3); color: var(--helium); font-family: var(--font-display); font-size: 1.375rem; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.1; }
.colonist__body p:last-child { margin: 0; font-size: var(--text-sm); color: var(--regolith); }

/* ---------- Chapters ---------- */
.chapters { display: grid; gap: var(--space-7) var(--space-5); margin: 0; padding: 0; list-style: none; }
@media (min-width: 40rem) { .chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .chapters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.chapter__art { aspect-ratio: 16 / 9; }
.chapter__head { display: flex; align-items: baseline; gap: var(--space-3); margin-top: var(--space-4); }
.chapter__no { flex: none; color: var(--helium); font-family: var(--font-display); font-size: 1.875rem; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.chapter__title { font-size: 1.875rem; font-weight: 500; }
.chapter p { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--dust); }
.continued { margin: var(--space-7) 0 0; color: var(--dust); font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---------- Concepts ---------- */
.concepts { display: grid; gap: var(--space-6) var(--space-5); margin: 0; padding: 0; list-style: none; }
@media (min-width: 40rem) { .concepts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .concepts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.concept__art { aspect-ratio: 16 / 9; }
.concept h3 { margin-top: var(--space-4); font-size: 1.875rem; }
.concept p { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--dust); }

/* ---------- Figure ---------- */
.figure { margin: 0; }
.figure img { margin-inline: auto; max-height: 40rem; width: auto; }
.figure figcaption { margin-top: var(--space-3); text-align: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--void); border-top: 1px solid var(--ridge); padding-block: var(--space-8); color: var(--dust); font-size: var(--text-sm); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-5); }
.site-footer img { height: 3.5rem; width: auto; opacity: 0.9; }
.site-footer p { margin: 0; max-width: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
