/* =========================================================================
   POSTURA — editorial design system
   Minimal, fast, journalism-grade. Light + dark. Two typefaces, one accent.
   ========================================================================= */

:root {
  /* Palette — light (paper) */
  --paper:        #fcfbf7;
  --paper-2:      #f4f2ea;
  --ink:          #15171c;
  --ink-soft:     #3a3d44;
  --muted:        #6c6f78;
  --faint:        #9a9ca3;
  --hairline:     #e6e3d8;
  --hairline-2:   #d9d5c7;
  --accent:       #1b5e44;   /* deep forest green — trust, calm, distinct */
  --accent-ink:   #11402f;
  --accent-wash:  #eaf2ed;
  --card:         #ffffff;
  --shadow:       0 1px 2px rgba(20,23,28,.04), 0 8px 30px rgba(20,23,28,.05);
  --shadow-lift:  0 2px 6px rgba(20,23,28,.06), 0 16px 50px rgba(20,23,28,.09);

  /* Type */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Layout */
  --measure: 44rem;          /* article reading column */
  --wide:    72rem;          /* page max width */
  --gap:     clamp(1rem, 4vw, 2.5rem);
  --radius:  10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #0e0f12;
    --paper-2:    #16181d;
    --ink:        #ecedf0;
    --ink-soft:   #c7c9cf;
    --muted:      #969aa3;
    --faint:      #6b6e77;
    --hairline:   #24262c;
    --hairline-2: #30333a;
    --accent:     #5fcaa0;
    --accent-ink: #aef0d3;
    --accent-wash:#15211c;
    --card:       #16181d;
    --shadow:     0 1px 2px rgba(0,0,0,.3), 0 10px 34px rgba(0,0,0,.4);
    --shadow-lift:0 2px 8px rgba(0,0,0,.4), 0 18px 56px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  --paper:#0e0f12; --paper-2:#16181d; --ink:#ecedf0; --ink-soft:#c7c9cf;
  --muted:#969aa3; --faint:#6b6e77; --hairline:#24262c; --hairline-2:#30333a;
  --accent:#5fcaa0; --accent-ink:#aef0d3; --accent-wash:#15211c; --card:#16181d;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 10px 34px rgba(0,0,0,.4);
  --shadow-lift:0 2px 8px rgba(0,0,0,.4),0 18px 56px rgba(0,0,0,.55);
}

/* ---------- reset ---------- */
*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img,svg,video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--accent); color: var(--paper); }

/* ---------- layout helpers ---------- */
.wrap   { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: var(--gap); }
.narrow { max-width: var(--measure); }
.center { text-align: center; }
.eyebrow {
  font-family: var(--sans);
  font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); display: inline-block;
}
.muted { color: var(--muted); }
.hairline { border: 0; border-top: 1px solid var(--hairline); margin: 3rem 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.site-header__bar {
  display: flex; align-items: center; gap: 1.5rem;
  height: 64px;
}
.masthead {
  font-family: var(--serif);
  font-weight: 600; font-size: 1.5rem; letter-spacing: -.01em;
  color: var(--ink); white-space: nowrap;
}
.masthead b { color: var(--accent); font-weight: 600; }
.site-nav { display: flex; align-items: center; gap: 1.4rem; margin-left: auto; }
.site-nav a {
  font-size: .92rem; font-weight: 500; color: var(--ink-soft);
  padding: .35rem 0; position: relative; transition: color .15s;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px;
  background: var(--accent); transition: right .2s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { right: 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--hairline); border-radius: 8px; background: transparent;
  color: var(--ink-soft); transition: all .15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--hairline-2); background: var(--paper-2); }
.icon-btn svg { width: 18px; height: 18px; }
.nav-tools { display: flex; align-items: center; gap: .5rem; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .moon,
.theme-toggle.is-dark .moon { display: block; }
:root[data-theme="dark"] .theme-toggle .sun,
.theme-toggle.is-dark .sun { display: none; }
.nav-burger { display: none; }

@media (max-width: 760px) {
  .site-nav {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch;
    gap: 0; background: var(--paper); border-bottom: 1px solid var(--hairline);
    padding: .5rem var(--gap) 1.25rem; margin: 0;
    transform: translateY(-120%); transition: transform .25s ease; box-shadow: var(--shadow);
  }
  .site-nav.open { transform: translateY(0); }
  .site-nav a { padding: .85rem 0; border-bottom: 1px solid var(--hairline); font-size: 1.05rem; }
  .site-nav a::after { display: none; }
  .nav-burger { display: inline-grid; }
}

/* ---------- hero / home ---------- */
.lede {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--hairline);
}
.lede h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.04; letter-spacing: -.02em;
  max-width: 18ch;
}
.lede p { font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--muted); max-width: 52ch; margin-top: 1.25rem; }

