/* Snowseer GitHub Pages site stylesheet.
 *
 * Palette: charcoal #1c1c1c · warm cream #f6f3ee · rust #b34a25 · mute #8a8780.
 * Typography: EB Garamond (body) · Inter (headers / UI) · JetBrains Mono (code).
 * One accent only (rust). Hairlines, not boxes. Generous whitespace.
 */

:root {
  --bg: #f6f3ee;
  --text: #1c1c1c;
  --accent: #b34a25;
  --mute: #8a8780;
  --green: #2e9c56;
  --red: #dc3c32;
  --max-width: 820px;
  --section-gap: 120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "EB Garamond", Georgia, serif;
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ─── Layout containers ───────────────────────────────────────────────── */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

section {
  padding: var(--section-gap) 0;
  border-top: 1px solid rgba(28, 28, 28, 0.08);
}

section:first-of-type,
header.hero + section {
  /* The hero already provides its own visual break. */
}

/* ─── Typography ──────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5 {
  font-family: "Inter", "Helvetica Neue", sans-serif;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0 0 0.5em 0;
  line-height: 1.2;
  text-align: center;
}

h1 { font-size: 56px; margin: 0 0 0.3em 0; }
h2 { font-size: 36px; margin: 0 0 0 0; }
h3 { font-size: 22px; color: var(--text); font-weight: 600; margin-top: 2.6em; }

/* Rust accent under section titles, between the heading and the body. */
section h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  background: var(--accent);
  margin: 18px auto 1.6em auto;
}

/* Smaller rust accent under each h3 sub-heading. */
section h3::after {
  content: "";
  display: block;
  width: 36px;
  height: 2px;
  background: var(--accent);
  margin: 12px auto 1.2em auto;
}

p { margin: 0 0 1.3em 0; }
p.lead { font-size: 22px; line-height: 1.5; }
p:last-child { margin-bottom: 0; }

em, i { font-style: italic; }
strong { font-weight: 600; color: var(--text); }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(179, 74, 37, 0.4);
  transition: border-bottom-color 0.15s;
}

a:hover { border-bottom-color: var(--accent); }

/* Hairline divider */
hr {
  border: 0;
  border-top: 1px solid rgba(28, 28, 28, 0.18);
  margin: 3em auto;
  width: 80px;
}

/* Pull-quote / blockquote: centred, italic, gentle accent */
blockquote {
  margin: 2em auto;
  padding: 0 1.5em;
  border-left: 3px solid var(--accent);
  font-style: italic;
  font-size: 1.04em;
  color: var(--text);
  text-align: left;
  max-width: 680px;
}

/* ─── Hero ────────────────────────────────────────────────────────────── */

.hero {
  padding: 100px 32px 80px 32px;
  text-align: center;
  border-top: none;
  max-width: 1080px;
  margin: 0 auto;
}

.hero h4 {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
  margin-bottom: 1em;
}
.hero h4::after {
  margin: 10px auto 0 auto;
}

.hero h1 {
  font-size: 68px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0 0;
}

/* Rust accent under the hero title, before the subtitle. */
.hero h1::after {
  content: "";
  display: block;
  width: 72px;
  height: 2px;
  background: var(--accent);
  margin: 22px auto 24px auto;
}

.hero h2 {
  font-family: "EB Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 28px;
  color: var(--mute);
  margin-bottom: 2em;
  border: none;
  text-align: center;
}

.hero-figure {
  margin: 2em auto 0 auto;
  max-width: 980px;
}

.hero-figure video,
.hero-figure img {
  width: 100%;
  height: auto;
  display: block;
  background: #1c1c1c;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
}

.hero-figure figcaption {
  margin-top: 1em;
  font-style: italic;
  color: var(--mute);
  font-size: 15px;
  text-align: center;
}

.note {
  font-size: 14px;
  color: var(--mute);
  font-style: italic;
  margin-top: 1em;
  text-align: center;
}

/* ─── Figures (images, captions) ─────────────────────────────────────── */

figure {
  margin: 2.4em auto;
  text-align: center;
  max-width: 100%;
}

figure img,
figure video {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 3px;
  background: #1c1c1c;
}

figure img {
  background: transparent;
  border: 1px solid rgba(28, 28, 28, 0.08);
}

figure figcaption {
  margin: 0.9em auto 0 auto;
  font-size: 14px;
  color: var(--mute);
  font-style: italic;
  line-height: 1.5;
  max-width: 680px;
  text-align: center;
}

/* ─── Architecture ASCII diagram ──────────────────────────────────────── */

pre.diagram {
  display: block;
  margin: 2em auto;
  padding: 1.6em 1.4em;
  background: #fafaf7;
  border: 1px solid rgba(28, 28, 28, 0.06);
  border-radius: 3px;
  font-family: "JetBrains Mono", ui-monospace, "Menlo", monospace;
  font-size: 12.5px;
  line-height: 1.45;
  text-align: left;
  white-space: pre;
  overflow-x: auto;
  width: max-content;
  max-width: 100%;
}

