:root {
  color-scheme: light;
  --paper: #f7f0e6;
  --paper-strong: #eadfce;
  --surface: #fffaf2;
  --ink: #2f2924;
  --muted: #675d54;
  --line: #cdbfad;
  --accent: #bd3f2e;
  --accent-ink: #fffaf5;
  --accent-soft: #f1cec5;
  --inverse-bg: #2f2924;
  --inverse-ink: #fffaf2;
  --inverse-muted: #d9cfc3;
  --inverse-accent: #f29a84;
  --inverse-accent-ink: #21130f;
  --display-font: "Space Grotesk", "Segoe UI", sans-serif;
  --body-font: "DM Sans", "Segoe UI", sans-serif;
  --content-width: 1180px;
  --reading-width: 720px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body-font);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191714;
  --paper-strong: #26221d;
  --surface: #211e1a;
  --ink: #f3e8dc;
  --muted: #c8b9aa;
  --line: #4d453d;
  --accent: #ef8f79;
  --accent-ink: #21130f;
  --accent-soft: #56362f;
  --inverse-bg: #f3e8dc;
  --inverse-ink: #211e1a;
  --inverse-muted: #65594f;
  --inverse-accent: #9b3023;
  --inverse-accent-ink: #fffaf2;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

figure {
  margin: 0;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

button,
summary {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

[id] {
  scroll-margin-top: 2rem;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  transform: translateY(-180%);
  background: var(--ink);
  color: var(--paper);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(var(--content-width), calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.site-nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 1.03rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.nav-links,
.header-actions,
.language-links,
.button-row {
  display: flex;
  align-items: center;
}

.nav-links {
  gap: clamp(1.25rem, 3vw, 2.25rem);
}

.header-actions,
.language-links {
  gap: 0.75rem;
}

.nav-links a,
.language-links a,
.mobile-menu a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links a:hover,
.language-links a:hover,
.mobile-menu a:hover,
.nav-links a[aria-current="page"],
.language-links a[aria-current="page"] {
  color: var(--ink);
}

.theme-toggle {
  min-width: 64px;
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
}

.theme-toggle:hover {
  border-color: var(--ink);
}

.mobile-menu {
  display: none;
}

.eyebrow {
  max-width: 42rem;
  margin: 0 0 1.15rem;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display-font);
  letter-spacing: -0.045em;
  line-height: 1.03;
}

h1 {
  max-width: 10ch;
  font-size: clamp(3.25rem, 7.6vw, 6.7rem);
}

h2 {
  max-width: 18ch;
  font-size: clamp(2.2rem, 5vw, 4.65rem);
}

h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.85rem);
}

.button-row {
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--accent);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  transition: transform 150ms ease, background-color 150ms ease, color 150ms ease;
}

.button:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.button-secondary {
  background: transparent;
  color: var(--accent);
}

.reading-list {
  border-top: 2px solid var(--ink);
}

.guide-link {
  min-height: 190px;
  display: grid;
  grid-template-columns: minmax(150px, 0.38fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 3.5rem);
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.guide-link:hover {
  color: var(--ink);
  text-decoration: none;
}

.guide-link img {
  width: 100%;
  height: 140px;
  border-radius: 8px;
  object-fit: cover;
  filter: saturate(0.82);
  transition: filter 150ms ease, transform 150ms ease;
}

.guide-link:hover img {
  filter: saturate(1);
  transform: translateY(-2px);
}

.guide-topic {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
}

.guide-link h3 {
  max-width: 24ch;
}

.guide-link p {
  max-width: 58ch;
  margin: 0.7rem 0 0;
  color: var(--muted);
}

.guide-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.closing-cta {
  padding-block: clamp(4rem, 9vw, 7rem);
  background: var(--inverse-bg);
  color: var(--inverse-ink);
}

.closing-cta .shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem;
}

.closing-cta h2 {
  max-width: 16ch;
}

.closing-cta .button-primary {
  border-color: var(--inverse-accent);
  background: var(--inverse-accent);
  color: var(--inverse-accent-ink);
}

.closing-cta .button-secondary {
  border-color: var(--inverse-ink);
  color: var(--inverse-ink);
}

