/* BlockWorld showcase: shared styles for the landing page and legal pages. */

/* Layout: a national-map sheet — framed sections on a 12-column grid, coordinates as labels, lake blue as the one loud colour. */
:root {
  --paper: #f3f5f2;
  --paper-2: #e7ece9;
  --ink: #0d1b26;
  --muted: #52626d;
  --rule: #c3cdd2;
  --lake: #1f6fc2;
  --lake-wash: #cbe2f4;
  --on-lake: #f3f8fc;
  --signal: #d7262e;

  --font-display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem);
  --step-3: clamp(2.2rem, 1.4rem + 3.4vw, 4.25rem);
  --step-hero: clamp(3.6rem, 1rem + 11vw, 11.5rem);

  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --space: clamp(4rem, 3rem + 5vw, 8rem);
  --max: 1320px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0b141b;
    --paper-2: #121e27;
    --ink: #e6edf0;
    --muted: #8e9ea8;
    --rule: #26343e;
    --lake: #5aa6ee;
    --lake-wash: #13324c;
    --on-lake: #06121c;
    --signal: #ff5a5f;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0b141b;
  --paper-2: #121e27;
  --ink: #e6edf0;
  --muted: #8e9ea8;
  --rule: #26343e;
  --lake: #5aa6ee;
  --lake-wash: #13324c;
  --on-lake: #06121c;
  --signal: #ff5a5f;
}

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--paper);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--lake); }
:focus-visible { outline: 3px solid var(--lake); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }

.wrap {
  max-width: calc(var(--max) + 2 * 16px);
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}

.label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.num { font-variant-numeric: tabular-nums; }