pre.diagram code {
  display: block;
  background: none;
  padding: 0;
  font-size: inherit;
  text-align: left;
}

@media (max-width: 720px) {
  pre.diagram {
    font-size: 10px;
    padding: 1em 0.8em;
  }
}

/* ─── Tables (architecture, integrity) ────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  margin: 1.6em auto;
}

th {
  font-weight: 600;
  text-align: left;
  padding: 0.7em 0.9em;
  border-bottom: 2px solid var(--text);
  color: var(--text);
}

td {
  padding: 0.65em 0.9em;
  border-bottom: 1px solid rgba(28, 28, 28, 0.12);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }

/* ─── Recipe (numbered list with accent counters) ─────────────────────── */

.recipe {
  list-style: none;
  padding: 0;
  margin: 1.6em auto;
  max-width: 640px;
  counter-reset: recipe;
  text-align: left;
}

.recipe li {
  counter-increment: recipe;
  position: relative;
  padding: 0.8em 0 0.8em 3em;
  border-bottom: 1px solid rgba(28, 28, 28, 0.08);
}

.recipe li:last-child { border-bottom: none; }

.recipe li::before {
  content: counter(recipe);
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 2em;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  color: var(--accent);
  font-size: 17px;
  text-align: left;
}

/* ─── Per-track video grid (canonical + alt) ──────────────────────────── */

.track-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  margin: 2.4em 0;
  width: 100%;
}

.track {
  margin: 0;
  text-align: center;
}

.track video {
  width: 100%;
  height: auto;
  display: block;
  background: #1c1c1c;
  border-radius: 3px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.track figcaption {
  margin-top: 0.8em;
  font-size: 14px;
  font-style: italic;
  color: var(--mute);
  text-align: center;
  line-height: 1.5;
}

/* ─── Pairs grid (nordic precursor: 2x2 raw images per pair) ──────────── */

.pairs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 32px;
  margin: 2.4em 0;
}

.pair {
  margin: 0;
  text-align: center;
}

.pair .quad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(28, 28, 28, 0.10);
  border-radius: 2px;
  background: var(--bg);
}

.pair .quad img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border: none;
  border-radius: 0;
  background: transparent;
}

.pair figcaption {
  margin-top: 12px;
  font-size: 14px;
  font-style: italic;
  color: var(--mute);
  text-align: center;
}

/* ─── Lists (bulleted, numbered) ──────────────────────────────────────── */

ul, ol {
  margin: 1.2em auto;
  padding-left: 1.6em;
  max-width: 700px;
  text-align: left;
}

ul li, ol li {
  margin-bottom: 0.6em;
}

/* ─── Code blocks ────────────────────────────────────────────────────── */

code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85em;
  background: rgba(28, 28, 28, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

pre {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 14px;
  background: rgba(28, 28, 28, 0.04);
  padding: 1.1em 1.3em;
  border-left: 2px solid var(--accent);
  line-height: 1.55;
  overflow-x: auto;
  margin: 1.4em 0;
  text-align: left;
}

pre code { background: none; padding: 0; font-size: inherit; }

/* ─── Footer ─────────────────────────────────────────────────────────── */

footer {
  padding: 80px 0 100px 0;
  font-size: 14px;
  color: var(--mute);
  font-style: italic;
  text-align: center;
  border-top: 1px solid rgba(28, 28, 28, 0.10);
}

footer p {
  text-align: center;
}

footer a {
  color: var(--mute);
  border-bottom-color: rgba(138, 135, 128, 0.5);
}

footer a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  :root { --section-gap: 70px; }
  body { font-size: 17px; }
  .hero { padding: 60px 18px 50px 18px; }
  .hero h1 { font-size: 42px; }
  .hero h2 { font-size: 21px; }
  h2 { font-size: 28px; }
  .container { padding: 0 18px; }
  .track-grid { grid-template-columns: 1fr; gap: 24px; }
  table { font-size: 14px; }
  pre { font-size: 13px; padding: 14px; }
  ul, ol { padding-left: 1.3em; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 34px; line-height: 1.1; }
  .hero h2 { font-size: 18px; }
  .hero { padding: 40px 16px 30px 16px; }
}

/* ─── Print stylesheet ────────────────────────────────────────────────── */

@media print {
  body { background: white; color: black; font-size: 11pt; }
  section { border-top: 1px solid #ccc; padding: 24pt 0; }
  .hero-figure video, .track-grid video { display: none; }
  .hero h1 { font-size: 32pt; }
  .hero h2 { font-size: 14pt; }
  h2 { font-size: 18pt; }
  pre { background: #f0f0f0; }
  a { color: black; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  a[href^="https://fonts."]::after,
  a[href^="https://github.com/"]::after { content: ""; }
  footer { font-size: 9pt; }
}
