/* ==========================================================================
   2099 Industries — styles.css
   1. Tokens   2. Base   3. Layout   4. Header   5. Hero
   6. Sections 7. Areas  7b. Explorations  8. Contact  9. Footer   10. Motion
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------
   Change the palette here; nothing below hard-codes a color.
   Contrast ratios are measured against --color-bg. */
:root {
  /* Base */
  --color-bg: #080b16;          /* night blue */
  --color-surface: #0d1222;     /* raised surface (cards, rows) */
  --color-surface-2: #111831;   /* surface on hover */
  --color-text: #e9ecf5;        /* cool white       (16.6:1) */
  --color-muted: #8e95ab;       /* blue-grey        (6.3:1)  */
  --color-line: #1a2033;        /* hairlines, decorative only */
  --color-line-strong: #2a3352;

  /* Accent: magenta, for small details only — never blocks or body text */
  --color-accent: #f0619e;      /* (6.4:1) */
  --color-accent-soft: rgb(240 97 158 / 0.35);

  /* Light: used only in the ruler sweep, card accent line and atmosphere */
  --color-violet: #7b5cff;
  --color-blue: #3d7bff;
  --color-teal: #1b8ea6;

  /* Type: system stack only, no web-font requests */
  --font-sans: "Helvetica Neue", Helvetica, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Arial, sans-serif;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: clamp(1.25rem, 1.05rem + 0.9vw, 1.625rem);
  --text-xl: clamp(1.5rem, 1.1rem + 1.8vw, 2.5rem);
  --text-display: clamp(5.5rem, 3rem + 20vw, 20.5rem); /* Cap reached at approximately 1400px. */

  /* Space (8px rhythm) */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-section: clamp(5rem, 3rem + 6vw, 8rem);

  /* Shape */
  --radius-card: 12px;
  --radius-pill: 999px;
  --hex: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);

  /* Layout */
  --container: 76rem;
  --gutter: clamp(1.25rem, 0.75rem + 3vw, 3rem);
  --header-h: 4.5rem;
  --tap: 2.75rem;               /* 44px minimum touch target */

  /* Motion: slow and soft */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 1000ms;
}

/* 2. Base ---------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: env(safe-area-inset-top, 0px);
  background: var(--color-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  font-feature-settings: "lnum", "tnum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

h1, h2, h3, p, ul { margin: 0; }
ul[role="list"],
ol[role="list"] { list-style: none; padding: 0; margin: 0; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--color-accent); color: var(--color-bg); }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

main:focus,
.section:focus { outline: none; } /* programmatic focus targets, not controls */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + var(--space-2));
  left: var(--gutter);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 var(--space-2);
  background: var(--color-text);
  color: var(--color-bg);
  font-size: var(--text-sm);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* 3. Layout -------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px))
                  max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* 4. Header -------------------------------------------------------------- */
.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  padding-top: env(safe-area-inset-top, 0px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--header-h);
}

/* Wordmark: placeholder for the future logo, same footprint either way. */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6em;
  font-size: var(--text-sm);
  line-height: 1;
  white-space: nowrap;
}
.wordmark__year { font-weight: 700; letter-spacing: -0.02em; }
.wordmark__name {
  font-size: 0.78em;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--color-muted);
  transition: color 300ms ease;
}
a.wordmark { padding-block: calc((var(--tap) - 1em) / 2); } /* exactly 44px tap height */
a.wordmark:hover .wordmark__name { color: var(--color-text); }

/* INDEX toggle: the single visible navigation control */
.index-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  min-height: var(--tap);
  margin-right: -0.25rem;          /* optical: aligns the label with the container edge */
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: var(--color-muted);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.32em;          /* same tracking as the wordmark name */
  text-transform: uppercase;
  cursor: pointer;
  transition: color 300ms ease;
}
.index-toggle__label { margin-right: -0.32em; } /* cancels trailing tracking */

