:root {
  color-scheme: dark;
  --bg: #101211;
  --surface: #181b19;
  --surface-raised: #242825;
  --text: #f3f0e8;
  --muted: #b6bcb5;
  --primary: #bce0cd;
  --accent: #f49473;
  --line: #333a35;
  --radius: 8px;
  --body: "Golos Text", system-ui, sans-serif;
  --head: var(--body);
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 18px/1.65 var(--body); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--primary); text-underline-offset: .2em; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--primary); color: var(--bg); }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.skip { position: absolute; z-index: 5; inset: 12px auto auto 24px; transform: translateY(-200%); padding: 12px 16px; background: var(--surface); }
.skip:focus { transform: none; }
.small { font-size: 14px; }
.muted { color: var(--muted); }

.top { border-bottom: 1px solid var(--line); }
.top-inner { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); font: 600 17px/1.2 var(--head); text-decoration: none; }
.brand .gf-site-icon { width: 32px; height: 32px; flex: 0 0 32px; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  display: flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 8px 12px; border: 1px solid transparent; border-radius: 8px;
  color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none;
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface); color: var(--text); border-color: var(--line); }
.nav a:first-child { color: var(--primary); }
.nav a:first-child { background: var(--primary); color: var(--bg); border-color: var(--primary); }
.nav a:first-child:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

.hero {
  position: relative; isolation: isolate; margin-block: 32px 40px; overflow: clip;
  padding: clamp(24px, 4.5vw, 48px); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { max-width: 26ch; margin: 0; font: 600 clamp(30px, 5.5vw, 48px)/1.13 var(--head); letter-spacing: -.035em; overflow-wrap: anywhere; }
.lead { max-width: 63ch; margin: 16px 0 0; color: var(--muted); font-size: 17px; overflow-wrap: anywhere; }
.stamp { display: inline-flex; align-items: baseline; gap: 8px; margin: 20px 0 0; color: var(--text); font: 600 12px/1.5 var(--mono); }
.stamp::before { content: ""; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--primary); align-self: center; }


