/* Hallmark · macrostructure: Marquee Hero (the hero IS the instrument: two continents lit by rank) · tone: technical, warm · anchor hue: gold 85
 * theme: custom (css/tokens.css: obsidian field, gold lantern, one parchment note) · nav: static site-nav (templates/page-shell.html) · footer: Ft doors
 * pre-emit critique: P5 H4 E4 S5 R5 V4
 * css/modules/home.css: PAGE LAYOUT ONLY for index.html (mast, static map fallback, board frame, note card, doors).
 * The map overlay, board rows and market bar style themselves in their own module css. Tokens only; transform/opacity motion only;
 * mobile-first at 375px (no horizontal scroll: every grid track is minmax(0, 1fr)); <= 500 lines. */

/* Mast: short headline above the instrument. The lede carries the whole promise in two sentences; the stamp carries the market and the scan. */
.home-mast { padding-block: var(--space-4) var(--space-6); max-width: var(--measure); }
.home-mast h1 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display); font-weight: var(--display-wght); font-stretch: var(--display-wdth)%;
  font-size: var(--text-display-s); line-height: 1.02; letter-spacing: -0.015em; text-wrap: balance;
  overflow-wrap: anywhere; min-width: 0;
}
.home-mast .lede { margin: 0 0 var(--space-3); color: var(--text-secondary); max-width: 60ch; }
.home-mast-stamp { margin: 0; color: var(--text-muted); }

/* World map hero. The module root is a dark felt table; the static figure is the no-JS fallback that world-map.js replaces. */
.world-map {
  position: relative; margin-inline: calc(-1 * var(--gutter)); padding: var(--space-3) var(--gutter);
  background: var(--map-felt); border-block: 1px solid var(--border-subtle);
}
.wm-static { margin: 0; display: grid; gap: var(--space-3); grid-template-columns: minmax(0, 1fr); }
.wm-static .wm-art {
  display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius-card); border: 1px solid var(--border-subtle); background: var(--bg-surface);
}
.wm-credit { grid-column: 1 / -1; margin: 0; font-size: var(--text-xs); color: var(--text-muted); max-width: var(--measure); }
@media (min-width: 900px) {
  .wm-static { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); }
  .world-map { padding-block: var(--space-4); }
}
@media (min-width: 1232px) {
  .world-map { margin-inline: 0; border-inline: 1px solid var(--border-subtle); border-radius: var(--radius-card); }
}

/* Board frame: the module owns its rows; the page gives it air and a heading. */
.atlas-board { padding-block: var(--space-8) var(--space-4); }
.atlas-board > h2 { margin: 0 0 var(--space-3); font-size: var(--text-2xl); letter-spacing: -0.01em; }
.atlas-board .board-counts { margin: 0 0 var(--space-3); }
.atlas-board .sources { margin-top: var(--space-4); }

/* Note + doors: the one bright surface on the page beside the obsidian doors. */
.home-note { padding-block: var(--space-8) var(--space-4); display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.home-paper { display: grid; gap: var(--space-2); align-content: start; }
.home-paper > .stamp { margin: 0; }
.home-note-title { margin: var(--space-1) 0 0; font-size: var(--text-xl); line-height: 1.2; }
.home-note-title a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--color-gold-dim); text-underline-offset: 3px; }
.home-note-title a:hover { text-decoration-color: var(--ink); }
.home-note-zone { margin: 0; }
.home-note-foot { margin: var(--space-2) 0 0; }

/* Doors: three quiet obsidian cards. Count is the only large figure; it is a count of pages, dated by the build. */
.home-doors { display: grid; gap: var(--space-3); grid-template-columns: minmax(0, 1fr); }
.door {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name count" "stamp stamp";
  gap: var(--space-1) var(--space-3); align-items: baseline;
  padding: var(--space-4) var(--space-5); min-height: var(--tap);
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-card);
  color: var(--text-primary); text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.door:hover { background: var(--bg-surface-hover); border-color: var(--color-gold-dim); text-decoration: none; }
.door:active { background: var(--bg-surface-active); }
.door:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 2px; }
.door-name { grid-area: name; font-weight: 600; font-size: var(--text-lg); }
.door-count { grid-area: count; font-family: var(--font-mono); font-size: var(--text-2xl); color: var(--color-gold); font-variant-numeric: tabular-nums; }
.door > .stamp { grid-area: stamp; margin: 0; }

@media (min-width: 720px) {
  .home-doors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .home-note { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-6); align-items: start; }
  .home-doors { grid-template-columns: minmax(0, 1fr); }
  .home-mast { padding-block: var(--space-6) var(--space-8); }
}

@media (prefers-reduced-motion: reduce) {
  .door { transition: none; }
}
