/* Cohetes Multitec. Palette: Multitec brandbook only (docs/design/brand-multitec.css in the
   quantumpc agent repo). Type: Ubuntu (brand) for text, Martian Mono for data. */

@font-face { font-family: "Ubuntu"; src: url("../fonts/Ubuntu-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Ubuntu"; src: url("../fonts/Ubuntu-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Ubuntu"; src: url("../fonts/Ubuntu-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Martian Mono"; src: url("../fonts/MartianMono.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  --mt-red: #A30006; --mt-red-1: #FF3A41; --mt-red-2: #FF0009; --mt-red-3: #DB0008; --mt-red-4: #630004; --mt-red-5: #330002;
  --mt-grey: #BCBFBE; --mt-grey-1: #F6F6F6; --mt-grey-2: #DEE5E5; --mt-grey-3: #7C8484; --mt-grey-4: #505353; --mt-grey-5: #1E2121; --mt-white: #FFFFFF;

  --bg: var(--mt-grey-1);
  --surface: var(--mt-white);
  --surface-2: var(--mt-grey-2);
  --text: var(--mt-grey-5);
  --dim: var(--mt-grey-4);
  --line: var(--mt-grey-2);
  --accent: var(--mt-red);
  --accent-text: var(--mt-red);
  --on-accent: var(--mt-white);
  --shadow: 0 1px 2px rgba(30, 33, 33, .06), 0 8px 24px rgba(30, 33, 33, .08);

  --space: var(--mt-grey-5);
  --space-text: var(--mt-grey-1);
  --space-dim: var(--mt-grey);
  --space-line: rgba(188, 191, 190, .16);
  --space-surface: rgba(80, 83, 83, .28);

  --font: "Ubuntu", ui-sans-serif, system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .6, .3, 1);
  --radius: 8px;
  --wrap: 1180px;
  --top-h: 64px;

  /* Shared tokens (V-002): type ramp, photo radius, focus ring. Sizes come only from the ramp. */
  --t-sm: 13px; --t-base: 16px; --t-md: 20px; --t-lg: 26px; --t-xl: 34px; --t-2xl: 44px;
  --t-3xl: clamp(36px, 5vw, 56px); --t-hero: clamp(48px, 9vw, 104px);
  --radius-photo: 14px;
  --focus: var(--mt-red);
  color-scheme: light;
}

/* Dark theme (V-014): surfaces are opaque Gris 5 so Rojo 1 text keeps 4.5:1; cards are outlined by
   --line, and --surface-2 is for non-text fills only (table heads, bars, alt bands). */
:root[data-theme="dark"] {
  --bg: var(--mt-grey-5); --surface: var(--mt-grey-5); --surface-2: rgba(80, 83, 83, .28);
  --text: var(--mt-grey-1); --dim: var(--mt-grey); --line: rgba(188, 191, 190, .22);
  --accent: var(--mt-red-1); --accent-text: var(--mt-red-1); --on-accent: var(--mt-red-5);
  --shadow: none; color-scheme: dark;
  --focus: var(--mt-red-1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--mt-grey-5); --surface: var(--mt-grey-5); --surface-2: rgba(80, 83, 83, .28);
    --text: var(--mt-grey-1); --dim: var(--mt-grey); --line: rgba(188, 191, 190, .22);
    --accent: var(--mt-red-1); --accent-text: var(--mt-red-1); --on-accent: var(--mt-red-5);
    --shadow: none; color-scheme: dark;
    --focus: var(--mt-red-1);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 12px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--t-base)/1.55 var(--font); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-text); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { line-height: 1.12; }
h3 { line-height: 1.3; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
/* Dark surfaces in the light theme get the bright ring (3:1 against Gris 5). */
.hero, .top:not(.scrolled), .pcb, .rm-sum, .foot, .rocket-card.next, .lightbox { --focus: var(--mt-red-1); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.ic-s { width: 1em; height: 1em; vertical-align: -.12em; }
.mono { font-family: var(--mono); font-size: var(--t-sm); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 20px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* ---- buttons, pills, chips ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 5px;
  font: 500 var(--t-base)/1 var(--font); white-space: nowrap; text-decoration: none; border: 2px solid transparent; transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--mt-red); color: var(--mt-white); }
.btn-primary:hover { background: var(--mt-red-3); }
.btn-ghost { border-color: currentColor; color: inherit; }
.btn-lg { min-height: 56px; padding: 16px 28px; font-size: var(--t-md); }
/* At 320 px the longest label ("Escríbenos para patrocinar" + icon) is wider than the column:
   below 400 px a button may wrap instead of pushing the page sideways (WCAG 1.4.10). */
@media (max-width: 399px) { .btn { max-width: 100%; white-space: normal; line-height: 1.25; } }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 500 var(--t-sm)/1 var(--mono); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em;
  padding: 6px 10px; border-radius: 999px; font-style: normal; border: 1px solid currentColor; }
.pill-done { color: var(--text); background: var(--surface-2); border-color: transparent; }
.pill-doing { color: var(--on-accent); background: var(--accent); border-color: transparent; }
.pill-next { color: var(--dim); }
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text);
  font: 500 var(--t-sm)/1 var(--mono); text-decoration: none; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.icon-btn { padding: 0; }
.note { color: var(--dim); font-size: var(--t-sm); line-height: 1.6; margin-top: 12px; }

/* ---- header ---- */
.top { position: fixed; inset: 0 0 auto 0; z-index: 50; padding-top: env(safe-area-inset-top, 0px);
  transition: background .2s var(--ease), border-color .2s var(--ease); border-bottom: 1px solid transparent; color: var(--space-text); }
.top.scrolled { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line); color: var(--text); }
.top-in { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; height: var(--top-h); display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; flex: none; }
/* Inline SVG logo (site/partials/logo.html): the emblem keeps its colours, the wordmark takes `color`. */
.brand .logo { height: 22px; width: auto; color: var(--mt-red); }
.top:not(.scrolled) .brand .logo { color: var(--mt-white); }
:root[data-theme="dark"] .brand .logo, :root[data-theme="dark"] .foot .logo { color: var(--mt-white); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand .logo, :root:not([data-theme="light"]) .foot .logo { color: var(--mt-white); } }
.brand-sub { font: 700 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; padding-left: 10px; border-left: 1px solid currentColor; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: inherit; text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 500; font-size: 15px; }
.nav a:hover { background: rgba(188, 191, 190, .16); }
/* Scrollspy (V-022): the link of the section on screen. */
.nav a[aria-current="true"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.nav .nav-cta { background: var(--mt-red); color: var(--mt-white); }
.nav .nav-cta:hover { background: var(--mt-red-3); }
.top-actions { display: flex; gap: 8px; margin-left: 8px; }
.top .chip { color: inherit; border-color: rgba(188, 191, 190, .35); }
.menu-btn { display: none; }
.ic-moon { display: none; }
:root[data-theme="dark"] .ic-sun { display: none; } :root[data-theme="dark"] .ic-moon { display: inline; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ic-sun { display: none; } :root:not([data-theme="light"]) .ic-moon { display: inline; } }

@media (max-width: 1060px) {
  /* The menu button comes before the nav in the DOM (Tab enters the open menu, A-004) but shows last. */
  .menu-btn { display: inline-flex; order: 3; margin-left: -8px; }
  .top-actions { margin-left: auto; order: 2; }
  .nav { position: absolute; top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); color: var(--text); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; display: none; box-shadow: var(--shadow); }
  /* At 400 % zoom or in landscape the open menu is taller than the screen: let it scroll (A-001). */
  .nav { max-height: calc(100dvh - var(--top-h) - env(safe-area-inset-top, 0px)); overflow-y: auto; overscroll-behavior: contain; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 8px; font-size: 20px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav .nav-cta { margin-top: 12px; text-align: center; border-radius: 999px; border: 0; }
  .no-js .nav { position: static; display: flex; flex-direction: row; flex-wrap: wrap; background: none; box-shadow: none; border: 0; padding: 0; }
}
/* Phones: "Cohetes" stays visible next to a smaller logo (V-022). */
@media (max-width: 420px) {
  .top-in { gap: 8px; }
  .brand { gap: 8px; }
  .brand .logo { height: 16px; }
  .brand-sub { letter-spacing: .04em; padding-left: 8px; }
  .top-actions { gap: 4px; }
}
/* 320 px (400 % zoom): nothing may be clipped (A-002). */
@media (max-width: 360px) {
  .top-in { padding: 0 12px; gap: 8px; }
  .top-actions { gap: 4px; margin-left: auto; }
  .menu-btn { margin-left: -4px; }
  .brand .logo { height: 14px; }
}
/* Below 360 px (400 % zoom) "Rocketry" no longer fits beside the three buttons. */
@media (max-width: 359px) { .brand-sub { display: none; } }

/* Back to top (V-024): floating, shown by 70-totop.js after two screens, never with JS off. */
.totop { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  background: var(--bg); color: var(--text); box-shadow: var(--shadow); visibility: hidden; opacity: 0;
  transition: opacity .2s var(--ease), visibility .2s var(--ease); }
.totop.show { visibility: visible; opacity: 1; }
.no-js .totop { display: none; }

/* ---- hero ---- */
/* V-047 (S-008, U-007): the real liftoff (SELECTION.md slot P-01) full-bleed behind the copy.
   The rocket sits at 34 % from the left and the right half of the frame is clean sky, so the copy
   column sits on the RIGHT, never left of 52 % of the viewport, over a right-to-left scrim that
   is plain Gris 5 under the whole column (Rojo 1 needs it: 4.6:1 on #1E2121 and nothing
   lighter) and has faded out at 32 %, on an eased curve: a linear ramp showed a light band where it
   ended over the flat sky of the video (team review).
   A second, short top scrim keeps the transparent header readable over the bright sky.
   Contrast is measured, not guessed: tests/hero_contrast.js samples the brightest pixel under
   every text box with the text hidden (V-047 accept). The object-position lives here, not in
   the markup, because the CSP forbids style attributes. */
.hero { position: relative; min-height: min(88svh, 860px); background: var(--mt-grey-5); color: var(--space-text);
  overflow: hidden; display: flex; align-items: center; padding: calc(var(--top-h) + 40px) 0 96px; isolation: isolate; }
.hero-photo { position: absolute; inset: 0; z-index: -2; }
.hero-photo picture { display: block; width: 100%; height: 100%; }
.hero-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 34% 40%; }
/* Desktop: the photo fills the video's box (the left half, the rest is under the opaque scrim),
   fitted to the height instead of the full width: a wider, sharper view of the lift-off, and the
   video fades back to it in the same frame (team review). The rocket sits in the clear part. */
