/* Spice GTM blog. Paper & Heat, editorial layout. */

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

:root {
  --paper:  #FAF7F1;
  --cream:  #F3EEE3;
  --sand:   #EAE3D3;
  --linen:  #DDD3BF;
  --bone:   #C8BCA5;
  --dust:   #A2988A;
  --taupe:  #7D7364;
  --umber:  #574E42;
  --char:   #2B241C;
  --ink:    #16110B;
  --spice:  #D8380E;
  --ember:  #A82605;
  --spice-tint: rgba(216,56,14,0.07);
  --spice-line: rgba(216,56,14,0.35);
  --line:        rgba(22,17,11,0.10);
  --line-strong: rgba(22,17,11,0.20);
  --font-display: 'Bricolage Grotesque', 'Arial Black', sans-serif;
  --font: 'Spline Sans', -apple-system, sans-serif;
  --font-mono: 'Spline Sans Mono', ui-monospace, monospace;
  --r-sm: 3px; --r-md: 6px; --r-lg: 10px;
  --sh-sm: 0 2px 8px rgba(43,36,28,0.06);
  --sh-md: 0 10px 32px rgba(43,36,28,0.09);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--umber);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--ink); color: var(--paper); }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 48px; position: relative; z-index: 2; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 60;
  background: var(--ink); color: var(--paper); padding: 10px 16px;
  font-size: 13px; text-decoration: none; border-radius: 0 0 var(--r-md) 0;
}
.skip-link:focus { left: 0; }

/* ── reading progress ── */
#progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--spice); z-index: 60; transition: width 0.1s linear;
}

/* ── nav ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 68px;
  background: rgba(250,247,241,0.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
nav.scrolled { background: rgba(250,247,241,0.97); border-bottom-color: var(--line); }
.nav-in {
  max-width: 1160px; margin: 0 auto; padding: 0 48px; height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.wm {
  font-family: var(--font-display); font-weight: 800;
  letter-spacing: -0.045em; color: var(--ink); text-decoration: none;
}
.wm .hot { color: var(--spice); }
.nav-logo { font-size: 18px; display: inline-flex; align-items: center; }
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; }
.nav-links a {
  font-size: 13px; font-weight: 500; color: var(--taupe);
  text-decoration: none; transition: color 0.15s; position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; background: var(--spice);
}
.nav-cta {
  background: var(--ink); color: var(--paper); padding: 10px 18px;
  border-radius: var(--r-md); font-size: 13px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: transform 0.15s, background 0.15s;
}
.nav-cta:hover { transform: translateY(-1px); background: var(--char); }
.nav-cta:active { transform: scale(0.97); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--spice); outline-offset: 2px; }

/* ── shared bits ── */
.eyebrow {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--taupe);
}
.eyebrow .dot { width: 3px; height: 3px; background: var(--bone); border-radius: 50%; }
.eyebrow a { color: var(--taupe); text-decoration: none; }
.eyebrow a:hover { color: var(--spice); }

/* ── page head (blog index) ── */
.page-head { padding: 148px 0 56px; }
.page-head h1 {
  font-family: var(--font-display); font-weight: 800; color: var(--ink);
  letter-spacing: -0.035em; line-height: 1.02;
  font-size: clamp(2.4rem, 6vw, 4rem); margin: 22px 0 18px;
}
.page-head p { max-width: 620px; font-size: 16.5px; color: var(--umber); }

.post-list { padding-bottom: 120px; display: grid; gap: 28px; }
.post-card {
  display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 40px;
  align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 36px; text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--line-strong); }
.post-card h2 {
  font-family: var(--font-display); font-weight: 700; color: var(--ink);
  letter-spacing: -0.03em; line-height: 1.1;
  font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 16px 0 12px;
}
.post-card p { color: var(--umber); font-size: 15px; }
.post-card .more {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 20px;
  font-size: 13px; font-weight: 600; color: var(--spice);
}
.post-card figure { border-radius: var(--r-md); overflow: hidden; background: var(--cream); }

/* ── article ── */
.article-head { padding: 132px 0 0; }
.article-head h1 {
  font-family: var(--font-display); font-weight: 800; color: var(--ink);
  letter-spacing: -0.035em; line-height: 1.03;
  font-size: clamp(2.1rem, 5.4vw, 3.6rem);
  max-width: 17ch; margin: 22px 0 0;
}
.standfirst {
  margin-top: 22px; max-width: 60ch;
  font-size: clamp(1rem, 2.2vw, 1.2rem); line-height: 1.6; color: var(--char);
}
.byline {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--taupe);
}
.byline b { color: var(--ink); font-weight: 600; }

.hero-figure { margin: 44px 0 0; border-radius: var(--r-lg); overflow: hidden; background: var(--cream); }

.article-body {
  display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 72px;
  align-items: start; padding: 64px 0 110px;
}
.prose { max-width: 68ch; }

.toc { position: sticky; top: 104px; }
.toc-k {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--dust);
  padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.toc a {
  display: block; padding: 6px 0 6px 14px; font-size: 12.5px; line-height: 1.45;
  color: var(--taupe); text-decoration: none;
  border-left: 2px solid transparent; transition: color 0.15s, border-color 0.15s;
}
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); border-left-color: var(--spice); }

.prose h2 {
  font-family: var(--font-display); font-weight: 700; color: var(--ink);
  letter-spacing: -0.028em; line-height: 1.14;
  font-size: clamp(1.35rem, 2.9vw, 1.85rem);
  margin: 56px 0 18px; scroll-margin-top: 96px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-family: var(--font); font-weight: 600; color: var(--ink);
  font-size: 16.5px; line-height: 1.4; margin: 32px 0 10px;
}
.prose p { margin-bottom: 18px; font-size: 16px; line-height: 1.72; }
.prose p strong { color: var(--char); font-weight: 600; }
/* Body links only. The CTA aside sits inside .prose, and an unscoped `.prose a`
   outranks `.btn-spice`/`.btn-ghost`, which painted both buttons ink on ink. */