.site-footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-grid p {
  margin: 0;
}

.guide-masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.65fr);
  align-items: end;
  gap: clamp(2rem, 8vw, 7rem);
  padding-block: clamp(4.5rem, 10vw, 8rem);
}

.guide-masthead h1 {
  max-width: 12ch;
}

.guide-masthead .lead {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
}

.featured-guide {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  background: var(--inverse-bg);
  color: var(--inverse-ink);
  text-decoration: none;
}

.featured-guide:hover {
  color: var(--inverse-ink);
  text-decoration: none;
}

.featured-guide img {
  width: 100%;
  height: 100%;
  min-height: 560px;
  object-fit: cover;
}

.featured-guide-copy {
  align-self: end;
  padding: clamp(2rem, 5vw, 4.5rem);
}

.featured-guide .guide-topic,
.featured-guide .guide-action {
  color: var(--inverse-accent);
}

.featured-guide h2 {
  font-size: clamp(2.4rem, 5vw, 4.6rem);
}

.featured-guide p {
  margin: 1.2rem 0 0;
  color: var(--inverse-muted);
}

.featured-guide .guide-action {
  margin-top: 2rem;
}

.guide-ledger {
  padding-block: clamp(3rem, 8vw, 6rem) clamp(5rem, 10vw, 8rem);
}

.guide-note {
  max-width: 62ch;
  margin: 0 0 2.5rem auto;
  color: var(--muted);
}

.article-masthead {
  padding-block: clamp(4.5rem, 10vw, 8rem) clamp(3rem, 7vw, 5rem);
}

.article-masthead-grid {
  display: grid;
  grid-template-columns: minmax(170px, 0.32fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(2rem, 7vw, 6rem);
}

.article-meta {
  padding-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.article-meta p {
  margin: 0;
}

.article-meta p + p {
  margin-top: 0.5rem;
}

.article-masthead h1 {
  max-width: 13ch;
  font-size: clamp(3rem, 7.2vw, 6.3rem);
}

.article-masthead .lead {
  max-width: 52ch;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.9vw, 1.3rem);
}

.article-lead-image {
  width: min(1380px, calc(100% - 48px));
  margin: 0 auto;
}

.article-lead-image img {
  width: 100%;
  max-height: 680px;
  aspect-ratio: 16 / 7;
  border-radius: 18px 180px 18px 18px;
  object-fit: cover;
}

.article-lead-image-asset,
.article-lead-image-phone {
  display: grid;
  justify-items: center;
  padding: clamp(1.5rem, 4vw, 4rem);
  border-radius: 18px 180px 18px 18px;
  background: var(--paper-strong);
}

.article-lead-image-asset img {
  width: min(100%, 960px);
  height: auto;
  max-height: 620px;
  aspect-ratio: auto;
  border-radius: 12px;
  object-fit: contain;
}

.article-lead-image-phone img {
  width: min(100%, 300px);
  height: auto;
  max-height: 620px;
  aspect-ratio: auto;
  border-radius: 34px 34px 0 0;
  box-shadow: 0 22px 60px -34px rgb(0 0 0 / 0.85);
  object-fit: contain;
}

.article-lead-image-asset figcaption,
.article-lead-image-phone figcaption {
  width: 100%;
}

.article-lead-image figcaption,
.article-figure figcaption {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, var(--reading-width));
  justify-content: center;
  gap: clamp(2.5rem, 7vw, 6rem);
  padding-block: clamp(4rem, 9vw, 8rem);
}

.article-toc {
  align-self: start;
  padding-top: 0.4rem;
}

.article-toc strong {
  display: block;
  margin-bottom: 0.75rem;
  font-family: var(--display-font);
}

.article-toc a {
  min-height: 44px;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.3;
  text-decoration: none;
}

.article-toc a:hover {
  color: var(--ink);
}

.article-content {
  min-width: 0;
}

.article-content .opening {
  margin-top: 0;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: clamp(1.25rem, 2.3vw, 1.65rem);
  font-weight: 600;
  line-height: 1.45;
}

.article-content h2 {
  max-width: 20ch;
  margin: 4.25rem 0 1.15rem;
  font-size: clamp(2rem, 4vw, 3.15rem);
}