@media (min-width: 861px) {
  .hero-photo picture { width: 52%; }
  .hero-img { object-position: 20% 45%; }
}
/* The launch-day montage (blocks/hero.py, 15-hero-video.js) over the photo, faded in once it plays.
   On desktop it fills the left half only (the right half is under the opaque scrim anyway), from
   a square cut framed shot by shot; phones get the portrait cut in the photo band. */
.hero-video { position: absolute; top: 0; left: 0; width: 52%; height: 100%; object-fit: cover; object-position: 50% 50%;
  opacity: 0; transition: opacity .8s var(--ease); }
.hero-video.on { opacity: 1; }
/* Bottom right, on the caption's line (centred on it); the caption steps left while it shows. */
.hero-pause { position: absolute; bottom: 11px; right: max(20px, calc((100% - var(--wrap)) / 2 + 20px)); z-index: 1;
  color: var(--space-text); background: rgba(30, 33, 33, .55); border-color: rgba(188, 191, 190, .35); }
.hero-pause[hidden] { display: none; }
.hero-pause:not([hidden]) + .hero-caption { right: calc(max(20px, calc((100% - var(--wrap)) / 2 + 20px)) + 56px); }
.hero-pause .ic-play { display: none; }
.hero-pause.paused .ic-play { display: inline; } .hero-pause.paused .ic-pause { display: none; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(30, 33, 33, .72) 0, rgba(30, 33, 33, .6) 28px, rgba(30, 33, 33, .46) 56px,
      rgba(30, 33, 33, .32) 84px, rgba(30, 33, 33, .2) 112px, rgba(30, 33, 33, .1) 140px, rgba(30, 33, 33, .04) 170px,
      rgba(30, 33, 33, 0) 210px),
    linear-gradient(to left, var(--mt-grey-5) 0, var(--mt-grey-5) 50%, rgba(30, 33, 33, .96) 52%, rgba(30, 33, 33, .86) 54%,
      rgba(30, 33, 33, .7) 56%, rgba(30, 33, 33, .5) 58%, rgba(30, 33, 33, .31) 60%, rgba(30, 33, 33, .16) 62%,
      rgba(30, 33, 33, .06) 64%, rgba(30, 33, 33, .015) 66%, rgba(30, 33, 33, 0) 68%); }
.hero-in { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; width: 100%; display: flex; justify-content: flex-end; }
.hero-copy { width: min(560px, 42vw); }
/* U-008: the h1 carries the message; the brand is big and uppercase with Rojo 1 on its second
   word (on the opaque part of the scrim), the description is a smaller second line. */
.hero-title { margin-bottom: 24px; }
.hero-title > span { display: block; }
.hero-brand { font-size: var(--t-hero); line-height: .95; letter-spacing: -.01em; text-transform: uppercase; }
.hero-brand-2 { color: var(--mt-red-1); }
.hero-sub { margin-top: 16px; font-size: var(--t-lg); font-weight: 500; line-height: 1.3; letter-spacing: 0; color: var(--space-text); max-width: 26ch; }
.hero-title .hero-sep { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero-lede { font-size: var(--t-md); line-height: 1.55; color: var(--mt-grey-2); max-width: 38ch; margin-bottom: 32px; }
.hero .btn-ghost { color: var(--space-text); }
.hero-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 24px; color: var(--space-text); font-weight: 500; min-height: 44px; }
.hero-caption { position: absolute; bottom: 24px; right: max(20px, calc((100% - var(--wrap)) / 2 + 20px)); margin: 0;
  font: 500 var(--t-sm)/1.4 var(--mono); color: var(--mt-grey-2); }
