/* Spice GTM canvas (since 24.11.2026): home, blog, posts, cases, privacy, 404.
   One dark stage for the whole page. Light content never repaints the screen:
   it sits on the stage as a rounded sheet with its own light tokens.
   The site chrome (nav and footer) lives here and nowhere else: markup comes from
   _includes/site-nav.html and _includes/site-footer.html via scripts/render-site-nav.mjs.
   Load AFTER the page's own style and after /assets/site.css. */

:root{--sheet-gap:16px;--sheet-r:32px;--stage:#0e0d0c}

/* ---------- sheets: home, blog index (sections marked light) ---------- */
main [data-theme="light"]{
  /* literal values: pages differ in which helper tokens they define, and a
     registered @property falls back to its dark initial value on a bad var() */
  --bg:#f3eee5;--s1:#fbf8f2;--s2:#ece6da;--s3:#e2dacb;
  --chalk:#15130f;--ink2:rgba(21,19,15,.68);--mute:rgba(21,19,15,.66);
  --line:rgba(21,19,15,.1);--line2:rgba(21,19,15,.2);
  --spice-t:rgba(224,64,26,.1);--spice-ink:#b5320f;
  background:var(--bg);color:var(--chalk);
  margin-left:var(--sheet-gap);margin-right:var(--sheet-gap);
  border-radius:var(--sheet-r);overflow:clip;
}

/* the sheet rises out of the stage while it enters the viewport */
@supports (animation-timeline:view()){
  @media (prefers-reduced-motion:no-preference){
    main [data-theme="light"],.cv-sheet{
      transform-origin:50% 0;
      animation:cv-rise linear both;animation-timeline:view();animation-range:entry 0% entry 70%;
    }
  }
}
@keyframes cv-rise{from{transform:translateY(48px) scale(.96)}to{transform:none}}

@media (max-width:720px){:root{--sheet-gap:8px;--sheet-r:24px}}

/* ---------- posts: dark head and footer, the article on a light sheet ---------- */
html:root body.cv-post{background:var(--stage);color:rgba(241,235,223,.74)}
body.cv-post::before{display:none}
body.cv-post ::selection{background:var(--spice);color:#fff}

body.cv-post .article-head h1{color:#f1ebdf}
body.cv-post .standfirst{color:rgba(241,235,223,.74)}
body.cv-post .article-head .eyebrow,body.cv-post .article-head .eyebrow a{color:rgba(241,235,223,.5)}
body.cv-post .article-head .eyebrow a:hover{color:var(--spice)}
body.cv-post .article-head .eyebrow .dot{background:rgba(241,235,223,.3)}
body.cv-post .byline{color:rgba(241,235,223,.5);border-top-color:rgba(241,235,223,.1)}
body.cv-post .byline b{color:#f1ebdf}
body.cv-post .page-head h1{color:#f1ebdf}
body.cv-post .page-head p{color:rgba(241,235,223,.74)}
body.cv-post .page-head .eyebrow{color:rgba(241,235,223,.5)}
/* blog.css pads heads for a fixed 68px nav; the nav is sticky now and takes its own space */
body.cv-post .article-head{padding-top:64px}
body.cv-post .page-head{padding-top:80px}
body.cv-post .cv-sheet>.doc,body.cv-post .cv-sheet>.nf{padding-top:72px}
body.cv-post .hero-figure{background:#161411;box-shadow:0 0 0 1px rgba(241,235,223,.08)}

body.cv-post .cv-sheet{
  max-width:none;margin:56px var(--sheet-gap) 0;padding:0 48px;
  background:var(--paper);color:var(--umber);border-radius:var(--sheet-r);overflow:clip;
}
body.cv-post .cv-sheet .article-body{max-width:1064px;margin:0 auto;padding:80px 0 112px}
/* cases: the page's own .wrap sets the side padding */
body.cv-post .cv-sheet.cv-case{padding:0}
/* blog.css styles every <nav> as the top bar; the TOC is a <nav> too */
body.cv-post nav.toc{height:auto;background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;border-bottom:0;z-index:auto}

@media (max-width:720px){
  body.cv-post .article-head{padding-top:44px}
  body.cv-post .page-head{padding-top:58px}
  body.cv-post .cv-sheet{margin-top:40px;padding:0 18px}
  body.cv-post .cv-sheet.cv-case{padding:0}
  body.cv-post .cv-sheet .article-body{padding:48px 0 72px}
  body.cv-post .cv-sheet>.doc,body.cv-post .cv-sheet>.nf{padding:48px 0 72px}
}

/* ---------- chrome: one nav and one footer on every page ----------
   literal dark values, and every box property set, because blog.css styles bare
   nav/footer elements and the older pages carry their own nav/footer rules */
html{scroll-padding-top:68px}
html body #nav{
  position:sticky;top:0;left:auto;right:auto;z-index:50;display:block;
  height:68px;margin:0;padding:0;
  background:rgba(14,13,12,.9);-webkit-backdrop-filter:saturate(1.4) blur(16px);backdrop-filter:saturate(1.4) blur(16px);
  border:0;border-bottom:1px solid rgba(241,235,223,.08);box-shadow:none;
  font-family:-apple-system,BlinkMacSystemFont,'SF Pro Text','Inter Tight','Helvetica Neue',Arial,sans-serif;
}
html body #nav .nav-in{max-width:1320px;height:100%;margin:0 auto;padding:0 40px;display:flex;align-items:center;justify-content:space-between;gap:24px}
html body #nav .wm,html body footer.ft .wm{font-family:inherit;font-weight:700;font-size:22px;letter-spacing:-.04em;line-height:1;color:#f1ebdf;text-decoration:none}
html body #nav .wm .hot,html body footer.ft .wm .hot{color:#e0401a}
html body #nav .nav-links{display:flex;align-items:center;gap:32px;margin:0;padding:0;list-style:none}
html body #nav .nav-links a{position:relative;font-size:15px;font-weight:500;color:rgba(241,235,223,.66);text-decoration:none;transition:color .2s}
html body #nav .nav-links a:hover,html body #nav .nav-links a.active{color:#f1ebdf}
html body #nav .nav-links a::after{content:none}
html body #nav .nav-links a.active::after{content:"";position:absolute;left:0;right:0;bottom:-6px;height:1.5px;background:#e0401a}
html body #nav .nav-cta{display:inline-flex;align-items:center;padding:9px 18px;font-size:15px;font-weight:600;line-height:1.2;color:#f1ebdf;text-decoration:none;
  background:transparent;border:1px solid rgba(241,235,223,.18);border-radius:999px;box-shadow:none;transition:border-color .2s}
html body #nav .nav-cta:hover{background:transparent;color:#f1ebdf;border-color:#e0401a}

html body footer.ft{
  position:static;z-index:auto;margin:64px 0 0;padding:0;background:transparent;border:0;
  color:rgba(241,235,223,.66);
  font-family:-apple-system,BlinkMacSystemFont,'SF Pro Text','Inter Tight','Helvetica Neue',Arial,sans-serif;
}
footer.ft .ft-in{max-width:1320px;margin:0 auto;padding:0 40px}
footer.ft .ft-grid{padding-top:56px;border-top:1px solid rgba(241,235,223,.08);display:grid;grid-template-columns:minmax(0,2fr) repeat(3,minmax(0,1fr));gap:40px}
footer.ft .ft-brand p{font-size:15px;line-height:1.5;color:rgba(241,235,223,.74);max-width:22em;margin:16px 0 0}
footer.ft .ft-svc{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-top:14px;font-size:13px;font-weight:500;color:rgba(241,235,223,.5)}
footer.ft .ft-svc span{white-space:nowrap}
footer.ft .ft-svc span::before{content:"";display:inline-block;width:4px;height:4px;border-radius:50%;background:#e0401a;margin-right:10px;vertical-align:middle;position:relative;top:-1px}
footer.ft .ft-col{display:flex;flex-direction:column;gap:12px;font-size:15px}
footer.ft .ft-col a{width:fit-content;color:rgba(241,235,223,.74);text-decoration:none;transition:color .2s}
footer.ft .ft-col a:hover{color:#f1ebdf}
footer.ft .ft-k{margin-bottom:6px;font-family:'JetBrains Mono',ui-monospace,monospace;font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:rgba(241,235,223,.4)}
footer.ft .ft-big{margin-top:88px;font-weight:700;font-size:clamp(72px,17.5vw,252px);line-height:.8;letter-spacing:-.045em;white-space:nowrap;user-select:none;
  background:linear-gradient(180deg,rgba(241,235,223,.16),rgba(241,235,223,.02));-webkit-background-clip:text;background-clip:text;color:transparent}
footer.ft .ft-big b{font-weight:700;background:linear-gradient(180deg,rgba(224,64,26,.55),rgba(224,64,26,.06));-webkit-background-clip:text;background-clip:text}
footer.ft .ft-bot{display:flex;justify-content:space-between;gap:16px;padding:22px 0 30px;font-size:12px;color:rgba(241,235,223,.5);border-top:1px solid rgba(241,235,223,.08)}
footer.ft .ft-bot a{color:inherit;text-decoration:none}
footer.ft .ft-bot a:hover{color:#f1ebdf}

@media (max-width:860px){html body #nav .nav-links{display:none}}
@media (max-width:720px){
  html{scroll-padding-top:60px}
  html body #nav{height:60px}
  html body #nav .nav-in{padding:0 16px}
  html body footer.ft{margin-top:48px}
  footer.ft .ft-in{padding:0 16px}
  footer.ft .ft-grid{padding-top:40px}
  footer.ft .ft-grid{grid-template-columns:1fr 1fr;gap:32px 20px}
  footer.ft .ft-brand{grid-column:1/-1}
  footer.ft .ft-big{margin-top:56px}
}
