:root {
  --bg: #030505;
  --bg-soft: #080a0a;
  --panel: rgba(14, 16, 16, 0.86);
  --panel-hover: rgba(20, 22, 21, 0.94);
  --line: rgba(255, 180, 68, 0.18);
  --line-strong: rgba(255, 180, 68, 0.4);
  --text: #f7f3ea;
  --muted: #b9b2a7;
  --muted-soft: #8d867d;
  --gold: #ffb43f;
  --gold-soft: #ffd37a;
  --orange: #ff7a1a;
  --max: 1120px;
  --reading-width: 720px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 78% 10%, rgba(218, 47, 24, 0.16), transparent 27rem),
    radial-gradient(circle at 63% 13%, rgba(255, 180, 63, 0.1), transparent 21rem),
    linear-gradient(180deg, #020303 0%, #060808 48%, #030505 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 180, 63, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 180, 63, 0.026) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 70%, transparent 100%);
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 4px;
  border-radius: 4px;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 180, 63, 0.13);
  background: rgba(3, 5, 5, 0.82);
  backdrop-filter: blur(20px);
}

.nav {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: fit-content;
  font-size: 26px;
  font-weight: 780;
  letter-spacing: -0.04em;
}

.brand img {
  width: 58px;
  height: 58px;
  filter: drop-shadow(0 0 16px rgba(255, 122, 26, 0.32));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.7vw, 32px);
  color: rgba(247, 243, 234, 0.8);
  font-size: 14px;
  font-weight: 650;
}

.nav-links a {
  transition: color 160ms ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--gold-soft);
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #1b1204;
  background: linear-gradient(180deg, #ffd57b 0%, #ffb13b 54%, #f69325 100%);
  box-shadow: 0 14px 30px rgba(255, 122, 26, 0.18);
  font-size: 14px;
  font-weight: 780;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 17px 36px rgba(255, 122, 26, 0.25);
}

.blog-hero {
  max-width: 850px;
  padding: 104px 0 70px;
}

.eyebrow {
  width: fit-content;
  margin: 0 0 24px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 180, 63, 0.48);
  border-radius: 999px;
  color: var(--gold-soft);
  background: rgba(255, 180, 63, 0.05);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.header-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 24px;
}

.header-labels .eyebrow {
  margin: 0;
}

.content-flair {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(108, 226, 166, 0.38);
  border-radius: 999px;
  color: #b9f6d4;
  background: rgba(68, 190, 127, 0.07);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.content-flair::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6ce2a6;
  box-shadow: 0 0 10px rgba(108, 226, 166, 0.55);
}

.blog-hero h1,
.post-header h1 {
  margin: 0;
  color: #fffdf7;
  font-size: clamp(48px, 7vw, 78px);
  line-height: 1;
  letter-spacing: -0.07em;
}

.blog-hero p:last-child {
  max-width: 700px;
  margin: 28px 0 0;
  color: rgba(247, 243, 234, 0.76);
  font-size: clamp(18px, 2.3vw, 21px);
  line-height: 1.7;
  letter-spacing: -0.02em;
}

