/* Intro: one cinematic moment, everything else quiet.
   Space is true black; colour only identifies things (Earth blue, Mars rust). */
#intro {
  --space: #000;
  --star: #eef0f6;
  --dim: #a9afba;
  --earth: #8fbaff;
  --mars: #e0713e;       /* label text; orbit line uses deeper #c1440e */
  position: fixed; inset: 0; z-index: 5000; background: var(--space); overflow: hidden;
  font-family: Inter, system-ui, sans-serif; color: var(--star);
  transition: opacity .9s ease;
}
#intro.gone { opacity: 0; pointer-events: none; }
.intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.intro-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, #fffaf0 0%, #ffe2a8 35%, rgba(255, 196, 107, .85) 60%, #000 100%); }

/* labels pinned to things in the scene */
.intro-labels { position: absolute; inset: 0; pointer-events: none; }
.intro-label { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 13px; letter-spacing: .02em;
  color: rgba(238, 240, 246, .78); opacity: 0; transition: opacity .5s ease; text-shadow: 0 1px 3px #000; }
.intro-label.earth { color: var(--earth); font-weight: 600; }
.intro-label.mars { color: var(--mars); font-weight: 600; }
.intro-label.faint { color: rgba(238, 240, 246, .45); font-style: italic; }
.intro-label.dist { font-family: Fraunces, Georgia, serif; font-size: 18px; font-style: italic; color: var(--star); }
.intro-label.here { color: var(--star); font-weight: 500; }
.intro-label.here::after { /* reticle on the point itself, below the text */
  content: ""; position: absolute; left: 50%; top: calc(100% + 4px); width: 18px; height: 18px; margin-left: -9px;
  border: 1.5px solid var(--star); border-radius: 50%; }

/* a soft shadow pooled in the lower-left keeps the caption legible over bright scenes */
.intro-scrim { position: absolute; left: 0; bottom: 0; width: min(900px, 100vw); height: 62vh; pointer-events: none;
  background: radial-gradient(ellipse 85% 75% at 0% 100%, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .45) 45%, transparent 75%); }

/* chapter caption: the one typographic moment */
.intro-caption { position: absolute; left: max(24px, 6vw); bottom: 128px; max-width: min(760px, 88vw);
  opacity: 0; transform: translateY(10px); transition: opacity .6s ease, transform .6s ease; }
.intro-caption.show { opacity: 1; transform: none; }
.intro-caption h1 { margin: 0 0 14px; font-family: Fraunces, Georgia, serif; font-weight: 300;
  font-size: clamp(42px, 6.4vw, 92px); line-height: 1.0; letter-spacing: -0.015em; font-variation-settings: "opsz" 144; }
.intro-caption p { margin: 0; max-width: 40ch; font-size: clamp(15px, 1.25vw, 18px); line-height: 1.55; color: var(--dim); }
#intro.ending .intro-caption, #intro.ending .intro-timeline, #intro.ending .intro-controls { opacity: 0; transition: opacity 1s ease; }

