/* Red Gate — static site. No external requests or trackers. */
@font-face {
  font-family: "Fraunces";
  src: url("fonts/Fraunces.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/Fraunces-Italic.ttf") format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/SourceSans3.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/SourceSans3-Italic.ttf") format("truetype");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --red: #D7263D;
  --red-dark: #A71C2F;
  --ink: #1A1414;
  --muted: #5E5652;
  --paper: #F7F3EE;
  --paper-2: #EFE8E0;
  --white: #FFFCFA;
  --line: #DED6CC;
  --max: 1100px;
  --pad: clamp(1.25rem, 4vw, 2.25rem);
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 430;
  line-height: 1.6;
  letter-spacing: 0.005em;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--red-dark); }
.wrap { width: min(var(--max), calc(100% - 2 * var(--pad))); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, white);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.7rem 0;
}
.brand { display: flex; align-items: center; gap: 0.85rem; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: auto; height: 64px; }
.brand .who { display: flex; flex-direction: column; line-height: 1.15; }
.brand .who strong { font-family: var(--serif); font-weight: 550; font-size: 1.05rem; }
.brand .who span { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.site-header ul {
  display: flex; flex-wrap: wrap; gap: 0.15rem 1.15rem;
  list-style: none; margin: 0; padding: 0;
  justify-content: flex-end;
}
.site-header li a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 550;
}
.site-header li a:hover,
.site-header li a[aria-current="page"] { color: var(--red); }

