:root {
  --ground: #f6f7f2;
  --surface: #ffffff;
  --ink: #121212;
  --muted: #55585a;
  --line: #121212;
  --soft-line: #d9dbd3;
  --yellow: #ffd51f;
  --on-yellow: #121212;
  --ochre: #b9771e;
  --ochre-soft: #f1dcb8;
  --sky: #d8ecf8;
  --red: #c2412d;
  --shadow: #121212;
  --display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #131412;
    --surface: #1c1d1a;
    --ink: #f2f1ea;
    --muted: #a6a79f;
    --line: #f2f1ea;
    --soft-line: #34352f;
    --ochre: #e0a04a;
    --ochre-soft: #3a2c17;
    --sky: #182630;
    --red: #ec7a63;
    --shadow: #000000;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #131412;
  --surface: #1c1d1a;
  --ink: #f2f1ea;
  --muted: #a6a79f;
  --line: #f2f1ea;
  --soft-line: #34352f;
  --ochre: #e0a04a;
  --ochre-soft: #3a2c17;
  --sky: #182630;
  --red: #ec7a63;
  --shadow: #000000;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.65;
}
.wrap {
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: 20px;
}
a { color: inherit; }
a:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 4px;
  border-radius: 6px;
}
.label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Top bar */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding-block: 20px;
  border-bottom: 2px dashed var(--soft-line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
}
.brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
}
.topbar nav { display: flex; gap: 18px; font-weight: 700; font-size: 16px; }
.topbar nav a { text-underline-offset: 4px; text-decoration-thickness: 2px; }
.topbar nav a[aria-current="page"] { text-decoration: none; background: var(--yellow); color: var(--on-yellow); padding: 2px 10px; border-radius: 999px; border: 2px solid var(--line); }

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  text-wrap: balance;
}

/* Blog index */
.index-head { padding-block: 48px 32px; }
.index-head h1 { font-size: clamp(44px, 8vw, 80px); line-height: 0.95; margin: 8px 0 16px; }
.index-head p { max-width: 54ch; color: var(--muted); margin: 0; font-size: 19px; }
.posts {
  list-style: none;
  margin: 0;
  padding: 0 0 56px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px 28px;
}
.post-card a { display: grid; gap: 12px; text-decoration: none; }
.thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border: 3px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--sky);
  box-shadow: 5px 5px 0 var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card a:hover .thumb { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--shadow); }
.post-card h2 { font-family: var(--body); font-weight: 700; font-size: 22px; line-height: 1.3; margin: 0; }
.post-card a:hover h2 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.post-card p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.55; }

/* Article */
.article { max-width: 720px; margin-inline: auto; padding-block: 44px 24px; }
.article > header h1 { font-size: clamp(38px, 6.4vw, 64px); line-height: 1; margin: 10px 0 18px; }
.article .dek { font-size: clamp(19px, 2.4vw, 22px); font-weight: 500; margin: 0 0 12px; text-wrap: pretty; }
.meta { font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 0 0 28px; }
.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 3px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #121212;
  box-shadow: 5px 5px 0 var(--shadow);
  margin: 0 0 40px;
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.article h2 { font-size: clamp(28px, 4vw, 36px); line-height: 1.1; margin: 44px 0 14px; }
.article p { margin: 0 0 18px; text-wrap: pretty; }
.article p strong { background: linear-gradient(transparent 60%, var(--ochre-soft) 60%); }

/* Figures */
.fig {
  margin: 32px 0 36px;
  padding: 20px 18px 16px;
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: 16px;
  box-shadow: 5px 5px 0 var(--shadow);
}
.fig svg { display: block; width: 100%; height: auto; }
.fig figcaption { margin-top: 12px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.fig figcaption b { color: var(--ink); }
.fig text { font-family: var(--body); fill: var(--ink); }
.fig .t-mono { font-family: var(--mono); font-weight: 700; }
.fig .t-muted { fill: var(--muted); }
.fig .t-bold { font-weight: 700; }
.fig .t-on-yellow { fill: var(--on-yellow); }
.fig .t-inv { fill: var(--ground); }
.fig .t-red { fill: var(--red); }
.fig .s-red { stroke: var(--red); }
.fig .s-muted { stroke: var(--muted); }
.fig .s-ink { stroke: var(--line); }
.fig .f-yellow { fill: var(--yellow); }
.fig .f-ochre { fill: var(--ochre); }
.fig .f-ochre-soft { fill: var(--ochre-soft); }
.fig .f-sky { fill: var(--sky); }
.fig .f-surface { fill: var(--surface); }
.fig .f-ground { fill: var(--ground); }
.fig .f-ink { fill: var(--ink); }
.fig .f-red { fill: var(--red); }
.fig .f-none { fill: none; }

/* Key numbers */
.numbers {
  list-style: none;
  padding: 0;
  margin: 28px 0 32px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.numbers li {
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 14px 14px 12px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
}
.numbers b {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 4px;
}

/* Chapters */
.chapters { list-style: none; padding: 0; margin: 0 0 18px; border-top: 2px solid var(--soft-line); }
.chapters li { border-bottom: 2px solid var(--soft-line); }
.chapters a { display: flex; gap: 16px; padding: 10px 2px; text-decoration: none; }
.chapters a:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.chapters time { font-family: var(--mono); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 3.4em; padding-top: 2px; }

/* Next */
.next {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin: 48px 0 0;
  padding: 16px;
  background: var(--yellow);
  color: var(--on-yellow);
  border: 3px solid var(--line);
  border-radius: 18px;
  box-shadow: 5px 5px 0 var(--shadow);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.next:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--shadow); }
.next img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 2px solid #121212; border-radius: 10px; display: block; }
.next .label { color: #121212; opacity: 0.75; }
.next strong { display: block; font-size: 21px; line-height: 1.3; margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--shadow);
  background: var(--surface);
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }

footer {
  border-top: 2px dashed var(--soft-line);
  margin-top: 56px;
  padding-block: 28px 44px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
footer a { text-underline-offset: 3px; }

@media (max-width: 720px) {
  body { font-size: 17px; }
  .posts { grid-template-columns: 1fr; gap: 32px; }
  .numbers { grid-template-columns: 1fr; }
  .numbers li { display: flex; align-items: baseline; gap: 12px; }
  .numbers b { font-size: 28px; min-width: 3.6ch; margin: 0; }
  .next { grid-template-columns: 1fr; }
  .fig { padding: 14px 12px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .thumb, .next, .btn { transition: none; }
  .post-card a:hover .thumb, .next:hover, .btn:hover { transform: none; }
}
