/* The site of the freemapper suite. The colour tokens are those of freemapper-core's suite.css (core ADR 0030,
   tag v0.28.0), so the site and the programs' local pages look alike; the rest is the site's own. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/InterVariable.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/InterVariable-Italic.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  /* freemapper-core v0.28.0, suite.css */
  --bg: #fafafa;
  --fg: #1d1d1f;
  --line: #c8c8cc;
  --bar: #ececef;
  --accent: #0b6bcb;
  --on-accent: #ffffff;
  --sel: #0b6bcb;
  --map-bg: #ffffff;
  --pool: #76767c;
  /* the site's own */
  --muted: #55555b;
  --card: #ffffff;
  --flag: #f07800;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --fg: #f2f2f7;
    --line: #48484a;
    --bar: #2c2c2e;
    --accent: #6cb0ff;
    --on-accent: #1c1c1e;
    --sel: #6cb0ff;
    --map-bg: #2a2a2d;
    --pool: #98989f;
    --muted: #b0b0b7;
    --card: #232326;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, sans-serif;
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.6;
}

:focus-visible { outline: 3px solid var(--sel); outline-offset: 2px; }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.25rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 1rem; }
h3 { font-size: 1.2rem; margin: 0 0 0.25rem; }

code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
table { font-variant-numeric: tabular-nums; border-collapse: collapse; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }

.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--bg); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; }

/* Header */
header.site { border-bottom: 1px solid var(--line); background: var(--bg); }
header.site .bar { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; flex-wrap: wrap; }
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--fg); text-decoration: none;
}
header.site nav { display: flex; gap: 1.25rem; align-items: center; margin-left: auto; flex-wrap: wrap; }
header.site nav a:not(.button) { color: var(--fg); text-decoration: none; font-weight: 500; }
header.site nav a:not(.button):hover { color: var(--accent); }
.lang { font-size: 0.9rem; color: var(--muted); }

/* Buttons */
.button {
  display: inline-block; padding: 0.6rem 1.15rem; border-radius: 8px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none;
  border: 1px solid var(--accent);
}
.button:hover { filter: brightness(1.08); }
.button.secondary { background: transparent; color: var(--accent); }
header.site .button { padding: 0.4rem 0.9rem; }

/* Hero */
.hero { padding: 3.5rem 0 3rem; background: var(--bar); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 3rem; align-items: center; }
.lead { font-size: 1.25rem; color: var(--muted); max-width: 34rem; }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.75rem; }
.hero-map { margin: 0; }
.hero-map img {
  display: block; width: 100%; height: auto; border-radius: 10px;
  background: var(--map-bg); box-shadow: 0 12px 32px rgb(0 0 0 / 0.14);
}
.hero-map figcaption { font-size: 0.875rem; color: var(--muted); margin-top: 0.75rem; }

/* Blocks */
.block { padding: 3.5rem 1.25rem 0; }
.block:last-of-type { padding-bottom: 3.5rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 2rem;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.steps li { counter-increment: step; padding-top: 0.25rem; color: var(--muted); }
.steps li::before {
  content: counter(step); display: block; width: 2rem; height: 2rem; line-height: 2rem; text-align: center;
  border-radius: 50%; background: var(--flag); color: #fff; font-weight: 700; margin-bottom: 0.5rem;
}

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.4rem 1.5rem; }
.card h3 a { color: var(--fg); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card .role { margin: 0 0 0.75rem; color: var(--accent); font-weight: 600; }
.card p { margin: 0 0 0.75rem; }
.card .state { font-size: 0.875rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 0.6rem; margin: 0; }

.states { list-style: none; padding: 0; margin: 1.25rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.states li { border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.8rem; background: var(--card); font-size: 0.95rem; }
.note { color: var(--muted); }

/* Text pages */
.prose { max-width: 46rem; padding-top: 3rem; padding-bottom: 3.5rem; }

/* Footer */
footer.site { border-top: 1px solid var(--line); background: var(--bar); color: var(--muted); font-size: 0.9rem; padding: 1.75rem 0; }
footer.site p { margin: 0.25rem 0; }
footer.site a { color: var(--muted); }
.small { font-size: 0.8rem; }

@media (max-width: 52rem) {
  .hero-grid, .two { grid-template-columns: 1fr; gap: 2rem; }
  .cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  header.site nav { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Program pages */
.program { padding-top: 3rem; padding-bottom: 3.5rem; }
.program-head { max-width: 46rem; margin-bottom: 2rem; }
.kicker { color: var(--accent); font-weight: 600; margin: 0 0 0.25rem; }
.program-head .links { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; margin-top: 1.5rem; }
.prose { max-width: 46rem; }
.prose h2 { margin-top: 2.5rem; }
.prose li { margin-bottom: 0.35rem; }
.prose table, .downloads { width: 100%; margin: 1rem 0; font-size: 0.95rem; }
.prose th, .prose td, .downloads th, .downloads td { text-align: left; padding: 0.45rem 0.75rem 0.45rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.downloads .num { text-align: right; white-space: nowrap; padding-right: 1.25rem; }
.downloads thead th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.downloads tbody th { font-weight: 600; white-space: nowrap; }
.hash { font-size: 0.72rem; color: var(--muted); word-break: break-all; }
pre { background: var(--bar); border: 1px solid var(--line); border-radius: 8px; padding: 0.9rem 1rem; overflow-x: auto; line-height: 1.45; }
:not(pre) > code { background: var(--bar); padding: 0.05rem 0.3rem; border-radius: 4px; }
.download { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }

@media (max-width: 52rem) {
  .downloads thead th:nth-child(4), .downloads td:nth-child(4) { display: none; }
  .downloads td a { word-break: break-all; }
}

/* Gallery */
.gallery { padding-top: 3rem; padding-bottom: 3.5rem; }
.gallery section { margin-top: 2.5rem; }
.examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.25rem; }
.example { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.example .thumb { display: block; background: var(--map-bg); border-bottom: 1px solid var(--line); }
.example .thumb img { display: block; width: 100%; height: auto; aspect-ratio: 480 / 390; object-fit: cover; object-position: top; }
.example-text { padding: 1rem 1.15rem 1.15rem; display: flex; flex-direction: column; flex: 1; }
.example-text p { margin: 0 0 0.5rem; }
.example .state { color: var(--accent); font-weight: 600; font-size: 0.85rem; margin-bottom: 0.15rem; }
.example .counts { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.example .pdfs { margin-top: auto; padding-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; font-size: 0.9rem; }