.prose a:not(.btn) { color: var(--ink); text-decoration: underline; text-decoration-color: var(--spice-line); text-underline-offset: 3px; }
.prose a:not(.btn):hover { color: var(--spice); text-decoration-color: var(--spice); }
.prose ul { margin: 0 0 18px 0; padding-left: 20px; }
.prose li { margin-bottom: 8px; font-size: 16px; }

.lede { font-size: 17px; }

.pull {
  margin: 34px 0; padding: 26px 30px;
  background: var(--cream); border-left: 2px solid var(--spice); border-radius: 0 var(--r-md) var(--r-md) 0;
}
.pull p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--ink); font-weight: 500; }

.tldr {
  margin: 36px 0 8px; padding: 28px 30px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm);
}
.tldr .toc-k { margin-bottom: 16px; }
.tldr ul { margin: 0; padding-left: 18px; }
.tldr li { margin-bottom: 10px; color: var(--umber); }
.tldr li:last-child { margin-bottom: 0; }

figure.inline { margin: 40px 0; }
figure.inline .shot { border-radius: var(--r-md); overflow: hidden; background: var(--cream); border: 1px solid var(--line); }
figcaption {
  margin-top: 12px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.06em; color: var(--dust); line-height: 1.6;
}

.tbl { margin: 34px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
table { border-collapse: collapse; width: 100%; min-width: 560px; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 14.5px; vertical-align: top; }
th {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--taupe); background: var(--cream);
}
tr:last-child td { border-bottom: none; }
td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }

/* ── editorial chain diagram ── */
.chain { margin: 40px 0; }
.chain-row { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.node {
  flex: 1 1 150px; min-width: 0; padding: 14px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
}
.node .k {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--dust); display: block; margin-bottom: 6px;
}
.node .v { font-size: 14px; color: var(--ink); font-weight: 500; line-height: 1.4; }
.node.gate { background: var(--spice); border-color: var(--ember); }
.node.gate .k { color: rgba(255,247,242,0.7); }
.node.gate .v { color: #FFF7F2; }
.node.approved { background: var(--ink); border-color: var(--ink); }
.node.approved .k { color: var(--dust); }
.node.approved .v { color: var(--paper); }
.node.hold { background: transparent; border-style: dashed; border-color: var(--bone); }
.node.hold .v { color: var(--umber); font-weight: 400; }
.chain-arrow {
  display: flex; align-items: center; justify-content: center;
  color: var(--bone); font-size: 14px; padding: 6px 0;
}
.chain-arrow.down { font-size: 16px; color: var(--dust); }
.chain-branch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.chain-legend {
  margin: 22px 0 10px; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--dust);
  display: flex; align-items: center; gap: 12px;
}
.chain-legend::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ── cta ── */
.cta {
  margin: 56px 0 0; padding: 34px;
  background: var(--ink); border-radius: var(--r-lg); color: var(--linen);
}
.cta h2 {
  font-family: var(--font-display); font-weight: 700; color: var(--paper);
  letter-spacing: -0.03em; line-height: 1.1; font-size: 1.5rem; margin: 12px 0 12px;
}
.cta .toc-k { border-color: rgba(250,247,241,0.16); color: var(--dust); }
.cta p { color: var(--bone); margin-bottom: 22px; max-width: 52ch; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px;
  border-radius: var(--r-md); font-size: 14px; font-weight: 600;
  text-decoration: none; transition: transform 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-spice { background: var(--spice); color: #FFF7F2; }
.btn-spice:hover { background: var(--ember); }
.btn-ghost { background: transparent; color: var(--paper); border: 1px solid rgba(250,247,241,0.28); }
.btn-ghost:hover { background: rgba(250,247,241,0.08); }

.faq { margin-top: 56px; }
.faq-item { border-top: 1px solid var(--line); padding: 22px 0; }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item h3 { margin: 0 0 8px; }
.faq-item p { margin: 0; }

/* ── footer ── */
footer { background: var(--cream); border-top: 1px solid var(--line); padding: 56px 0 34px; position: relative; z-index: 2; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.foot-brand { font-size: 20px; display: inline-block; margin-bottom: 12px; }
.f-tag { font-size: 13.5px; color: var(--taupe); max-width: 42ch; }
.f-col { display: flex; flex-direction: column; gap: 9px; }
.f-k {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--dust); margin-bottom: 4px;
}
.f-col a { font-size: 13.5px; color: var(--taupe); text-decoration: none; }
.f-col a:hover { color: var(--ink); }
.footer-bottom {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--dust);
}

/* ── responsive ── */
@media (max-width: 1080px) {
  .article-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .post-card { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .post-card figure { order: -1; }
}
@media (max-width: 860px) {
  .wrap, .nav-in { padding: 0 24px; }
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .f-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  /* Stack the chain so a wrapped row never starts with a dangling arrow. */
  .chain-row { flex-direction: column; gap: 0; }
  .chain-row .node { flex: 0 0 auto; }
  .chain-arrow { transform: rotate(90deg); font-size: 16px; color: var(--dust); }
  .chain-arrow.down { transform: none; }
  .chain-branch { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .wrap, .nav-in { padding: 0 20px; }
  nav { height: 60px; }
  .article-head { padding-top: 104px; }
  .page-head { padding: 118px 0 40px; }
  .article-body { padding: 44px 0 80px; }
  .prose p, .prose li { font-size: 15.5px; }
  .post-card { padding: 22px; }
  .pull, .tldr, .cta { padding: 22px; }
  .chain-branch { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
