/* ==========================================================================
   HouseHackers — Warm Premium Editorial
   Design system: ivory · forest green · terracotta · Instrument Serif/Sans
   Tokens map 1:1 to the handoff spec (2b). WCAG AA throughout.
   ========================================================================== */

:root {
  /* — Color — */
  --cream-50:  #F7F2E7;   /* page background          */
  --cream-25:  #FCFAF3;   /* card / surface           */
  --cream-100: #EFE7D6;   /* bands                    */
  --field-bg:  #F7F2E7;   /* input fill inside cards  */
  --ink:       #2A241A;   /* primary text             */
  --muted:     #6F6555;   /* secondary text (ink.60)  */
  --faint:     #9C9080;   /* tertiary / captions      */
  --forest:    #21402C;   /* primary action           */
  --forest-700:#16301E;   /* forest hover / footer    */
  --forest-900:#0F2415;   /* forest active            */
  --terracotta:#BC5F38;   /* highlight / kicker       */
  --danger:    #8A4B2E;   /* warnings                 */
  --sand:      #DCCFB6;   /* gauge rest track         */
  --sand-warm: #D9C9A3;   /* on-dark accent dot       */
  --card-edge: #E4DBC6;   /* image placeholder fill   */

  /* hairlines */
  --line-08: rgba(42, 36, 26, .08);
  --line-10: rgba(42, 36, 26, .10);
  --line-12: rgba(42, 36, 26, .12);
  --line-14: rgba(42, 36, 26, .14);
  --line-18: rgba(42, 36, 26, .18);
  --line-22: rgba(42, 36, 26, .22);
  --line-28: rgba(42, 36, 26, .28);
  --on-forest-70: rgba(247, 242, 231, .72);
  --on-forest-50: rgba(247, 242, 231, .5);
  --on-forest-line: rgba(247, 242, 231, .16);

  /* — Type — */
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans:  'Instrument Sans', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono:  ui-monospace, Menlo, Consolas, monospace;

  /* — Radius — */
  --r-btn:  10px;
  --r-card: 16px;
  --r-panel:18px;
  --r-pill: 999px;

  /* — Elevation — */
  --shadow-card:  0 1px 3px rgba(42, 36, 26, .08);
  --shadow-panel: 0 1px 2px rgba(42, 36, 26, .04), 0 18px 44px rgba(42, 36, 26, .09);
  --shadow-lift:  0 24px 60px rgba(0, 0, 0, .28);

  /* — Layout — */
  --page-x: 56px;   /* desktop section inline padding */
  --page-y: 88px;   /* desktop section block padding  */
  --maxw:   1440px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream-50);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--forest-700); }

::selection { background: rgba(188, 95, 56, .22); }

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

h1, h2, h3, p { margin: 0; }

.tnum { font-variant-numeric: tabular-nums; }

/* Constrain full-bleed page to a nice max width, centered on very wide screens */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  background: var(--cream-50);
}

.serif { font-family: var(--serif); font-weight: 400; }
.italic { font-style: italic; }

/* ==========================================================================
   Kicker label
   ========================================================================== */
.kicker {
  display: block;
  font: 600 11.5px/1.3 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--terracotta);
}
.kicker--onforest { color: var(--sand-warm); }
.kicker--sm { font-size: 11px; letter-spacing: .14em; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 600 15.5px/1 var(--sans);
  border-radius: var(--r-btn);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(33, 64, 44, .28); }

.btn-primary { background: var(--forest); color: var(--cream-50); padding: 16px 28px; }
.btn-primary:hover { background: var(--forest-700); color: var(--cream-50); }
.btn-primary:active { background: var(--forest-900); }

.btn-secondary {
  background: transparent; color: var(--ink);
  border-color: var(--line-28); padding: 15px 26px;
}
.btn-secondary:hover { background: rgba(42, 36, 26, .05); color: var(--ink); }