@media (max-width: 1200px) {
  .hero-brand { font-size: var(--t-3xl); }
}
/* ---- stats (V-017, S-010): inset band, even cells, hairline grid on phones, mono trust line ---- */
/* On the theme's tokens: white under the hero in the light theme, opaque Gris 5 in the dark one. */
.stats-band { background: var(--surface); color: var(--text); border-top: 0; border-bottom: 1px solid var(--line); padding-block: 8px; }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); }
.stat { padding: 32px 24px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat-v { display: flex; align-items: baseline; gap: 4px; }
.stat-v b { font: 700 var(--t-xl)/1 var(--mono); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-v small { font: 500 var(--t-base)/1 var(--mono); color: var(--accent-text); }
.stat-l { display: block; margin-top: 8px; font-size: var(--t-sm); line-height: 1.5; letter-spacing: .02em; color: var(--dim); }
.stats-trust { padding-block: 8px 24px; color: var(--dim); line-height: 1.6; }
@media (max-width: 960px) { .stat { padding: 28px 16px; } .stats { grid-template-columns: repeat(3, 1fr); } .stat:nth-child(4) { border-left: 0; } .stat:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); background-clip: content-box; }
  .stat { background: var(--surface); border: 0 !important; padding: 24px 16px; }
  .stat-v b { font-size: var(--t-lg); }
}
/* ---- sections ---- */
.section { padding: 96px 0; }
.section.alt { background: var(--surface-2); }
/* "Dark" bands follow the theme (team review 2026-11-25: no dark zones in the light theme). Light: a
   white band between hairlines, on the page's own tokens. Dark: the page tokens already are the
   old band's (opaque Gris 5, V-014), so it looks exactly as before; the hairlines go (below). */
.section.dark { background: var(--surface); border-block: 1px solid var(--line); }
/* Dark theme (V-014, S-026): alt bands lift to .28 and every band boundary gets a hairline, so the
   sections keep their rhythm. Dark bands are plain Gris 5 in every theme: the red corner glow is gone
   (team review, 2026-11-25). */
:root[data-theme="dark"] .section.dark { border-block: 0; }
:root[data-theme="dark"] .section.alt { background: rgba(80, 83, 83, .28); }
:root[data-theme="dark"] .section + .section { border-top: 1px solid var(--line); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .section.dark { border-block: 0; }
  :root:not([data-theme="light"]) .section.alt { background: rgba(80, 83, 83, .28); }
  :root:not([data-theme="light"]) .section + .section { border-top: 1px solid var(--line); }
}
.sec-head { max-width: 760px; margin-bottom: 48px; }
.sec-head h2 { font-size: var(--t-3xl); margin-bottom: 16px; }
.lede { font-size: var(--t-md); line-height: 1.55; color: var(--dim); max-width: 64ch; }
.sub-title { font-size: var(--t-lg); line-height: 1.3; margin: 64px 0 24px; }
/* ---- pages (release 2.1): one page per nav tab ---- */
/* A sub-page has no hero under the fixed header: its header is solid from the start
   (blocks/pages.py) and the page head below starts clear of it. */
/* The nav link of the page on screen. */
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* Home: one teaser per page, photo and copy side by side, alternating sides. */
.teaser { padding: 80px 0; }
.teaser-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 64px; align-items: center; }
.teaser:nth-child(even) .teaser-photo { order: 2; }
.teaser-photo { margin: 0; }
.teaser-photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-photo); background: var(--surface-2); }
.teaser-copy h2 { font-size: var(--t-2xl); margin-bottom: 16px; }
.teaser-more { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 12px; }
/* Text colour, not Rojo 1: on the alt band of the dark theme Rojo 1 is 3.8:1 (the detector's
   low-contrast rule); the underline carries the accent. */
.teaser-more a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; color: inherit;
  text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.teaser-go { margin-top: 20px; }
@media (max-width: 860px) {
  .teaser { padding: 56px 0; }
  .teaser-in { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .teaser:nth-child(even) .teaser-photo { order: 0; }
  .teaser-copy h2 { font-size: var(--t-xl); }
  .teaser-copy .lede { font-size: var(--t-base); }  /* as the hero lede, never larger */
}

/* Page head of a sub-page: breadcrumb and the page's h1, under the solid header. */
.page-head { padding: calc(var(--top-h) + 40px) 0 36px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: var(--t-3xl); margin-top: 8px; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; font: 500 var(--t-sm)/1.4 var(--mono); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--dim); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.crumbs [aria-current="page"] { color: var(--dim); }
@media (max-width: 860px) { .page-head { padding: calc(var(--top-h) + 32px) 0 32px; } }
/* The first band after the page head needs less air: the head's border already separates them. */
.page-head + .section { padding-top: 64px; }
@media (max-width: 860px) { .page-head + .section { padding-top: 48px; } }
/* ---- project ---- */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.rocket-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); overflow: hidden; }
.rocket-card h3 { font-size: var(--t-lg); line-height: 1.3; margin: 16px 0 12px; }
.rocket-card p { color: var(--dim); }
/* V-053: the rocket photo opens the card, 3:1 (a rocket is long and thin), caption below, no filter. */
.rocket-photo { margin: 0 0 20px; }
.rocket-photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; border-radius: var(--radius-photo); background: var(--mt-grey-4); }
.rocket-card .rocket-photo figcaption { margin-top: 8px; font-size: var(--t-sm); line-height: 1.5; color: var(--dim); }
.rocket-card.next { background: linear-gradient(160deg, var(--mt-red-5), var(--mt-grey-5) 70%); color: var(--space-text); border-color: transparent; }
.rocket-card.next p { color: var(--space-dim); }
.rocket-card.next .pill-doing { background: var(--mt-red-1); color: var(--mt-red-5); }
.rocket-card.next { padding-bottom: 76px; }
/* Decorative figure: the empty alt after "/" keeps it out of the accessibility tree (A-020). */
.rocket-card.next::after { content: "8.000 ft" / ""; position: absolute; right: 16px; bottom: 12px; font: 700 var(--t-2xl)/1.1 var(--mono); color: rgba(255, 58, 65, .22); letter-spacing: -.05em; }
:lang(en) .rocket-card.next::after { content: "8,000 ft" / ""; }

/* Comparison: a real <table> (A-009); on phones each row becomes a card (S-013, A-006). */
.cmp { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cmp caption { text-align: left; caption-side: top; }
.cmp th, .cmp td { padding: 14px 20px; text-align: left; vertical-align: baseline; border-top: 1px solid var(--line); }
.cmp thead th, .cmp thead td { border-top: 0; border-bottom: 2px solid var(--text); background: transparent; color: var(--text); font: 500 var(--t-sm)/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.cmp thead + tbody tr:first-child > * { border-top: 0; }
.cmp th[scope="row"] { font-weight: 700; width: 24%; }
.cmp td.cmp-a { color: var(--dim); width: 38%; }
.cmp td.cmp-b { font-weight: 500; }
@media (max-width: 720px) {
  .duo { grid-template-columns: 1fr; }
  .cmp, .cmp tbody, .cmp tr, .cmp th, .cmp td { display: block; width: auto; }
  .cmp caption { display: block; }
  .cmp thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .cmp tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; padding: 14px 16px; border-top: 1px solid var(--line); }
  .cmp tbody tr:first-child { border-top: 0; }
  .cmp tbody th, .cmp tbody td { padding: 0; border-top: 0; }
  .cmp th[scope="row"] { grid-column: 1 / -1; }
  .cmp th[scope="row"], .cmp td.cmp-a { width: auto; } /* the desktop column widths squeezed the Lucentum cell */
  .cmp td::before { content: attr(data-col); display: block; font: 500 var(--t-sm)/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text); }
}
/* ---- launch ---- */
.launch-meta { font: 500 var(--t-sm)/1.4 var(--mono); color: var(--dim); letter-spacing: .04em; margin-bottom: 16px; }
/* V-052: four real photos at 3:4, caption below (never over), photo radius, no filter; a scroll-snap
   row on phones. The wide competition-site photo follows the strip. */