/* Hairline under the label, same language as the email links */
.index-toggle::after {
  content: "";
  position: absolute;
  left: calc(1rem + 0.7em + 0.25rem);
  right: 0.25rem;
  bottom: 0.7rem;
  height: 1px;
  background: var(--color-text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 500ms var(--ease);
}

.index-toggle__mark {
  width: 1rem;
  height: 1rem;
  flex: none;
  overflow: visible;
  transition: transform 200ms ease;
}
.index-toggle:active .index-toggle__mark { transform: scale(0.9); }
.index-toggle__mark polygon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
.index-toggle__mark circle {
  fill: var(--color-line-strong);
  transition: fill 300ms ease;
}

@media (hover: hover) {
  .index-toggle:hover { color: var(--color-text); }
  .index-toggle:hover::after { transform: scaleX(1); }
}
.index-toggle:focus-visible::after { transform: scaleX(1); }

/* Open state: label brightens, the node inside the hexagon lights up */
.site-nav:has(.index-panel:popover-open) .index-toggle { color: var(--color-text); }
.site-nav:has(.index-panel:popover-open) .index-toggle__mark circle { fill: var(--color-accent); }

/* INDEX panel: a quiet sheet aligned under the toggle. Hidden by default; only
   browsers with the Popover API can open it (see fallback below). */
.index-panel {
  display: none;
  position: fixed;
  inset: auto;
  top: calc(env(safe-area-inset-top, 0px) + var(--header-h));
  right: calc(max(0px, (100% - var(--container)) / 2) + var(--gutter));
  width: min(23rem, calc(100% - 2 * var(--gutter)));
  max-height: calc(100% - var(--header-h) - env(safe-area-inset-top, 0px) - var(--space-3));
  margin: 0;
  padding: var(--space-1) var(--space-3);
  overflow: auto;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-card);
}
.index-panel:popover-open { display: block; }
.index-panel::backdrop { background: transparent; }

.index-list > li + li { border-top: 1px solid var(--color-line); }

.index-item {
  position: relative;
  display: grid;
  grid-template-columns: 2.25rem 1fr auto;
  align-items: center;
  gap: var(--space-2);
  min-height: 3.25rem;
  font-size: var(--text-sm);
}

.index-item__num {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.index-item__name {
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.index-item__status {
  font-size: var(--text-xs);
  color: var(--color-muted);
  white-space: nowrap;             /* "En desarrollo" stays on one line */
}

/* Reserved entries (not yet live): present, but clearly inactive */
.index-item--reserved .index-item__name { color: var(--color-muted); }

/* Live entries: a hairline draws under the name on hover/focus */
a.index-item .index-item__name {
  justify-self: start;
  background: linear-gradient(var(--color-text), var(--color-text)) left 100% / 0% 1px no-repeat;
  transition: background-size 200ms var(--ease);
}
a.index-item .index-item__num { transition: color 200ms ease; }
a.index-item:focus-visible .index-item__name,
a.index-item:active .index-item__name { background-size: 100% 1px; }   /* :active = touch feedback */
a.index-item:focus-visible .index-item__num,
a.index-item:active .index-item__num { color: var(--color-text); }
@media (hover: hover) {
  a.index-item:hover .index-item__name { background-size: 100% 1px; }
  a.index-item:hover .index-item__num { color: var(--color-text); }
}
a.index-item:focus-visible { outline-offset: 2px; }

/* Section currently on screen: number brightens, a node appears in the empty status column */
a.index-item[aria-current] .index-item__num { color: var(--color-text); }
a.index-item[aria-current]::after {
  content: "";
  justify-self: end;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--color-accent);
}

/* Without the Popover API the toggle would do nothing, so it is not shown.
   Every section stays reachable by scrolling. */
@supports not selector(:popover-open) {
  .index-toggle { display: none; }
}

/* 5. Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-bottom: clamp(3rem, 6vw - 3rem, 4.5rem);
  overflow: hidden;
  isolation: isolate;
}

/* Atmosphere: petrol haze upper left, faint violet low right, both fading
   into the page. Very low opacity on purpose. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse 60% 55% at 12% 8%, rgb(27 142 166 / 0.13), transparent 70%),
    radial-gradient(ellipse 55% 50% at 92% 88%, rgb(123 92 255 / 0.08), transparent 70%),
    linear-gradient(to bottom, transparent 70%, var(--color-bg));
}

/* Drafting grid, fading out from the upper left. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, var(--color-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--color-line) 1px, transparent 1px);
  background-size: 6rem 6rem;
  opacity: 0.7;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 25% 30%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 65% at 25% 30%, #000 0%, transparent 78%);
}

/* Concentric hexagons: draw in once, then rest. They answer the pointer (§10). */
.hero__geometry {
  position: absolute;
  z-index: -1;
  top: 50%;
  /* Anchored to the container's right edge, so it stays with the content on wide screens */
  right: max(calc(max(0px, (100% - var(--container)) / 2) - 16rem), -6vw);
  width: min(48rem, 56vw);
  height: auto;
  transform: translateY(-56%);
  overflow: visible;
  opacity: 0.8;
  pointer-events: none;
}

/* Large desktop: reduce geometry to match the capped numerals. */
@media (min-width: 100rem) {
  .hero__geometry {
    width: 43rem;
  }
}

/* Trace uses each hexagon's real perimeter (6 × radius in viewBox units),
   which every browser handles consistently. */
.geo-line {
  --len: 1620;                 /* outer: 6 × 270 */
  fill: none;
  stroke: var(--color-line-strong);
  stroke-width: 0.9;
  stroke-dasharray: var(--len);
}
.geo-line--inner {
  --len: 1020;                 /* inner: 6 × 170 */
  stroke: var(--color-line);
}

.geo-nodes circle { fill: var(--color-line-strong); }
.geo-nodes .geo-node--lit { fill: var(--color-accent); }

/* Narrow phones: the lit node falls behind the numerals, so it reverts to a
   neutral node rather than moving the geometry. The 2099 takes priority. */
@media (max-width: 24rem) {
  .geo-nodes .geo-node--lit { fill: var(--color-line-strong); }
}

/* Portrait screens: hang from the header instead of centering on a tall hero */
@media (orientation: portrait) {
  .hero__geometry {
    top: 4.5rem;
    transform: none;
  }
}

@media (max-width: 48rem) {
  .hero__geometry {
    top: 4.5rem;
    right: -38vw;
    width: min(105vw, 40rem);
    transform: none;
    opacity: 0.6;
  }
}

.hero__inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-5);
}