/* feature row */
.feature {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(1.5rem, 5vw, 4rem);
  align-items: stretch; padding: clamp(2.5rem,6vw,4rem) 0;
}
@media (max-width: 860px){ .feature { grid-template-columns: 1fr; } }
.feature__lead a.card-title { font-size: clamp(1.9rem, 4vw, 2.75rem); }
.feature__side { display: flex; flex-direction: column; gap: 1.5rem; }

/* ---------- article cards ---------- */
.card-meta {
  display: flex; gap: .6rem; align-items: center; flex-wrap: wrap;
  font-size: .78rem; color: var(--muted); margin-bottom: .55rem;
}
.tag {
  font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
}
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.card-title {
  font-family: var(--serif); font-weight: 500; line-height: 1.12; letter-spacing: -.01em;
  color: var(--ink); display: block; transition: color .15s;
}
a.card-title:hover { color: var(--accent); }
.card-dek { color: var(--muted); margin-top: .6rem; font-size: .98rem; }

.grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 2.75rem);
}
@media (max-width: 860px){ .grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px){ .grid { grid-template-columns: 1fr; } }
.grid .card-title { font-size: 1.4rem; }

.list-item {
  display: block; padding: 1.4rem 0; border-top: 1px solid var(--hairline);
}
.list-item:first-child { border-top: 0; }
.list-item .card-title { font-size: 1.3rem; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: clamp(3rem,7vw,4.5rem) 0 1.75rem; gap: 1rem;
  border-bottom: 2px solid var(--ink); padding-bottom: .65rem;
}
.section-head h2 { font-family: var(--serif); font-weight: 600; font-size: 1.4rem; letter-spacing: -.01em; }
.section-head a { font-size: .85rem; font-weight: 600; color: var(--accent); white-space: nowrap; }

/* ---------- article page ---------- */
.article-head { padding: clamp(2.5rem,6vw,4rem) 0 1.5rem; }
.breadcrumb { font-size: .8rem; color: var(--muted); margin-bottom: 1.25rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--accent); }
.article-title {
  font-family: var(--serif); font-weight: 500; letter-spacing: -.02em; line-height: 1.06;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
}
.article-dek { font-size: clamp(1.1rem,2.4vw,1.4rem); color: var(--muted); margin-top: 1.1rem; max-width: 60ch; line-height: 1.5; }

.byline {
  display: flex; align-items: center; gap: .85rem; margin-top: 1.75rem;
  padding-top: 1.5rem; border-top: 1px solid var(--hairline);
}
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--accent); color: var(--paper);
  display: grid; place-items: center; font-weight: 600; font-size: 1rem;
  object-fit: cover;
}
.byline__meta { font-size: .9rem; line-height: 1.4; }
.byline__meta strong { color: var(--ink); }
.byline__meta span { color: var(--muted); }

/* article body typography */
.prose { font-size: 1.16rem; line-height: 1.75; color: var(--ink-soft); }
.prose > * { max-width: var(--measure); margin-inline: auto; }
.prose p { margin: 1.4rem auto; }
.prose h2 {
  font-family: var(--serif); font-weight: 600; color: var(--ink);
  font-size: 1.85rem; line-height: 1.15; letter-spacing: -.01em;
  margin: 2.8rem auto .75rem; scroll-margin-top: 84px;
}
.prose h3 {
  font-family: var(--serif); font-weight: 600; color: var(--ink);
  font-size: 1.4rem; margin: 2rem auto .5rem; scroll-margin-top: 84px;
}
.prose a {
  color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition: text-decoration-color .15s;
}
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 1.4rem auto; }
.prose li { margin: .5rem 0; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  border-left: 3px solid var(--accent); padding: .3rem 0 .3rem 1.4rem; margin: 2rem auto;
  font-family: var(--serif); font-size: 1.4rem; line-height: 1.4; color: var(--ink); font-style: italic;
}
.prose code {
  font-family: var(--mono); font-size: .86em; background: var(--paper-2);
  padding: .15em .4em; border-radius: 5px; border: 1px solid var(--hairline);
}
.prose pre {
  background: var(--paper-2); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; overflow-x: auto; margin: 1.75rem auto; font-size: .92rem;
}
.prose pre code { background: none; border: 0; padding: 0; }
.prose img { border-radius: var(--radius); margin: 2rem auto; box-shadow: var(--shadow); }
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin: 2.5rem auto; max-width: 6rem; }
.prose figure { margin: 2rem auto; }
.prose figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: .6rem; }