/* light button used on forest backgrounds */
.btn-light { background: var(--cream-50); color: var(--forest); padding: 16px 28px; }
.btn-light:hover { background: var(--cream-100); color: var(--forest-700); }

.btn-ghost-light {
  background: transparent; color: var(--cream-50);
  border-color: var(--on-forest-line); padding: 0 22px; height: 44px;
}
.btn-ghost-light:hover { background: rgba(247, 242, 231, .08); color: var(--cream-50); }

.btn-sm { font-size: 14.5px; padding: 11px 20px; }
.btn-block { display: flex; width: 100%; }

.link-arrow { font: 600 15px/1 var(--sans); color: var(--forest); }
.link-arrow:hover { color: var(--forest-700); }

/* ==========================================================================
   Site navigation
   ========================================================================== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--page-x);
  border-bottom: 1px solid var(--line-10);
  background: var(--cream-50);
  position: relative;
  z-index: 20;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 400 25px/1 var(--serif);
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand .dot { color: var(--terracotta); }
/* the uploaded house mark, injected before the wordmark; swaps to the
   reverse cut-out on dark (forest) surfaces */
.brand::before {
  content: "";
  flex: none;
  width: 1.06em;
  height: 1.04em;
  background: url("../assets/logo/mark-primary.svg") center / contain no-repeat;
  transform: translateY(-0.02em);
}
.footer .brand::before,
.footer--slim .brand::before,
.drawer__top .brand::before {
  background-image: url("../assets/logo/mark-reverse.svg");
}

.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a { font: 500 14.5px/1 var(--sans); color: var(--ink); }
.nav-links a.muted { color: var(--muted); }
.nav-links a.is-active {
  font-weight: 600; color: var(--forest);
  border-bottom: 2px solid var(--terracotta); padding-bottom: 3px;
}
.nav-links a:hover { color: var(--forest); }
/* the nav CTA is a button, not a link — keep its text cream in every state */
.nav-links a.btn-primary,
.nav-links a.btn-primary:hover { color: var(--cream-50); }

/* hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px 2px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--ink); }

/* ==========================================================================
   Mobile nav drawer (2d)
   ========================================================================== */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  visibility: hidden;
  opacity: 0;
  transition: opacity .25s ease, visibility .25s ease;
}
.drawer[data-open="true"] { visibility: visible; opacity: 1; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(22, 48, 30, .4); }
.drawer__panel {
  position: absolute;
  inset: 0;
  background: var(--forest-700);
  display: flex;
  flex-direction: column;
  translate: 0 -8px;
  transition: translate .25s ease;
}
.drawer[data-open="true"] .drawer__panel { translate: 0 0; }
.drawer__top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(247, 242, 231, .12);
}
.drawer__top .brand { color: var(--cream-50); font-size: 21px; }
.drawer__top .brand .dot { color: var(--sand-warm); }
.drawer__close {
  position: relative; width: 22px; height: 22px;
  background: none; border: none; cursor: pointer; padding: 0;
}
.drawer__close span {
  position: absolute; top: 10px; left: 0; width: 22px; height: 1.5px; background: var(--cream-50);
}
.drawer__close span:first-child { transform: rotate(45deg); }
.drawer__close span:last-child  { transform: rotate(-45deg); }
.drawer__body {
  padding: 20px 20px 40px;
  display: flex; flex-direction: column; flex: 1;
}
.drawer__links { display: flex; flex-direction: column; }
.drawer__links a {
  font: 400 26px/1.1 var(--serif);
  color: var(--cream-50);
  padding: 18px 0;
  border-bottom: 1px solid rgba(247, 242, 231, .12);
}
.drawer__links a.dim { color: rgba(247, 242, 231, .65); }
.drawer__foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.drawer__foot .btn { padding: 17px; border-radius: 11px; }
.drawer__note {
  font: 400 12.5px/1.4 var(--sans);
  color: rgba(247, 242, 231, .55);
  text-align: center;
}
body.no-scroll { overflow: hidden; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { background: var(--forest-700); padding: 64px var(--page-x) 32px; }
.footer__cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 44px;
  margin-bottom: 56px;
}
.footer .brand { color: var(--cream-50); font-size: 24px; }
.footer .brand .dot { color: var(--sand-warm); }
.footer__blurb {
  font: 400 14px/1.65 var(--sans);
  color: rgba(247, 242, 231, .6);
  max-width: 34ch;
  margin-top: 12px;
}
.footer__head {
  font: 600 11px/1 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--on-forest-50);
  margin-bottom: 14px;
}
.footer__list { display: flex; flex-direction: column; gap: 10px; }
.footer__list a { font: 400 14.5px/1.2 var(--sans); color: var(--cream-50); }
.footer__list a:hover { color: var(--sand-warm); }
.footer__base {
  border-top: 1px solid var(--on-forest-line);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer__base span { font: 400 12px/1.5 var(--sans); color: var(--on-forest-50); }

/* ==========================================================================
   Inputs, fields & segmented controls (2a states)
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label {
  font: 600 11px/1.2 var(--sans);
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted);
}
.field-row { display: flex; align-items: center; justify-content: space-between; }

.control {
  display: flex;
  align-items: center;
  background: var(--field-bg);
  border: 1px solid var(--line-18);
  border-radius: var(--r-btn);
  padding: 0 14px;
  height: 48px;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.control:focus-within { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(33, 64, 44, .14); }
.control.is-error { border-color: var(--terracotta); }
.control .affix { color: var(--faint); font: 500 15px/1 var(--sans); }
.control .affix--suffix { margin-left: auto; }
.control input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font: 600 16px/1 var(--sans);
  color: var(--ink);
  padding-left: 6px;
  font-variant-numeric: tabular-nums;
}
.control input.no-pad { padding-left: 0; }
.control input::placeholder { color: var(--faint); font-weight: 500; }

.field-help { font: 400 12.5px/1.4 var(--sans); color: var(--faint); }
.field-warn {
  display: flex; gap: 7px; align-items: flex-start;
  font: 500 12px/1.45 var(--sans); color: var(--danger);
}
.field-warn .tri { flex: none; }

/* Segmented control */
.seg {
  display: inline-flex;
  flex-wrap: wrap; /* wrap onto multiple rows on narrow screens instead of overflowing */
  gap: 2px;
  background: rgba(42, 36, 26, .07);
  padding: 4px;
  border-radius: 12px;
}
.seg.seg--sm { padding: 3px; border-radius: 9px; }
.seg.seg--wrap { flex-wrap: wrap; }
.seg button {
  font: 500 13.5px/1.2 var(--sans);
  color: var(--muted);
  padding: 9px 15px;
  border-radius: 9px;
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}
.seg.seg--sm button { padding: 4px 11px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] {
  background: var(--cream-25);
  color: var(--forest);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(42, 36, 26, .18);
}
.seg.seg--sm button[aria-pressed="true"] { box-shadow: 0 1px 2px rgba(42, 36, 26, .18); }
.seg button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(33, 64, 44, .2); }