.hero__title {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  line-height: 1;
  /* Very slight scroll drift, driven by script.js */
  transform: translate3d(0, var(--drift, 0px), 0);
}

.hero__year {
  font-size: var(--text-display);
  line-height: 0.82;
  letter-spacing: -0.065em;
  margin-left: -0.04em; /* optical alignment of the "2" */
  color: var(--color-text); /* fallback: solid numerals */
}

/* Barely-there tonal shift from top to bottom gives the numerals depth.
   Applied only where text clipping is supported, so the fallback above stays visible. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero__year {
    background: linear-gradient(to bottom, var(--color-text) 55%, #b9c0d6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.hero__name {
  margin-top: var(--space-3);
  font-size: clamp(0.9rem, 0.7rem + 1.2vw, 1.5rem);
  font-weight: 500;
  letter-spacing: 0.62em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* Horizon ruler: 2026 → 2099, one tick per year (73 intervals),
   taller ticks on each decade (2030 … 2090). */
.horizon {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-muted);
}
.horizon__label--start { color: var(--color-text); }

.horizon__track {
  position: relative;
  height: 1rem;
}

/* Year ticks + baseline */
.horizon__rule {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--color-line-strong), var(--color-line-strong)) left 50% / 100% 1px no-repeat,
    repeating-linear-gradient(to right, var(--color-line-strong) 0 1px, transparent 1px calc(100% / 73)) left 50% / 100% 30% no-repeat;
  transform-origin: left center;
}

/* On narrow screens yearly ticks become noise: keep baseline + decades only */
@media (max-width: 34rem) {
  .horizon__rule {
    background: linear-gradient(var(--color-line-strong), var(--color-line-strong)) left 50% / 100% 1px no-repeat;
  }
}

/* Decade ticks: start at 2030 (4/73 along), repeat every 10 years */
.horizon__track::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(100% * 4 / 73);
  right: 0;
  background: repeating-linear-gradient(to right, #3a4569 0 1px, transparent 1px calc(100% * 10 / 69));
  transform-origin: left center;
}