/* controls */
.intro-controls { position: absolute; top: 20px; right: 24px; display: flex; gap: 8px; }
.intro-controls button { font: 500 13px Inter, system-ui, sans-serif; color: var(--star); background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.intro-controls button:hover { border-color: rgba(255, 255, 255, .7); }
#intro button:focus-visible { outline: 2px solid var(--earth); outline-offset: 3px; }

/* the journey: six real stops, placed by when they happen */
.intro-timeline { position: absolute; left: max(24px, 6vw); right: max(24px, 6vw); bottom: 46px; height: 34px; }
.intro-track { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: rgba(255, 255, 255, .18); }
.intro-fill { height: 1px; width: 0; background: var(--star); }
.intro-timeline button { position: absolute; top: -5px; padding: 12px 0 0; background: none; border: 0; cursor: pointer;
  font: 12px Inter, system-ui, sans-serif; color: rgba(238, 240, 246, .45); white-space: nowrap; transform: translateX(-5px); }
.intro-timeline button::before { content: ""; position: absolute; left: 1px; top: 1px; width: 9px; height: 9px; border-radius: 50%;
  background: #000; border: 1px solid rgba(255, 255, 255, .45); }
.intro-timeline button:hover { color: var(--star); }
.intro-timeline button.active { color: var(--star); }
.intro-timeline button.active::before { background: var(--star); border-color: var(--star); }

@media (max-width: 640px) {
  .intro-caption { bottom: 110px; }
  .intro-timeline button:not(.active) { font-size: 0; }
}

/* header button that replays the intro */
.intro-replay { font: 500 12px Inter, system-ui, sans-serif; color: var(--text); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.intro-replay:hover { border-color: var(--muted); }

/* ---------- title screen ---------- */
.intro-title { position: absolute; left: max(24px, 6vw); top: 50%; transform: translateY(-50%); max-width: min(760px, 88vw);
  transition: opacity .8s ease, transform .8s ease; }
#intro:not(.titled) .intro-title { opacity: 0; transform: translateY(-46%); pointer-events: none; }
#intro.titled .intro-caption, #intro.titled .intro-timeline, #intro.titled .intro-controls { opacity: 0; pointer-events: none; }
.intro-by { margin: 0 0 10px; font-size: 15px; color: var(--dim); }
.intro-title h1 { margin: 0 0 18px; font-family: Fraunces, Georgia, serif; font-weight: 300; font-size: clamp(56px, 9vw, 136px);
  line-height: .95; letter-spacing: -0.02em; font-variation-settings: "opsz" 144; }
.intro-lede { margin: 0 0 30px; max-width: 34ch; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.5; color: var(--star); }
.intro-title-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.intro-begin { font: 600 16px Inter, system-ui, sans-serif; color: #000; background: var(--star); border: 0;
  border-radius: 999px; padding: 13px 34px; cursor: pointer; }
.intro-begin:hover { background: #fff; }
.intro-skip-title { font: 500 15px Inter, system-ui, sans-serif; color: var(--star); background: transparent;
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; padding: 12px 22px; cursor: pointer; }
.intro-skip-title:hover { border-color: rgba(255, 255, 255, .7); }
.intro-note { margin: 22px 0 0; font-size: 13px; color: rgba(238, 240, 246, .5); }

/* famous places pinned to Mars as it turns and unrolls */
.intro-label.place { font-size: 12px; font-weight: 500; color: #f6e2d4; }
.intro-label.place::after { content: ""; position: absolute; left: 50%; top: calc(100% + 3px); width: 6px; height: 6px;
  margin-left: -3px; border-radius: 50%; background: #f6e2d4; box-shadow: 0 0 0 2px rgba(0, 0, 0, .45); }
.intro-controls .intro-sound.locked { border-color: var(--star); animation: sound-hint 1.6s ease-in-out infinite; }
@keyframes sound-hint { 50% { background: rgba(255, 255, 255, .16); } }



/* =========================================================
   MARTIAN MAP — CINEMATIC TITLE EXPERIENCE
   Original Three.js animation is preserved.
   ========================================================= */

#intro {
  --space: #0B0C10;
  --star: #F4F4F6;
  --dim: #9BA1A6;
  --earth: #8fbaff;
  --mars: #E25822;
  --amber: #F29F67;

  background: #050608;
  color: var(--star);
}

#intro::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;

  background:
    linear-gradient(
      90deg,
      rgba(11,12,16,.97) 0%,
      rgba(11,12,16,.88) 29%,
      rgba(11,12,16,.48) 58%,
      rgba(11,12,16,.06) 100%
    ),
    linear-gradient(
      0deg,
      rgba(11,12,16,.75),
      transparent 36%
    );
}

.intro-canvas {
  z-index: 0;
}

.intro-flash {
  z-index: 2;
}

.intro-labels {
  z-index: 4;
}

.intro-scrim {
  z-index: 3;
  width: 100%;
  height: 70vh;
  background:
    linear-gradient(
      0deg,
      rgba(0,0,0,.68),
      transparent
    );
}

/* TOP NAVIGATION */

.intro-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 21px clamp(24px, 5.5vw, 88px);

  border-bottom: 1px solid rgba(244,244,246,.10);

  background: rgba(11,12,16,.30);
  backdrop-filter: blur(12px);

  transition:
    opacity .7s ease,
    transform .7s ease;
}

.intro-brand {
  display: flex;
  align-items: center;
  gap: 12px;

  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
}

.intro-brand b {
  color: var(--mars);
}

.intro-brand-symbol {
  display: grid;
  place-items: center;

  width: 34px;
  height: 34px;

  border-radius: 10px;
  background: linear-gradient(135deg,#E25822,#C1440E);

  color: #fff;
  font-family: Inter,sans-serif;
  font-size: 18px;
  font-weight: 800;
}

.intro-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;

  color: var(--dim);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.5px;
}

.intro-status-dot {
  width: 7px;
  height: 7px;

  border-radius: 50%;
  background: #6CC68A;
  box-shadow: 0 0 12px rgba(108,198,138,.7);
}

.intro-topbar-divider {
  width: 1px;
  height: 14px;
  margin: 0 7px;
  background: rgba(255,255,255,.20);
}

/* MAIN HERO */

.intro-title {
  z-index: 8;

  position: absolute;
  top: 49%;
  left: clamp(24px, 6vw, 110px);

  width: min(790px, 65vw);
  max-width: 790px;

  transform: translateY(-50%);

  transition:
    opacity .8s ease,
    transform .8s ease;
}

#intro:not(.titled) .intro-title {
  opacity: 0;
  transform: translateY(-46%);
  pointer-events: none;
}

#intro:not(.titled) .intro-topbar {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

/* EYEBROW */

.intro-kicker {
  display: flex;
  align-items: center;
  gap: 12px;

  margin-bottom: 27px;

  color: var(--amber);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 2.5px;
}

.intro-kicker-line {
  display: block;

  width: 36px;
  height: 2px;

  background: var(--mars);
  box-shadow: 0 0 12px rgba(226,88,34,.6);
}

/* MAIN HEADING */

.intro-title h1 {
  margin: 0 0 24px;

  font-family: Fraunces, Georgia, serif;
  font-weight: 350;

  font-size: clamp(54px, 7.5vw, 106px);
  line-height: .98;
  letter-spacing: -.045em;

  color: #F4F4F6;

  text-shadow: 0 4px 35px rgba(0,0,0,.35);
}

.intro-title h1 em {
  display: inline-block;

  color: var(--mars);
  font-weight: 400;
  font-style: italic;

  text-shadow: 0 0 35px rgba(226,88,34,.17);
}

/* DESCRIPTION */

.intro-lede {
  margin: 0 0 30px;

  max-width: 43ch;

  color: #B5B9C1;

  font-size: clamp(15px,1.25vw,18px);
  line-height: 1.75;
  font-weight: 400;
}

/* ACTION BUTTONS */

.intro-title-actions {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;

  margin-bottom: 40px;
}

.intro-begin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;

  min-width: 190px;

  padding: 15px 21px;

  border: 1px solid #E25822;
  border-radius: 9px;

  background: linear-gradient(
    135deg,
    #E25822,
    #C1440E
  );

  color: #fff;

  font-size: 14px;
  font-weight: 700;
  letter-spacing: .25px;

  box-shadow:
    0 7px 28px rgba(226,88,34,.20);

  cursor: pointer;

  transition:
    transform .25s ease,
    box-shadow .25s ease,
    filter .25s ease;
}

.intro-begin:hover {
  transform: translateY(-3px);

  filter: brightness(1.12);

  box-shadow:
    0 12px 38px rgba(226,88,34,.35);
}

.intro-button-arrow {
  font-size: 19px;
}

.intro-skip-title {
  padding: 14px 20px;

  border: 1px solid rgba(244,244,246,.25);
  border-radius: 9px;

  background: rgba(11,12,16,.30);

  color: #F4F4F6;

  font-size: 13px;
  font-weight: 600;

  cursor: pointer;
  backdrop-filter: blur(8px);

  transition:
    border-color .2s ease,
    background .2s ease;
}

.intro-skip-title:hover {
  border-color: var(--amber);
  background: rgba(226,88,34,.10);
}

#intro button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 4px;
}

