/* =========================================================
   savoaonline.com — "THE COST LEDGER"
   Hero: full-bleed cinematic frame with a cost scale down the
   right edge. Article: a ledger grid — the plate numeral hangs
   in the margin and travels with its entry, heading leads, a
   figures strip states the damage, image follows, body closes.
   Quote bands cut full-width to pine-dark.
   Type: Syne (display) / Karla (text) — sampled from the logo.
   ========================================================= */

:root{
  /* --- pulled from the Savoa logo --- */
  --brand:#70C098;        /* ribbon green    */
  --coral:#F09070;        /* ribbon coral    */
  --amber:#F8C050;        /* ribbon amber    */

  /* --- structural derivatives --- */
  --ledger:#14211B;       /* pine-black: quote bands, footer */
  --ledger-2:#1D3128;
  --brand-deep:#2F7C56;
  --brand-dark:#235F42;
  --brand-lt:#8FD0AE;

  --paper:#FFFFFF;
  --foam:#EDF3EF;
  --sand:#FAF6F2;
  --ink:#1B211E;
  --body-text:#4B534E;
  --muted:#79817C;
  --line:#E2E8E3;
  --line-2:#C6D2CB;

  --shell:1180px;
  --measure:680px;
  --gutter:clamp(18px,4vw,40px);

  --display:"Syne","Trebuchet MS","Segoe UI",sans-serif;
  --text:"Karla","Segoe UI",Helvetica,Arial,sans-serif;
}

*,*::before,*::after{box-sizing:border-box}
html,body{max-width:100%;overflow-x:hidden}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{
  margin:0;background:var(--paper);color:var(--body-text);
  font-family:var(--text);font-size:17px;line-height:1.72;
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%;height:auto;display:block}
a{color:inherit}
h1,h2,h3{font-family:var(--display);color:var(--ink);line-height:1.14;margin:0;font-weight:700}
p{margin:0 0 1.1em}
ul,ol{margin:0;padding:0;list-style:none}
:focus-visible{outline:3px solid var(--coral);outline-offset:3px}

.shell{max-width:var(--shell);margin-inline:auto;padding-inline:var(--gutter)}
.skip{
  position:absolute;left:-9999px;top:0;z-index:99;background:var(--ink);color:#fff;
  padding:.7rem 1.1rem;font-weight:700;font-size:.85rem;text-decoration:none;
}
.skip:focus{left:0}

/* =========================================================
   MASTHEAD — solid light bar so the charcoal logo reads
   ========================================================= */
.masthead{background:var(--foam);border-bottom:1px solid var(--line)}
.masthead-inner{
  display:flex;align-items:center;justify-content:space-between;
  gap:1.2rem;padding-block:1.05rem;flex-wrap:wrap;
}
.wordmark{display:inline-flex;align-items:center;text-decoration:none}
.wordmark-logo{height:44px;width:auto}
@media (max-width:520px){.wordmark-logo{height:36px}}
.masthead-nav{display:flex;flex-wrap:wrap;gap:.35rem 1.15rem}
.masthead-nav a{
  font-size:.76rem;font-weight:500;letter-spacing:.05em;
  color:var(--body-text);text-decoration:none;
}
.masthead-nav a:hover{color:var(--brand-dark)}

/* =========================================================
   HERO — full-bleed frame, copy anchored bottom-left
   ========================================================= */
.hero{
  position:relative;isolation:isolate;overflow:hidden;
  min-height:clamp(540px,80vh,780px);
  display:flex;align-items:flex-end;background:var(--ledger);
}
.hero-bg{position:absolute;inset:0;z-index:-2;margin:0}
.hero-bg img{width:100%;height:100%;object-fit:cover}
.hero::before{
  content:"";position:absolute;inset:0;z-index:-1;
  background:
    linear-gradient(180deg,rgba(20,33,27,.76) 0%,rgba(20,33,27,.10) 26%,rgba(20,33,27,0) 42%),
    linear-gradient(0deg,rgba(20,33,27,.95) 0%,rgba(20,33,27,.74) 30%,rgba(20,33,27,.12) 66%,rgba(20,33,27,0) 100%);
}
.hero-inner{width:100%;padding-block:clamp(46px,8vw,86px)}
.eyebrow{
  display:flex;align-items:center;gap:.85rem;margin:0 0 1.3rem;
  color:var(--coral);font-size:.68rem;font-weight:700;
  letter-spacing:.24em;text-transform:uppercase;
}
.eyebrow::before{content:"";width:clamp(28px,6vw,64px);height:1px;background:var(--coral);flex:none}
.hero h1{
  color:#fff;font-size:clamp(2.05rem,5.9vw,4.2rem);
  letter-spacing:-.028em;line-height:1.04;font-weight:800;
  max-width:17ch;margin:0 0 1.5rem;
  text-shadow:0 2px 26px rgba(0,0,0,.36);
}
.hero-meta{
  display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;margin:0;
  font-size:.8rem;letter-spacing:.04em;color:rgba(255,255,255,.8);
}
.hero-meta span{display:inline-flex;align-items:center;gap:1rem}
.hero-meta span + span::before{
  content:"";width:1px;height:11px;background:rgba(240,144,112,.55);display:inline-block;
}