/* Light sweep along the ruler (violet → blue): a 900ms pass, repeated every 15s by script.js. */
.horizon__track::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 22%;
  height: 1px;
  margin-top: -0.5px;
  background: linear-gradient(to right, transparent, var(--color-violet), var(--color-blue), transparent);
  box-shadow: 0 0 6px rgb(91 108 255 / 0.25);
  opacity: 0;
  pointer-events: none;
}

.horizon__marker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-bg), 0 0 14px 2px var(--color-accent-soft);
  transform: translate(-50%, -50%);
}

.hero__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
}

.hero__lead {
  max-width: 22ch;
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.status__dot {
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--color-accent);
}

/* 6. Sections ------------------------------------------------------------ */
.section {
  position: relative;
  padding-block: var(--space-section);
  border-top: 1px solid var(--color-line);
}

/* Small hexagonal node where the divider meets the label column. */
.section::before {
  content: "";
  position: absolute;
  top: -5px;
  left: calc(max(0px, (100% - var(--container)) / 2) + var(--gutter) - 4.5px);
  width: 9px;
  height: 10px;
  background: var(--color-line-strong);
  clip-path: var(--hex);
}

.section__grid {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 56rem) {
  .section__grid {
    grid-template-columns: minmax(10rem, 1fr) 3fr;
    gap: var(--space-5);
    align-items: baseline; /* label sits on the first line of its content */
  }
}

.section__title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.01em;
}