.post-list {
  margin: 0 0 80px;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.post-list-item {
  border-bottom: 1px solid var(--line);
}

.post-list-link {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 32px;
  align-items: start;
  padding: 40px 4px;
  transition: padding 180ms ease, background 180ms ease;
}

.post-list-link:hover {
  padding-inline: 20px;
  background: linear-gradient(90deg, rgba(255, 180, 63, 0.045), transparent 80%);
}

.post-date,
.post-meta {
  color: var(--muted-soft);
  font-size: 13px;
  font-weight: 660;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.post-list-copy h2 {
  margin: -4px 0 12px;
  color: #fffaf0;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.18;
  letter-spacing: -0.045em;
}

.post-list-copy p {
  max-width: 690px;
  margin: 0;
  color: rgba(247, 243, 234, 0.68);
  font-size: 16px;
  line-height: 1.65;
}

.post-arrow {
  color: var(--gold);
  font-size: 28px;
  line-height: 1;
  transition: transform 180ms ease;
}

.post-list-link:hover .post-arrow {
  transform: translateX(5px);
}

.post-header {
  max-width: 900px;
  padding: 84px 0 54px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 38px;
  color: var(--muted-soft);
  font-size: 14px;
}

.breadcrumbs a:hover {
  color: var(--gold-soft);
}

.post-header h1 {
  font-size: clamp(42px, 6.3vw, 72px);
}

.post-dek {
  max-width: 760px;
  margin: 26px 0 30px;
  color: rgba(247, 243, 234, 0.76);
  font-size: clamp(18px, 2.3vw, 22px);
  line-height: 1.65;
  letter-spacing: -0.025em;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.post-meta span + span::before {
  content: "·";
  margin-right: 22px;
  color: rgba(255, 180, 63, 0.52);
}

.article-rule {
  height: 1px;
  margin: 0;
  border: 0;
  background: linear-gradient(90deg, var(--line-strong), var(--line), transparent);
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--reading-width)) 220px;
  gap: 80px;
  align-items: start;
  padding: 58px 0 100px;
}

.post-layout-single {
  grid-template-columns: minmax(0, 800px);
}

.post-content {
  color: rgba(247, 243, 234, 0.82);
  font-size: 18px;
  line-height: 1.82;
  letter-spacing: -0.014em;
}

.post-content > :first-child {
  margin-top: 0;
}

.post-content p,
.post-content ul,
.post-content ol {
  margin: 0 0 28px;
}

.post-content h2 {
  scroll-margin-top: 112px;
  margin: 58px 0 20px;
  color: #fffaf0;
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.045em;
}

.post-content h3 {
  margin: 40px 0 16px;
  color: #fffaf0;
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.post-content strong {
  color: #fffaf0;
}

.post-content a {
  color: var(--gold-soft);
  text-decoration: underline;
  text-decoration-color: rgba(255, 180, 63, 0.42);
  text-underline-offset: 4px;
}

.post-content a:hover {
  color: #fff3cf;
}

.post-content li {
  margin-bottom: 10px;
  padding-left: 6px;
}

.post-content li::marker {
  color: var(--gold);
}

.post-content blockquote {
  margin: 42px 0;
  padding: 22px 26px;
  border-left: 3px solid var(--gold);
  border-radius: 0 12px 12px 0;
  color: #f7efe0;
  background: rgba(255, 180, 63, 0.055);
  font-size: 21px;
  line-height: 1.55;
  letter-spacing: -0.025em;
}

.post-content figure {
  margin: 42px 0;
}

.post-content figure img,
.post-content figure video {
  width: 100%;
  border: 1px solid rgba(255, 180, 63, 0.24);
  border-radius: 14px;
  background: #080b0e;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.post-content figure video {
  display: block;
  aspect-ratio: 16 / 9;
}

.post-content figcaption {
  margin-top: 13px;
  color: var(--muted-soft);
  font-size: 14px;
  line-height: 1.55;
}

.post-content .diagram-frame img {
  padding: clamp(10px, 2vw, 22px);
  background: #090c10;
}

.post-content table {
  width: 100%;
  margin: 38px 0;
  border-collapse: collapse;
  border: 1px solid var(--line);
  color: rgba(247, 243, 234, 0.8);
  font-size: 15px;
  line-height: 1.55;
}

.post-content th,
.post-content td {
  padding: 15px 16px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.post-content th {
  color: #fffaf0;
  background: rgba(255, 180, 63, 0.075);
  font-weight: 740;
}

.post-content td:first-child {
  color: var(--gold-soft);
  font-weight: 720;
}

.table-scroll {
  overflow-x: auto;
  margin: 38px 0;
  border-radius: 12px;
}

.table-scroll table {
  min-width: 680px;
  margin: 0;
}

.wer-formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 34px 0 38px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #fffaf0;
  background: rgba(255, 180, 63, 0.045);
  font: 650 clamp(18px, 3vw, 25px)/1.25 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.formula-fraction {
  display: inline-grid;
  grid-template-rows: auto auto;
  text-align: center;
}

.formula-fraction span:first-child {
  padding: 0 10px 5px;
  border-bottom: 1px solid var(--gold);
}

.formula-fraction span:last-child {
  padding-top: 5px;
}

.post-content .announcement-callout {
  margin: 40px 0;
  padding: 24px 26px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 180, 63, 0.1), transparent 17rem),
    var(--panel);
}

.post-content .announcement-callout p:last-child {
  margin-bottom: 0;
}

.post-content code {
  padding: 0.12em 0.34em;
  border: 1px solid rgba(255, 180, 63, 0.17);
  border-radius: 5px;
  color: var(--gold-soft);
  background: rgba(0, 0, 0, 0.4);
  font: 0.88em ui-monospace, SFMono-Regular, Consolas, monospace;
}

.post-content pre {
  overflow-x: auto;
  margin: 34px 0;
  padding: 20px 22px;
  border: 1px solid rgba(255, 180, 63, 0.2);
  border-radius: 12px;
  color: var(--gold-soft);
  background: rgba(0, 0, 0, 0.5);
  font: 15px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.post-content pre code {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
}

.post-aside {
  position: sticky;
  top: 120px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.post-aside p {
  margin: 0 0 14px;
  color: var(--muted-soft);
  font-size: 12px;
  font-weight: 740;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-aside ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-aside a {
  color: rgba(247, 243, 234, 0.7);
  font-size: 14px;
  line-height: 1.45;
}

.post-aside a:hover {
  color: var(--gold-soft);
}

.post-footer-nav {
  margin-top: 62px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.post-footer-nav a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-soft);
  font-weight: 720;
  text-decoration: none;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 34px 0 46px;
  border-top: 1px solid rgba(255, 180, 63, 0.13);
  color: rgba(247, 243, 234, 0.62);
  font-size: 14px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  color: rgba(247, 243, 234, 0.74);
  font-weight: 650;
}

.footer-links a:hover {
  color: var(--gold-soft);
}

@media (max-width: 900px) {
  .nav {
    min-height: 74px;
  }

  .nav-links a:not([aria-current="page"]) {
    display: none;
  }

  .post-layout {
    grid-template-columns: minmax(0, var(--reading-width));
    gap: 0;
  }

  .post-aside {
    display: none;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 28px, var(--max));
  }

  .brand {
    font-size: 21px;
  }

  .brand img {
    width: 42px;
    height: 42px;
  }

  .nav-links {
    display: none;
  }

  .button {
    min-height: 42px;
    padding-inline: 15px;
  }

  .blog-hero {
    padding: 72px 0 50px;
  }

  .blog-hero h1,
  .post-header h1 {
    letter-spacing: -0.055em;
  }

  .post-list-link {
    grid-template-columns: 1fr auto;
    gap: 14px 20px;
    padding: 30px 0;
  }

  .post-list-link:hover {
    padding-inline: 10px;
  }

  .post-date {
    grid-column: 1 / -1;
  }

  .post-header {
    padding: 58px 0 42px;
  }

  .breadcrumbs {
    margin-bottom: 28px;
  }

  .post-meta {
    display: grid;
    gap: 8px;
  }

  .post-meta span + span::before {
    content: none;
  }

  .post-layout {
    padding: 42px 0 72px;
  }

  .post-content {
    font-size: 17px;
    line-height: 1.76;
  }

  .post-content h2 {
    margin-top: 48px;
  }

  .post-content blockquote {
    margin: 34px 0;
    padding: 19px 20px;
    font-size: 19px;
  }

  .post-content th,
  .post-content td {
    padding: 12px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