/* FEATURE STRIP */

.intro-proof {
  display: flex;
  align-items: stretch;

  width: fit-content;
  max-width: 100%;

  padding-top: 22px;

  border-top: 1px solid rgba(244,244,246,.15);
}

.intro-proof > div {
  display: flex;
  flex-direction: column;
  gap: 5px;

  padding-right: 26px;
  margin-right: 26px;

  border-right: 1px solid rgba(244,244,246,.15);
}

.intro-proof > div:last-child {
  border-right: 0;
  margin-right: 0;
}

.intro-proof b {
  color: var(--amber);

  font-family: Fraunces,Georgia,serif;
  font-size: 25px;
  font-weight: 400;
}

.intro-proof span {
  color: #9BA1A6;

  font-size: 9px;
  font-weight: 750;
  letter-spacing: 1.3px;
  white-space: nowrap;
}

.intro-note {
  margin-top: 21px;

  color: rgba(244,244,246,.42);

  font-size: 9px;
  font-weight: 650;
  letter-spacing: 1.5px;
}

.intro-note span {
  padding: 0 6px;
  color: var(--mars);
}

/* CHAPTER CAPTIONS DURING THE CINEMATIC JOURNEY */

.intro-caption {
  z-index: 8;
}

.intro-caption h1 {
  color: #F4F4F6;
  font-family: Fraunces, Georgia, serif;
}

