/* Tany Space — "NASA to the App Store" story page
   Palette lifted directly from the app's own TanyColor.swift so the web story
   and the app feel like one artifact, not two. */

:root {
  --void: #05050D;
  --void-2: #0A0D1A;
  --void-3: #0F1226;
  --violet: #6B47D9;
  --blue: #3373F2;
  --green: #52FAAB;
  --teal: #40D9D1;
  --gold: #FFD173;

  --paper: #E7E9E4;
  --paper-2: #DEE2DA;
  --ink: #14161A;
  --ink-soft: rgba(20, 22, 26, 0.66);
  --ink-faint: rgba(20, 22, 26, 0.42);

  --void-text: #F3F4F7;
  --void-text-soft: rgba(243, 244, 247, 0.72);
  --void-text-faint: rgba(243, 244, 247, 0.46);

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --measure: 62ch;
  --gutter: clamp(20px, 6vw, 72px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
}

.void .eyebrow { color: var(--teal); }
.paper .eyebrow { color: var(--blue); }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.96;
  margin: 0;
  text-wrap: balance;
  letter-spacing: 0.002em;
}

p { margin: 0; }

.section {
  position: relative;
  padding: clamp(56px, 10vh, 110px) var(--gutter);
}

.paper { background: var(--paper); color: var(--ink); }
.void {
  background: var(--void);
  color: var(--void-text);
}

.void::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 20%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1.5px 1.5px at 22% 70%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 40% 35%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 58% 15%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 72% 60%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 85% 25%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 92% 80%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1.5px 1.5px at 12% 90%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 65% 90%, rgba(255,255,255,0.35), transparent);
  opacity: 0.9;
}

.void .orbit-ring {
  position: absolute;
  border: 1px solid rgba(102, 136, 242, 0.28);
  border-radius: 50%;
  pointer-events: none;
}

.content {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
}

/* ---------- Masthead ---------- */

.masthead {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--void);
  color: #fff;
  padding: clamp(20px, 5vw, 40px) var(--gutter) clamp(32px, 6vw, 56px);
}

.masthead-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.04);
}

.masthead-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(5,5,13,0.75) 0%,
    rgba(5,5,13,0.05) 30%,
    rgba(5,5,13,0.1) 55%,
    rgba(5,5,13,0.92) 100%
  );
}

.masthead-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: #fff;
}

.masthead-top img { width: 40px; height: 40px; border-radius: 10px; }
.masthead-top .brand { display: flex; align-items: center; gap: 12px; font-size: 1.05rem; }
.masthead-top .date { font-size: 0.72rem; font-weight: 400; color: rgba(255,255,255,0.7); }

.masthead-main {
  position: relative;
  margin-top: auto;
}

.masthead h1 {
  font-size: clamp(2.6rem, 10vw, 6rem);
  color: #fff;
}

.masthead .kicker {
  font-family: var(--display);
  font-size: clamp(1.3rem, 4vw, 2.1rem);
  color: var(--blue);
  margin-top: 2px;
}

.masthead .dek {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
  margin-top: 18px;
}

.masthead .credit-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: rgba(255,255,255,0.88);
  margin-top: 22px;
  max-width: 46ch;
}

.masthead .school {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-top: 10px;
}

/* ---------- Chapter headers ---------- */

.chapter-head { max-width: 760px; }

.chapter-head h2 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  margin-top: 10px;
}

.chapter-head.compact h2 { font-size: clamp(1.7rem, 4.6vw, 2.6rem); }

/* ---------- Body copy ---------- */

.lede {
  font-size: clamp(1.1rem, 2.3vw, 1.3rem);
  max-width: var(--measure);
  margin-top: 28px;
}

.body-text {
  max-width: var(--measure);
  font-size: 1.05rem;
  margin-top: 22px;
}

.body-text + .body-text { margin-top: 16px; }

.pull-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.3rem, 3.4vw, 1.9rem);
  line-height: 1.35;
  max-width: 34ch;
  margin-top: 36px;
  position: relative;
  padding-left: 22px;
}

.pull-quote::before {
  content: "";
  position: absolute;
  left: 0; top: 0.15em; bottom: 0.15em;
  width: 3px;
}