/* Hero */
.hero { padding: 4.2rem 0 3.4rem; }
.hero .kicker {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 650;
  margin: 0 0 0.9rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.15rem, 5.4vw, 3.55rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 1.15rem;
  max-width: 18ch;
}
.hero .lead { font-size: 1.2rem; max-width: 40rem; color: var(--muted); margin: 0 0 1.7rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff;
  font-weight: 620; font-size: 0.98rem;
  padding: 0.72rem 1.2rem;
  border-radius: 2px;
  text-decoration: none;
  border: 1px solid var(--red);
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn.alt { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.alt:hover { background: var(--ink); color: #fff; }

.enthusiast .photo { margin: 0 0 1.7rem; max-width: 56rem; }
.enthusiast .photo img { width: 100%; border-radius: 2px; }
.enthusiast .photo figcaption { font-size: 0.78rem; color: var(--muted); margin-top: 0.4rem; }

/* Sections */
section { padding: 3.2rem 0; }
section.tint { background: var(--white); }
section.earth { background: var(--ink); color: #f4ece6; }
section.earth .lead, section.earth p { color: #c9bfb6; }
section.earth h2, section.earth h3 { color: #fff; }
section.earth a { color: #ffd4d8; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 42rem; }
h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.7rem;
}
h3 { font-family: var(--serif); font-weight: 550; font-size: 1.22rem; margin: 0 0 0.4rem; letter-spacing: -0.01em; }
.grid { display: grid; gap: 1.1rem; margin-top: 1.6rem; }
.grid-4, .grid-2 { display: grid; gap: 1.1rem; margin-top: 1.6rem; }
@media (min-width: 700px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-4.three { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 980px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-4.three { grid-template-columns: repeat(3, 1fr); }
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 1.25rem 1.2rem 1.35rem;
  border-top: 3px solid var(--red);
}
section.tint .card { background: var(--paper); }
section.earth .card { background: #241c1c; border-color: #3a2f2f; color: #f4ece6; }
.card p { margin: 0; color: var(--muted); }
section.earth .card p { color: #c9bfb6; }
.card .n {
  font-family: var(--serif);
  color: var(--red);
  font-size: 1.35rem;
  font-weight: 550;
  margin-bottom: 0.35rem;
}

.quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.45rem;
  line-height: 1.35;
  margin: 1.2rem 0 0;
  max-width: 28rem;
}
.quote cite { display: block; font-style: normal; font-family: var(--sans); font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; letter-spacing: 0.04em; text-transform: uppercase; }

/* Lists / credentials */
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li {
  padding: 0.55rem 0 0.55rem 1.3rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.ticks li::before { content: ""; position: absolute; left: 0; top: 1.05rem; width: 0.6rem; height: 2px; background: var(--red); }

/* Two column */
.two { display: grid; gap: 1.6rem; margin-top: 1.2rem; }
@media (min-width: 800px) { .two { grid-template-columns: 1.15fr 0.85fr; align-items: start; } }

/* Contact */
.contact-list { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.contact-list li { margin: 0 0 0.65rem; }
.contact-list span:first-child { display: block; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* Mars homes pair */
.homes { display: grid; gap: 1.1rem; margin-top: 1.5rem; }
@media (min-width: 800px) { .homes { grid-template-columns: 1fr 1fr; } }
.home { padding: 1.3rem 1.25rem 1.4rem; border: 1px solid var(--line); background: var(--white); }
.home .tag { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); font-weight: 650; margin-bottom: 0.7rem; }
section.earth .home { background: #241c1c; border-color: #3a2f2f; }
.caption { font-size: 0.82rem; color: var(--muted); }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 0.85rem 0; }
details summary { cursor: pointer; font-weight: 620; }
details p { margin: 0.6rem 0 0.3rem; color: var(--muted); }

/* Footer */
.site-footer {
  background: var(--ink);
  color: #c9bfb6;
  padding: 2.4rem 0 2.6rem;
  font-size: 0.9rem;
}
.site-footer h3 { color: #fff; font-size: 1.05rem; margin-bottom: 0.7rem; }
.site-footer a { color: #ffd4d8; }
.site-footer .lockup { height: 110px; width: auto; margin-bottom: 1.1rem; }
.site-footer p { margin: 0.55rem 0; max-width: 52rem; }
.fine { font-size: 0.8rem; color: #9a9088; }

@media (max-width: 699px) {
  .brand img { height: 52px; }
  .brand .who { display: none; }
  .site-header nav { flex-wrap: wrap; }
  .site-header ul { width: 100%; justify-content: flex-start; gap: 0.35rem 0.95rem; }
  .hero { padding: 2.4rem 0 2.2rem; }
  section { padding: 2.3rem 0; }
}

/* v4: personal-brand hero with portrait, lanes, fine print */
.hero-grid { display: grid; gap: 1.8rem; align-items: center; }
@media (min-width: 820px) { .hero-grid { grid-template-columns: 1fr 260px; gap: 3rem; } }
.portrait { margin: 0; justify-self: start; }
@media (min-width: 820px) { .portrait { justify-self: end; } }
.portrait img {
  width: 220px; height: 220px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--white); box-shadow: 0 0 0 2px var(--red), 0 14px 32px rgba(26,20,20,0.16);
}
@media (min-width: 820px) { .portrait img { width: 260px; height: 260px; } }
@media (max-width: 819px) { .portrait { order: -1; } .portrait img { width: 132px; height: 132px; } }
.lanes { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 1.4rem 0 0; }
.lanes li {
  border: 1px solid var(--line); background: var(--white); padding: 0.35rem 0.8rem;
  font-size: 0.92rem; font-weight: 600; border-radius: 999px;
}
.lanes li.core { border-color: var(--red); color: var(--red-dark); }
.card.feature { border-top-width: 5px; }
@media (min-width: 700px) { .card.feature { grid-column: 1 / -1; } }
.card .fineprint { margin-top: 0.75rem; font-size: 0.85rem; color: var(--muted); font-style: italic; }
.creds li { font-size: 0.98rem; }
section.earth .contact-list span:first-child { color: #9a9088; }
section.earth .contact-list a { font-size: 1.25rem; font-weight: 620; }
.stories { display: grid; gap: 1.1rem; margin: 0 0 1.7rem; max-width: 56rem; }
@media (min-width: 800px) { .stories { grid-template-columns: repeat(3, 1fr); } }
.card.feature p { max-width: 68ch; }

/* v5: Mars section (additive; nothing above is changed) */
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.5rem 0.9rem; z-index: 50; }
.skip:focus { left: 0.5rem; top: 0.5rem; }
.lanes li a { color: inherit; text-decoration: none; }
.lanes li a:hover { color: var(--red); text-decoration: underline; text-underline-offset: 0.18em; }

/* Labels: words plus outline style, never color alone */
.tag {
  display: inline-block; font-family: var(--sans); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase; line-height: 1.2;
  padding: 0.12rem 0.45rem; border: 2px solid var(--ink); color: var(--ink); background: transparent;
  vertical-align: baseline; white-space: nowrap;
}
.tag.cited { background: var(--ink); color: var(--white); }
.tag.calc { border-style: double; border-width: 4px; padding: 0.02rem 0.4rem; }
.tag.est { border-style: dashed; }
.tag.concept { border-style: dotted; font-style: italic; }
.tag.unknown::before { content: "? "; }
.tag.unknown { border-style: dashed; border-width: 2px; background: var(--paper-2); }
.tag.opinion { border-style: solid; border-width: 1px; }
.tags { margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.hero .tags { margin: 0 0 1rem; }

.mars-hero .lead { max-width: 44rem; }
.mars-hero .photo { max-width: 60rem; }
.readfirst { max-width: 44rem; border: 1px solid var(--line); border-left: 5px solid var(--red); background: var(--white); padding: 1rem 1.2rem 1.1rem; }
.readfirst h2 { font-size: 1.15rem; margin: 0 0 0.4rem; }
.readfirst ul { margin: 0; padding-left: 1.1rem; }
.readfirst li { margin: 0.3rem 0; color: var(--muted); }

.post-grid { display: grid; gap: 1.1rem; margin-top: 1.6rem; }
@media (min-width: 700px) { .post-grid { grid-template-columns: 1fr 1fr; } }
.post-card { display: flex; flex-direction: column; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { color: var(--red); }
.post-card .more { margin-top: auto; padding-top: 0.9rem; font-weight: 620; font-size: 0.95rem; text-decoration: none; }
.post-card .more:hover { text-decoration: underline; }
.post-card .n { font-size: 1.6rem; }

.legend { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; gap: 0.7rem; max-width: 50rem; }
.legend li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.9rem; align-items: baseline; padding-bottom: 0.7rem; border-bottom: 1px solid var(--line); }
.legend li span { color: var(--muted); }
@media (max-width: 520px) { .legend li { grid-template-columns: 1fr; gap: 0.3rem; } }
.unknowns { max-width: 50rem; margin-top: 1.2rem; }
.unknowns li::before { content: "?"; background: none; width: auto; height: auto; top: 0.55rem; font-family: var(--serif); font-weight: 700; color: var(--red-dark); }
.unknowns li { padding-left: 1.5rem; }

/* Post pages */
.post-hero { padding: 3rem 0 1.6rem; }
.post-hero h1 { max-width: 20ch; }
.post-hero .lead { max-width: 44rem; margin-bottom: 0; }
.crumbs { font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 650; margin: 0 0 0.8rem; color: var(--muted); }
.crumbs a { color: var(--red); text-decoration: none; }
.prose { max-width: 46rem; }
.prose h2 { margin-top: 2.4rem; }
.prose h3 { margin-top: 1.4rem; }
.prose p { margin: 0 0 1rem; }
.prose .actions { margin-top: 1.2rem; }
.concept-note { border: 2px dashed var(--ink); background: var(--white); padding: 0.8rem 1rem; font-size: 0.95rem; margin: 0 0 1.8rem !important; }
.pull {
  font-family: var(--serif); font-style: italic; font-size: 1.4rem; line-height: 1.35;
  border-left: 4px solid var(--red); padding: 0.2rem 0 0.2rem 1rem; margin: 1.6rem 0 !important; max-width: 34rem;
}
.ref { font-size: 0.8rem; font-weight: 650; text-decoration: none; vertical-align: super; line-height: 0; }
.stats { display: grid; gap: 0.9rem; margin: 1.3rem 0 1.5rem; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(3, 1fr); } .stats.two-up { grid-template-columns: 1fr 1fr; } }
.stat { border: 1px solid var(--line); border-top: 3px solid var(--ink); background: var(--white); padding: 0.8rem 0.95rem 0.9rem; font-size: 0.9rem; color: var(--muted); }
.stat b { display: block; font-family: var(--serif); font-weight: 550; font-size: 1.7rem; line-height: 1.15; color: var(--ink); margin-bottom: 0.2rem; }
.stat span { display: block; margin-bottom: 0.5rem; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 1rem 0 1.4rem; }
.steps li { counter-increment: step; position: relative; padding: 0.8rem 0 0.8rem 3.2rem; border-bottom: 1px solid var(--line); }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.65rem; width: 2.2rem; height: 2.2rem;
  border: 2px solid var(--ink); border-radius: 50%; text-align: center; line-height: 1.95rem;
  font-family: var(--serif); font-weight: 600; font-size: 1.1rem;
}
.rules { list-style: none; counter-reset: rule; padding: 0; margin: 1.4rem 0; }
.rules li { counter-increment: rule; position: relative; padding: 0.3rem 0 1.2rem 3.2rem; }
.rules li::before { content: counter(rule); position: absolute; left: 0; top: 0.2rem; font-family: var(--serif); font-size: 2.2rem; font-weight: 500; color: var(--red); line-height: 1; }
.rules h3 { margin: 0 0 0.25rem; }
.rules p { margin: 0; color: var(--muted); }

.fig { margin: 1.6rem 0; }
.fig img { width: 100%; border: 1px solid var(--line); background: var(--white); }
.fig figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.55rem; line-height: 1.5; }
.annot-img { position: relative; }
.annot-img .ring { position: absolute; left: 69%; top: 50.3%; width: 13%; max-width: 64px; aspect-ratio: 1; transform: translate(-50%, -50%); border: 3px dashed #fff; outline: 2px solid var(--ink); border-radius: 50%; }
.annot-img .ring-label { position: absolute; right: calc(31% + 6.5%); top: 50.3%; transform: translateY(-50%); background: var(--ink); color: #fff; font-size: 0.78rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.2rem 0.5rem; white-space: nowrap; }
.annot-img .ring-label::after { content: " →"; }

.ladder { list-style: none; counter-reset: rung; padding: 0; margin: 1.2rem 0 1rem; }
.ladder li { counter-increment: rung; border: 1px solid var(--line); border-left: 6px solid var(--ink); background: var(--white); padding: 0.9rem 1.1rem 0.5rem; margin-bottom: 0.9rem; }
.ladder h3 { margin: 0 0 0.4rem; }
.ladder .rung { display: block; font-family: var(--sans); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red-dark); margin-bottom: 0.15rem; }
.ladder .rung::before { content: "Rung " counter(rung) " · "; }
.ladder .limit { font-size: 0.93rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 0.5rem; margin-top: 0.4rem; }

.bars { display: grid; gap: 1rem; border: 1px solid var(--line); background: var(--white); padding: 1rem 1.1rem; }
.bar-row { display: grid; grid-template-columns: 1fr; gap: 0.25rem; }
.bar-label { font-weight: 600; font-size: 0.95rem; }
.bar-label small { font-weight: 400; color: var(--muted); }
.bar-track { height: 1.7rem; border-left: 2px solid var(--ink); display: flex; align-items: center; }
.bar { display: block; height: 100%; }
.bar.melt { width: 100%; border: 2px solid var(--ink); background: repeating-linear-gradient(45deg, var(--ink) 0 3px, var(--white) 3px 8px); }
.bar.lift { width: 4px; background: var(--ink); }
.bar-val { font-family: var(--serif); font-size: 1.15rem; font-weight: 550; }
.textalt { margin: 0 0 1.4rem; border: 1px solid var(--line); background: var(--white); padding: 0.6rem 1rem; font-size: 0.95rem; }
.textalt summary { cursor: pointer; font-weight: 620; }
.textalt ul { margin: 0.6rem 0 0.3rem; padding-left: 1.1rem; }
.sources { padding-left: 1.2rem; font-size: 0.93rem; }
.sources li { margin: 0 0 0.6rem; overflow-wrap: anywhere; }
.math { font-size: 0.93rem; padding-left: 1.1rem; }
.math li { margin: 0.25rem 0; }
.post-nav { display: grid; gap: 0.8rem; margin: 2.4rem 0 0; }
@media (min-width: 600px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.pn { display: block; border: 1px solid var(--ink); padding: 0.7rem 1rem; text-decoration: none; color: var(--ink); font-family: var(--serif); font-size: 1.1rem; }
.pn span { display: block; font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pn.next { text-align: right; }
.pn:hover { background: var(--ink); color: #fff; }
.pn:hover span { color: #ddd; }
.prose .fine { color: var(--muted); }

/* v5.1: Mars hub swap (dark theme, NASA photo hero, water chain, fade-ins) */
body.mars-dark { background: #141010; color: #eee4dd; }
.mars-dark .site-header { background: rgba(20,16,16,0.92); border-bottom-color: #3a2f2f; }
.mars-dark .brand, .mars-dark .site-header li a, .mars-dark .brand .who strong { color: #f4ece6; }
.mars-dark .brand .who span { color: #b9aea6; }
.mars-dark .site-header li a:hover, .mars-dark .site-header li a[aria-current="page"] { color: #ffb3bb; }
.mars-dark section.tint { background: #1b1414; }
.mars-dark h2, .mars-dark h3 { color: #fff; }
.mars-dark .lead, .mars-dark p { color: #cfc5bd; }
.mars-dark a { color: #ffb3bb; }
.mars-dark a:hover { color: #fff; }
.mars-dark .card { background: #241c1c; border-color: #3a2f2f; border-top-color: #ffb3bb; }
.mars-dark .card p { color: #cfc5bd; }
.mars-dark .post-card h3 a { color: #fff; }
.mars-dark .post-card h3 a:hover { color: #ffb3bb; }
.mars-dark .card .n { color: #ffb3bb; }
.mars-dark .tag { border-color: #f4ece6; color: #f4ece6; }
.mars-dark .tag.cited { background: #f4ece6; color: #141010; }
.mars-dark .tag.unknown { background: #2c2222; }
.mars-dark .legend li { border-bottom-color: #3a2f2f; }
.mars-dark .legend li span { color: #cfc5bd; }
.mars-dark .ticks li { border-bottom-color: #3a2f2f; }
.mars-dark .ticks li::before { background: #ffb3bb; }
.mars-dark .unknowns li::before { color: #ffb3bb; background: none; }
.mars-dark section.earth { background: #0c0909; border-top: 1px solid #3a2f2f; }
.mars-dark .btn { background: var(--red); border-color: var(--red); color: #fff; }
.mars-dark .btn.alt { background: transparent; border-color: #f4ece6; color: #f4ece6; }
.mars-dark .btn.alt:hover { background: #f4ece6; color: #141010; }

.mars-hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(5rem, 9vw, 6.5rem); background: #141010; }
.mars-hero .hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; z-index: -2; border: 0; }
.mars-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(14,10,10,0.92) 0%, rgba(14,10,10,0.8) 55%, rgba(14,10,10,0.55) 100%); }
.mars-hero .kicker { color: #ffb3bb; }
.mars-hero h1 { color: #fff; font-size: clamp(2.5rem, 7vw, 4.6rem); max-width: 14ch; line-height: 1.06; }
.mars-hero .lead { color: #eadfd7; max-width: 40rem; }
.byline { display: flex; align-items: center; gap: 0.9rem; margin-top: 1.6rem; padding-top: 1.1rem; border-top: 1px solid rgba(255,255,255,0.25); max-width: 36rem; }
.byline img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid #f4ece6; }
.byline p { margin: 0; font-size: 0.92rem; color: #eadfd7; line-height: 1.45; }
.mars-hero .credit { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 0.55rem var(--pad); background: rgba(0,0,0,0.62); color: #eadfd7; font-size: 0.78rem; line-height: 1.4; }
.mars-hero .credit a { color: #ffd4d8; }

.chain { padding: 3rem 0; background: #1b1414; border-top: 1px solid #3a2f2f; border-bottom: 1px solid #3a2f2f; }
.chain-grid { display: grid; gap: 1.8rem; align-items: center; }
@media (min-width: 820px) { .chain-grid { grid-template-columns: 1fr 420px; gap: 3.5rem; } }
.chain-fig { margin: 0; color: #f4ece6; max-width: 420px; }
.chain-fig svg { width: 100%; height: auto; display: block; }
.chain-fig a text { cursor: pointer; }
.chain-fig a:hover rect:first-of-type { stroke: #ffb3bb; }
.chain-fig figcaption { font-size: 0.82rem; color: #b9aea6; margin-top: 0.6rem; line-height: 1.5; }
.readfirst-inline { border-left: 4px solid #ffb3bb; padding-left: 0.9rem; font-size: 0.95rem; }

@media (prefers-reduced-motion: no-preference) {
  .rv { animation: rvfade 0.7s ease-out both; }
  .rv2 { animation-delay: 0.1s; } .rv3 { animation-delay: 0.2s; } .rv4 { animation-delay: 0.3s; }
  @keyframes rvfade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
.mars-dark section.tint .card, .mars-dark .card { background: #241c1c; }
.mars-dark .tag.cited { background: #f4ece6; color: #141010; }
.mars-hero::before { background: linear-gradient(90deg, rgba(14,10,10,0.9) 0%, rgba(14,10,10,0.72) 50%, rgba(14,10,10,0.25) 100%); }
@media (max-width: 699px) { .mars-hero::before { background: rgba(14,10,10,0.8); } }

/* v6: X-posts centerpiece, merged story page, engine page (additive; nothing above is changed) */
.mars-dark .kicker { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: #ffb3bb; font-weight: 650; margin: 0 0 0.6rem; }
.mars-dark .crumbs, .mars-dark .crumbs a { color: #ffb3bb; }
.mars-dark .post-hero { padding: 3rem 0 1.4rem; }
.mars-dark .post-hero h1 { color: #fff; max-width: 24ch; }
.mars-dark .hero .tags, .mars-dark .prose .tags { margin: 0.9rem 0 1rem; }
.mars-dark .concept-note { background: #1b1414; border-color: #f4ece6; color: #eee4dd; }
.mars-dark .concept-note a { color: #ffd4d8; }
.mars-dark .textalt { background: #1b1414; border-color: #3a2f2f; color: #eee4dd; }
.mars-dark .textalt p, .mars-dark .textalt li { color: #eee4dd; }
.mars-dark .prose h2, .mars-dark .prose h3 { color: #fff; }
.mars-dark .prose p, .mars-dark .prose li { color: #e3d9d1; }
.mars-dark .prose .fine, .mars-dark .fine { color: #b9aea6; }
.mars-dark .sources li { color: #e3d9d1; }
.mars-dark .ref { color: #ffd4d8; }
.mars-dark .pn { border-color: #f4ece6; color: #f4ece6; }
.mars-dark .pn span { color: #b9aea6; }
.mars-dark .pn:hover { background: #f4ece6; color: #141010; }
.mars-dark .pn:hover span { color: #3a2f2f; }
.mars-dark .btn { color: #fff; }
.mars-dark .btn.alt { color: #f4ece6; border-color: #f4ece6; }
.mars-dark .btn.alt:hover { background: #f4ece6; color: #141010; }
.mars-dark .tag.calc, .mars-dark .tag.est, .mars-dark .tag.concept, .mars-dark .tag.unknown, .mars-dark .tag.opinion { color: #f4ece6; }

/* Centerpiece on the Mars landing */
.story-center { padding: 3.4rem 0; background: #141010; }
.story-center .lead { max-width: 46rem; }
.xgrid { display: grid; gap: 1.1rem; margin-top: 2rem; }
@media (min-width: 700px) { .xgrid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .xgrid { grid-template-columns: repeat(3, 1fr); } }
.xcard { display: flex; flex-direction: column; gap: 0.6rem; }
.xcard .xk { margin: 0; font-weight: 650; color: #fff; font-family: var(--serif); font-size: 1.15rem; }
.xcard .xk .n { display: inline-block; margin: 0 0.35rem 0 0; font-size: 1rem; }
.xcard blockquote { margin: 0; padding: 0 0 0 0.9rem; border-left: 4px solid #ffb3bb; }
.xcard blockquote p { margin: 0; color: #eee4dd; font-size: 1rem; line-height: 1.5; }
.xcard .tags { margin: 0; }
.xcard .xlinks { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; margin-top: auto; font-size: 0.9rem; font-weight: 600; }
.engine-feature { padding: 3rem 0; background: #1b1414; border-top: 1px solid #3a2f2f; border-bottom: 1px solid #3a2f2f; }
.two-col-feature { display: grid; gap: 1.6rem; align-items: center; }
@media (min-width: 860px) { .two-col-feature { grid-template-columns: 1.05fr 1fr; gap: 3rem; } }
.two-col-feature figure { margin: 0; }
.two-col-feature img { width: 100%; height: auto; border: 1px solid #3a2f2f; background: #fff; }
.two-col-feature figcaption { font-size: 0.82rem; color: #b9aea6; margin-top: 0.5rem; }

/* Story page */
.story-hero .lead { max-width: 46rem; }
.story-intro { padding: 1.6rem 0 0.4rem; }
.chapter { padding: 2.4rem 0 1rem; border-top: 1px solid #3a2f2f; }
.chapter:first-of-type { border-top: 0; }
.chapter .prose h2 { margin-top: 0; }
.chap-n { margin: 0 0 0.3rem !important; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 650; color: #ffb3bb !important; }
.chap-dek { font-size: 1.12rem; color: #cfc5bd !important; margin: 0 0 0.4rem !important; }
.bridge { font-style: italic; color: #cfc5bd !important; }
blockquote.xq { margin: 1.3rem 0; padding: 0.2rem 0 0.2rem 1.1rem; border-left: 5px solid #ffb3bb; }
blockquote.xq p { font-size: 1.06rem; line-height: 1.62; margin: 0 0 0.85rem; color: #f4ece6; overflow-wrap: anywhere; }
.xsrc { font-size: 0.85rem; color: #b9aea6; margin-top: 0.2rem; }
.xsrc a { font-weight: 600; }

/* Engine page */
.engine-hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); max-width: 20ch; }
.engine-hero { padding-bottom: clamp(3rem, 6vw, 4.5rem); }
.engine-render { padding: 0 0 1rem; background: #141010; }
.engine-render .wrap { max-width: 1100px; }
.render { margin: 0; }
.render img { width: 100%; height: auto; border: 1px solid #3a2f2f; background: #fff; }
.render figcaption, .sheet figcaption { font-size: 0.88rem; color: #cfc5bd; margin-top: 0.6rem; line-height: 1.5; max-width: 62rem; }
.engine-body { padding-top: 1.6rem; }
.howsteps { padding-left: 1.4rem; margin: 0 0 1.4rem; }
.howsteps li { margin: 0 0 0.75rem; padding-left: 0.3rem; }
.howsteps li::marker { font-weight: 700; color: #ffb3bb; }
.table-wrap { overflow-x: auto; margin: 1rem 0 1.4rem; }
table.nums { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
@media (max-width: 599px) { table.nums { font-size: 0.88rem; } table.nums th, table.nums td { padding: 0.45rem 0.45rem; } }
table.nums th, table.nums td { border: 1px solid #5a4b4b; padding: 0.55rem 0.7rem; text-align: left; vertical-align: top; color: #eee4dd; }
table.nums thead th { background: #2c2222; color: #fff; }
table.nums tbody th { font-weight: 620; color: #fff; }
.small { font-size: 0.82rem; color: #b9aea6; display: block; margin-top: 0.3rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.actions.dl { margin: 1.2rem 0 1.4rem; }
.sheet { margin: 2rem 0; }
.sheet > a { display: block; }
.sheet img { width: 100%; height: auto; background: #fff; border: 1px solid #5a4b4b; }
.mars-dark .unknowns li::before { content: "?"; background: none; }

/* v6.1: concept-illustration hero, real-photo section */
.mars-hero .hero-bg { object-position: 62% 40%; }
.mars-hero .credit { font-size: 0.82rem; }
.real-photo { padding: 3rem 0; background: #141010; }
.real-photo figure { margin: 0; }
.real-photo img { width: 100%; height: auto; border: 1px solid #3a2f2f; }
.real-photo figcaption { font-size: 0.82rem; color: #b9aea6; margin-top: 0.5rem; line-height: 1.45; }
.story-fig { margin: 1.2rem 0 1.6rem; }
.story-fig img { width: 100%; height: auto; border: 1px solid #3a2f2f; }
.story-fig figcaption { font-size: 0.85rem; color: #cfc5bd; margin-top: 0.5rem; }
.mars-hero .hero-bg { object-position: 55% 38%; }
@media (min-width: 700px) { .mars-hero::before { background: linear-gradient(90deg, rgba(14,10,10,0.9) 0%, rgba(14,10,10,0.7) 42%, rgba(14,10,10,0.12) 100%); } }
@media (max-width: 699px) { .mars-hero { padding-bottom: 9.5rem; } .mars-hero::before { background: rgba(14,10,10,0.72); } }

/* v6.3: non-color cues for the current page and keyboard focus (nav, all pages) */
.site-header li a[aria-current="page"] { font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.28em; border-bottom: 0; }
.site-header li a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.28em; }
.site-header a:focus-visible, .site-header .brand:focus-visible { outline: 3px solid var(--red-dark); outline-offset: 3px; text-decoration: underline; }
.mars-dark .site-header a:focus-visible, .mars-dark .site-header .brand:focus-visible { outline-color: #ffffff; }
.mars-dark a:focus-visible, .mars-dark .btn:focus-visible, .mars-dark summary:focus-visible { outline: 3px solid #ffffff; outline-offset: 3px; }
.skip:focus-visible { outline: 3px solid #ffffff; }
.leadin { margin: 1.4rem 0 0.2rem; padding: 0.55rem 0.9rem; border: 1px dashed #b9aea6; font-size: 0.97rem; color: #eee4dd !important; }
.legend-line { margin: 0 0 1rem; }
