:root {
  color-scheme: dark;
  --bg: #111417;
  --surface: #181d21;
  --surface-strong: #20272d;
  --text: #edf1f3;
  --muted: #a8b3ba;
  --quiet: #7f8b94;
  --line: #33404a;
  --accent: #d6b36a;
  --accent-strong: #f0cf82;
  --code: #d9e7ea;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(214, 179, 106, 0.08), transparent 320px),
    var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
  color: var(--text);
}

.site-header,
.layout,
.post-shell {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--text);
}

.nav .brand {
  margin-right: auto;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero {
  max-width: 760px;
  padding: 86px 0 64px;
}

.eyebrow,
.post-meta {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
}

h1 {
  font-size: clamp(3rem, 8vw, 6.4rem);
  letter-spacing: 0;
}

h2 {
  font-size: 1.1rem;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.subtitle {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1.2rem, 3vw, 1.65rem);
}

.byline {
  margin: 14px 0 0;
  color: var(--quiet);
}

.intro {
  max-width: 650px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  padding: 0 0 72px;
}

.content,
.sidebar {
  min-width: 0;
}

.post-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 29, 33, 0.92);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

.post-card {
  margin-top: 18px;
  padding: 28px;
}

.section-heading {
  margin-top: 34px;
}

.post-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.post-card p {
  max-width: 680px;
  color: var(--muted);
}

.read-more {
  display: inline-flex;
  margin-top: 8px;
  font-weight: 700;
}

.sidebar {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel {
  padding: 22px;
}

.panel h2 {
  margin-bottom: 16px;
}

dl,
.rule-list {
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

dt {
  color: var(--quiet);
}

dd {
  margin: 0;
  color: var(--code);
  overflow-wrap: anywhere;
}

.rule-list {
  padding-left: 18px;
  color: var(--muted);
}

.rule-list li + li {
  margin-top: 8px;
}

.post-shell {
  max-width: 820px;
  padding-bottom: 72px;
}

.post-header {
  padding: 72px 0 34px;
  border-bottom: 1px solid var(--line);
}

.post-header h1 {
  max-width: 760px;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
}

.post-header .byline {
  color: var(--muted);
}

.post-body {
  padding-top: 38px;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(1.08rem, 2vw, 1.2rem);
  line-height: 1.78;
}

.post-body p {
  margin: 0 0 1.35em;
}

.post-body code {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.08em 0.32em;
  background: var(--surface);
  color: var(--code);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

.post-body h2 {
  margin: 2.1em 0 0.75em;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.35rem;
}

.post-footer {
  margin-top: 42px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

  .hero {
    padding: 58px 0 42px;
  }

  .nav {
    min-height: 64px;
    gap: 14px;
  }
}

@media (max-width: 520px) {
  .site-header,
  .layout,
  .post-shell {
    width: min(100% - 24px, var(--max-width));
  }

  .post-card,
  .panel {
    padding: 20px;
  }

  dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