.section__body {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.statement {
  max-width: 28ch;
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.015em;
}

.prose {
  max-width: 62ch;
  color: var(--color-muted);
}

/* 7. Areas --------------------------------------------------------------- */
.areas {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* 1 column → 2 → 4 */
@media (min-width: 40rem) {
  .areas { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 64rem) {
  .areas { grid-template-columns: repeat(4, 1fr); }
}

/* Mark → space → title → text, aligned from the top so titles line up
   across a row regardless of description length. */
.area {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 13.5rem;
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: background-color 500ms var(--ease), border-color 500ms var(--ease), transform 500ms var(--ease);
}

/* Accent line that draws across the top edge on hover */
.area::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--radius-card);
  right: var(--radius-card);
  height: 1px;
  background: linear-gradient(to right, var(--color-accent), var(--color-violet) 60%, transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 500ms var(--ease);
}

.area__mark {
  width: 2rem;
  height: 2rem;
  flex: none;
  overflow: visible;
  transform-origin: left center;
  transition: transform 500ms var(--ease);
}
.area__mark polygon {
  fill: none;
  stroke: var(--color-line-strong);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: stroke 500ms var(--ease);
}
.area__mark circle {
  fill: var(--color-muted);
  transition: fill 500ms var(--ease);
}

.area__title {
  margin-top: var(--space-5);
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.area__text {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

@media (hover: hover) {
  .area:hover {
    background: var(--color-surface-2);
    border-color: var(--color-line-strong);
    transform: translateY(-2px);
  }
  .area:hover .area__mark { transform: scale(1.08); }
  .area:hover::before { transform: scaleX(1); }
  .area:hover .area__mark polygon { stroke: #4a5680; }
  .area:hover .area__mark circle { fill: var(--color-accent); }
}

@media (max-width: 39.99rem) {
  .area { min-height: 0; }
  .area__title { margin-top: var(--space-3); }
}

/* 7b. Explorations -------------------------------------------------------
   Concept visuals in the same frame as the area cards. The photos keep their
   own dark backgrounds; a soft fade at the foot of each image merges it into
   the caption, so they read as part of the page rather than pasted rectangles. */
.explorations {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}
@media (min-width: 64rem) {
  .explorations { grid-template-columns: repeat(3, 1fr); }
}

/* The caption fade colour is a registered property so it can animate,
   matching the surface change of the area cards on hover. */
@property --fade {
  syntax: "<color>";
  inherits: true;
  initial-value: #080b16;
}

.exploration {
  --fade: var(--color-bg);
  position: relative;
  overflow: hidden;
  background: var(--fade);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  transition: border-color 500ms var(--ease), transform 500ms var(--ease), --fade 500ms var(--ease);
}

/* Same accent line as the area cards, drawn above the photo */
.exploration::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--radius-card);
  right: var(--radius-card);
  z-index: 2;
  height: 1px;
  background: linear-gradient(to right, var(--color-accent), var(--color-violet) 60%, transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 500ms var(--ease);
}

.exploration figure {
  position: relative;
  margin: 0;
}

/* Fade from the photo into the caption strip */
.exploration figure::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(to bottom, transparent, var(--fade) 92%);
  pointer-events: none;
}

.exploration img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 500ms var(--ease);
}

.exploration figcaption {
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  bottom: var(--space-2);
  z-index: 1;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}

@media (hover: hover) {
  .exploration:hover {
    --fade: var(--color-surface-2);
    border-color: var(--color-line-strong);
    transform: translateY(-2px);
  }
  .exploration:hover::before { transform: scaleX(1); }
  .exploration:hover img { transform: scale(1.03); }
}

/* Phones: a horizontal strip that swipes, instead of a long column of images */
@media (max-width: 39.99rem) {
  ul.explorations { /* ul. beats the ul[role="list"] reset's margin/padding */
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 78%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    /* Strip runs to the screen edges; the first image still aligns with the text */
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
    padding-bottom: var(--space-2);
    scrollbar-width: thin;
    scrollbar-color: var(--color-line-strong) transparent;
  }
  .exploration { scroll-snap-align: start; }
}

/* 8. Contact ------------------------------------------------------------- */
.contacts {
  display: grid;
  gap: var(--space-2);
}

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  transition: border-color 500ms var(--ease);
}
.contact:hover,
.contact:focus-within { border-color: var(--color-line-strong); }

.contact__label {
  font-size: var(--text-base);
  font-weight: 500;
}

.contact__text {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* The description wraps inside its column before the email drops to a new line */
.contact__meta { flex: 1 1 14rem; min-width: 0; }

.contact__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.contact__email {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  /* Underline that grows from the left on hover/focus */
  background: linear-gradient(to right, var(--color-accent), var(--color-violet)) left 85% / 0% 1px no-repeat;
  transition: background-size 500ms var(--ease);
}
.contact__email:hover,
.contact__email:focus-visible { background-size: 100% 1px; }

.copy-btn {
  flex: none;
  min-width: 4.75rem;
  min-height: var(--tap);
  padding: 0 var(--space-2);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-muted);
  font: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
  transition: border-color 300ms ease, color 300ms ease, box-shadow 300ms ease, transform 200ms ease;
}
.copy-btn:hover {
  border-color: var(--color-accent-soft);
  color: var(--color-text);
  box-shadow: 0 0 0 3px rgb(240 97 158 / 0.08);
}
.copy-btn:active { transform: scale(0.97); }
.copy-btn.is-copied {
  border-color: var(--color-accent);
  color: var(--color-text);
  animation: confirm 500ms ease;
}

@media (max-width: 34rem) {
  .contact { padding: var(--space-2) var(--space-3); }
  .contact__actions { width: 100%; justify-content: space-between; }
  .contact__email { overflow-wrap: break-word; } /* never split an address mid-word */
}

/* Below 400px the longer address no longer fits beside Copy: stack both rows the same way */
@media (max-width: 25rem) {
  .contact__actions { flex-direction: column; align-items: flex-start; gap: var(--space-1); }
}

/* Back to top: a zero-height sticky rail at the end of <main>. It rides the
   bottom of the viewport and stops above the footer on its own. */
.to-top-rail {
  position: sticky;
  bottom: 0;
  height: 0;
  z-index: 4;
}

.to-top {
  position: absolute;
  right: calc(max(0px, (100% - var(--container)) / 2) + var(--gutter));
  bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: var(--tap);
  padding: 0 1.1rem 0 1rem;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.32em;            /* same tracking as INDEX */
  text-transform: uppercase;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease), visibility 0s linear 500ms,
              color 300ms ease, border-color 300ms ease;
}
.to-top.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 500ms var(--ease), transform 500ms var(--ease), visibility 0s,
              color 300ms ease, border-color 300ms ease;
}
.to-top:focus-visible { color: var(--color-text); }
.to-top:active { transform: scale(0.97); }

