/* =========================================================
   Talaiot — blog / long-form report
   Builds on ../../assets/talaiot.css (tokens, nav, buttons, footer)
   ========================================================= */
:root {
  /* colours come from /brand/brand.css */
  --alarm: var(--tl-alert);
  --alarm-soft: rgb(var(--tl-alert-rgb) / .10);
  --measure: 700px;
}

/* ---------- Language blocks ---------- */
html[data-lang="en"] [data-l]:not([data-l="en"]),
html[data-lang="es"] [data-l]:not([data-l="es"]),
html[data-lang="it"] [data-l]:not([data-l="it"]) { display: none !important; }

/* ---------- Reading progress ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.progress__bar { height: 100%; width: 100%; background: var(--grad-warm); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Header ---------- */
.post-hero { position: relative; padding: 150px 0 56px; overflow: hidden; }
.post-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 60% 70% at 80% 20%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 80% 20%, #000 0%, transparent 70%);
  opacity: .55;
}
.post-hero::before {
  content: ""; position: absolute; right: -10%; top: -20%; width: 60vw; height: 60vw; max-width: 760px; max-height: 760px; z-index: -1;
  background: radial-gradient(closest-side, rgb(var(--tl-coral-rgb) / .14), rgb(var(--tl-amber-rgb) / .06) 55%, transparent 72%);
}
.crumbs { font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 26px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--ink); }
.kicker--alarm { color: var(--alarm); }
.live-dot--alarm { background: var(--alarm); animation-name: pulseRed; }
.post-title { font-size: clamp(2.4rem, 6vw, 5rem); font-weight: 800; letter-spacing: -0.045em; line-height: .98; max-width: 15em; }
.post-dek { font-size: clamp(1.1rem, 1.7vw, 1.35rem); color: var(--ink-2); margin-top: 28px; max-width: 36em; line-height: 1.55; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 34px; font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); }
.post-meta b { color: var(--ink); font-weight: 600; }
.post-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); }

/* ---------- Big numbers ---------- */
.bignums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 56px; }
.bignum {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 24px 22px 22px; overflow: hidden;
}
.bignum::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad-warm); }
.bignum__n { font-family: var(--f-head); font-weight: 800; font-size: clamp(2.4rem, 4vw, 3.4rem); letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.bignum__n small { font-size: .5em; letter-spacing: -0.02em; margin-left: 2px; }
.bignum p { font-size: 14.5px; color: var(--ink-2); margin-top: 12px; line-height: 1.45; }
.bignum cite { display: block; font-style: normal; font-family: var(--f-mono); font-size: 11px; color: var(--muted); margin-top: 12px; letter-spacing: .02em; }
@media (max-width: 980px) { .bignums { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .bignums { grid-template-columns: 1fr; } }

/* ---------- Layout ---------- */
.post { padding: 30px 0 40px; }
.post-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 64px; align-items: start; }
.toc { position: sticky; top: 100px; font-size: 13.5px; }
.toc__label { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line-2); }
.toc li a { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); line-height: 1.35; transition: color .2s, border-color .2s; }
.toc li a:hover { color: var(--ink); }
.toc li a.is-on { color: var(--ink); border-left-color: var(--alarm); font-weight: 600; }
@media (max-width: 1060px) { .post-grid { grid-template-columns: 1fr; } .toc { display: none; } }

.prose { max-width: var(--measure); }
.chapter { padding-top: 40px; margin-top: 40px; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.chapter:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.chapter__num { font-family: var(--f-mono); font-size: 12px; font-weight: 600; color: var(--alarm); letter-spacing: .1em; }
.chapter h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 700; margin: 10px 0 22px; letter-spacing: -0.035em; line-height: 1.08; }
.prose p { font-size: 18px; line-height: 1.7; color: var(--ink-2); margin: 0 0 20px; }
.prose p strong { color: var(--ink); }
.prose a.ref { color: var(--tl-accent-text); font-family: var(--f-mono); font-size: .68em; font-weight: 600; vertical-align: super; line-height: 0; padding: 0 1px; }
.prose a.ref:hover { text-decoration: underline; }
.prose h3 { font-size: 1.25rem; font-weight: 700; margin: 34px 0 12px; letter-spacing: -0.02em; }

/* Key takeaway box at chapter start */
.tldr { display: flex; gap: 14px; background: var(--paper); border-radius: var(--r-sm); padding: 16px 18px; margin: 0 0 26px; font-size: 15.5px; line-height: 1.5; color: var(--ink); }
.tldr::before { content: "→"; font-family: var(--f-mono); font-weight: 700; color: var(--alarm); }

