/* 1. Root variables and reset */
:root {
  --bg: #f7f3ea;
  --surface: #fffaf1;
  --surface-strong: #efe2cc;
  --text: #201b17;
  --text-muted: #61564b;
  --border: #d7c6ad;
  --accent: #7c3f24;
  --accent-strong: #512716;
  --success: #2f6b4f;
  --danger: #93443e;
  --shadow-soft: 0 18px 45px rgba(32, 27, 23, 0.12);
  --content-width: 1200px;
  --wide-width: 1120px;
  --section-gap: clamp(2.4rem, 5vw, 4.8rem);
  --radius-sm: 0.55rem;
  --radius-md: 1rem;
  --radius-lg: 1.6rem;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, #fff9ed 0, var(--bg) 44%, #eee0ca 100%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(16px, 1.2vw, 19px);
  line-height: 1.68;
}

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

a {
  color: var(--accent-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

/* 2. Base typography */
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  color: var(--text);
}

h1 {
  font-size: clamp(2.4rem, 7vw, 5.6rem);
  letter-spacing: -0.055em;
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.75rem, 3.6vw, 3rem);
  letter-spacing: -0.035em;
  margin: 0 0 1rem;
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  margin: 0 0 0.65rem;
}

p, li, td, th, dd, summary {
  text-align: left;
}

p {
  margin: 0 0 1.05rem;
}

/* 3. Global layout and page shell */
.site-header, .site-footer {
  background: rgba(255, 250, 241, 0.9);
  border-bottom: 1px solid var(--border);
}

.header-inner, .footer-inner {
  width: min(var(--wide-width), calc(100% - 2rem));
  margin: 0 auto;
}

main {
  width: 100%;
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: var(--content-width);
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

article {
  margin: 0 auto;
}

.section-block, .toc {
  width: min(var(--content-width), calc(100% - 2rem));
  margin: var(--section-gap) auto 0;
}

/* 4. Header and navigation */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent-strong);
}

.site-header nav, .site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
}

.site-header nav a, .site-footer nav a {
  font-size: 0.95rem;
  color: var(--text);
}

/* 5. Hero */
.hero {
  width: min(var(--wide-width), calc(100% - 2rem));
  margin: 2rem auto 0;
  padding: clamp(1.4rem, 5vw, 4rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fffaf1 0%, #f0e1c8 55%, #ead4b6 100%);
  box-shadow: var(--shadow-soft);
}

.hero-copy {
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}

.eyebrow {
  margin-bottom: 0.85rem;
  color: var(--accent-strong);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}

.lead {
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  color: var(--text);
}

.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.3rem;
}

.hero-notes span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 250, 241, 0.7);
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 700;
}

.hero-figure {
  max-width: 900px;
  margin: 2rem auto 0;
}

/* 6. Article sections and prose */
.section-block {
  background: rgba(255, 250, 241, 0.78);
  border: 1px solid rgba(215, 198, 173, 0.9);
  border-radius: var(--radius-md);
  padding: clamp(1.2rem, 3vw, 2rem);
}

.section-block > :last-child, .toc > :last-child {
  margin-bottom: 0;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
}

/* 7. Reusable components */
.tldr, .callout, .checklist-card {
  margin: 1.35rem 0;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.tldr {
  background: #f3eadb;
  color: var(--text);
}

.callout {
  background: #f9efe1;
  color: var(--text);
  border-left: 0.35rem solid var(--accent);
}

.checklist-card {
  background: #eef4ed;
  color: var(--text);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.35rem 0;
}

.card-grid section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: var(--surface);
}

.decision-path {
  display: grid;
  gap: 0.8rem;
  padding-left: 1.2rem;
}

/* 8. Tables and lists */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th, td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--surface-strong);
  color: var(--text);
}

ul, ol {
  padding-left: 1.2rem;
}

/* 9. Images and figures */
figure {
  margin: 1.7rem auto;
}

figure img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(32, 27, 23, 0.10);
}

figcaption {
  margin-top: 0.55rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* 10. Details and FAQ accordion */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  background: var(--surface);
  margin: 0.75rem 0;
}

summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-strong);
}

/* 11. Footer */
.site-footer {
  margin-top: var(--section-gap);
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.footer-inner {
     display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, .6fr);
    gap: 2rem;
    width: min(100%, var(--wide-width));
    margin: 0 auto;
}

.footer-col h2 {
      font-family: var(--font-heading);
      font-weight: 700;
      font-size: 0.78rem;
      letter-spacing: 0.16em;
      text-transform: uppercase;
      color: var(--accent);
      margin: 0 0 1rem;
    }

.site-footer p {
  color: var(--text-muted);
  max-width: var(--content-width);
  font-size: 0.82rem;
}

/* 12. 404 page styles */
.not-found {
  min-height: 60vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

/* 13. Focus states, reduced motion and responsive media queries */
a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 0.2rem;
}

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

@media (max-width: 840px) {
   .footer-inner
 {
        grid-template-columns: 1fr;
    }

@media (max-width: 760px) {
  .header-inner {
    align-items: flex-start;
    
  }

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

  .hero, .section-block, .toc {
    width: min(100% - 1rem, var(--wide-width));
  }

  .hero {
    padding: 1rem;
  }
}



@media (max-width: 480px) {
    .site-footer {
        padding: 30px 15px 15px;
    }
}