@media (hover: hover) {
  .to-top:hover { color: var(--color-text); border-color: var(--color-accent-soft); }
}

/* 9. Footer -------------------------------------------------------------- */
.site-footer {
  position: relative;
  padding-block: var(--space-5);
  font-size: var(--text-xs);
  color: var(--color-muted);
  /* Faint violet light rising from the bottom edge */
  background: radial-gradient(ellipse 60% 120% at 50% 130%, rgb(123 92 255 / 0.05), transparent 70%);
}

/* Divider that fades out at both ends */
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-line-strong) 20%, var(--color-line-strong) 80%, transparent);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.wordmark--footer { color: var(--color-text); }

/* 10. Motion ------------------------------------------------------------- */

/* Hero load sequence: the one orchestrated moment on the page. */
@keyframes rise {
  from { opacity: 0; transform: translateY(0.75rem); }
  to   { opacity: 1; transform: none; }
}
@keyframes draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes appear {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes trace {
  from { stroke-dashoffset: var(--len); }
  to   { stroke-dashoffset: 0; }
}
/* One pass along the ruler: the 22%-wide light travels to the end of the track
   (78% of the track = 354.55% of its own width). Transform only, no layout. */
@keyframes sweep {
  0%   { transform: translateX(0);       opacity: 0; }
  18%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateX(354.55%); opacity: 0; }
}
@keyframes geo-ripple {
  0%   { transform: scale(1);    opacity: 0; }
  12%  { opacity: 0.55; }
  100% { transform: scale(1.06); opacity: 0; }
}
@keyframes settle {
  from { box-shadow: 0 0 0 4px var(--color-bg), 0 0 26px 8px var(--color-accent-soft); }
  to   { box-shadow: 0 0 0 4px var(--color-bg), 0 0 14px 2px var(--color-accent-soft); }
}
@keyframes index-in {
  from { opacity: 0; transform: translateY(-0.375rem); }
  to   { opacity: 1; transform: none; }
}
@keyframes confirm {
  from { opacity: 0.4; }
  to   { opacity: 1; }
}
@keyframes breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.intro {
  animation: rise var(--dur) var(--ease) both;
  animation-delay: var(--delay, 0ms);
}

/* Geometry traces itself in, slowly, behind the title */
.geo-line {
  animation: trace 2800ms var(--ease) both;
  animation-delay: 200ms;
}
.geo-line--inner { animation-delay: 600ms; }
.geo-nodes {
  animation: appear 1200ms ease both;
  animation-delay: 1800ms;
}

/* Ruler: baseline draws, decade ticks follow, one sweep, marker settles.
   The first sweep is CSS (runs even without JS). script.js replays it every 15s
   by setting --sweep-delay to 0 and restarting it through .is-resetting. */
.horizon__rule {
  animation: draw 1600ms var(--ease) both;
  animation-delay: 450ms;
}
.horizon__track::before {
  animation: draw 1600ms var(--ease) both;
  animation-delay: 650ms;
}
.horizon__track::after {
  animation: sweep 900ms cubic-bezier(0.45, 0, 0.25, 1) var(--sweep-delay, 1700ms) both;
}
.horizon__track.is-resetting::after { animation: none; }
.horizon__marker {
  animation:
    appear 800ms ease 1500ms both,
    settle 2200ms ease 1500ms both;
}

/* Hexagon pointer response (classes set by script.js after the opening trace).
   Mouse/pen over the hexagons: lines take a blue tint and grow 1.5% around their
   own centre (the SVG itself never moves). Entry or tap: one outline ripple. */