/* cost scale down the right edge of the hero */
.hero-scale{
  position:absolute;right:var(--gutter);top:50%;transform:translateY(-50%);
  z-index:2;display:flex;flex-direction:column;align-items:flex-end;gap:.55rem;
  font-size:.6rem;letter-spacing:.16em;color:rgba(240,144,112,.64);
}
.hero-scale i{display:block;height:1px;background:rgba(240,144,112,.44);font-style:normal}
.hero-scale i:nth-child(odd){width:14px}
.hero-scale i:nth-child(even){width:26px}
.hero-scale b{font-weight:600;color:rgba(240,144,112,.9)}

/* =========================================================
   BODY GRID — ledger rail + entries
   ========================================================= */
.body-grid{
  display:grid;grid-template-columns:216px minmax(0,1fr);
  gap:clamp(28px,5vw,76px);align-items:start;
  padding-block:clamp(38px,5.5vw,68px) clamp(48px,7vw,94px);
}

/* --- contents rail --- */
.toc{position:sticky;top:24px}
.toc-title{
  margin:0 0 1rem;font-size:.64rem;font-weight:700;letter-spacing:.22em;
  text-transform:uppercase;color:var(--muted);
}
.toc-track{position:relative;padding-left:1.1rem}
.toc-track::before{
  content:"";position:absolute;left:0;top:.35rem;bottom:.35rem;width:2px;
  background:var(--line);border-radius:2px;
}
.toc-progress{
  position:absolute;left:0;top:.35rem;width:2px;height:0;
  background:linear-gradient(180deg,var(--brand),var(--brand-dark));
  border-radius:2px;transition:height .12s linear;
}
.toc-list{display:flex;flex-direction:column}
.toc-list a{
  position:relative;display:flex;gap:.5rem;align-items:baseline;
  padding:.34rem 0;font-size:.81rem;line-height:1.4;
  color:var(--muted);text-decoration:none;transition:color .16s ease;
}
.toc-list a::before{
  content:"";position:absolute;left:-1.1rem;top:.82em;
  width:7px;height:2px;background:var(--line-2);transition:background .16s ease,width .16s ease;
}
.toc-list a span{
  font-family:var(--display);font-size:.72rem;font-weight:700;
  color:var(--brand-deep);flex:none;
}
.toc-list a:hover{color:var(--ink)}
.toc-list a.is-active{color:var(--ink);font-weight:700}
.toc-list a.is-active::before{background:var(--brand-deep);width:12px}

/* --- article --- */
.article{max-width:var(--measure)}

/* standfirst */
.intro{
  border-left:3px solid var(--brand);padding-left:clamp(1rem,2.4vw,1.5rem);
  margin-bottom:clamp(10px,2vw,18px);
}
.intro p{font-size:clamp(1.05rem,1.9vw,1.2rem);line-height:1.62;color:var(--ink)}
.intro p:last-child{margin-bottom:0;color:var(--body-text);font-size:1.02rem}

/* --- ledger entries: numeral hangs in the margin and travels --- */
.entry{
  display:grid;grid-template-columns:clamp(54px,7.4vw,82px) minmax(0,1fr);
  gap:0 clamp(12px,2vw,22px);
  margin:clamp(30px,4.4vw,48px) 0 0;
  padding-top:clamp(22px,3.2vw,32px);
  border-top:1px solid var(--line);
  scroll-margin-top:24px;
}
.entry-index{
  font-family:var(--display);font-weight:800;line-height:.9;
  font-size:clamp(1.7rem,3.4vw,2.7rem);letter-spacing:-.04em;
  color:var(--brand-deep);
  position:sticky;top:26px;align-self:start;
}
@supports (-webkit-text-stroke:1px currentColor){
  .entry-index{color:transparent;-webkit-text-stroke:1.5px var(--brand-deep)}
}
.entry-index::after{
  content:"";display:block;width:20px;height:2px;background:var(--brand);margin-top:.55rem;
}
.entry h2{
  font-size:clamp(1.3rem,2.5vw,1.72rem);letter-spacing:-.02em;
  margin:0 0 .35rem;
}
.entry-where{
  margin:0 0 1.05rem;font-size:.8rem;font-weight:500;letter-spacing:.05em;
  text-transform:uppercase;color:var(--muted);
}

