:root {
  --bg: #19191f;
  --surface: #222229;
  --surface-hover: #292930;
  --ink: #f7f5ef;
  --muted: #aaa8b1;
  --line: #383841;
  --accent: #e9b949;
  --content: 720px;
  --wide: 976px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 4px; }
a:hover { color: var(--accent); }
img { display: block; width: 100%; height: auto; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.site-header a { font-weight: 650; text-decoration: none; }
.site-header a:first-child { font-size: 1rem; letter-spacing: -0.02em; }
.site-header a:last-child, .site-header span { color: var(--muted); font-weight: 500; }
main { width: min(1120px, calc(100% - 48px)); margin: 0 auto 100px; }
article { min-width: 0; }

.article-header {
  max-width: var(--wide);
  margin: clamp(64px, 9vw, 112px) auto 54px;
}
.back-link {
  display: inline-block;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
}
.back-link:hover { color: var(--ink); }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.85rem;
}
.eyebrow span + span::before { content: "·"; margin-right: 12px; }
h1 {
  max-width: 1000px;
  margin: 0;
  font-size: clamp(2.7rem, 5.4vw, 4.65rem);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.055em;
  text-wrap: balance;
}
.subtitle {
  max-width: 860px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(1.12rem, 2vw, 1.35rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.article-body {
  max-width: var(--content);
  margin: 0 auto;
  color: #e7e4dc;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(1.08rem, 1.7vw, 1.22rem);
  line-height: 1.82;
}
.article-body p { margin: 0 0 1.45em; }
.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 2.4em 0 0.72em;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.035em;
}
.article-body h2 { font-size: 2rem; }
.article-body h3 { font-size: 1.75rem; }
.article-body h4 { font-size: 1.55rem; }
.article-body figure { margin: 2.6em 0; }
.article-body figure.hero {
  width: min(var(--wide), calc(100vw - 48px));
  margin: 0 0 3.2em 50%;
  transform: translateX(-50%);
}
.article-body figure img {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.article-body figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
}
.article-body blockquote {
  margin: 2.2em 0;
  padding: 0 0 0 24px;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-size: 1.18em;
  line-height: 1.6;
}
.article-body pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 2em 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #111116;
  color: #efedf5;
  font-size: 0.82rem;
  line-height: 1.6;
}
.article-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.article-body :not(pre) > code {
  padding: 0.14em 0.34em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  font-size: 0.86em;
}
.article-body hr { width: 72px; margin: 3.5em auto; border: 0; border-top: 1px solid var(--line); }
.article-body li { margin: 0.6em 0; }
.article-body strong { color: var(--ink); }
.article-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--content);
  margin: 70px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}
.article-footer p { margin: 0; }

.archive { max-width: 1040px; }
.archive-header { margin: clamp(64px, 9vw, 108px) 0 52px; }
.archive-header .eyebrow { color: var(--accent); }
.archive-header h1 { font-size: clamp(3rem, 7vw, 5.6rem); }
.archive-header > p:not(.eyebrow):not(#result-count) {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  line-height: 1.6;
}
mark { padding: 0 5px; color: inherit; background: linear-gradient(transparent 58%, rgba(233, 185, 73, 0.82) 58%); }
.search { display: block; max-width: 680px; margin-top: 38px; color: var(--muted); font-size: 0.8rem; }
.search span { display: block; margin-bottom: 9px; }
.search input {
  width: 100%;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: 1rem/1.4 inherit;
}
.search input:focus { border-color: var(--accent); outline: 3px solid rgba(233, 185, 73, 0.16); }
#result-count { margin: 13px 0 0; color: var(--muted); font-size: 0.78rem; }
.archive-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.archive-item { min-width: 0; }
.archive-item[hidden] { display: none; }
.archive-item a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.archive-item a:hover {
  border-color: #55545f;
  background: var(--surface-hover);
  color: inherit;
  transform: translateY(-2px);
}
.archive-item time { color: var(--muted); font-size: 0.75rem; }
.archive-item h2 {
  margin: 11px 0 10px;
  font-size: clamp(1.24rem, 2.2vw, 1.55rem);
  font-weight: 620;
  line-height: 1.25;
  letter-spacing: -0.025em;
}
.archive-item p { margin: auto 0 0; padding-top: 12px; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }

@media (max-width: 700px) {
  .site-header, main { width: min(100% - 32px, 1120px); }
  .site-header { padding: 21px 0; }
  .article-header { margin-top: 48px; }
  .back-link { margin-bottom: 28px; }
  h1 { font-size: clamp(2.45rem, 12vw, 3.55rem); letter-spacing: -0.05em; }
  .article-body figure.hero { width: calc(100vw - 32px); }
  .article-body figure { margin: 2.2em 0; }
  .article-footer { display: block; }
  .article-footer p { margin-bottom: 12px; }
  .archive-list { grid-template-columns: 1fr; }
  .archive-item a { padding: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .archive-item a { transition: none; }
}