.geo-line,
.geo-nodes {
  transform-box: fill-box;
  transform-origin: center;
  transition: stroke 400ms ease, scale 400ms var(--ease);
}
.hero__geometry.is-engaged :is(.geo-line, .geo-nodes) { scale: 1.015; }
.hero__geometry.is-engaged .geo-line { stroke: #34519c; }
.hero__geometry.is-engaged .geo-line--inner { stroke: #253c72; }

.geo-ripple {
  fill: none;
  stroke: var(--color-blue);
  stroke-width: 1;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.hero__geometry.is-rippling .geo-ripple {
  animation: geo-ripple 1100ms cubic-bezier(0.2, 0.6, 0.2, 1) both;
}

/* INDEX opens with a short, quiet settle; closing is instant */
.index-panel:popover-open {
  animation: index-in 500ms var(--ease) both;
}

/* The only continuous motion: a slow, gentle breath on the status dot */
.status__dot {
  animation: breathe 5s ease-in-out 3s infinite;
}

/* Section reveal (class toggled by script.js; content stays visible without JS).
   Label first, then body, then each card. Animations rather than transitions, so
   hover transitions never inherit the stagger delays. Content is hidden only while
   JS is running and the section has not been reached yet. */
.js [data-reveal]:not(.is-visible) > *,
.js [data-reveal]:not(.is-visible) :is(.area, .exploration) { opacity: 0; }

.js [data-reveal].is-visible > *,
.js [data-reveal].is-visible :is(.area, .exploration) {
  animation: rise var(--dur) var(--ease) backwards;
}
.js [data-reveal].is-visible > :nth-child(2) { animation-delay: 120ms; }
.js [data-reveal].is-visible :is(.area, .exploration):nth-child(1) { animation-delay: 240ms; }
.js [data-reveal].is-visible :is(.area, .exploration):nth-child(2) { animation-delay: 320ms; }
.js [data-reveal].is-visible :is(.area, .exploration):nth-child(3) { animation-delay: 400ms; }
.js [data-reveal].is-visible :is(.area, .exploration):nth-child(4) { animation-delay: 480ms; }
.js [data-reveal].is-visible .exploration:nth-child(5) { animation-delay: 560ms; }
.js [data-reveal].is-visible .exploration:nth-child(6) { animation-delay: 640ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  /* No trace, sweep, breathing or entrance: everything renders in its final state. */
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 1ms !important;
  }

  .js [data-reveal]:not(.is-visible) > *,
  .js [data-reveal]:not(.is-visible) :is(.area, .exploration) { opacity: 1; }
  .hero__title { transform: none; }
  .geo-line { stroke-dashoffset: 0; }
  .horizon__track::after,
  .geo-ripple { display: none; }
}

/* 11. Footer links + secondary pages --------------------------------------
   Added for FAQ / Privacy / Terms / Accessibility. Only new rules: nothing
   above this line was changed. */

/* Footer: two rows on wide screens — brand + links, then legal + domain */
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-3);
}
.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--color-muted);
  background: linear-gradient(var(--color-text), var(--color-text)) left 75% / 0% 1px no-repeat;
  transition: color 300ms ease, background-size 500ms var(--ease);
}
.site-footer__links a:focus-visible,
.site-footer__links a[aria-current="page"] { color: var(--color-text); background-size: 100% 1px; }
@media (hover: hover) {
  .site-footer__links a:hover { color: var(--color-text); background-size: 100% 1px; }
}

@media (min-width: 40rem) {
  .site-footer__inner:has(.site-footer__links) {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--space-1) var(--space-4);
  }
  .site-footer__inner:has(.site-footer__links) .site-footer__domain { justify-self: end; }
}
@media (max-width: 39.99rem) {
  .site-footer__inner:has(.site-footer__links) { flex-direction: column; align-items: flex-start; }
  .site-footer__links { margin-left: -0.25rem; }
}

/* Secondary pages: same header and footer, content starts below the header */
.page {
  padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
}
.page .section:first-child { border-top: 0; }
.page .section:first-child::before { display: none; }

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: var(--tap);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.32em;            /* same tracking as INDEX */
  text-transform: uppercase;
  transition: color 300ms ease;
}
.page-back:focus-visible { color: var(--color-text); }
@media (hover: hover) { .page-back:hover { color: var(--color-text); } }

