@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-v17-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --espresso: #241b16;
  --espresso-soft: #3a2c24;
  --copper: #b5793a;
  --copper-dark: #8a5a22;
  --cream: #f2efe6;
  --paper: #fffdf9;
  --ink: #2b2521;
  --muted: #6e645e;
  --line: #ddd5cc;
  --warm-line: #e9dccb;
  --shadow: 0 18px 55px rgba(55, 39, 29, 0.09);
  font-family:
    'DM Sans',
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

a:focus-visible,
summary:focus-visible,
.table-scroll:focus-visible {
  outline: 3px solid var(--copper);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--espresso);
  font-weight: 700;
  transform: translateY(-150%);
}

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

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  background: var(--espresso);
  color: #fff;
}

.wordmark,
.footer-wordmark {
  text-decoration: none;
  font-size: 28px;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  font-weight: 650;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: #fff;
}

.site-nav .nav-cta {
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: #fff;
}

.article-hero,
.hub-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 5%, rgba(181, 121, 58, 0.28), transparent 34%),
    radial-gradient(circle at 88% 72%, rgba(255, 255, 255, 0.08), transparent 32%), var(--espresso);
  color: #fff;
}

.article-hero::after,
.hub-hero::after {
  position: absolute;
  right: -110px;
  bottom: -160px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  content: '';
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(900px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 78px;
}

.hub-hero .hero-inner {
  width: min(1180px, calc(100% - 48px));
  padding: 92px 0 98px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 52px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.breadcrumbs a {
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 3px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--copper-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.35;
  text-transform: uppercase;
}

.article-hero .eyebrow,
.hub-hero .eyebrow {
  color: #deb17c;
}

.article-hero h1,
.hub-hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(42px, 6vw, 68px);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.hub-hero h1 {
  max-width: 760px;
  font-size: clamp(48px, 7vw, 76px);
}

.dek {
  max-width: 780px;
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.55;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 30px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 760px);
  gap: clamp(44px, 7vw, 92px);
  width: min(1100px, calc(100% - 48px));
  margin: 0 auto;
  padding: 76px 0 112px;
}

.toc-column {
  min-width: 0;
}

.toc {
  position: sticky;
  top: 34px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.toc-label {
  margin: 0 0 14px;
  color: var(--espresso);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toc ol,
.toc-inline ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a,
.toc-inline a {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-decoration: none;
}

.toc a:hover,
.toc-inline a:hover {
  color: var(--copper-dark);
}

.mobile-toc {
  display: none;
}

.prose {
  min-width: 0;
  font-size: 17px;
  line-height: 1.78;
}

.prose > p:first-child {
  margin-top: 0;
  color: var(--espresso-soft);
  font-size: 21px;
  line-height: 1.68;
}

.prose p {
  margin: 0 0 24px;
}

.prose h2,
.prose h3 {
  color: var(--espresso);
  letter-spacing: -0.025em;
  scroll-margin-top: 32px;
}

.prose h2 {
  margin: 66px 0 20px;
  padding-top: 5px;
  font-size: clamp(29px, 4vw, 38px);
  font-weight: 690;
  line-height: 1.15;
}

.prose h3 {
  margin: 42px 0 14px;
  font-size: 23px;
  font-weight: 690;
  line-height: 1.3;
}

.prose ul,
.prose ol {
  margin: 0 0 28px;
  padding-left: 26px;
}

.prose li {
  margin: 8px 0;
  padding-left: 5px;
}

.prose li::marker {
  color: var(--copper);
  font-weight: 700;
}

.prose a {
  color: var(--copper-dark);
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose strong {
  color: var(--espresso);
  font-weight: 720;
}

.prose img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 34px auto 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.prose blockquote {
  margin: 34px 0;
  padding: 22px 26px;
  border-left: 4px solid var(--copper);
  border-radius: 0 12px 12px 0;
  background: #f7f0e7;
  color: var(--espresso-soft);
  font-size: 19px;
  font-weight: 580;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.table-scroll {
  width: 100%;
  margin: 34px 0 40px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(55, 39, 29, 0.05);
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

.table-scroll th,
.table-scroll td {
  padding: 15px 17px;
  border-bottom: 1px solid #ebe5de;
  text-align: left;
  vertical-align: top;
}

.table-scroll th {
  background: var(--cream);
  color: var(--espresso);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.table-scroll tr:last-child td {
  border-bottom: 0;
}

.article-cta {
  position: relative;
  margin-top: 72px;
  padding: clamp(28px, 5vw, 48px);
  overflow: hidden;
  border-radius: 22px;
  background: var(--espresso);
  box-shadow: var(--shadow);
  color: #fff;
}

.article-cta::after {
  position: absolute;
  right: -70px;
  bottom: -100px;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  content: '';
}

.prose .article-cta h2 {
  position: relative;
  z-index: 1;
  max-width: 570px;
  margin: 0 0 14px;
  padding: 0;
  color: #fff;
  font-size: clamp(28px, 4vw, 39px);
}

.article-cta p {
  position: relative;
  z-index: 1;
  max-width: 590px;
  color: rgba(255, 255, 255, 0.72);
}

.article-cta .eyebrow {
  color: #deb17c;
}

.cta-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.prose .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 19px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 760;
  line-height: 1;
  text-decoration: none;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.prose .button-primary {
  background: var(--copper-dark);
  color: #fff;
}

.prose .button-secondary {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.related-card {
  margin-top: 26px;
  padding: 28px 30px;
  border: 1px solid var(--warm-line);
  border-radius: 18px;
  background: #fbf6ef;
}

.prose .related-card h2 {
  margin: 0 0 10px;
  padding: 0;
  font-size: 25px;
  line-height: 1.3;
}

.related-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
}

.guides-section {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 88px 0 118px;
}

.section-heading {
  max-width: 660px;
  margin-bottom: 34px;
}

.section-heading h2 {
  margin: 0;
  color: var(--espresso);
  font-size: clamp(34px, 5vw, 48px);
  letter-spacing: -0.04em;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.guide-card,
.empty-guides {
  display: flex;
  min-height: 350px;
  flex-direction: column;
  padding: clamp(28px, 4vw, 42px);
  border: 1px solid var(--warm-line);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(181, 121, 58, 0.08), transparent 48%), #fff;
  box-shadow: var(--shadow);
}

.not-found {
  display: grid;
  min-height: calc(100vh - 72px);
  place-items: center;
  padding: 56px 24px;
  background: radial-gradient(circle at 20% 10%, rgba(181, 121, 58, 0.13), transparent 32%), var(--paper);
}

.not-found-card {
  width: min(620px, 100%);
  padding: clamp(34px, 7vw, 64px);
  border: 1px solid var(--warm-line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.not-found-card h1 {
  margin: 0 0 16px;
  color: var(--espresso);
  font-size: clamp(42px, 8vw, 68px);
  letter-spacing: -0.05em;
}

.not-found-card > p:not(.eyebrow) {
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.not-found-card .button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--espresso);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}

.guide-card h2,
.empty-guides h2 {
  margin: 0 0 16px;
  color: var(--espresso);
  font-size: clamp(27px, 3vw, 35px);
  letter-spacing: -0.035em;
  line-height: 1.18;
}

.guide-card h2 a {
  text-decoration: none;
}

.guide-card > p:not(.eyebrow),
.empty-guides > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: auto;
  padding-top: 32px;
  color: var(--muted);
  font-size: 13px;
}

.text-link {
  margin-top: 18px;
  color: var(--copper-dark);
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
}

.guide-card:hover h2 a,
.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.empty-guides {
  grid-column: 1 / -1;
  min-height: 260px;
  justify-content: center;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto;
  gap: 30px 72px;
  padding: 58px max(24px, calc((100vw - 1180px) / 2));
  background: #1d1714;
  color: #fff;
}

.site-footer > div p {
  max-width: 460px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
  line-height: 1.6;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 22px;
}

.site-footer nav a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.site-footer nav a:hover {
  color: #fff;
}

.copyright {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

@media (max-width: 850px) {
  .site-header {
    padding-inline: 20px;
  }

  .site-nav > a:not(.nav-cta) {
    display: none;
  }

  .hero-inner,
  .hub-hero .hero-inner {
    width: min(100% - 40px, 760px);
    padding: 58px 0 64px;
  }

  .breadcrumbs {
    margin-bottom: 40px;
  }

  .article-layout {
    display: block;
    width: min(100% - 40px, 760px);
    padding: 46px 0 86px;
  }

  .toc-column {
    display: none;
  }

  .mobile-toc {
    display: block;
    width: min(100% - 40px, 760px);
    margin: 28px auto 0;
    padding: 15px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }

  .mobile-toc summary {
    cursor: pointer;
    color: var(--espresso);
    font-size: 14px;
    font-weight: 750;
  }

  .toc-inline {
    padding-top: 16px;
  }

  .toc-inline .toc-label {
    display: none;
  }

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

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

  .site-footer nav {
    gap: 18px;
  }

  .copyright {
    grid-column: 1;
  }
}

@media (max-width: 480px) {
  .site-header {
    min-height: 64px;
  }

  .wordmark {
    font-size: 25px;
  }

  .site-nav .nav-cta {
    padding: 9px 12px;
    font-size: 13px;
  }

  .hero-inner,
  .hub-hero .hero-inner,
  .article-layout,
  .mobile-toc,
  .guides-section {
    width: calc(100% - 32px);
  }

  .article-hero h1,
  .hub-hero h1 {
    font-size: 39px;
    line-height: 1.07;
  }

  .dek {
    font-size: 18px;
  }

  .article-meta {
    font-size: 13px;
  }

  .prose {
    font-size: 16px;
  }

  .prose > p:first-child {
    font-size: 19px;
  }

  .prose h2 {
    margin-top: 54px;
    font-size: 29px;
  }

  .prose h3 {
    font-size: 21px;
  }

  .prose blockquote {
    margin-inline: 0;
    padding: 18px 20px;
    font-size: 17px;
  }

  .article-cta,
  .related-card,
  .guide-card,
  .empty-guides {
    border-radius: 17px;
  }

  .article-cta {
    padding: 27px 22px;
  }

  .cta-actions,
  .prose .button {
    width: 100%;
  }

  .guides-section {
    padding: 66px 0 84px;
  }

  .guide-card {
    min-height: 0;
    padding: 28px 24px;
  }
}

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

  .prose .button {
    transition: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  .toc-column,
  .mobile-toc,
  .article-cta,
  .related-card {
    display: none;
  }

  .article-hero {
    background: #fff;
    color: #000;
  }

  .article-hero .dek,
  .article-hero .article-meta {
    color: #333;
  }

  .article-layout {
    display: block;
    width: 100%;
    padding: 30px 0;
  }
}