/* Homepage scene, with the image on the same plane as the headline. */
body:has(.hero-home) {
  --bg: #0c1410;
  --text: #f4e9cd;
  --muted: #c9c5b3;
  --line: #566056;
  --scene-gutter: clamp(16px, 4.2vw, 64px);
  --scene-width: 1328px;
}
body:has(.hero-home) .top { border: 0; }
body:has(.hero-home) .top-inner {
  width: min(var(--scene-width), calc(100% - var(--scene-gutter) * 2));
  border-bottom: 1px solid var(--line);
}
body:has(.hero-home) .nav a:first-child {
  color: var(--text);
  background: transparent;
  border-color: transparent;
}
body:has(.hero-home) .nav a:hover {
  color: var(--text);
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
}
.hero.hero-home {
  width: min(1456px, 100%);
  margin: 0 auto;
  padding: 0 var(--scene-gutter);
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: clip;
  isolation: isolate;
}
.hero-copy {
  min-width: 0;
  position: relative;
  z-index: 1;
  padding-block: 32px 16px;
}
.hero-home .eyebrow {
  margin-bottom: 16px;
  color: var(--primary);
  line-height: 16px;
  letter-spacing: .08em;
}
.hero-home h1 {
  max-width: 21ch;
  font-size: clamp(33px, 4.7vw, 68px);
  line-height: 1.03;
  letter-spacing: -.052em;
  font-weight: 700;
}
.hero-home .lead {
  max-width: 43ch;
  margin-top: 20px;
  color: var(--text);
  font-size: clamp(16px, 1.45vw, 20px);
  line-height: 1.55;
}
.hero-home .stamp { margin-top: 20px; color: var(--muted); }
.hero-home .stamp::before { background: var(--accent); }
.hero-art {
  position: relative;
  margin: 0 calc(-1 * var(--scene-gutter));
  aspect-ratio: 16 / 9;
}
.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% center;
}
.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--bg), transparent 20%, transparent 84%, var(--bg));
}
main:has(> .hero-home) > .wrap:not(.hero) {
  width: min(var(--scene-width), calc(100% - var(--scene-gutter) * 2));
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
main:has(> .hero-home) .related {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
main:has(> .hero-home) .related h2 { font-size: 24px; margin-bottom: 8px; }
main:has(> .hero-home) .related .card:first-child { border-top: 1px solid var(--line); }
@media (min-width: 840px) {
  .hero.hero-home {
    display: grid;
    align-items: center;
    min-height: clamp(456px, 39vw, 580px);
  }
  .hero-copy { width: 48%; padding-block: 40px; }
  .hero-art { position: absolute; inset: 0 0 0 30%; margin: 0; aspect-ratio: auto; z-index: -1; }
  .hero-art::after {
    background:
      linear-gradient(to right, var(--bg), color-mix(in srgb, var(--bg) 75%, transparent) 13%, transparent 38%),
      linear-gradient(to bottom, transparent 85%, var(--bg));
  }
  main:has(> .hero-home) .related { border-left: 1px solid var(--line); padding-left: 32px; }
}
@media (max-width: 639px) {
  .hero-home h1 { font-size: clamp(31px, 8.7vw, 44px); }
  .hero-home .lead { margin-top: 16px; }
  .hero-home .stamp { margin-top: 16px; }
}

main > .wrap:not(.hero):has(> .prose) { display: grid; align-items: start; gap: 32px; margin-bottom: 64px; }
.prose { min-width: 0; max-width: 66ch; color: var(--text); overflow-wrap: anywhere; }
.prose p, .prose ul, .prose ol, .prose pre, .prose figure { margin: 0 0 16px; }
.prose p { max-width: 68ch; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--primary); }
.prose h2, .prose h3 { font-family: var(--head); font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.prose h2 { margin: 48px 0 16px; font-size: clamp(24px, 3.5vw, 30px); padding-top: 24px; border-top: 1px solid var(--line); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border: 0; }
.prose h3 { margin: 24px 0 12px; font-size: 20px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose code { padding: 2px 5px; border-radius: 4px; color: var(--accent); background: var(--surface-raised); font: 600 .89em/1.4 var(--mono); overflow-wrap: anywhere; }
.prose pre { overflow: auto; background: var(--surface); padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.prose pre code { padding: 0; background: none; }
.prose table {
  width: 100%; margin: 0 0 24px; border: 1px solid var(--line); border-spacing: 0;
  border-radius: var(--radius); background: var(--surface); font-size: 14px; line-height: 1.45;
}
.prose th, .prose td { padding: 12px; vertical-align: top; text-align: start; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-raised); color: var(--primary); font-weight: 600; }
.prose th:first-child { border-top-left-radius: calc(var(--radius) - 1px); }
.prose th:last-child { border-top-right-radius: calc(var(--radius) - 1px); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--text) 1%, transparent); }
.prose details { margin-bottom: 8px; padding-inline: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.prose summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; gap: 16px; padding-block: 10px; font-weight: 600; cursor: pointer; list-style: none; }
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after { content: "+" / ""; flex: 0 0 12px; color: var(--primary); }
.prose details[open] summary::after { content: "−" / ""; }
.prose details[open] summary { color: var(--primary); }
.prose details p { margin-top: 8px; }

.related { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.related h2 { margin: 0 0 4px; font: 600 20px/1.3 var(--head); color: var(--text); }
.related .grid { display: grid; gap: 0 24px; }
.related .card { position: relative; padding: 14px 20px 14px 0; border-top: 1px solid var(--line); }
.related .card:first-child { border-top: 0; }
.card h3 { margin: 0; font: 600 16px/1.35 var(--head); }
.card a { text-decoration: none; }
.related .card:hover a { color: var(--text); }
.card a:hover { text-decoration: underline; }
.card a::before { content: ""; position: absolute; inset: 0; }
.card a::after { content: ""; position: absolute; right: 4px; top: 19px; width: 7px; height: 7px; border-top: 1px solid var(--primary); border-right: 1px solid var(--primary); transform: rotate(45deg); }
.card p { margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }

.foot { border-top: 1px solid var(--line); background: var(--surface); padding: 32px 0; }
.foot-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.foot-name { margin: 0; font: 600 18px/1.3 var(--head); }
.foot-brand .small { max-width: 42ch; margin: 8px 0 0; }
.foot-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; align-content: start; }
.foot-links a { display: flex; align-items: center; min-height: 36px; color: var(--muted); font-size: 14px; text-decoration: none; overflow-wrap: anywhere; }
.foot-links a:hover { color: var(--text); text-decoration: underline; }
.disclaimer { margin: 24px 0 0; border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: 13px; }
@media (min-width: 920px) {
  main > .wrap:has(> .related) { grid-template-columns: minmax(0, 1fr) minmax(252px, .4fr); gap: 48px; }
}
@media (min-width: 640px) and (max-width: 919px) {
  .related .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .related .card:nth-child(2) { border-top: 0; }
}
@media (max-width: 639px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .top-inner { min-height: 0; display: grid; gap: 4px; padding-block: 12px 8px; }
  .nav { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .nav a { padding: 6px 8px; justify-content: start; }
  .hero { margin-block: 20px 28px; padding: 24px; }
  .hero h1 { font-size: clamp(28px, 7vw, 36px); }
  .lead { font-size: 16px; }
  .stamp { margin-top: 16px; }
  .prose table { table-layout: fixed; font-size: 13px; }
  .prose th, .prose td { padding: 8px 6px; overflow-wrap: anywhere; }
  .prose h2 { margin-top: 32px; }
  .foot-inner { gap: 20px; }
}
