/* Solar No Roof — shared editorial design system */

:root {
  --bg: #FBF8F3;
  --bg-elev: #FFFFFF;
  --bg-sunk: #F3EEE4;
  --ink: #1A1814;
  --ink-2: #4A453D;
  --ink-3: #7A7368;
  --rule: #E5DFD2;
  --rule-strong: #C9C0AC;
  --sun: oklch(0.78 0.14 75);
  --sun-deep: oklch(0.62 0.16 60);
  --slate: oklch(0.45 0.08 230);
  --slate-soft: oklch(0.92 0.02 230);
  --good: oklch(0.55 0.12 145);
  --warn: oklch(0.65 0.15 45);

  --serif: 'Newsreader', 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --maxw: 1200px;
  --maxw-narrow: 760px;
  --gutter: clamp(20px, 4vw, 56px);

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--sun-deep); color: var(--sun-deep); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0 0 0.4em;
  text-wrap: balance;
}
h1 { font-size: clamp(40px, 6vw, 76px); font-weight: 400; letter-spacing: -0.025em; }
h2 { font-size: clamp(30px, 3.6vw, 46px); }
h3 { font-size: clamp(22px, 2vw, 28px); }
h4 { font-size: 19px; font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 1em; max-width: 70ch; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin: 0 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px; height: 1px;
  background: var(--ink-3);
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.container.narrow { max-width: var(--maxw-narrow); }

/* ---- Header ---- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(6px);
  background: color-mix(in oklch, var(--bg) 92%, transparent);
}
.site-header .row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
  gap: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand span { white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; flex-shrink: 0; }
.nav { display: flex; gap: 22px; align-items: center; flex-wrap: nowrap; }
.nav a { text-decoration: none; font-size: 15px; color: var(--ink-2); white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); font-weight: 500; }
.nav .cta {
  font-family: var(--sans);
  background: var(--ink); color: var(--bg);
  padding: 9px 16px; border-radius: 999px;
  font-size: 14px; letter-spacing: 0.01em;
  white-space: nowrap;
}
.nav .cta:hover { background: var(--sun-deep); color: white; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--bg);
  font-family: var(--sans); font-size: 15px;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: var(--sun-deep); border-color: var(--sun-deep); color: white; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); }
.btn.sun { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.btn.sun:hover { background: var(--sun-deep); border-color: var(--sun-deep); color: white; }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-sunk);
  padding: 64px 0 40px;
  margin-top: 96px;
}
.site-footer .grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 40px;
  align-items: start;
}
.site-footer h5 {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--ink-3); margin: 0 0 14px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { text-decoration: none; color: var(--ink-2); font-size: 14px; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--sun-deep); }
.site-footer .colophon { font-size: 13px; color: var(--ink-3); margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---- Sections ---- */
section { padding: 80px 0; }
section.tight { padding: 48px 0; }
.section-head {
  display: flex; justify-content: space-between; align-items: end; gap: 32px;
  margin-bottom: 40px; padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}
.section-head h2 { margin: 0; max-width: 18ch; }
.section-head .meta { font-family: var(--mono); font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.12em; }
.section-head a.see-all { font-size: 14px; color: var(--ink-2); white-space: nowrap; }

/* ---- Cards ---- */
.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { border-color: var(--rule-strong); transform: translateY(-2px); }
.card .thumb { aspect-ratio: 16/10; background: var(--bg-sunk); border-bottom: 1px solid var(--rule); }
.card .body { padding: 22px; }
.card .kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sun-deep); margin-bottom: 10px; }
.card h3 { font-size: 22px; margin-bottom: 8px; }
.card .meta { font-size: 13px; color: var(--ink-3); margin-top: 12px; font-family: var(--mono); }

/* Affiliate badge */
.affiliate-cta { display: block; }
body.no-affiliate .affiliate-cta { display: none !important; }
.aff-tag {
  display: inline-block;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  background: var(--sun); color: var(--ink);
  padding: 2px 8px; border-radius: 3px;
  text-transform: uppercase;
}

/* ---- Pill / chip ---- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  font-size: 12px; font-family: var(--mono); letter-spacing: 0.06em;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--ink-2);
  text-transform: uppercase;
}
.chip.legal-yes { background: color-mix(in oklch, var(--good) 15%, var(--bg-elev)); border-color: var(--good); color: var(--good); }
.chip.legal-pending { background: color-mix(in oklch, var(--sun) 25%, var(--bg-elev)); border-color: var(--sun-deep); color: var(--sun-deep); }
.chip.legal-no { background: color-mix(in oklch, var(--warn) 18%, var(--bg-elev)); border-color: var(--warn); color: var(--warn); }

/* ---- Rule between sections ---- */
hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* breadcrumbs */
.crumbs { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 24px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { margin: 0 10px; opacity: 0.5; }

/* utility */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) {
  .row-2, .row-3, .row-4 { grid-template-columns: 1fr; }
  .site-footer .grid { grid-template-columns: 1fr 1fr; }
  .nav a:not(.cta) { display: none; }
}

/* big number / pull quote */
.bignum { font-family: var(--serif); font-size: clamp(52px, 7vw, 96px); line-height: 1; letter-spacing: -0.03em; font-weight: 400; }
.bignum sup { font-size: 0.4em; vertical-align: super; color: var(--ink-3); margin-left: 2px; }

/* form elements (calculator) */
input[type="number"], input[type="text"], select {
  font-family: var(--sans); font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-sm);
  background: var(--bg-elev);
  width: 100%;
  color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--sun); outline-offset: 1px; border-color: var(--sun-deep); }
label.field { display: block; }
label.field .lbl { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); margin-bottom: 6px; display: block; }

/* read time strip on articles */
.read-strip { display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding: 18px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.read-strip span { display: inline-flex; gap: 8px; }
.read-strip b { color: var(--ink); font-weight: 500; }