.paper .pull-quote::before { background: var(--blue); }
.void .pull-quote::before { background: var(--green); }

/* ---------- Photo grid / strip ---------- */

.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 44px;
}

figure { margin: 0; }

.photo-strip img, .photo-full img, .photo-pair img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.03);
}

.photo-strip figure { aspect-ratio: 3/4; overflow: hidden; }

figcaption {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 10px;
}

.paper figcaption { color: var(--ink-faint); }
.void figcaption { color: var(--void-text-faint); }

.photo-full {
  margin-top: 48px;
  aspect-ratio: 16/10;
  overflow: hidden;
  border-radius: 2px;
}

.photo-pair {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.photo-pair figure { aspect-ratio: 3/4; overflow: hidden; }

/* ---------- COPUOS two-photo layout ---------- */

.copuos-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: start;
}

.copuos-grid figure { aspect-ratio: 4/5; overflow: hidden; }
.copuos-grid img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05) contrast(1.03); }

.copuos-label {
  margin-top: 56px;
}

.copuos-label h3 {
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  color: rgba(243,244,247,0.16);
  -webkit-text-stroke: 1px rgba(64,217,209,0.4);
}

.copuos-label .copuos-name {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--teal);
  text-transform: none;
  margin-top: 4px;
}

.copuos-label p { margin-top: 10px; max-width: 48ch; color: var(--void-text-soft); }

/* ---------- Question chapter (no screenshot available) ---------- */

.question-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.orbit-visual {
  position: relative;
  aspect-ratio: 1/1;
  max-width: 340px;
  margin: 24px auto 0;
}

.orbit-visual .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(82,250,171,0.35);
}

.orbit-visual .ring.r2 { inset: 14%; border-color: rgba(51,115,242,0.4); }
.orbit-visual .ring.r3 { inset: 30%; border-color: rgba(107,71,217,0.4); }

.orbit-visual .core {
  position: absolute;
  inset: 42%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3373F2, #0F1226 70%);
  box-shadow: 0 0 40px rgba(51,115,242,0.5);
}

.orbit-visual .dot {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* ---------- Real app screenshots, phone-framed ---------- */

.phone-frame {
  position: relative;
  max-width: 220px;
  margin: 0 auto;
  border-radius: 28px;
  padding: 8px;
  background: linear-gradient(160deg, rgba(255,255,255,0.14), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.55);
}

.phone-frame img {
  width: 100%;
  border-radius: 20px;
  aspect-ratio: 738/1600;
  object-fit: cover;
}

.question-wrap .phone-frame {
  max-width: 260px;
}

.step .phone-frame {
  max-width: 100%;
  margin-bottom: 16px;
}

.paper .phone-frame {
  border-color: rgba(20,22,26,0.14);
  background: linear-gradient(160deg, rgba(20,22,26,0.08), rgba(20,22,26,0.02));
  box-shadow: 0 20px 40px -18px rgba(20,22,26,0.35);
}

/* ---------- Build steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.step {
  background: #fff;
  border: 1px solid var(--paper-2);
  border-radius: 4px;
  padding: 24px;
}

.step .num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--blue);
  letter-spacing: 0.1em;
}

.step h4 {
  font-family: var(--display);
  font-size: 1.4rem;
  text-transform: uppercase;
  margin-top: 10px;
}

.step p {
  margin-top: 8px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.note-box {
  margin-top: 40px;
  max-width: var(--measure);
  font-size: 0.95rem;
  color: var(--ink-soft);
  border-left: 2px solid var(--green);
  padding-left: 18px;
}

/* ---------- Attribution columns ---------- */

.attrib-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.attrib-card {
  border-radius: 4px;
  padding: 24px 22px 28px;
  border: 1px solid rgba(255,255,255,0.1);
}

.attrib-card.tanya { background: linear-gradient(160deg, rgba(51,115,242,0.22), rgba(51,115,242,0.06)); }
.attrib-card.ai { background: linear-gradient(160deg, rgba(64,217,209,0.22), rgba(64,217,209,0.05)); }
.attrib-card.parents { background: linear-gradient(160deg, rgba(107,71,217,0.26), rgba(107,71,219,0.07)); }

.attrib-card h4 {
  font-family: var(--display);
  font-size: 1.3rem;
  text-transform: uppercase;
}

.attrib-card .role-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--void-text-faint);
  margin: 14px 0 10px;
}