/* figures strip — the ledger line for each project */
.figures{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:1px;background:var(--line);border:1px solid var(--line);
  margin:0 0 1.15rem;border-radius:3px;overflow:hidden;
}
.figures > div{background:var(--foam);padding:.7rem .85rem}
.figures dt{
  margin:0 0 .2rem;font-size:.62rem;font-weight:700;letter-spacing:.14em;
  text-transform:uppercase;color:var(--muted);
}
.figures dd{
  margin:0;font-family:var(--display);font-weight:700;font-size:.98rem;
  line-height:1.25;color:var(--ink);letter-spacing:-.01em;
}
.figures .over{background:var(--ledger)}
.figures .over dt{color:rgba(240,144,112,.85)}
.figures .over dd{color:var(--coral)}

.entry-media{margin:0 0 1.15rem;border-radius:3px;overflow:hidden;background:var(--foam)}
.entry-media img{
  width:100%;height:clamp(198px,29vw,330px);object-fit:cover;
  transition:transform .5s ease;
}
.entry:hover .entry-media img{transform:scale(1.025)}
.entry-media figcaption{
  padding:.5rem .1rem 0;font-size:.7rem;line-height:1.5;color:var(--muted);
}
.entry-media figcaption a{color:var(--muted)}
.entry p:last-child{margin-bottom:0}

/* --- quote bands ---
   Full-bleed without horizontal overflow. --bleed-left (the article
   column's distance from the viewport edge) and --page-w (the viewport
   width, scrollbar excluded) are set by article.js on load and resize.
   Without JS the band degrades to a dark panel the width of the column. */
.quote-band{
  position:relative;
  width:var(--page-w,100%);
  margin:clamp(40px,5.8vw,68px) 0 clamp(40px,5.8vw,68px) calc(-1 * var(--bleed-left,0px));
  background:var(--ledger);color:#fff;
  padding:clamp(2rem,4.4vw,3.2rem) var(--gutter);
  border-block:1px solid rgba(240,144,112,.3);
}
.quote-band blockquote{
  margin:0 auto;max-width:780px;position:relative;
  padding-left:clamp(2.6rem,5vw,3.8rem);
}
.quote-band blockquote::before{
  content:"\201C";position:absolute;left:0;top:-.12em;
  font-family:var(--display);font-weight:800;
  font-size:clamp(3.4rem,7vw,5rem);line-height:1;
  color:var(--coral);opacity:.6;
}
.quote-band p{
  margin:0;font-family:var(--display);font-weight:600;
  font-size:clamp(1.12rem,2.3vw,1.5rem);line-height:1.4;color:#fff;
  letter-spacing:-.015em;
}

/* --- closing sections --- */
.closing{
  margin:clamp(38px,5.4vw,60px) 0 0;padding-top:clamp(22px,3.2vw,32px);
  border-top:1px solid var(--line);scroll-margin-top:24px;
}
.closing h2{
  font-size:clamp(1.34rem,2.6vw,1.78rem);margin:0 0 .9rem;
  display:flex;align-items:center;gap:.75rem;letter-spacing:-.02em;
}
.closing h2::after{content:"";flex:1;height:1px;background:var(--foam)}
.closing p:last-child{margin-bottom:0}

/* --- sources note --- */
.sources{
  margin-top:clamp(30px,4vw,44px);padding:1.1rem 1.2rem;
  background:var(--sand);border:1px solid var(--line);border-radius:6px;
  font-size:.82rem;line-height:1.6;color:var(--muted);
}
.sources p{margin:0}
.sources a{color:var(--brand-dark)}

/* =========================================================
   TWO-STEP SIGNUP
   ========================================================= */