.page__title {
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.page__meta {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* FAQ-style accordion (native <details>, no JavaScript) */
.faq { border-top: 1px solid var(--color-line); }

.faq__item { border-bottom: 1px solid var(--color-line); }

.faq__item > summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 3.5rem;
  padding: var(--space-2) 0;
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.faq__item > summary::-webkit-details-marker { display: none; }

/* Hexagon marker: its node lights up when the answer is open, as in INDEX */
.faq__mark {
  flex: none;
  width: 1rem;
  height: 1rem;
  overflow: visible;
}
.faq__mark polygon {
  fill: none;
  stroke: var(--color-line-strong);
  stroke-width: 1.4;
  transition: stroke 300ms ease;
}
.faq__mark circle {
  fill: var(--color-line-strong);
  transition: fill 300ms ease;
}
.faq__item[open] .faq__mark circle { fill: var(--color-accent); }
.faq__item[open] .faq__mark polygon,
.faq__item > summary:focus-visible .faq__mark polygon { stroke: var(--color-muted); }
@media (hover: hover) {
  .faq__item > summary:hover .faq__mark polygon { stroke: var(--color-muted); }
}
.faq__item > summary:focus-visible { outline-offset: 2px; }

.faq__answer {
  display: grid;
  gap: var(--space-2);
  max-width: 68ch;
  padding: 0 0 var(--space-3) calc(1rem + var(--space-2));
  color: var(--color-muted);
}
.faq__answer ul { margin: 0; padding-left: 1.1rem; display: grid; gap: var(--space-1); }
.faq__answer a {
  color: var(--color-text);
  background: linear-gradient(to right, var(--color-accent), var(--color-violet)) left 100% / 100% 1px no-repeat;
}
.faq__item[open] .faq__answer { animation: rise 500ms var(--ease) both; }

/* 12. Language switch (English / Español) ---------------------------------
   Shown by i18n.js. Same type system as INDEX: small caps, wide tracking.
   ≥ 48rem "English / Español" · 27–48rem "EN / ES" · < 27rem one button with
   the other language · < 22.5rem (home only) it moves into the INDEX panel. */
.lang-switch {
  display: flex;
  align-items: center;
  margin-left: auto;               /* sits right, next to INDEX or Home */
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.lang-switch[hidden] { display: none; }

.lang-switch__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color 300ms ease;
}
.lang-switch__btn > span { margin-right: -0.32em; } /* cancels trailing tracking */

/* Hairline under the active language, same as the INDEX hover line */
.lang-switch__btn::after {
  content: "";
  position: absolute;
  left: 0.25rem;
  right: 0.25rem;
  bottom: 0.7rem;
  height: 1px;
  background: var(--color-text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 500ms var(--ease);
}
.lang-switch__btn[aria-pressed="true"] { color: var(--color-text); cursor: default; }
.lang-switch__btn[aria-pressed="true"]::after { transform: scaleX(1); }
.lang-switch__btn:focus-visible { color: var(--color-text); }
@media (hover: hover) {
  .lang-switch__btn:hover { color: var(--color-text); }
}

.lang-switch__sep { padding: 0 0.15rem; letter-spacing: 0; color: var(--color-line-strong); }

.lang-switch__short { display: none; }
@media (max-width: 47.99rem) {
  .lang-switch__long { display: none; }
  .lang-switch__short { display: inline; }
}

/* Small phones: one button that offers the other language */
@media (max-width: 26.99rem) {
  .site-header__inner { gap: var(--space-2); }
  .lang-switch--header .lang-switch__btn[aria-pressed="true"],
  .lang-switch--header .lang-switch__sep { display: none; }
}

/* Narrowest phones, home page: the header keeps only the wordmark and INDEX,
   and the switch appears as the last row of the INDEX panel. */
.lang-switch--panel {
  margin-left: 0;
  padding-top: var(--space-1);
  border-top: 1px solid var(--color-line);
}
@media (min-width: 22.5rem) {
  .lang-switch--panel { display: none; }
}
@media (max-width: 22.49rem) {
  .lang-switch--with-index { display: none; }
  .lang-switch--panel .lang-switch__long { display: inline; }
  .lang-switch--panel .lang-switch__short { display: none; }
  .page-back__label { display: none; }  /* secondary pages: "←" alone, named "Home" */
}

/* Secondary pages: legal text stays in English; this note explains it in Spanish */
.page__notice {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-card);
  font-size: var(--text-sm);
  color: var(--color-text);
}