.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.shot, .field-shot { margin: 0; }
.shot img, .field-shot img { display: block; width: 100%; height: auto; object-fit: cover; border-radius: var(--radius-photo); background: var(--mt-grey-4); }
.shot img { aspect-ratio: 3 / 4; }
.field-shot img { aspect-ratio: 21 / 9; object-position: 50% 30%; }
@media (max-width: 720px) { .field-shot img { aspect-ratio: 16 / 9; } }
.shot figcaption, .field-shot figcaption { margin-top: 8px; font-size: var(--t-sm); line-height: 1.5; color: var(--dim); }
.shot figcaption { font-family: var(--mono); letter-spacing: .02em; }
.field-shot { margin-bottom: 48px; }
@media (max-width: 720px) { .shots { grid-template-columns: repeat(4, 62%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin-inline: -20px; padding-inline: 20px; scroll-padding-inline: 20px; }
  .shot { scroll-snap-align: start; } }
.flight { display: grid; grid-template-columns: 1.7fr 1fr; gap: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.flight h3 { font-size: var(--t-md); margin-bottom: 12px; }
.chart { width: 100%; height: auto; display: block; }
/* V-025 (S-014): the wide chart above 640 px, the narrow one (drawn ~1:1) below. */
.chart-narrow { display: none; }
@media (max-width: 640px) { .chart-wide { display: none; } .chart-narrow { display: block; } }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.chart-wide .ch-tick, .chart-wide .ch-axis { font-size: 18px; }
.chart-narrow .ch-tick, .chart-narrow .ch-axis { font-size: 15px; }
.ch-tick { font-family: var(--mono); font-weight: 400; fill: var(--dim); }
.ch-axis { font-family: var(--mono); font-weight: 500; fill: var(--dim); }
.ch-line { fill: none; stroke: var(--mt-red-1); stroke-width: 3; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.js .flight:not(.in) .ch-line { stroke-dashoffset: 1; }
.js .flight.in .ch-line { transition: stroke-dashoffset 2.4s var(--ease); }
/* V-029: the OpenRocket curve, dashed and quiet, under the real one; one legend for both variants. */
.ch-sim { fill: none; stroke: var(--dim); stroke-width: 2; stroke-dasharray: 6 5; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 12px; padding: 0; list-style: none; font: 500 var(--t-sm)/1.4 var(--mono); color: var(--text); }
.ch-legend li { display: flex; align-items: center; gap: 8px; }
.ch-legend li::before { content: ""; width: 24px; border-top: 3px solid var(--mt-red-1); }
.ch-legend .lg-sim::before { border-top: 2px dashed var(--dim); }
.ch-mark circle { fill: var(--mt-grey-5); stroke: var(--mt-red-1); stroke-width: 2.5; }
.ch-mark text { font: 700 13px var(--mono); fill: var(--mt-grey-1); }
.ch-lead { stroke: var(--mt-red-1); stroke-width: 1.5; }
.ch-data { margin-top: 16px; }
.ch-data summary { cursor: pointer; font-weight: 500; color: var(--text); padding: 8px 0; }
.ch-data summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.ch-table { border-collapse: collapse; margin-top: 8px; font: 400 var(--t-sm)/1.4 var(--mono); }
.ch-table caption { text-align: left; color: var(--dim); padding-bottom: 8px; font-family: var(--font); }
.ch-table th, .ch-table td { text-align: right; padding: 4px 16px 4px 0; border-bottom: 1px solid var(--line); }
.ch-table th { color: var(--dim); font-weight: 500; font-family: var(--font); }
.events { display: grid; gap: 4px; align-content: center; }
.events li { display: grid; grid-template-columns: 28px 84px 1fr; column-gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.events li:first-child { border-top: 0; }
.ev-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--mt-grey-1); color: var(--mt-red-5); border: 2px solid var(--mt-red-1); font: 700 var(--t-sm)/1 var(--mono); align-self: center; grid-row: span 2; }
/* V-026 (A-007): the time sits on the tinted card, so it is plain text, not Rojo 1. */
.ev-t { font: 500 var(--t-sm)/1.4 var(--mono); color: var(--text); }
.events b { font-weight: 700; }
.ev-d { grid-column: 3; color: var(--dim); font-size: var(--t-sm); }
@media (max-width: 860px) { .flight { grid-template-columns: 1fr; padding: 20px; } }
.launch-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; margin-top: 24px; }
/* The results box keeps the row's height (as tall as the replay card); its content sits in the middle. */
.results { display: flex; flex-direction: column; justify-content: center; }
.results, .replay { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.results h3, .replay h3 { font-size: var(--t-md); margin-bottom: 16px; }
/* V-026 (A-021, S-016): two columns that may shrink, long values wrap instead of overflowing. */
.results ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.results li b { display: block; font: 700 var(--t-lg)/1.1 var(--mono); color: var(--text); overflow-wrap: anywhere; }
.results li span { color: var(--dim); font-size: var(--t-sm); }
.replay p { color: var(--dim); margin-bottom: 24px; }
/* V-026 (S-001): flat card, the accent only on its border. */
.replay { background: var(--surface); border: 1px solid var(--accent); }
/* V-030: the replay card shows what the link opens; the hint only on phones, where 3D is heavy. */
.replay-poster { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-photo); border: 1px solid var(--line); margin-bottom: 20px; }
.replay-hint { display: none; margin: 12px 0 0; color: var(--dim); font-size: var(--t-sm); }
@media (max-width: 640px) { .replay-hint { display: block; } }
@media (max-width: 860px) { .launch-grid { grid-template-columns: 1fr; } }


/* Launches page: the latest launch carries a badge; the earlier ones follow as cards. */
.launch-badge { display: inline-block; margin-bottom: 16px; padding: 8px 14px; border-radius: 999px;
  background: var(--mt-red); color: var(--mt-white); font: 700 var(--t-sm)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
/* The flight video with the telemetry: portrait, beside its text; stacked on phones. */
.flight-video { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 32px 64px; align-items: center; margin-top: 32px; }
.fv-video { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: var(--radius-photo); background: var(--mt-grey-5); }
.fv-text h3 { font-size: var(--t-md); margin-bottom: 12px; }
.fv-text { justify-self: center; max-width: 52ch; }
.fv-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; font-size: var(--t-sm); color: var(--dim); }
.fv-links > span { margin-right: 4px; }
.fv-link { gap: 6px; color: var(--text); text-decoration: none; }
.fv-note { margin-top: 12px; font: 500 var(--t-sm)/1.4 var(--mono); color: var(--dim); letter-spacing: .04em; }
@media (max-width: 720px) { .flight-video { grid-template-columns: 1fr; } .fv-video { max-width: 340px; margin: 0 auto; } .fv-text { justify-self: start; } }
.launch-cards { display: grid; gap: 24px; }
.launch-card { display: grid; grid-template-columns: 320px 1fr; max-width: 820px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
/* The card's photo only (a direct child): the mission patch in its head must not be cropped to 4:3. */
.launch-card > img { display: block; width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.launch-card-body { padding: 24px 28px; align-self: center; }
.launch-card-when { font: 500 var(--t-sm)/1.4 var(--mono); color: var(--dim); letter-spacing: .04em; margin-bottom: 8px; }
.launch-card h3 { font-size: var(--t-md); margin-bottom: 8px; }
@media (max-width: 640px) { .launch-card { grid-template-columns: 1fr; } }
.launch-card-facts { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.launch-card-facts dt { font-size: var(--t-sm); color: var(--dim); }
.launch-card-facts dd { margin: 2px 0 0; font: 700 var(--t-md)/1.2 var(--mono); color: var(--text); }

/* Mission patches (site/img/patches/, blocks/common.py patch_img): small, beside the rocket's name,
   never the focus. Lucentum's sits right of the launch header, level with the title (not the badge);
   on phones it stays on the right, beside the title, which keeps clear of it. */
.mission-patch { display: block; flex: none; height: auto; }
.launch-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 40px; align-items: start; }
.launch-top .mission-patch { width: 112px; margin-top: 52px; }
@media (max-width: 720px) {
  .launch-top { display: block; position: relative; }
  .launch-top .mission-patch { position: absolute; top: 48px; right: 0; width: 64px; margin: 0; }
  .launch-top .sec-head h2 { padding-right: 76px; }
}
.launch-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.launch-card-head .mission-patch { width: 56px; margin-top: 14px; }  /* level with the title */
/* ---- designs ---- */
.pcb { background: var(--mt-grey-5); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; color: var(--space-text);
  background-image: radial-gradient(70% 90% at 50% 50%, rgba(163, 0, 6, .28), transparent 70%); }
/* Tabs wrap instead of overflowing at 320 px (A-003, S-018). */
.pcb-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pcb-tabs button { white-space: normal; min-height: 44px; padding: 0 12px; border-radius: 5px; border: 1px solid var(--space-line); background: transparent; color: var(--space-dim); font: 500 var(--t-sm)/1.2 var(--mono); text-transform: uppercase; letter-spacing: .04em; cursor: pointer; }
.pcb-tabs button[aria-selected="true"] { background: var(--mt-red); color: var(--mt-white); border-color: var(--mt-red); }
.pcb-stage { display: grid; }
.pcb-side { grid-area: 1 / 1; border-radius: var(--radius); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.pcb-side img { width: 100%; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .45)); }
.pcb-side[hidden] { display: block !important; opacity: 0; transform: rotateY(12deg) scale(.98); pointer-events: none; visibility: hidden; }

.designs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.design { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.design.wide { grid-column: 1 / -1; }
/* V-053: the real MT1 photo, 16:10 beside its text on a full row; stacked from 900 px down. */
.design.feature { grid-column: 1 / -1; flex-direction: row; }
.design.feature .design-img { flex: 0 0 58%; aspect-ratio: 16 / 10; }
.design.feature figcaption { align-self: center; padding: 28px 32px; }
@media (max-width: 900px) { .design.feature { flex-direction: column; } .design.feature .design-img { flex: none; } }
/* One 4:3 frame for every photo; portraits are cropped, not letterboxed (S-017). */
.design-img { position: relative; background: var(--mt-grey-5); aspect-ratio: 4 / 3; overflow: hidden; }
.design-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.design.fit-contain .design-img img { object-fit: cover; object-position: center 35%; }
/* Charts are never cropped: the whole sheet, contained on its own light background. */
.design.fit-sheet .design-img { background: var(--mt-white); }
.design.fit-sheet .design-img img { object-fit: contain; }
/* OpenRocket screenshots are cropped to the drawing; the white sheet sits in a light frame. */
.design.wide .design-img { aspect-ratio: auto; background: var(--mt-white); padding: 16px; }
.design.wide .design-img img { position: static; object-fit: contain; height: auto; }
:root[data-theme="dark"] .design.wide .design-img { background: var(--mt-grey-1); margin: 16px 16px 0; border-radius: var(--radius); }
:root[data-theme="dark"] .design.fit-sheet .design-img { background: var(--mt-grey-1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .design.wide .design-img { background: var(--mt-grey-1); margin: 16px 16px 0; border-radius: var(--radius); }
  :root:not([data-theme="light"]) .design.fit-sheet .design-img { background: var(--mt-grey-1); }
}
.design figcaption { padding: 20px 24px 24px; }
.design h3 { font-size: var(--t-md); margin-bottom: 8px; }
.design p { color: var(--dim); font-size: var(--t-base); }
@media (max-width: 900px) { .designs { grid-template-columns: 1fr 1fr; } }
/* Phone: a snap row instead of seven full-width cards (S-018). */
@media (max-width: 600px) {
  .designs { grid-auto-flow: column; grid-auto-columns: 80%; grid-template-columns: none;
    overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -20px; padding-inline: 20px; scroll-padding-inline: 20px; }
  .design { scroll-snap-align: start; }
  .design.wide, .design.feature { grid-column: auto; }
  .designs:has(> .design:only-child) { grid-auto-columns: 100%; }
  /* V-053: the two cards always shown (MT1 photo, OpenRocket) stack; only "Ver más" scrolls. */
  .designs-main { grid-auto-flow: row; grid-template-columns: 1fr; overflow: visible; margin-inline: 0; padding-inline: 0; }
}

.archs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.arch-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.arch-label { margin-bottom: 16px; }
.arch { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 10px; align-items: center; }
.arch-box:last-child .arch { grid-template-columns: 1fr auto 1fr; }
.arch-col { display: grid; gap: 10px; }
.node { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--bg); }
.node b { display: block; font-size: var(--t-sm); }
.node small { display: block; color: var(--dim); font-size: var(--t-sm); line-height: 1.4; margin-top: 2px; }
/* Full border, not a side tab (S-007). */
.node.core { border: 2px solid var(--accent); box-shadow: none; }
/* The wire is a still dashed line, no stripes and no endless animation (S-007, A-016). */
.wire { position: relative; display: grid; place-items: center; min-width: 44px; align-self: stretch; }
.wire::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed var(--accent); }
/* Label on an opaque surface in the text colour: no red text on a tint (A-006). */
.wire span { position: relative; font: 500 var(--t-sm)/1.2 var(--mono); background: var(--surface); color: var(--text); padding: 2px 4px; writing-mode: vertical-rl; transform: rotate(180deg); }
@media (max-width: 1060px) { .archs { grid-template-columns: 1fr; } }
/* Two nodes per row on phones keeps Diseño short (V-033); below 360 px long words need the full width. */
@media (min-width: 360px) and (max-width: 640px) { .arch-col { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .arch, .arch-box:last-child .arch { grid-template-columns: 1fr; }
  .wire { min-height: 36px; }
  .wire::before { left: 50%; right: auto; top: 0; bottom: 0; border-top: 0; border-left: 2px dashed var(--accent); }
  .wire span { writing-mode: horizontal-tb; transform: none; }
}

/* Shorter Diseño (V-033): the extra cards wait behind one disclosure. */
.design-more { margin: 24px 0 8px; }
.design-more summary { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--text); font: 500 var(--t-base)/1.2 var(--font); cursor: pointer; list-style: none; }
.design-more summary::-webkit-details-marker { display: none; }
.design-more summary::after { content: "+" / ""; font: 500 var(--t-md)/1 var(--mono); }
.design-more[open] summary::after { content: "\2212" / ""; }
.design-more summary:hover { border-color: var(--text); }
.design-more[open] summary { margin-bottom: 24px; }
.design-more:not([open]) > .designs { display: none; }
/* ---- roadmap (#estado, inside #proyecto): only "en curso" and "siguiente" (V-038) ---- */
.roadmap-block { margin-top: 64px; }
.roadmap-block .sub-title { margin-top: 0; margin-bottom: 12px; }
.rm-lede { margin-bottom: 32px; }
.roadmap { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-width: 820px; }
.rm { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 20px; padding: 0 0 28px; }
/* The progress line is drawn per item from its status class, so it stops where the work does
   (S-021; CSP forbids inline styles). The last item draws none. */
.rm::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.rm-doing::before { background: var(--accent); }
.rm:last-child::before { content: none; }
.rm-dot { width: 24px; height: 24px; border-radius: 50%; background: var(--bg); border: 3px solid var(--mt-grey-3); margin-top: 2px; z-index: 1; }
.rm-doing .rm-dot { border-color: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent); }
/* Pulse only once the list is in view, three beats, done within 5 s (A-016, S-006). */
.roadmap.in .rm-doing .rm-dot { animation: pulse 1.6s ease-in-out 3; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 6%, transparent); } }
.rm-meta { display: flex; align-items: center; gap: 10px; font: 500 var(--t-sm)/1.3 var(--mono); color: var(--dim); margin-bottom: 8px; flex-wrap: wrap; }
.rm h4 { font-size: var(--t-md); line-height: 1.3; margin: 0 0 4px; }
.rm p { color: var(--dim); }