/* tables (comparison tables hold affiliate links) */
.table-wrap { max-width: var(--measure); margin: 2rem auto; overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: .98rem; font-family: var(--sans); }
.prose thead th {
  text-align: left; background: var(--paper-2); color: var(--ink);
  font-weight: 600; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase;
  padding: .8rem 1rem; border-bottom: 1px solid var(--hairline-2);
}
.prose tbody td { padding: .8rem 1rem; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) { background: color-mix(in srgb, var(--paper-2) 50%, transparent); }

/* drop cap on first paragraph */
.prose.dropcap > p:first-of-type::first-letter {
  font-family: var(--serif); font-weight: 600; float: left; line-height: .8;
  font-size: 3.6rem; padding: .35rem .55rem 0 0; color: var(--accent);
}

/* ---------- table of contents ---------- */
.toc {
  max-width: var(--measure); margin: 2rem auto; padding: 1.25rem 1.5rem;
  background: var(--paper-2); border: 1px solid var(--hairline); border-radius: var(--radius);
  font-family: var(--sans);
}
.toc strong { display: block; font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .75rem; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { counter-increment: toc; margin: .3rem 0; font-size: .98rem; }
.toc li::before { content: counter(toc) "."; color: var(--accent); font-variant-numeric: tabular-nums; margin-right: .5rem; font-weight: 600; }
.toc a { color: var(--ink-soft); }
.toc a:hover { color: var(--accent); }

/* ---------- shortcode blocks ---------- */
/* affiliate CTA card */
.aff {
  max-width: var(--measure); margin: 2.25rem auto; padding: 1.5rem 1.6rem;
  border: 1px solid var(--hairline-2); border-radius: var(--radius);
  background: var(--accent-wash); display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap;
}
.aff__body { flex: 1 1 16rem; }
.aff__name { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; color: var(--ink); }
.aff__blurb { color: var(--ink-soft); font-size: .98rem; margin-top: .25rem; }
.aff__cta {
  display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap;
  background: var(--accent); color: var(--paper); font-weight: 600; font-size: .95rem;
  padding: .7rem 1.25rem; border-radius: 8px; transition: transform .12s, background .15s;
}
.aff__cta:hover { background: var(--accent-ink); transform: translateY(-1px); }
:root[data-theme="dark"] .aff__cta, @media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .aff__cta { color: #0e0f12; } }

/* newsletter / email capture */
.newsletter {
  background: var(--ink); color: var(--paper); border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 2.75rem); margin: 2.5rem auto; max-width: var(--measure);
}
.newsletter.full { max-width: none; }
.newsletter h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem,3vw,2rem); line-height: 1.15; color: var(--paper); }
.newsletter p { color: color-mix(in srgb, var(--paper) 72%, transparent); margin-top: .6rem; max-width: 46ch; }
.newsletter form { display: flex; gap: .6rem; margin-top: 1.5rem; flex-wrap: wrap; }
.newsletter input[type=email] {
  flex: 1 1 16rem; border: 1px solid color-mix(in srgb, var(--paper) 25%, transparent);
  background: color-mix(in srgb, var(--paper) 8%, transparent); color: var(--paper);
  border-radius: 8px; padding: .8rem 1rem; font: inherit; min-width: 0;
}
.newsletter input::placeholder { color: color-mix(in srgb, var(--paper) 55%, transparent); }
.newsletter button {
  background: var(--accent); color: var(--paper); border: 0; border-radius: 8px;
  padding: .8rem 1.4rem; font-weight: 600; transition: background .15s, transform .12s;
}
.newsletter button:hover { background: var(--accent-ink); transform: translateY(-1px); }
.newsletter small { display: block; margin-top: .85rem; color: color-mix(in srgb, var(--paper) 55%, transparent); font-size: .8rem; }
.newsletter .ok { margin-top: 1rem; color: var(--accent); font-weight: 600; }

/* ad slot */
.ad {
  max-width: var(--measure); margin: 2.5rem auto; min-height: 100px;
  display: grid; place-items: center; text-align: center;
}
.ad__ph {
  width: 100%; border: 1px dashed var(--hairline-2); border-radius: var(--radius);
  padding: 2rem 1rem; color: var(--faint); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  background: var(--paper-2);
}
.ad__label { display: block; text-align: center; font-size: .65rem; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: .4rem; }

