:root {
  color-scheme: dark;
  --canvas: #0d0d0c;
  --surface: #171715;
  --surface-raised: #1d1d1a;
  --text: #f3f1e9;
  --muted: #aaa79d;
  --subtle: #85827a;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --gold: #d8b752;
  --gold-light: #f1d77e;
  --info: #4a90d9;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--canvas);
  color: var(--text);
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 76% 8%, rgba(216, 183, 82, 0.08), transparent 28rem),
    var(--canvas);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

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

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 5px;
  background: var(--gold);
  color: #17150e;
  font-weight: 800;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.site-footer {
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
}

.site-header {
  min-height: 84px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

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

.site-nav,
.site-actions,
.site-footer-links {
  display: flex;
  align-items: center;
}

.site-nav {
  gap: 1.9rem;
}

.site-actions {
  justify-content: flex-end;
  gap: 1.3rem;
}

.site-nav a,
.login-link {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.login-link:hover {
  color: var(--text);
}

.button {
  min-height: 40px;
  padding: 0.55rem 0.85rem 0.55rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 1px solid var(--gold);
  border-radius: 5px;
  background: var(--gold);
  color: #17150e;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.button::after,
.text-arrow::after {
  content: "\2192";
}

.button:hover {
  border-color: var(--gold-light);
  background: var(--gold-light);
}

.blog-index,
.article-shell,
.not-found {
  width: min(100% - 64px, 1240px);
  margin: 0 auto;
}

.blog-hero {
  max-width: 850px;
  padding: clamp(4.5rem, 9vw, 8rem) 0 clamp(3.5rem, 7vw, 6rem);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.blog-hero h1,
.article-header h1,
.not-found h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.4rem);
  font-weight: 620;
  letter-spacing: -0.065em;
  line-height: 0.98;
  text-wrap: balance;
}

.blog-hero > p:last-child,
.article-lead {
  max-width: 720px;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.2rem);
  line-height: 1.7;
}

.article-grid {
  padding-bottom: clamp(5rem, 9vw, 8rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.article-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.article-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.article-card-visual,
.article-visual {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 12% 5%, rgba(83, 52, 214, 0.24), transparent 38%),
    #090909;
}

.article-card-visual {
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--border);
}

.article-card-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.article-card-copy {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.article-card h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.article-card p {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.text-arrow {
  margin-top: 1.25rem;
  display: inline-flex;
  gap: 0.45rem;
  color: var(--gold-light);
  font-size: 0.82rem;
  font-weight: 750;
}

.article-shell {
  max-width: 980px;
  padding-bottom: clamp(5rem, 10vw, 9rem);
}

.back-link {
  margin-top: 2.5rem;
  display: inline-block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

.article-header {
  max-width: 900px;
  padding: clamp(3rem, 7vw, 6rem) 0 2.5rem;
}

.article-header h1 {
  font-size: clamp(2.75rem, 6.6vw, 5.6rem);
}

.article-visual {
  min-height: 260px;
  max-height: 620px;
  margin: 0 0 clamp(3rem, 6vw, 5rem);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.article-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.article-body {
  max-width: 740px;
  margin: 0 auto;
  color: #cbc7bc;
  font-size: clamp(1rem, 1.4vw, 1.08rem);
}

.article-body h2 {
  margin: 3rem 0 1rem;
  color: var(--text);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.15;
  text-wrap: balance;
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote {
  margin: 1rem 0 0;
}

.article-body ul,
.article-body ol {
  padding-left: 1.4rem;
}

.article-body li + li {
  margin-top: 0.55rem;
}

.article-body strong {
  color: var(--text);
}

.article-body a {
  color: var(--gold-light);
}

.article-body blockquote {
  padding: 1.1rem 1.25rem;
  border-left: 3px solid var(--gold);
  border-radius: 0 7px 7px 0;
  background: var(--surface);
  color: var(--text);
  font-size: 1.03em;
}

.example {
  margin: 1.5rem 0 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.example-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.article-cta {
  margin-top: 3.5rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 10px;
  background: var(--gold);
  color: #19170f;
}

.article-cta h2 {
  margin: 0;
  color: #19170f;
}

.article-cta p {
  margin-top: 0.7rem;
  color: rgba(25, 23, 15, 0.78);
}

.article-cta .button {
  margin-top: 1.25rem;
  border-color: #19170f;
  background: #19170f;
  color: var(--text);
}

.related {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related h2 {
  margin: 0;
  font-size: 1.15rem;
}

.related ul {
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
  list-style: none;
}

.related a {
  color: var(--gold-light);
  font-weight: 700;
}

.not-found {
  min-height: calc(100vh - 195px);
  max-width: 860px;
  padding: clamp(5rem, 13vw, 10rem) 0;
}

.not-found h1 {
  font-size: clamp(3.5rem, 10vw, 8rem);
}

.not-found > p:not(.eyebrow) {
  max-width: 560px;
  margin: 1.3rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.not-found .button {
  margin-top: 2rem;
}

.site-footer {
  min-height: 110px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  border-top: 1px solid var(--border);
}

.site-footer p,
.site-footer a {
  color: var(--subtle);
  font-size: 0.72rem;
}

.site-footer-links {
  justify-content: flex-end;
  gap: 1.5rem;
}

@media (max-width: 760px) {
  .site-header,
  .site-footer,
  .blog-index,
  .article-shell,
  .not-found {
    width: min(100% - 36px, 1240px);
  }

  .site-header {
    min-height: 72px;
    grid-template-columns: 1fr auto;
  }

  .site-nav,
  .login-link {
    display: none;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-visual {
    min-height: 210px;
  }

  .site-footer {
    padding: 2rem 0;
    grid-template-columns: 1fr auto;
  }

  .site-footer > p {
    display: none;
  }
}

@media (max-width: 520px) {
  .site-actions {
    gap: 0.75rem;
  }

  .button {
    min-height: 44px;
  }

  .article-visual {
    min-height: 170px;
    aspect-ratio: 4 / 3;
  }

  .site-footer-links a:first-child {
    display: none;
  }
}

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

  .article-card {
    transition: none;
  }
}
