/* One guiding idea: a single vertical thread. Every item on every page is a node on it. */
:root {
  --ink: #14161a;
  --muted: #4a5058;
  --accent: #0f5e6e;
  --line: #d5dadf;
  --bg: #ffffff;
  --head: "Space Grotesk", system-ui, sans-serif;
  --text: "Inter", system-ui, sans-serif;
  --num: "Space Grotesk", system-ui, sans-serif;
}

/* Self-hosted fonts, latin subset (SIL Open Font License, fonts/OFL-*.txt). Only 400 and 600 files: 700 renders as 600. */
@font-face { font-family: "Space Grotesk"; src: url("fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--text);
}

a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* Header and page tabs */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.top .name { font: 600 17px/1.2 var(--head); color: var(--ink); text-decoration: none; }
.tabs { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  border-bottom: 2px solid transparent;
}
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Page opening */
.hero { padding: 56px 0 32px; }
.kicker { margin: 0 0 12px; color: var(--accent); font-size: 15px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(34px, 7vw, 52px); letter-spacing: -.01em; }
.lede { margin: 20px 0 0; font-size: clamp(19px, 3vw, 22px); line-height: 1.5; color: var(--ink); max-width: 34em; }
.facts { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 24px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 15px; }
.facts li { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.facts a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }
.facts .ico { width: 18px; height: 18px; color: var(--accent); }
.facts .flag { width: 21px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); }


h2.section { font-size: 15px; font-family: var(--text); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 40px 0 8px; }

/* The thread */
.thread { list-style: none; margin: 0; padding: 0; position: relative; }
.thread::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 2px; background: var(--line); }
.node { position: relative; padding: 0 0 8px 36px; }
.node::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
}
.node.solid::before { background: var(--accent); }

/* Expandable items, custom marker instead of the native triangle */
details > summary { list-style: none; cursor: pointer; min-height: 44px; padding: 10px 32px 10px 0; position: relative; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 22px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
}
details[open] > summary::after { transform: rotate(-135deg); top: 26px; }
summary :is(h2, h3) { font-size: 22px; }
summary .meta { display: block; margin-top: 4px; color: var(--muted); font-size: 15px; }
summary .gist { display: block; margin-top: 6px; color: var(--ink); }
.body { padding: 4px 0 16px; }
.body p { margin: 0 0 12px; }
.body :is(h3, h4) { margin: 16px 0 4px; font-size: 15px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }

/* Problem, decision, result: three steps that read as one line */
.pdr { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 10px; }
.pdr li { padding-left: 14px; border-left: 2px solid var(--line); }
.pdr li:last-child { border-left-color: var(--accent); }
.pdr b { display: block; font-size: 14px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.pdr li:last-child b { color: var(--accent); }

/* Big numbers */
.nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 12px 0 16px; padding: 0; list-style: none; }
.nums strong { display: block; font: 600 28px/1.1 var(--num); color: var(--accent); }
.nums span { font-size: 15px; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.tags li { font-size: 14px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }

/* Contact */
.contact { margin: 48px 0 0; padding: 32px 0 48px; border-top: 1px solid var(--line); }
.contact p { margin: 0 0 12px; }
.contact ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.contact a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

@media (min-width: 768px) {
  body { font-size: 18px; }
  .hero { padding: 88px 0 40px; }
  .pdr { grid-template-columns: repeat(3, 1fr); }
}

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