/* Pull quote */
.pull { margin: 38px 0; padding: 4px 0 4px 26px; border-left: 3px solid; border-image: var(--grad-warm) 1; }
.pull blockquote { margin: 0; font-family: var(--f-head); font-weight: 600; font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.28; letter-spacing: -0.025em; color: var(--ink); }
.pull figcaption { margin-top: 14px; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }

/* ---------- Figures / charts ---------- */
.fig { margin: 34px 0 38px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 26px 26px 20px; }
.fig--wide { margin-left: 0; margin-right: 0; }
.fig__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.fig__title { font-family: var(--f-head); font-weight: 700; font-size: 1.12rem; letter-spacing: -0.02em; line-height: 1.25; }
.fig__sub { font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.fig__tag { flex: none; font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--alarm); background: var(--alarm-soft); padding: 5px 9px; border-radius: 999px; }
.fig__src { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.fig__src a { color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.fig__src a:hover { color: var(--tl-accent-text); }
.chart { width: 100%; position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--f-body); fill: var(--muted); font-size: 12px; }
.chart .c-val { font-family: var(--f-head); font-weight: 700; fill: var(--ink); font-size: 14px; }
.chart .c-val--hot { fill: var(--alarm); }
.chart .c-grid { stroke: var(--line); stroke-width: 1; }
.chart .c-axis { stroke: var(--line-2); stroke-width: 1; }
.chart .c-bar { fill: #C9CFDB; }
.chart .c-bar--hot { fill: url(#gWarm); }
.chart .c-bar--cool { fill: url(#gCool); }
.chart .c-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart .c-line--hot { stroke: var(--alarm); }
.chart .c-line--cold { stroke: #9AA3B5; stroke-dasharray: 2 6; }
.chart .c-dot--hot { fill: #fff; stroke: var(--alarm); stroke-width: 3; }
.chart .c-dot--cold { fill: #fff; stroke: #9AA3B5; stroke-width: 3; }
.chart .c-lbl { font-size: 12.5px; fill: var(--ink-2); }
.chart .c-lbl--strong { font-weight: 600; fill: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 7px; }
.legend .lg-hot { background: var(--alarm); }
.legend .lg-cold { background: #9AA3B5; }

/* Animated chart elements */
.chart .grow { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); transition: transform 1.1s var(--ease); }
.chart .grow-x { transform-box: fill-box; transform-origin: 0 50%; transform: scaleX(0); transition: transform 1.1s var(--ease); }
.chart.is-drawn .grow, .chart.is-drawn .grow-x { transform: none; }
.chart .fade { opacity: 0; transition: opacity .6s var(--ease) .7s; }
.chart.is-drawn .fade { opacity: 1; }
.chart .draw { transition: stroke-dashoffset 1.6s var(--ease); }

/* Toggle above chart */
.seg-mini { display: inline-flex; background: rgb(var(--tl-ink-rgb) / .06); border-radius: 999px; padding: 3px; margin-bottom: 16px; }
.seg-mini button { border: 0; background: transparent; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 6px 12px; border-radius: 999px; }
.seg-mini button.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* People grid (out of 100) */
.dots { display: grid; grid-template-columns: repeat(20, 1fr); gap: 5px; max-width: 520px; }
.dots span { aspect-ratio: 1; border-radius: 50%; background: #D9DDE5; transform: scale(.4); opacity: .4; transition: transform .5s var(--ease), opacity .5s, background .5s; }
.dots.is-drawn span { transform: scale(1); opacity: 1; }
.dots span.on { background: var(--alarm); }
.dots-legend { display: flex; align-items: baseline; gap: 14px; margin-top: 18px; }
.dots-legend b { font-family: var(--f-head); font-size: 2.6rem; font-weight: 800; letter-spacing: -0.05em; color: var(--alarm); line-height: 1; }
.dots-legend span { font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }

/* Two-stat compare */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 30px 0; }
.duo > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; }
.duo b { display: block; font-family: var(--f-head); font-weight: 800; font-size: 2.6rem; letter-spacing: -0.05em; line-height: 1; }
.duo b.hot { color: var(--alarm); }
.duo p { font-size: 14.5px !important; line-height: 1.45 !important; margin: 10px 0 0 !important; }
.duo cite { display: block; font-style: normal; font-family: var(--f-mono); font-size: 11px; color: var(--muted); margin-top: 10px; }
@media (max-width: 560px) { .duo { grid-template-columns: 1fr; } }

/* ---------- Dark band: detection ---------- */
.band { position: relative; background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 44px 40px; margin: 40px 0; overflow: hidden; }
.band::before { content: ""; position: absolute; right: -120px; top: -120px; width: 380px; height: 380px; background: radial-gradient(closest-side, rgb(var(--tl-coral-rgb) / .35), transparent 70%); pointer-events: none; }
.band__n { font-family: var(--f-head); font-weight: 800; font-size: clamp(4rem, 11vw, 7.5rem); letter-spacing: -0.06em; line-height: .9; background: var(--grad-warm); -webkit-background-clip: text; background-clip: text; color: transparent; }
.band p { color: rgba(255,255,255,.82) !important; font-size: 18px !important; max-width: 30em; margin: 18px 0 0 !important; position: relative; }
.band p strong { color: #fff !important; }
.band cite { display: block; position: relative; font-style: normal; font-family: var(--f-mono); font-size: 11.5px; color: rgba(255,255,255,.5); margin-top: 18px; }
.band cite a { color: rgba(255,255,255,.75); border-bottom: 1px solid rgba(255,255,255,.25); }
@media (max-width: 560px) { .band { padding: 34px 22px; } }

/* ---------- Timeline ---------- */
.tl { list-style: none; padding: 0; margin: 30px 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--line-2), var(--alarm)); }
.tl li { position: relative; padding: 0 0 26px 38px; }
.tl li::before { content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid #9AA3B5; }
.tl li.hot::before { border-color: var(--alarm); box-shadow: 0 0 0 5px var(--alarm-soft); }
.tl time { display: block; font-family: var(--f-mono); font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.tl h4 { font-family: var(--f-head); font-size: 1.08rem; font-weight: 700; margin: 4px 0 6px; letter-spacing: -0.015em; line-height: 1.3; }
.tl p { font-size: 15.5px !important; line-height: 1.55 !important; margin: 0 !important; }

/* ---------- Callout: what it means ---------- */
.verdict { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 34px 32px; margin: 36px 0; }
.verdict h3 { margin-top: 0 !important; font-size: 1.4rem !important; }
.verdict ol { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: v; }
.verdict li { counter-increment: v; position: relative; padding: 0 0 18px 46px; font-size: 16.5px; line-height: 1.55; color: var(--ink-2); }
.verdict li::before { content: counter(v, decimal-leading-zero); position: absolute; left: 0; top: 0; font-family: var(--f-mono); font-weight: 600; font-size: 13px; color: var(--alarm); background: var(--alarm-soft); border-radius: 8px; padding: 3px 7px; }
.verdict li strong { color: var(--ink); }
@media (max-width: 560px) { .verdict { padding: 26px 20px; } }

/* ---------- Sources ---------- */
.sources { margin-top: 60px; padding-top: 34px; border-top: 1px solid var(--line-2); }
.sources h2 { font-size: 1.4rem !important; margin-bottom: 8px !important; }
.sources > p { font-size: 15px !important; color: var(--muted) !important; }
.sources ol { padding-left: 0; list-style: none; counter-reset: s; margin: 22px 0 0; }
.sources li { counter-increment: s; position: relative; padding: 9px 0 9px 44px; font-size: 14px; line-height: 1.5; color: var(--ink-2); border-bottom: 1px solid var(--line); scroll-margin-top: 100px; }
.sources li::before { content: "[" counter(s) "]"; position: absolute; left: 0; top: 9px; font-family: var(--f-mono); font-size: 12px; color: var(--tl-accent-text); font-weight: 600; }
.sources li:target { background: rgb(var(--tl-accent-rgb) / .06); }
.sources li a { color: var(--tl-accent-text); word-break: break-word; }
.sources li a:hover { text-decoration: underline; }

/* ---------- CTA tweaks ---------- */
.post-cta { padding-top: 30px; }

/* ---------- Share ---------- */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 40px; }
.share span { font-family: var(--f-mono); font-size: 12px; color: var(--muted); margin-right: 4px; }
.share a, .share button { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.6); font-size: 13.5px; font-weight: 600; color: var(--ink); }
.share a:hover, .share button:hover { background: #fff; }

@media (max-width: 640px) {
  .post-hero { padding: 120px 0 40px; }
  .prose p { font-size: 17px; }
  .fig { padding: 20px 16px 16px; border-radius: 14px; }
  .fig__head { flex-direction: column; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .chart .grow, .chart .grow-x, .chart .fade, .dots span, .reveal { transition: none !important; transform: none !important; opacity: 1 !important; }
}
@media print {
  .nav, .progress, .toc, .share, .cta { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
@media (max-width: 640px) { .post-meta .sep { display: none; } .post-meta { gap: 6px 16px; } }