/* key-takeaways callout */
.callout {
  max-width: var(--measure); margin: 2rem auto; padding: 1.4rem 1.6rem;
  border: 1px solid var(--hairline); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
}
.callout strong.callout__title { display: block; font-family: var(--sans); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: .6rem; }
.callout p, .callout ul { margin: .4rem 0; font-size: 1rem; }

/* ---------- author box ---------- */
.author-box {
  max-width: var(--measure); margin: 3rem auto; padding: 1.75rem;
  border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--card);
  display: flex; gap: 1.25rem; box-shadow: var(--shadow);
}
.author-box .avatar { width: 64px; height: 64px; font-size: 1.4rem; }
.author-box h4 { font-family: var(--serif); font-size: 1.2rem; }
.author-box .role { color: var(--accent); font-size: .85rem; font-weight: 600; margin-bottom: .5rem; }
.author-box p { font-size: .96rem; color: var(--ink-soft); }
.author-box .author-links { margin-top: .6rem; display: flex; gap: 1rem; font-size: .85rem; }
.author-box .author-links a { color: var(--accent); font-weight: 600; }

/* ---------- related ---------- */
.related { max-width: var(--measure); margin: 3rem auto; }

/* ---------- topic / pillar page ---------- */
.topic-head { padding: clamp(2.5rem,6vw,4rem) 0; border-bottom: 1px solid var(--hairline); }
.topic-head h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.2rem,5vw,3.4rem); letter-spacing: -.02em; }
.topic-head p { color: var(--muted); font-size: 1.15rem; margin-top: 1rem; max-width: 56ch; }

/* ---------- legal/page ---------- */
.page-prose { max-width: var(--measure); margin: 0 auto; }
.page-prose h2 { font-family: var(--serif); font-size: 1.5rem; margin: 2rem 0 .6rem; color: var(--ink); }
.page-prose p, .page-prose li { color: var(--ink-soft); }
.page-prose ul { padding-left: 1.3rem; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: clamp(4rem,8vw,6rem); border-top: 1px solid var(--hairline);
  background: var(--paper-2); padding: clamp(2.5rem,6vw,4rem) 0 2.5rem;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; }
@media (max-width: 700px){ .footer-grid { grid-template-columns: 1fr; gap: 2.5rem; } }
.footer-brand .masthead { font-size: 1.4rem; }
.footer-brand p { color: var(--muted); font-size: .92rem; margin-top: .75rem; max-width: 34ch; }
.footer-col h5 { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .9rem; }
.footer-col a { display: block; color: var(--ink-soft); font-size: .92rem; padding: .28rem 0; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--hairline);
  font-size: .82rem; color: var(--muted);
}
.footer-social { display: flex; gap: .75rem; }
.footer-social a:hover { color: var(--accent); }

/* ---------- search ---------- */
.search-modal {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: color-mix(in srgb, var(--ink) 35%, transparent); backdrop-filter: blur(3px);
  padding: 12vh 1rem 1rem;
}
.search-modal.open { display: block; }
.search-panel {
  max-width: 38rem; margin: 0 auto; background: var(--paper); border: 1px solid var(--hairline-2);
  border-radius: 14px; box-shadow: var(--shadow-lift); overflow: hidden;
}
.search-panel input {
  width: 100%; border: 0; border-bottom: 1px solid var(--hairline); background: transparent;
  color: var(--ink); font: inherit; font-size: 1.1rem; padding: 1.1rem 1.25rem; outline: none;
}
.search-results { max-height: 56vh; overflow-y: auto; }
.search-results a {
  display: block; padding: .9rem 1.25rem; border-bottom: 1px solid var(--hairline);
}
.search-results a:hover, .search-results a.active { background: var(--paper-2); }
.search-results .sr-title { font-family: var(--serif); font-size: 1.05rem; color: var(--ink); }
.search-results .sr-meta { font-size: .78rem; color: var(--muted); margin-top: .15rem; }
.search-empty { padding: 1.5rem 1.25rem; color: var(--muted); font-size: .95rem; }

/* ---------- misc ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--accent); color: var(--paper); font-weight: 600;
  padding: .8rem 1.4rem; border-radius: 8px; transition: background .15s, transform .12s;
}
.btn:hover { background: var(--accent-ink); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--hairline-2); }
.btn-ghost:hover { background: var(--paper-2); }
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); width: 0; z-index: 60; transition: width .1s; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
