/* diaglam showcase.
   Editorial print look: ink on paper, hairline rules, numbered sections.
   The renders themselves are the colour; the page stays out of their way.
   System themed via prefers-color-scheme; renders sit on paper cards in
   both themes because they are, literally, prints. */

:root {
  --paper: #faf9f6;
  --ink: #1a1a18;
  --ink-soft: #55534e;
  --rule: #d8d5cd;
  --accent: #b4552d;
  --card: #ffffff;
  --card-edge: #e3e0d8;
  --code-bg: #f1efe9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161513;
    --ink: #e8e5de;
    --ink-soft: #a09c92;
    --rule: #33312c;
    --accent: #e07a4a;
    --card: #f7f6f2;         /* renders stay on paper */
    --card-edge: #000000;
    --code-bg: #201f1c;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 ui-serif, "Iowan Old Style", Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82em;
}

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.5rem; }

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

em { font-style: italic; }
b { font-weight: 650; }

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 5.5rem 0 3.5rem;
}

.kicker {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.masthead h1 {
  font-size: clamp(3.4rem, 9vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0.35rem 0 1.4rem;
}

.masthead h1::after {
  content: ".";
  color: var(--accent);
}

.lede {
  max-width: 44rem;
  font-size: 1.22rem;
  line-height: 1.6;
  color: var(--ink);
}

.actions { margin-top: 2rem; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }

.button {
  display: inline-block;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  padding: 0.55rem 1.1rem;
  text-decoration: none;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  transition: background 120ms ease, color 120ms ease;
}
.button:hover { background: var(--ink); color: var(--paper); }

.note { color: var(--ink-soft); }

/* ---------- stats ---------- */

.stats { border-bottom: 1px solid var(--rule); }

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.grid-4 > div {
  padding: 1.6rem 1.25rem 1.5rem 0;
  border-left: 1px solid var(--rule);
  padding-left: 1.25rem;
}
.grid-4 > div:first-child { border-left: none; padding-left: 0; }

.grid-4 b {
  display: block;
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.grid-4 span {
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.45;
  display: block;
  margin-top: 0.2rem;
}

@media (max-width: 720px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 > div:nth-child(3) { border-left: none; padding-left: 0; }
}

/* ---------- sections ---------- */

.section { padding: 3.75rem 0 0.5rem; }

.section h2 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 1.1rem;
}

.num {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--accent);
  vertical-align: 0.5em;
  margin-right: 0.9rem;
  letter-spacing: 0.08em;
}

.section p { max-width: 44rem; margin-bottom: 1rem; }

.caption-lede { color: var(--ink-soft); font-style: italic; }

/* ---------- gallery ---------- */

.print {
  background: var(--card);
  border: 1px solid var(--card-edge);
  padding: 1rem 1rem 0.75rem;
  margin: 1.75rem 0;
}

.print img {
  display: block;
  width: 100%;
  height: auto;
}

.print figcaption {
  padding-top: 0.7rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

@media (prefers-color-scheme: dark) {
  .print figcaption { color: #5b584f; }
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.pair .print { margin: 0.25rem 0 1.5rem; }

@media (max-width: 860px) {
  .pair { grid-template-columns: 1fr; }
}

/* ---------- code ---------- */

.pipeline {
  background: var(--code-bg);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  font-size: 0.85rem;
}

.code {
  background: var(--code-bg);
  padding: 1.25rem 1.4rem;
  margin: 1.25rem 0;
  overflow-x: auto;
  line-height: 1.7;
  font-size: 0.8rem;
}

.c { color: var(--ink-soft); }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--rule);
  margin-top: 4.5rem;
  padding: 2rem 0 3rem;
  color: var(--ink-soft);
}
.footer .mono { font-size: 0.78rem; }

.button.static { cursor: default; }
.button.static:hover { background: transparent; color: var(--ink); }

.legal { margin-top: 0.5rem; font-size: 0.72rem !important; }