.article-content h3 {
  margin: 2.5rem 0 0.75rem;
}

.article-content p,
.article-content li {
  color: var(--muted);
}

.article-content li + li {
  margin-top: 0.75rem;
}

.article-callout {
  margin-block: 3.5rem;
  padding-block: 1.6rem;
  border-block: 2px solid var(--ink);
}

.article-callout strong {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--accent);
  font-family: var(--display-font);
  font-size: 0.9rem;
}

.article-callout p {
  margin: 0;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: clamp(1.2rem, 2.3vw, 1.55rem);
  font-weight: 600;
  line-height: 1.45;
}

.article-figure {
  width: min(980px, calc(100vw - 48px));
  margin: 4rem 0 4rem min(-9vw, -100px);
}

.article-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  object-fit: cover;
}

.article-figure-phone {
  display: grid;
  place-items: center;
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 6vw, 4rem) 0;
  background: var(--paper-strong);
}

.article-figure-phone img {
  width: min(100%, 296px);
  aspect-ratio: auto;
  border-radius: 34px 34px 0 0;
  box-shadow: 0 22px 60px -34px rgb(0 0 0 / 0.85);
}

.article-figure-phone figcaption {
  width: 100%;
  padding-block: 1rem 1.5rem;
}

.article-content .button-row {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .shell,
  .article-lead-image {
    width: min(100% - 36px, var(--content-width));
  }

  .nav-links {
    display: none;
  }

  .mobile-menu {
    position: relative;
    display: block;
  }

  .mobile-menu summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 700;
    list-style: none;
  }

  .mobile-menu summary::-webkit-details-marker {
    display: none;
  }

  .mobile-menu nav {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: min(260px, calc(100vw - 36px));
    display: grid;
    padding: 0.7rem 1rem;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 16px 40px -28px rgb(0 0 0 / 0.8);
  }

  .guide-masthead,
  .featured-guide,
  .article-masthead-grid,
  .article-layout,
  .closing-cta .shell {
    grid-template-columns: 1fr;
  }

  .article-lead-image img {
    border-radius: 100px 14px 14px 14px;
  }

  .article-lead-image-asset,
  .article-lead-image-phone {
    border-radius: 100px 14px 14px 14px;
  }

  .guide-masthead {
    gap: 1.5rem;
  }

  .featured-guide img {
    min-height: 380px;
  }

  .article-meta {
    order: 2;
    padding-top: 0;
  }

  .article-toc {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
  }

  .article-toc strong {
    grid-column: 1 / -1;
  }

  .article-figure {
    width: 100%;
    margin-left: 0;
  }

}

@media (max-width: 620px) {
  .shell,
  .article-lead-image {
    width: min(100% - 28px, var(--content-width));
  }

  body {
    font-size: 16px;
  }

  .site-nav {
    min-height: 68px;
    gap: 0.6rem;
  }

  .brand {
    gap: 0.55rem;
    font-size: 0.94rem;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .language-links {
    display: none;
  }

  .theme-toggle {
    min-width: 56px;
    padding-inline: 0.55rem;
  }

  h1 {
    font-size: clamp(3rem, 16vw, 4.6rem);
  }

  h2 {
    font-size: clamp(2.15rem, 11vw, 3.4rem);
  }

  .button-row,
  .button {
    width: 100%;
  }

  .article-toc {
    grid-template-columns: 1fr;
  }

  .guide-link {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-block: 1.5rem 2rem;
  }

  .guide-link img {
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .guide-action {
    width: fit-content;
  }

  .featured-guide img {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .featured-guide-copy {
    padding: 2rem 1.25rem 2.5rem;
  }

  .article-masthead {
    padding-block: 3.5rem 3rem;
  }

  .article-masthead h1 {
    font-size: clamp(2.8rem, 14vw, 4.4rem);
  }

  .article-lead-image img {
    aspect-ratio: 4 / 3;
  }

  .article-layout {
    gap: 2.5rem;
    padding-block: 3rem 5rem;
  }

  .article-content h2 {
    margin-top: 3.5rem;
  }

  .closing-cta .shell {
    gap: 0;
  }

  .footer-grid {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