.rm-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.rm-layout aside { position: sticky; top: calc(var(--top-h) + 24px); }
.rm-sum { background: var(--mt-grey-5); color: var(--space-text); border-radius: var(--radius); padding: 28px;
  background-image: radial-gradient(90% 80% at 100% 0%, rgba(163, 0, 6, .45), transparent 70%); }
.rm-nums { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rm-nums b { display: block; font: 700 var(--t-2xl)/1 var(--mono); }
.rm-nums .n-done { color: var(--mt-grey-1); } .rm-nums .n-doing { color: var(--mt-red-1); } .rm-nums .n-next { color: var(--mt-grey); }
.rm-nums span { font: 500 var(--t-sm)/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--space-dim); }
.rm-bar { display: flex; gap: 4px; }
.rm-bar .seg { flex: 1; height: 10px; border-radius: 3px; background: var(--mt-grey-4); }
.rm-bar .seg-done { background: var(--mt-grey-1); } .rm-bar .seg-doing { background: var(--mt-red-1); }
.rm-sum .note { color: var(--space-dim); margin-top: 16px; }
.rm-sum .note a { color: var(--mt-grey-1); }
@media (max-width: 860px) { .rm-layout { grid-template-columns: 1fr; gap: 24px; } .rm-layout aside { position: static; order: -1; } }
/* ---- team (#equipo): photos, then "Cómo nos organizamos" (V-037, N-1, S-019) ---- */
.team-size { margin-top: 12px; font-size: var(--t-md); font-weight: 500; color: var(--text); }