.attrib-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attrib-card li {
  font-size: 0.92rem;
  color: var(--void-text-soft);
  padding-left: 14px;
  position: relative;
}

.attrib-card li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.callout-box {
  margin-top: 40px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 22px 24px;
  font-size: 0.95rem;
  color: var(--void-text-soft);
  max-width: var(--measure);
}

.flow-line {
  margin-top: 36px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
}

/* ---------- CelesTrak ---------- */

.celestrak-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 44px;
  align-items: start;
}

.kelso-card {
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  background: rgba(255,255,255,0.03);
}

.kelso-photo {
  width: 72px; height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  border: 2px solid rgba(64,217,209,0.5);
  background: var(--void-2);
}

.kelso-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1.6rem;
  color: var(--teal);
}

.kelso-card .label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
}

.kelso-card h4 {
  font-family: var(--display);
  font-size: 1.15rem;
  text-transform: uppercase;
  margin-top: 4px;
}

.kelso-card p {
  font-size: 0.86rem;
  color: var(--void-text-soft);
  margin-top: 6px;
}

.kelso-thumbsup {
  margin-top: 40px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(82,250,171,0.14), rgba(64,217,209,0.05));
  border: 1px solid rgba(82,250,171,0.4);
  border-radius: 8px;
  padding: 26px 28px;
}

.kelso-thumbsup-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(82,250,171,0.16);
  color: var(--green);
}

.kelso-thumbsup-head {
  font-family: var(--display);
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  text-transform: uppercase;
  color: var(--green);
}

.thanks-banner {
  margin-top: 44px;
  border: 1px solid rgba(64,217,209,0.35);
  border-radius: 6px;
  padding: 24px 26px;
}

.thanks-banner p.big {
  font-family: var(--display);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  text-transform: uppercase;
}

.thanks-banner p.small {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--void-text-faint);
}

.thanks-banner a { color: var(--teal); text-decoration: underline; }

/* ---------- Journey chapter ---------- */

.journey-stack {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.journey-stack p {
  font-family: var(--display);
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  text-transform: uppercase;
}

.journey-stack p.accent { color: var(--blue); }

/* ---------- Final CTA ---------- */

.finale {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.finale .content { text-align: center; }

.finale h2 {
  font-size: clamp(2.4rem, 9vw, 5rem);
  color: #fff;
}

.finale .tagline {
  font-family: var(--display);
  font-size: clamp(1.2rem, 3.4vw, 1.8rem);
  color: var(--green);
  margin-top: 8px;
}

.finale .sub {
  margin-top: 18px;
  font-size: 1rem;
  color: var(--void-text-soft);
}

.store-cta {
  margin-top: 36px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 20px 38px;
  border-radius: 999px;
  background: var(--green);
  color: #05050D;
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 0 0 0 rgba(82,250,171,0.5);
  animation: cta-pulse 2.4s ease-in-out infinite;
}

@keyframes cta-pulse {
  0% { box-shadow: 0 0 0 0 rgba(82,250,171,0.45); }
  70% { box-shadow: 0 0 0 16px rgba(82,250,171,0); }
  100% { box-shadow: 0 0 0 0 rgba(82,250,171,0); }
}

.colophon {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.14);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--void-text-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
}

/* ---------- Reveal-on-scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .photo-strip { grid-template-columns: 1fr 1fr; }
  .photo-strip figure:nth-child(3) { grid-column: span 2; aspect-ratio: 16/9; }
  .photo-pair { grid-template-columns: 1fr; }
  .copuos-grid { grid-template-columns: 1fr; gap: 28px; }
  .celestrak-grid { grid-template-columns: 1fr; }
  .attrib-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  body { font-size: 16.5px; }
  .section { padding-inline: 18px; }
  .photo-strip { grid-template-columns: 1fr; }
  .photo-strip figure:nth-child(3) { grid-column: auto; aspect-ratio: 3/4; }
}