.seg-label {
  font: 600 11px/1 var(--sans);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ==========================================================================
   Cards & panels
   ========================================================================== */
.card {
  background: var(--cream-25);
  border: 1px solid var(--line-12);
  border-radius: var(--r-card);
  padding: 28px;
}
.panel {
  background: var(--cream-25);
  border: 1px solid var(--line-12);
  border-radius: var(--r-panel);
  padding: 32px;
  box-shadow: var(--shadow-panel);
}
.card-title { font: 400 21px/1.2 var(--serif); color: var(--ink); }

/* Guide / article card — landing grid + the library */
.guide-card {
  background: var(--cream-25);
  border: 1px solid var(--line-12);
  border-radius: var(--r-card);
  overflow: hidden;
  display: block;
  color: inherit;
  transition: box-shadow .2s ease, translate .2s ease;
}
.guide-card:hover { box-shadow: 0 14px 36px rgba(42, 36, 26, .12); translate: 0 -2px; color: inherit; }
.guide-card__img { height: 220px; background: var(--card-edge); overflow: hidden; }
.guide-card__img img { width: 100%; height: 100%; object-fit: cover; }
.guide-card__body { padding: 24px; }
.guide-card__kicker { font-size: 10.5px; letter-spacing: .14em; margin-bottom: 10px; }
.guide-card__title { font: 400 23px/1.25 var(--serif); color: var(--ink); margin-bottom: 10px; }
.guide-card:hover .guide-card__title { color: var(--forest-700); }
.guide-card__meta { font: 400 13px/1 var(--sans); color: var(--faint); }

/* Newsletter card — guide articles + the library */
.nl {
  background: var(--cream-100);
  border-radius: var(--r-panel);
  padding: 40px;
  text-align: center;
}
.nl__h { font: 400 26px/1.2 var(--serif); color: var(--ink); }
.nl__p { font: 400 15px/1.6 var(--sans); color: var(--muted); margin: 8px auto 20px; max-width: 44ch; }
.nl__form { display: flex; gap: 10px; max-width: 440px; margin: 0 auto; }
.nl__input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line-22); background: var(--cream-25);
  border-radius: var(--r-btn); outline: none;
  font: 500 15px/1 var(--sans); color: var(--ink); padding: 0 16px; height: 50px;
}
.nl__input:focus { border-color: var(--forest); }
.nl__btn {
  border: none; cursor: pointer; background: var(--forest); color: var(--cream-50);
  font: 600 14.5px/1 var(--sans); border-radius: var(--r-btn); padding: 0 22px;
}
.nl__btn:hover { background: var(--forest-700); }
.nl__fine { font: 400 12px/1.4 var(--sans); color: var(--faint); margin-top: 14px; }
.signup-done { font: 500 15px/1.5 var(--sans); color: var(--forest); }

/* ==========================================================================
   The Live-for-Free gauge (shared: landing teaser + calculator)
   ========================================================================== */
.gauge { width: 200px; display: block; margin: 20px auto 4px; }
.gauge--lg { width: 230px; margin: 26px auto 6px; }
.gauge__legend {
  display: flex; justify-content: space-between;
  font: 400 10.5px/1 var(--sans); color: var(--faint);
  text-transform: uppercase; letter-spacing: .08em;
}
.gauge__legend .free { color: var(--forest); font-weight: 600; }
.gauge .needle { transition: transform .5s cubic-bezier(.3, .9, .3, 1); }
@media (prefers-reduced-motion: reduce) { .gauge .needle { transition: none; } }

/* ==========================================================================
   Reveal-on-scroll
   ========================================================================== */
.reveal { opacity: 0; translate: 0 18px; transition: opacity .7s ease, translate .7s cubic-bezier(.22, .8, .3, 1); }
.reveal.in { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; translate: none; transition: none; }
}

/* ==========================================================================
   Responsive — tablet (≤1024) and mobile (≤640)
   ========================================================================== */
@media (max-width: 1024px) {
  :root { --page-x: 40px; --page-y: 64px; }
  .footer__cols { grid-template-columns: 1fr 1fr; gap: 36px; }
}

@media (max-width: 640px) {
  :root { --page-x: 20px; --page-y: 52px; }
  body { font-size: 16px; }

  .nav { padding: 18px var(--page-x); }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .control { height: 46px; padding: 0 12px; }

  .footer { padding: 40px var(--page-x) 24px; }
  .footer__cols { grid-template-columns: 1fr; gap: 28px; margin-bottom: 28px; }

  .nl { padding: 26px; }
  .nl__form { flex-direction: column; }
  .nl__btn { height: 48px; padding: 0; }
}