/* Lead group photo, 3:2 (P-03). Renders only when its file exists (blocks/team.py). */
.team-lead { margin: 0 0 20px; }
.team-lead img, .team-shot img { display: block; width: 100%; height: auto; object-fit: cover; border-radius: var(--radius-photo); background: var(--surface-2); }
.team-lead img { aspect-ratio: 3 / 2; }
.team-lead figcaption, .team-shot figcaption { margin-top: 8px; font-size: var(--t-sm); line-height: 1.5; color: var(--dim); }

/* Strip of 4:3 shots (P-04..P-07): a row on desktop, a snapping scroller on phones. */
.team-strip { margin: 0 0 8px; border-radius: var(--radius-photo); }
.team-strip ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.team-shot { margin: 0; }
.team-shot img { aspect-ratio: 4 / 3; }
@media (max-width: 959px) {
  .team-strip { overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding-bottom: 8px; }
  .team-strip ul { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%; }
  .team-strip li { scroll-snap-align: start; }
}

/* Departments: icon inline with the heading, no tile; 3 columns from 960 px, the 7th spans. */
.depts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 20px; }
.dept { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; box-shadow: var(--shadow); }
.dept h4 { display: flex; align-items: center; gap: 10px; font-size: var(--t-md); line-height: 1.3; margin: 0 0 8px; }
.dept h4 .ic { flex: none; width: 24px; height: 24px; color: var(--accent); }
.dept p { color: var(--dim); }
.dept-tools { margin-top: 12px; font: 400 var(--t-sm)/1.5 var(--font); }
.dept-tools span { color: var(--text); font-weight: 700; margin-right: 4px; }
@media (min-width: 640px) {
  .depts { grid-template-columns: repeat(2, 1fr); }
  .dept:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
  .depts { grid-template-columns: repeat(3, 1fr); }
  .dept:last-child:nth-child(odd) { grid-column: auto; }
  .dept:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
}

/* Department card with a photo of its work (V-050): 3:2 photo full-bleed on top, text below.
   From 960 px it spans two columns with the photo on the left, so its row keeps the height of a
   text card (no tall empty neighbours); 7 cards with 2 photo cards fill exactly 3 rows. */
.dept.has-photo { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.dept-photo { margin: 0; }
.dept-photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--surface-2); }
.dept-body { padding: 24px 28px; }
@media (min-width: 640px) and (max-width: 959px) { .depts:has(.has-photo) { align-items: start; } }
@media (min-width: 960px) {
  .dept.has-photo { grid-column: span 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dept-photo img { height: 100%; }
  .depts:has(.has-photo) .dept:last-child:nth-child(3n+1) { grid-column: auto; }
}
/* ---- tools ---- */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.tool > a { display: grid; grid-template-columns: 44px 1fr; gap: 16px; height: 100%; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.tool > a:hover { border-color: var(--accent); transform: translateY(-3px); }
.tool-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); background: var(--surface-2); color: var(--text); }
.tool h3 { font-size: var(--t-base); line-height: 1.4; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.tool p { color: var(--dim); font-size: var(--t-base); line-height: 1.55; margin: 0; }
.tool .ext { color: var(--dim); flex: none; }

/* Visually hidden, still read by screen readers: the " (opens in a new tab)" of every
   target=_blank link and the "(enlarge)" of gallery photos. Global by nature. */
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
/* The external icon makes a new-tab button wider; on the narrowest phones let its label wrap
   instead of pushing the card past the screen (1.4.10 at 320 px). */
.btn .ext { flex: none; }
@media (max-width: 400px) { .btn[target="_blank"] { white-space: normal; line-height: 1.3; } }
/* ---- gallery ---- */
/* Mosaic (style.md 8): row flow, a 4:3-ish cell by default, the shape of a photo picked in
   content/gallery.json (g-feature / g-tall / g-wide). Captions sit below the photo, never over. */
.g-group { font-size: var(--t-md); line-height: 1.3; margin: 32px 0 16px; }
.sec-head + .g-group { margin-top: 0; }
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 120px; grid-auto-flow: row dense; gap: 12px; }
.gallery li { grid-column: span 2; grid-row: span 2; min-width: 0; }
.gallery .g-feature { grid-column: span 4; grid-row: span 3; }
.gallery .g-tall { grid-column: span 2; grid-row: span 3; }
.gallery .g-wide { grid-column: span 3; grid-row: span 2; }
.gallery figure { display: flex; flex-direction: column; height: 100%; margin: 0; }
.g-link { display: block; flex: 1 1 0; min-height: 0; border-radius: var(--radius-photo); overflow: hidden; background: var(--surface-2); }
.g-link img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.g-link:hover img { transform: scale(1.03); }
.gallery figcaption { flex: none; font-size: var(--t-sm); line-height: 1.5; color: var(--dim); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) {
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 140px; }
  .gallery li, .gallery .g-wide { grid-column: span 2; grid-row: span 2; }
  .gallery .g-feature { grid-column: span 2; grid-row: span 2; }
  .gallery .g-tall { grid-column: span 1; grid-row: span 2; }
}