/* Placeholder text the owner must replace before going live. */
.todo {
  background: color-mix(in srgb, var(--signal) 14%, transparent);
  outline: 1px dashed var(--signal);
  padding-inline: 0.2em;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.9rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.wordmark:hover { color: inherit; }
.wordmark svg { width: 22px; height: 22px; }
.site-nav { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.site-nav a { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; }
@media (max-width: 720px) { .site-nav a:not(.nav-cta) { display: none; } }
.nav-cta { color: var(--lake); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.4rem;
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: var(--step-0);
  text-decoration: none;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}
.btn:hover { background: var(--lake); border-color: var(--lake); color: var(--on-lake); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn[aria-disabled="true"] { pointer-events: none; opacity: 0.55; }
.btn .arrow { font-family: var(--font-mono); }
.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border: 1px solid currentColor;
}

/* ---------- hero ---------- */
.hero { padding-block: clamp(2.5rem, 2rem + 3vw, 5rem) var(--space); }
.hero-grid {
  display: grid;
  gap: clamp(2rem, 1rem + 3vw, 4rem);
  align-items: end;
}
@media (min-width: 980px) { .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.hero-copy { display: grid; gap: 1.75rem; }
.hero h1 {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 850;
  font-size: var(--step-hero);
  line-height: 0.86;
  letter-spacing: -0.045em;
}
.hero h1 .ratio { display: block; color: var(--lake); }
.hero .lead { font-size: var(--step-1); max-width: 34ch; line-height: 1.45; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ---------- sheet map ---------- */
.sheet { margin: 0; display: grid; gap: 0.6rem; }
.sheet svg { width: 100%; height: auto; display: block; border: 2px solid var(--ink); background: var(--paper); }
.sheet svg { cursor: crosshair; }
.sheet .places g { cursor: pointer; }
.sheet .places g:hover text { fill: var(--lake); }
.sheet .marker path { stroke: var(--signal); stroke-width: 1.6; fill: none; }
.sheet .marker rect { fill: var(--signal); }
.sheet .chunks { pointer-events: none; }

/* coordinates tool under the sheet */
.coords-tool { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem 1.25rem; align-items: end; padding-top: 0.4rem; }
.coords-read { display: grid; gap: 0.15rem; min-width: 0; }
.coords-lv95 { font-family: var(--font-display); font-stretch: 112%; font-weight: 750; font-size: var(--step-1); line-height: 1.2; }
.coords-cmd { font-family: var(--font-mono); font-size: 0.9rem; color: var(--lake); overflow-wrap: anywhere; user-select: all; }
.coords-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.coords-help { grid-column: 1 / -1; color: var(--muted); font-size: var(--step--1); max-width: 70ch; }
@media (max-width: 520px) { .coords-tool { grid-template-columns: 1fr; } .coords-actions { justify-content: flex-start; } }
.btn--small { padding: 0.55rem 0.85rem; font-size: 0.9rem; cursor: pointer; }
.btn--small:hover { transform: none; box-shadow: none; }
.sheet .grid line { stroke: var(--rule); stroke-width: 0.6; }
.sheet .ticks line { stroke: var(--ink); stroke-width: 0.8; }
.sheet .lakes path { fill: var(--lake-wash); stroke: var(--lake); stroke-width: 0.7; stroke-linejoin: round; }
.sheet .lake-names text { fill: var(--lake); font-family: var(--font-display); font-style: italic; font-size: 8.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.sheet .places rect { fill: var(--ink); }
.sheet .places text { fill: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 10px; }
.sheet .places .hb rect { fill: var(--signal); }
.sheet .coords text { fill: var(--muted); font-family: var(--font-mono); font-size: 7px; }
.sheet .scale rect { stroke: var(--ink); stroke-width: 0.8; }
.sheet .scale text { fill: var(--ink); font-family: var(--font-mono); font-size: 7px; }
.sheet .chunks rect { fill: var(--paper-2); animation: chunk 420ms ease-out both; animation-delay: var(--d); }
@keyframes chunk { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet .chunks { display: none; } }

/* ---------- screenshots / placeholders ---------- */
.shot { margin: 0; position: relative; aspect-ratio: var(--ar, 16 / 9); max-width: 100%; background: var(--paper-2); overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.ar-16-9 { --ar: 16 / 9; }
.ar-4-3 { --ar: 4 / 3; }
.shot .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.35rem;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}
.shot .ph::before, .shot .ph::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
}
.shot .ph::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.shot .ph::after { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }
.shot .ph strong { font-family: var(--font-display); font-stretch: 112%; color: var(--ink); font-size: var(--step-0); }
.shot .ph span { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.04em; }
.shot .ph span, .shot .ph strong { background: var(--paper-2); padding-inline: 0.4rem; justify-self: center; }
.shot-caption { margin-top: 0.7rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- facts band ---------- */
.facts { border-block: 2px solid var(--ink); }
.facts dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.facts div { padding: 1.6rem 1.25rem; border-left: 1px solid var(--rule); display: grid; gap: 0.4rem; align-content: start; }
.facts div:first-child { border-left: 0; padding-left: 0; }
@media (max-width: 520px) {
  .facts dl { grid-template-columns: 1fr 1fr; }
  .facts div { border-left: 0; padding-left: 0; }
  .facts div:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}
.facts dt { order: 2; }
.facts dd { margin: 0; font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: var(--step-2); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---------- sections ---------- */
.section { padding-block: var(--space) 0; }
.section-head { display: grid; gap: 1.25rem; margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem); }
@media (min-width: 900px) { .section-head { grid-template-columns: 1fr 2fr; align-items: end; } }
.section-head h2 { font-family: var(--font-display); font-stretch: 125%; font-weight: 850; font-size: var(--step-3); line-height: 0.95; letter-spacing: -0.035em; }
.section-head p { max-width: 58ch; color: var(--muted); }
.section-head .label { grid-column: 1 / -1; display: flex; gap: 1rem; align-items: center; }
.section-head .label::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* feature rows: text + large shot, alternating */
.features { display: grid; gap: clamp(3.5rem, 2.5rem + 4vw, 6.5rem); }
.feature { display: grid; gap: clamp(1.5rem, 1rem + 2vw, 3rem); align-items: center; }
@media (min-width: 900px) {
  .feature { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .feature:nth-child(even) .feature-text { order: 2; }
}
.feature-text { display: grid; gap: 1rem; max-width: 46ch; }
.feature-text h3 { font-family: var(--font-display); font-stretch: 118%; font-weight: 800; font-size: var(--step-2); line-height: 1.05; letter-spacing: -0.02em; }
.feature-text .source { color: var(--lake); }
.feature-text ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.45rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.feature-text li { display: grid; grid-template-columns: 0.9rem 1fr; gap: 0.5rem; }
.feature-text li::before { content: ""; width: 7px; height: 7px; margin-top: 0.55em; background: var(--ink); }

/* compact feature index */
.index { margin-top: clamp(4rem, 3rem + 4vw, 7rem); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
@media (max-width: 900px) { .index { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .index { grid-template-columns: 1fr; } }
.index article { padding: 1.5rem 1.25rem 1.75rem 0; border-bottom: 1px solid var(--rule); display: grid; gap: 0.55rem; align-content: start; }
.index h3 { font-family: var(--font-display); font-stretch: 112%; font-weight: 750; font-size: var(--step-1); line-height: 1.15; }
.index p { color: var(--muted); font-size: 0.98rem; }

/* gallery mosaic */
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.gallery figure { grid-column: span 2; }
.gallery .shot { --ar: 4 / 3; }
.gallery .g-wide { grid-column: span 4; }
.gallery .g-wide .shot { --ar: 16 / 10; }
.gallery .g-tall { grid-row: span 2; }
.gallery .g-tall .shot { aspect-ratio: auto; height: 100%; min-height: 18rem; }
@media (max-width: 760px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery figure, .gallery .g-wide { grid-column: auto; grid-row: auto; }
  .gallery .g-tall .shot { aspect-ratio: 3 / 4; height: auto; min-height: 0; }
}
.gallery figure { margin: 0; display: grid; gap: 0.5rem; grid-template-rows: 1fr auto; }

/* download band */
.download { margin-top: var(--space); background: var(--lake); color: var(--on-lake); }
.download .wrap { padding-block: var(--space); display: grid; gap: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
@media (min-width: 980px) { .download .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.download h2 { font-family: var(--font-display); font-stretch: 125%; font-weight: 850; font-size: var(--step-3); line-height: 0.95; letter-spacing: -0.035em; }
.download .label { color: inherit; opacity: 0.8; }
.download-intro { display: grid; gap: 1.5rem; }
.download-intro p { max-width: 44ch; font-size: var(--step-1); line-height: 1.45; }
.download .btn { background: var(--on-lake); color: var(--lake); border-color: var(--on-lake); justify-self: start; }
.download .btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 var(--on-lake); }
.filecard { border: 2px solid var(--on-lake); }
.filecard dl { margin: 0; }
.filecard dl > div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 0.85rem 1.1rem; border-bottom: 1px solid color-mix(in srgb, var(--on-lake) 35%, transparent); }
.filecard dt { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.filecard dd { margin: 0; font-family: var(--font-mono); font-size: 0.92rem; overflow-wrap: anywhere; }
@media (max-width: 480px) { .filecard dl > div { grid-template-columns: 1fr; gap: 0.2rem; } }
.filecard ol { margin: 0; padding: 1.1rem 1.1rem 1.3rem; list-style: none; counter-reset: step; display: grid; gap: 0.8rem; }
.filecard li { counter-increment: step; display: grid; grid-template-columns: 2rem 1fr; gap: 0.5rem; }
.filecard li::before { content: counter(step); font-family: var(--font-mono); font-weight: 500; }
.download .todo { background: color-mix(in srgb, var(--on-lake) 22%, transparent); outline-color: var(--on-lake); }

/* recommended mods: one row per mod, category label first */
.mods { border-top: 2px solid var(--ink); }
.mods-row { display: grid; gap: 0.35rem 2rem; padding-block: 1.1rem; border-bottom: 1px solid var(--rule); align-items: baseline; }
@media (min-width: 900px) { .mods-row { grid-template-columns: 11rem minmax(0, 18rem) minmax(0, 1fr); } }
.mods-row h3 { font-family: var(--font-display); font-stretch: 112%; font-weight: 750; font-size: var(--step-1); line-height: 1.2; }
.mods-row h3 a { text-decoration: none; }
.mods-row h3 a::after { content: "\2009↗"; font-family: var(--font-mono); font-size: 0.8em; color: var(--lake); }
.mods-row h3 a:hover { text-decoration: underline; }
.mods-row > p:last-child { color: var(--muted); max-width: 62ch; }

/* source */
.source-grid { display: grid; gap: clamp(2rem, 1rem + 3vw, 4rem); }
@media (min-width: 980px) { .source-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; } }
.source-title { font-family: var(--font-display); font-stretch: 125%; font-weight: 850; font-size: var(--step-hero); line-height: 0.86; letter-spacing: -0.045em; }
.source-title em { font-style: normal; color: var(--lake); display: block; }
.source-copy { display: grid; gap: 1.4rem; }
.source-copy ul { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.source-copy li { padding-block: 0.75rem; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 1rem; }
.source-copy li span:last-child { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); text-align: right; }

/* credits */
.credits { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.credits div { padding: 1.25rem 1.25rem 1.4rem 0; border-bottom: 1px solid var(--rule); display: grid; gap: 0.35rem; align-content: start; }
.credits strong { font-family: var(--font-display); font-stretch: 112%; font-weight: 700; }
.credits p { color: var(--muted); font-size: 0.95rem; }
.credits-note { margin-top: 1.5rem; color: var(--muted); max-width: 70ch; font-size: 0.95rem; }

/* footer */
.site-footer { margin-top: var(--space); border-top: 2px solid var(--ink); padding-bottom: 2rem; }
.site-footer .wrap { padding-block: 2rem; display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .site-footer .wrap { grid-template-columns: 1fr auto; align-items: start; } }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.disclaimer { color: var(--muted); font-size: var(--step--1); max-width: 72ch; display: grid; gap: 0.5rem; }

/* ---------- legal pages ---------- */
.legal { padding-block: clamp(3rem, 2rem + 4vw, 6rem); }
.legal article { max-width: 68ch; display: grid; gap: 1.1rem; }
.legal h1 { font-family: var(--font-display); font-stretch: 125%; font-weight: 850; font-size: var(--step-3); line-height: 0.95; letter-spacing: -0.035em; margin-bottom: 1rem; }
.legal h2 { font-family: var(--font-display); font-stretch: 112%; font-weight: 750; font-size: var(--step-1); margin-top: 1.4rem; }
.legal ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.legal address { font-style: normal; }
.legal .updated { color: var(--muted); }