.intro-caption p {
  color: #B5B9C1;
}

.intro-controls {
  z-index: 11;
}

.intro-controls button {
  background: rgba(11,12,16,.72);
  border-color: rgba(244,244,246,.20);
  backdrop-filter: blur(10px);
}

.intro-controls button:hover {
  border-color: var(--mars);
}

.intro-timeline {
  z-index: 10;
}

.intro-fill {
  background: var(--mars);
  box-shadow: 0 0 10px rgba(226,88,34,.6);
}

.intro-timeline button.active::before {
  background: var(--mars);
  border-color: var(--mars);
  box-shadow: 0 0 10px rgba(226,88,34,.65);
}

.intro-timeline button.active {
  color: #F4F4F6;
}

/* TABLET */

@media (max-width: 900px) {
  .intro-title {
    width: 78vw;
  }

  .intro-title h1 {
    font-size: clamp(48px,8vw,76px);
  }
}

/* MOBILE */

@media (max-width: 640px) {
  .intro-topbar {
    padding: 15px 20px;
  }

  .intro-topbar-right {
    font-size: 8px;
    letter-spacing: .8px;
  }

  .intro-topbar-divider {
    display: none;
  }

  .intro-title {
    top: 47%;
    left: 22px;
    width: calc(100% - 44px);
  }

  .intro-kicker {
    font-size: 9px;
    letter-spacing: 1.5px;
    margin-bottom: 21px;
  }

  .intro-title h1 {
    font-size: clamp(43px,11vw,64px);
    margin-bottom: 20px;
  }

  .intro-lede {
    max-width: 35ch;
    font-size: 14px;
  }

  .intro-title-actions {
    gap: 9px;
    margin-bottom: 26px;
  }

  .intro-begin {
    min-width: 155px;
    padding: 13px 15px;
    gap: 12px;
    font-size: 12px;
  }

  .intro-skip-title {
    padding: 12px 13px;
    font-size: 11px;
  }

  .intro-proof > div {
    padding-right: 12px;
    margin-right: 12px;
  }

  .intro-proof span {
    font-size: 7px;
    letter-spacing: .6px;
  }

  .intro-proof b {
    font-size: 20px;
  }

  .intro-note {
    font-size: 7px;
    line-height: 1.8;
  }
}

@media (prefers-reduced-motion: reduce) {
  #intro,
  #intro * {
    scroll-behavior: auto;
  }

  .intro-begin,
  .intro-skip-title {
    transition: none;
  }
}