/* Lightbox: a native <dialog>; the <img> is created by js/parts/60-lightbox.js on open. */
.lightbox { border: 0; padding: 0; background: transparent; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; color: var(--mt-grey-1); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(30, 33, 33, .94); }
.lightbox figure { margin: 0; padding: 72px 72px 16px; max-width: 100%; text-align: center; }
.lightbox img { display: block; max-width: min(100%, 1200px); max-height: calc(100dvh - 160px); width: auto; height: auto; margin: 0 auto; border-radius: var(--radius-photo); }
.lightbox figcaption { margin-top: 12px; font-size: var(--t-base); line-height: 1.5; }
.lb-count { font-family: var(--mono); font-size: var(--t-sm); color: var(--mt-grey-1); margin-left: 8px; }
.lightbox .icon-btn { position: fixed; color: var(--mt-grey-1); border-color: rgba(246, 246, 246, .4); background: rgba(30, 33, 33, .6); }
.lb-close { top: 16px; right: 16px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
@media (max-width: 720px) {
  .lightbox figure { padding: 72px 8px 88px; }
  .lb-prev, .lb-next { top: auto; bottom: 24px; transform: none; }
  .lb-prev { left: calc(50% - 60px); }
  .lb-next { right: calc(50% - 60px); }
}
/* A group with a single photo (the first rocket, today) takes the full phone width instead of
   leaving an empty half beside a tall cell. */
@media (max-width: 720px) { .gallery li:only-child { grid-column: span 2; } }
/* ---- sponsors ---- */
/* "Lo que necesitamos" (V-035): rendered only when content/data/needs.json has items. */
.needs { margin-bottom: 40px; }
.needs h3 { font-size: var(--t-lg); margin-bottom: 16px; }
.needs-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.needs-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px 24px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--line); }
.needs-list b { font-weight: 500; }
.need-what { color: var(--dim); }
.need-cost { font-family: var(--mono); font-size: var(--t-sm); white-space: nowrap; }
@media (max-width: 860px) { .needs-list li { grid-template-columns: 1fr; } }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 16px; }
.tier { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.tier h3 { font-size: var(--t-lg); margin-bottom: 16px; }
.tier-amount { font: 500 var(--t-md)/1.3 var(--mono); margin: -8px 0 16px; }
.tier ul { display: grid; gap: 10px; }
.tier li { display: flex; gap: 10px; align-items: flex-start; color: var(--dim); }
.tier li .ic { color: var(--accent-text); margin-top: 3px; }
/* S-024: flat like the others, marked only by the border and the flag (no red tint under text). */
.tier-featured { border: 2px solid var(--mt-red-1); }
.tier-flag { position: absolute; top: -12px; left: 24px; background: var(--mt-red-1); color: var(--mt-red-5); font: 700 var(--t-sm)/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 6px 10px; border-radius: 999px; }
@media (max-width: 860px) { .tiers { grid-template-columns: 1fr; gap: 28px; } }
.tier-note { color: var(--dim); margin-bottom: 32px; }
.tiers + .sponsor-why { margin-top: 32px; }
.sponsor-why { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.sponsor-why h3 { font-size: var(--t-lg); margin-bottom: 16px; }
.sponsor-why .ticks { max-width: 70ch; }
.sponsor-why .note { margin-bottom: 24px; max-width: 70ch; }
.ticks { display: grid; gap: 10px; }
.ticks li { padding-left: 28px; position: relative; color: var(--dim); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 7px; width: 14px; height: 8px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }
@media (max-width: 860px) { .sponsor-why { padding: 24px; } }

/* V-055: the team photo leads the band (P-12). Beside the heading at 960 px and up, below it on a
   phone; 3:2 like the master, radius 14 px, caption under the photo, never over it. */
.sponsor-lead { display: grid; gap: 0 48px; margin-bottom: 48px; }
.sponsor-lead .sec-head { margin-bottom: 32px; }
@media (min-width: 960px) {
  .sponsor-lead { grid-template-columns: minmax(0, 1fr) minmax(0, 520px); align-items: center; }
  .sponsor-lead .sec-head { margin-bottom: 0; }
}
.sponsor-photo { margin: 0; }
.sponsor-photo img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-photo); }
.sponsor-photo figcaption { margin-top: 8px; color: var(--dim); font-size: var(--t-sm); line-height: 1.5; }
/* ---- join ---- */
.join { background: linear-gradient(180deg, var(--bg), var(--surface-2)); }
/* A-006: in the dark theme the band is plain Gris 5, so Rojo 1 text (numbers, email) keeps 4.5:1. */
:root[data-theme="dark"] .join { background: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .join { background: var(--bg); } }

/* S-025: steps as a plain numbered list; at 960 px and up a photo column beside them when
   site/img/join/ holds one (class has-photo), otherwise the list keeps the full width. */
.join-grid { display: grid; gap: 40px; margin-bottom: 40px; }
@media (min-width: 960px) { .join-grid.has-photo { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } }
.join-main { display: grid; gap: 40px; max-width: 760px; }
.steps { counter-reset: step; border-top: 1px solid var(--line); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 3ch minmax(0, 1fr); column-gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step) "."; grid-row: span 2; font: 500 var(--t-md)/1.3 var(--mono); color: var(--accent-text); }
.steps b { font-size: var(--t-md); line-height: 1.3; margin-bottom: 4px; }
.steps span { color: var(--dim); }

/* FAQ (V-036): only answered questions from content/data/faq.json render. */
.faq h3 { font-size: var(--t-lg); margin-bottom: 16px; }
.faq-list { margin: 0; display: grid; gap: 16px; }
.faq-item dt { font-weight: 500; }
.faq-item dd { margin: 4px 0 0; color: var(--dim); }

.join-photo { margin: 0; }
.join-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-photo); }
.join-photo figcaption { margin-top: 8px; color: var(--dim); font-size: var(--t-sm); }

.join-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.mail-line { color: var(--dim); }
.mail-line a { font-family: var(--mono); font-size: var(--t-base); white-space: nowrap; } /* wraps before the address, never inside it */
/* ---- history (#historia): a timeline of cards, oldest first (V-038, N-2) ---- */
.history { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 20px; }
.hist { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
/* The timeline: a grey bar across the top of every card; the latest step is red. */
.hist::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--mt-grey-3); }
.hist:last-child::before { background: var(--accent); }
.hist-body { padding: 24px 24px 28px; }
.hist-when { font: 500 var(--t-sm)/1.4 var(--mono); color: var(--dim); margin-bottom: 8px; }
.hist h3 { font-size: var(--t-md); line-height: 1.3; margin: 0 0 8px; }
.hist p { color: var(--dim); }
/* Photo (V-051): 4:3 above the text; with none the card is text only. */
.hist-photo { margin: 0; }
.hist-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); }
.hist-photo figcaption { padding: 8px 24px 0; font-size: var(--t-sm); line-height: 1.5; color: var(--dim); }
/* From 640 px: one card per row, a vertical timeline read top to bottom; a card with a photo
   puts it on the right, so text-only cards never stretch beside a tall photo card (V-051). The
   timeline mark stays the bar across the top: a coloured left edge on a card is a side-tab. */