.signup{background:var(--sand);border-top:1px solid var(--line);padding-block:clamp(40px,6vw,76px)}
.signup-card{
  max-width:640px;margin-inline:auto;background:var(--paper);
  border:1px solid var(--line-2);border-radius:12px;
  padding:clamp(1.4rem,3.6vw,2.4rem);text-align:center;
}
.stepper{
  display:flex;align-items:center;justify-content:center;gap:.7rem;
  margin-bottom:1.4rem;flex-wrap:wrap;
}
.step{display:inline-flex;align-items:center;gap:.45rem;font-size:.78rem;font-weight:700;color:var(--muted)}
.step i{
  font-style:normal;display:grid;place-items:center;width:22px;height:22px;
  border-radius:50%;border:1.5px solid var(--line-2);
  font-size:.72rem;color:var(--muted);background:var(--paper);
}
.step.is-on{color:var(--ink)}
.step.is-on i{background:var(--brand-dark);border-color:var(--brand-dark);color:#fff}
.step-rule{width:34px;height:1.5px;background:var(--line-2);flex:none}

.signup h2{font-size:clamp(1.3rem,2.8vw,1.85rem);margin:0 0 .7rem;letter-spacing:-.02em}
.signup-sub{margin:0 0 1.4rem;font-size:.98rem;color:var(--body-text)}
.signup-form{display:flex;gap:.6rem;flex-wrap:wrap;justify-content:center}
.signup-form input[type=email]{
  flex:1 1 260px;min-width:0;font-family:var(--text);font-size:1rem;color:var(--ink);
  border:1.5px solid var(--line-2);border-radius:8px;padding:.78rem .95rem;background:var(--paper);
}
.signup-form input[type=email]:focus{border-color:var(--brand-dark);outline:none;box-shadow:0 0 0 3px rgba(112,192,152,.3)}
.signup-form input[type=email][aria-invalid=true]{border-color:#C2445E;background:#FFFAFA}
.signup-form button{
  flex:0 0 auto;cursor:pointer;font-family:var(--text);font-weight:700;font-size:.95rem;
  background:var(--brand-dark);color:#fff;border:1.5px solid var(--brand-dark);
  border-radius:8px;padding:.78rem 1.6rem;
  transition:background .16s ease,border-color .16s ease;
}
.signup-form button:hover{background:var(--brand-deep);border-color:var(--brand-deep)}
.signup-err{display:block;margin-top:.7rem;font-size:.85rem;color:#C2445E}
.signup-note{margin:1rem 0 0;font-size:.78rem;color:var(--muted)}

.signup-done{text-align:center}
.done-mark{
  display:grid;place-items:center;width:52px;height:52px;border-radius:50%;
  background:var(--brand-dark);color:#fff;margin:0 auto 1rem;
}
.done-mark svg{width:26px;height:26px}
.signup-done p{margin:0;font-size:1rem;color:var(--body-text)}
[hidden]{display:none !important}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer{background:var(--ledger);color:#A8B3AD;padding-block:clamp(32px,4.5vw,52px)}
.footer-inner{display:grid;gap:1.2rem;justify-items:center;text-align:center}
.footer-logo{height:40px;width:auto;filter:brightness(0) invert(1);opacity:.92}
.footer-nav{display:flex;flex-wrap:wrap;justify-content:center;gap:.45rem 1.4rem}
.footer-nav a{font-size:.8rem;color:#BAC5BE;text-decoration:none}
.footer-nav a:hover{color:var(--coral);text-decoration:underline;text-underline-offset:3px}
.footer-rule{width:100%;max-width:560px;height:1px;background:rgba(240,144,112,.22)}
.footer-site{margin:0;font-weight:700;color:#fff;font-size:.9rem;letter-spacing:.04em}
.footer-inner p{margin:0;font-size:.83rem}
.footer-inner a[href^="mailto"],.footer-inner a[href^="tel"]{color:var(--coral)}
.footer-note{max-width:640px;color:#8E9A94 !important;font-size:.78rem !important;line-height:1.6}
.footer-copy{color:#7E8A84 !important;font-size:.78rem !important}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width:900px){
  .body-grid{grid-template-columns:minmax(0,1fr)}
  .toc{position:static;order:-1;background:var(--sand);border-radius:10px;padding:1.1rem 1.2rem}
  .toc-track{padding-left:1rem}
  .toc-list{display:grid;grid-template-columns:1fr 1fr;column-gap:1rem}
  .article{max-width:none}
  .hero-scale{display:none}
}
@media (max-width:560px){
  body{font-size:16px}
  .masthead-inner{justify-content:center;text-align:center;gap:.5rem}
  .masthead-nav{justify-content:center;gap:.3rem .8rem}
  .hero{min-height:clamp(480px,74vh,620px)}
  .toc-list{grid-template-columns:1fr}
  .entry{grid-template-columns:minmax(0,1fr);gap:0}
  .entry-index{position:static;margin-bottom:.7rem}
  .entry-index::after{display:none}
  .figures{grid-template-columns:1fr}
  .signup-form button{flex:1 1 100%}
}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .entry:hover .entry-media img{transform:none}
  .toc-progress{transition:none}
}
