/* ============================================================
   Affiliate network — shared design system
   Editorial / magazine-calm. Fluid type, real dark mode,
   zero frameworks. Tokens first so every topic subdomain
   can theme itself with 3 overrides.
   ============================================================ */

:root {
  /* Palette — override per topic with 2-3 of these only */
  --accent:        #1b5e4a;
  --accent-ink:    #ffffff;
  --accent-soft:   color-mix(in oklab, var(--accent) 12%, transparent);

  --bg:            #fbfaf7;
  --surface:       #ffffff;
  --surface-2:     #f3f1ec;
  --ink:           #16171a;
  --ink-2:         #4a4d55;
  --ink-3:         #83868f;
  --rule:          #e4e1da;

  /* Type scale — fluid, no breakpoints needed */
  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem,   0.96rem + 0.2vw,  1.09rem);
  --step-1:  clamp(1.2rem, 1.13rem + 0.35vw, 1.4rem);
  --step-2:  clamp(1.5rem, 1.36rem + 0.7vw,  1.95rem);
  --step-3:  clamp(1.95rem,1.7rem + 1.25vw,  2.85rem);
  --step-4:  clamp(2.5rem, 2rem + 2.5vw,     4.2rem);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --mono:  ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 68ch;
  --gutter: clamp(1.15rem, 4vw, 3rem);
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 12px 32px -12px rgb(0 0 0 / .16);
  --speed: 180ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #101113;
    --surface:   #17181b;
    --surface-2: #1e2024;
    --ink:       #ecedef;
    --ink-2:     #b3b6bd;
    --ink-3:     #7d818a;
    --rule:      #2a2c31;
    --accent:    #4fd1a5;
    --accent-ink:#06251b;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 16px 40px -16px rgb(0 0 0 / .6);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---------- layout ---------- */

.wrap { width: min(100% - 2 * var(--gutter), 74rem); margin-inline: auto; }
article, .prose { max-width: var(--measure); }

main { padding-block: clamp(2.5rem, 7vw, 5.5rem) 0; }

/* ---------- masthead ---------- */

.masthead {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.masthead .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding-block: 0.85rem;
}
.brand {
  font-family: var(--serif); font-size: var(--step-1); font-weight: 600;
  letter-spacing: -0.01em; color: var(--ink); text-decoration: none;
}
.brand span { color: var(--accent); }

.nav { display: flex; gap: 1.35rem; flex-wrap: wrap; }
.nav a {
  font-size: var(--step--1); color: var(--ink-2); text-decoration: none;
  letter-spacing: 0.01em; border-bottom: 1px solid transparent;
  transition: color var(--speed), border-color var(--speed);
}
.nav a:hover, .nav a[aria-current] { color: var(--accent); border-color: var(--accent); }

/* ---------- typography ---------- */

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.14; letter-spacing: -0.018em; }
h1 { font-size: var(--step-4); margin: 0 0 0.5em; }
h2 { font-size: var(--step-3); margin: 2.4em 0 0.4em; }
h3 { font-size: var(--step-2); margin: 1.8em 0 0.3em; }
p  { margin: 0 0 1.15em; color: var(--ink-2); }
p.lede { font-size: var(--step-1); color: var(--ink); line-height: 1.5; }

a { color: var(--accent); text-underline-offset: 3px; }

.eyebrow {
  font-family: var(--mono); font-size: var(--step--1); text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--accent); margin: 0 0 0.9rem;
}
.muted { color: var(--ink-3); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* ---------- topic list (hub + 404) ---------- */

.topic-list { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.topic-list li { background: var(--surface); padding: 1.15rem 1.35rem; }
.topic-list a { font-family: var(--serif); font-size: var(--step-1); text-decoration: none; }

/* ---------- product / affiliate card ---------- */

.grid-products {
  display: grid; gap: 1.4rem; margin: 2rem 0;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
}
.product {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform var(--speed) ease, box-shadow var(--speed) ease;
}
.product:hover { transform: translateY(-3px); }
.product .thumb { aspect-ratio: 4 / 3; background: var(--surface-2); }
.product .body { padding: 1.15rem 1.25rem 1.35rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.product h3 { font-size: var(--step-1); margin: 0; }
.product .why { font-size: var(--step--1); color: var(--ink-2); margin: 0; flex: 1; }
.product .price { font-family: var(--mono); font-size: var(--step--1); color: var(--ink-3); }

/* card furniture — badge, brand, verdict, specs, pros/cons */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.badge {
  font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--accent-ink); background: var(--accent);
  padding: 0.22rem 0.6rem; border-radius: 999px; white-space: nowrap;
}
.product .brand {
  display: block; margin-top: 0.15em;
  font-family: var(--sans); font-size: var(--step--1); font-weight: 500; color: var(--ink-3);
}
.product .verdict {
  margin: 0; font-size: var(--step--1); color: var(--ink);
  border-left: 2px solid var(--accent); padding-left: 0.7rem;
}
.product dl.specs { margin: 0; display: grid; gap: 0.2rem; font-size: var(--step--1); }
.product dl.specs > div {
  display: flex; justify-content: space-between; gap: 1rem;
  border-bottom: 1px dotted var(--rule); padding-bottom: 0.2rem;
}
.product dl.specs dt { color: var(--ink-3); }
.product dl.specs dd { margin: 0; color: var(--ink-2); text-align: right; }
.pc { font-size: var(--step--1); }
.pc .k {
  display: block; margin-bottom: 0.25rem;
  font-family: var(--mono); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.pc ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.15rem; }
.pc li { color: var(--ink-2); }
.pc.pros .k { color: var(--accent); }
.pc.cons .k { color: var(--ink-3); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5ch;
  padding: 0.72rem 1.2rem; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: var(--step--1); text-decoration: none;
  border: 1px solid color-mix(in oklab, var(--accent) 70%, black);
  transition: filter var(--speed), transform var(--speed);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--accent); border-color: var(--rule); }

/* Unfilled placeholder state — visually honest, never pretends to be a link */
.btn--pending {
  background: var(--surface-2); color: var(--ink-3);
  border: 1px dashed var(--rule); cursor: not-allowed;
}

/* ---------- disclosure ---------- */

.disclosure {
  font-size: var(--step--1); color: var(--ink-3);
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 0.85rem 1.05rem; margin: 1.6rem 0;
}
.disclosure strong { color: var(--ink-2); }

/* ---------- footer ---------- */

footer.site {
  margin-top: clamp(3rem, 8vw, 6rem);
  border-top: 1px solid var(--rule);
  padding: 2.2rem 0 3.2rem;
  font-size: var(--step--1); color: var(--ink-3);
}
footer.site nav { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: 0.8rem; }

/* ---------- 404 ---------- */

.page-nf main { padding-top: 5rem; }

/* ---------- a11y ---------- */

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--accent);
  color: var(--accent-ink); padding: 0.7rem 1rem; z-index: 100;
}
.skip:focus { left: 0; }