@media (min-width: 640px) {
  .history { max-width: 960px; }
  .hist.has-photo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
  .hist.has-photo .hist-photo { grid-column: 2; grid-row: 1; }
  .hist.has-photo .hist-body { grid-column: 1; grid-row: 1; align-self: center; }
  .hist-photo figcaption { padding: 8px 16px 12px; }
}
/* ---- footer ---- */
.foot { background: var(--mt-grey-5); color: var(--space-dim); padding: 56px 0 calc(40px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--space-line); }  /* a dark last section (Patrocinio) no longer runs into it */
.foot-in { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 24px 48px; }
.foot-nav ul { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 4px 32px; align-content: start; }
.foot .logo { height: 28px; width: auto; color: var(--mt-white); margin-bottom: 16px; }
.foot-brand p { max-width: 48ch; }
.foot-links { display: grid; gap: 4px; align-content: start; }
.foot a { color: var(--space-text); display: inline-flex; min-height: 44px; align-items: center; gap: 6px; }
.foot-meta { grid-column: 1 / -1; border-top: 1px solid var(--space-line); padding-top: 20px; font-size: 14px; }
@media (max-width: 720px) { .foot-in { grid-template-columns: 1fr; } }

/* ---- reveal ---- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---- 404 ---- */
/* The illustration that was the hero until V-047 (rocket, starfield, HUD), drawn only on the
   404 pages now (blocks/notfound.py). Every loop ends within 5 s (V-018, A-016). */
.stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1;
  -webkit-mask-image: radial-gradient(60% 60% at 75% 40%, #000 40%, transparent 75%); mask-image: radial-gradient(60% 60% at 75% 40%, #000 40%, transparent 75%); }
.stars .tw { animation: twinkle 1.4s ease-in-out 2 alternate; }
.stars .tw:nth-child(3n) { animation-delay: 1.1s; } .stars .tw:nth-child(4n) { animation-delay: 2.1s; }
@keyframes twinkle { from { opacity: .15; } to { opacity: 1; } }
.hero-art { position: relative; justify-self: center; width: min(320px, 100%); }
.hero-rocket { width: 100%; height: auto; overflow: visible; }
.hr-word { font: 700 20px/1 var(--font); letter-spacing: .3em; fill: var(--mt-red); }
.hr-ship { animation: hover-ship 2.4s var(--ease) 2 alternate; transform-origin: 200px 300px; }
.hr-flame { transform-origin: 200px 430px; animation: flame .35s linear 14 alternate; }
.hr-glow { animation: glow 1.6s ease-in-out 3 alternate; transform-origin: 200px 470px; }
.hr-path { stroke-dashoffset: 0; animation: dash 4.8s linear 1; }
@keyframes hover-ship { from { transform: translateY(8px); } to { transform: translateY(-14px); } }
@keyframes flame { from { transform: scaleY(.92) scaleX(1.02); } to { transform: scaleY(1.06) scaleX(.96); } }
@keyframes glow { from { opacity: .7; } to { opacity: 1; } }
@keyframes dash { to { stroke-dashoffset: -280; } }
/* A-024: opaque Gris 5 under the HUD, so the Rojo 1 label keeps 4.58:1 over the red glow. */
.hud { position: absolute; right: 0; top: 16%; display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 6px;
  font-family: var(--mono); color: var(--space-text); background: var(--mt-grey-5); border: 1px solid var(--space-line); border-radius: 10px; padding: 10px 14px; }
.hud span { grid-column: 1 / -1; font-size: var(--t-sm); color: var(--mt-red-1); letter-spacing: .14em; }
.hud b { font-size: var(--t-xl); font-weight: 700; }

/* Page layout; after the art rules so the phone sizes below win over .hero-art. */
.nf-main { position: relative; min-height: 100svh; display: grid; place-items: center; background: radial-gradient(120% 80% at 50% 100%, var(--mt-red-4), var(--mt-grey-5) 60%); color: var(--space-text); padding: 24px; isolation: isolate; }
/* V-047: the illustrated rocket that left the hero flies here, beside the message. */
.nf-in { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 280px); gap: 48px; align-items: center; }
.nf-box { max-width: 560px; }
.nf-box h1 { font-size: var(--t-2xl); margin-bottom: 12px; }
.nf-box h2 { font-size: var(--t-md); margin: 40px 0 8px; }
.nf-box p { margin-bottom: 16px; color: var(--space-dim); }
.nf-box a:not(.btn) { color: var(--space-text); text-decoration: underline; }
.nf-art { width: 100%; }
@media (max-width: 760px) {
  .nf-in { grid-template-columns: 1fr; gap: 0; }
  .nf-art { order: -1; width: 140px; justify-self: end; }
  .nf-art .hud { top: auto; bottom: 16px; right: 100%; margin-right: 8px; }
}

.nf-logo { height: 28px; width: auto; color: var(--mt-white); }
.nf-home { display: inline-block; }
/* V-047 (S-009 final): below 861 px the photo is a band at the top (16:9, or the 3:4 phone crop
   below 700 px) and the copy starts over the ground at the bottom of the photo on a bottom-up
   scrim, then continues on plain Gris 5. V-059: the phone crop is a tighter 3:4 around the rocket
   (twice its old size, launch pad and hills visible) and the scrim starts lower, so the band is
   taller and brighter. Measured at 390x844: the title sits on the opaque part and both CTAs are
   above the fold (tests/hero_contrast.sh). */
@media (max-width: 860px) {
  .hero { --photo-h: 56.25vw; display: block; min-height: auto; padding: calc(var(--photo-h) - 72px) 0 24px; }
  .hero-photo { bottom: auto; height: var(--photo-h); }
  .hero::before { bottom: auto; height: var(--photo-h);
    background:
      linear-gradient(to bottom, rgba(30, 33, 33, .72) 0, rgba(30, 33, 33, 0) 120px),
      linear-gradient(to bottom, rgba(30, 33, 33, 0) 45%, rgba(30, 33, 33, .9) 66%, var(--mt-grey-5) 74%); }
  .hero-img { object-position: 34% 30%; }
  /* 700-860 px: the band is 16:9 and would cut the portrait video to a sliver; the photo stays. */
  .hero-video, .hero-pause { display: none; }
  .hero-copy { width: 100%; }
  .hero-brand { font-size: clamp(40px, 11.5vw, 56px); }
  .hero-sub { font-size: var(--t-md); }
  .hero-lede { font-size: var(--t-base); margin-bottom: 24px; }
  .hero-link { margin-top: 16px; }
  .hero-caption { position: static; max-width: var(--wrap); margin: 16px auto 0; padding: 0 20px; }
  .section { padding: 72px 0; }
  .sub-title { margin-top: 48px; }
}
@media (max-width: 699.98px) {
  .hero { --photo-h: 133.33vw; padding-top: calc(var(--photo-h) - 140px); }
  .hero::before { background:
      linear-gradient(to bottom, rgba(30, 33, 33, .72) 0, rgba(30, 33, 33, 0) 120px),
      linear-gradient(to bottom, rgba(30, 33, 33, 0) 55%, rgba(30, 33, 33, .9) 67%, var(--mt-grey-5) 74%); }
  .hero-img { object-position: 50% 50%; }
  .hero-video { display: block; width: 100%; object-position: 50% 55%; }
  .hero-pause { display: inline-flex; top: calc(var(--top-h) + 12px); bottom: auto; right: 16px; }
  .hero-pause[hidden] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .flight:not(.in) .ch-line { stroke-dashoffset: 0; }
}
