/* Attribution Express — shared shell.
 *
 * The one page that existed first, index.html, carries its own copy of all of
 * this inline. This file exists so the pages added later — the insight pieces —
 * do not need a third and fourth copy of the same header, footer and colour
 * ramp. Only the shell lives here; index.html is untouched and still
 * self-contained.
 *
 * THE TOKEN BLOCK BELOW IS A COPY. It was lifted verbatim out of index.html
 * and the two must stay in step: change a colour there, change it here, or the
 * insight pages will drift away from the page they link back to.
 *
 * No web fonts and no remote images anywhere, because the CSP allows neither.
 */

:root,
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #070d18;
  --bg-alt: #0a1322;
  --fg: #e9eff7;
  --strong: #ffffff;
  --body: #a7b7ca;
  --muted: #93a3b8;
  --line: rgba(255, 255, 255, 0.09);
  --ink: #e9eff7;
  --ink-fg: #070d18;
  --accent: #4fa8e8;
  --accent-2: #45c9be;
  --accent-soft: rgba(69, 201, 190, 0.1);
  --deep: #050a13;
  --pos: #57d9a3;
  --neg: #ff8f8f;
  --pos-strong: #7ff0c0;
  --neg-strong: #ffb4b4;
  --ok: #57d9a3;
  --err: #ff8f8f;

  --glass: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  --glass-line: rgba(255, 255, 255, 0.1);
  --lift: 0 1px 0 rgba(255, 255, 255, 0.07) inset, 0 24px 48px -30px rgba(0, 0, 0, 0.9);
  --grid-dot: rgba(255, 255, 255, 0.055);
  --wash-1: rgba(69, 201, 190, 0.3);
  --wash-2: rgba(79, 168, 232, 0.26);
  --wash-3: rgba(79, 168, 232, 0.12);
  --header-bg: rgba(7, 13, 24, 0.72);
  --band-alt: rgba(255, 255, 255, 0.022);
  --band-line: rgba(255, 255, 255, 0.055);

  --grad-text: linear-gradient(100deg, #5fd6c9 0%, #4fa8e8 52%, #7cc0f0 100%);
  --btn-bg: linear-gradient(135deg, #45c9be 0%, #3f9fe0 100%);
  --btn-fg: #04121c;
  --btn-glow: 0 10px 26px -12px rgba(69, 201, 190, 0.85);
  --btn-glow-hi: 0 16px 32px -12px rgba(69, 201, 190, 0.95);
  --btn-inset: 0 1px 0 rgba(255, 255, 255, 0.35) inset;

  --th-bg: linear-gradient(180deg, rgba(79, 168, 232, 0.22), rgba(79, 168, 232, 0.1));
  --th-fg: #dbe8f6;
  --th-eff-bg: linear-gradient(180deg, rgba(69, 201, 190, 0.26), rgba(69, 201, 190, 0.12));
  --th-eff-fg: #d6f5f0;
  --td-fg: #cdd9e7;
  --row-hover: rgba(255, 255, 255, 0.03);
  --tfoot-bg: rgba(255, 255, 255, 0.06);

  --field-bg: rgba(255, 255, 255, 0.045);
  --focus-ring: rgba(69, 201, 190, 0.16);
  --focus-line: rgba(69, 201, 190, 0.7);

  --cost-bg: radial-gradient(28rem 18rem at 80% 0%, rgba(69, 201, 190, 0.3), transparent 70%),
    linear-gradient(150deg, #123b55 0%, #0d2a44 55%, #0a1c30 100%);
  --cost-fg: #ffffff;
  --cost-body: #c2d6e8;
  --cost-unit: #7fdccf;
  --say-bg: linear-gradient(150deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));

  --flow-fill: rgba(255, 255, 255, 0.04);
  --flow-stroke: rgba(255, 255, 255, 0.14);
  --flow-dark: #030910;
  --footer-bg: rgba(0, 0, 0, 0.25);
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f5f8fc;
  --bg-alt: #eef3f9;
  --fg: #0c2340;
  --strong: #08172b;
  --body: #46586e;
  --muted: #6b7c92;
  --line: rgba(12, 35, 64, 0.12);
  --ink: #0c2340;
  --ink-fg: #ffffff;
  --accent: #1f5e9e;
  --accent-2: #0e8c86;
  --accent-soft: rgba(14, 140, 134, 0.08);
  --deep: #0c2340;
  --pos: #1f6f43;
  --neg: #a3282b;
  --pos-strong: #145c37;
  --neg-strong: #8d1f22;
  --ok: #1f6f43;
  --err: #a3282b;

  /* On white the equivalent of a glass panel is a white card lifted off
     the ground — the depth has to come from shadow rather than from a
     lighter fill, because there is nothing lighter than the card. */
  --glass: linear-gradient(180deg, #ffffff, #fbfdff);
  --glass-line: rgba(12, 35, 64, 0.1);
  --lift: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 1px 2px rgba(12, 35, 64, 0.06),
    0 18px 40px -28px rgba(12, 35, 64, 0.45);
  --grid-dot: rgba(12, 35, 64, 0.07);
  --wash-1: rgba(14, 190, 178, 0.28);
  --wash-2: rgba(79, 148, 232, 0.24);
  --wash-3: rgba(79, 148, 232, 0.12);
  --header-bg: rgba(245, 248, 252, 0.78);
  --band-alt: rgba(12, 35, 64, 0.028);
  --band-line: rgba(12, 35, 64, 0.07);

  --grad-text: linear-gradient(100deg, #0e8c86 0%, #1f5e9e 55%, #2b7ac4 100%);
  --btn-bg: linear-gradient(135deg, #0e9a93 0%, #1f5e9e 100%);
  --btn-fg: #ffffff;
  --btn-glow: 0 10px 24px -12px rgba(14, 140, 134, 0.75);
  --btn-glow-hi: 0 16px 30px -12px rgba(14, 140, 134, 0.85);
  --btn-inset: 0 1px 0 rgba(255, 255, 255, 0.3) inset;

  --th-bg: linear-gradient(180deg, #1f5e9e, #1a5389);
  --th-fg: #ffffff;
  --th-eff-bg: linear-gradient(180deg, #0e8c86, #0c7a75);
  --th-eff-fg: #ffffff;
  --td-fg: #33465e;
  --row-hover: rgba(12, 35, 64, 0.03);
  --tfoot-bg: #e9eff7;

  --field-bg: #ffffff;
  --focus-ring: rgba(14, 140, 134, 0.18);
  --focus-line: rgba(14, 140, 134, 0.8);

  /* The price panel stays dark in both themes. On a light page a dark
     card is the strongest thing on it, which is where the price belongs. */
  --cost-bg: radial-gradient(28rem 18rem at 80% 0%, rgba(69, 201, 190, 0.32), transparent 70%),
    linear-gradient(150deg, #123b55 0%, #0d2a44 55%, #0a1c30 100%);
  --cost-fg: #ffffff;
  --cost-body: #c2d6e8;
  --cost-unit: #7fdccf;
  --say-bg: linear-gradient(150deg, #ffffff, #f4f8fd);

  --flow-fill: #ffffff;
  --flow-stroke: rgba(12, 35, 64, 0.16);
  --flow-dark: #0c2340;
  --footer-bg: rgba(12, 35, 64, 0.03);
}


/* The media query that used to flip tokens on the OS preference lives in
   index.html. Themes are explicit here, so there is nothing to neutralise. */

/* ====================================================== base */
* { box-sizing: border-box; }

html {
  background-color: var(--bg);
  background-image:
    radial-gradient(var(--grid-dot) 1px, transparent 1px),
    radial-gradient(58rem 34rem at 4% -10%, var(--wash-1), transparent 60%),
    radial-gradient(52rem 32rem at 98% 0%, var(--wash-2), transparent 58%),
    radial-gradient(46rem 30rem at 50% 104%, var(--wash-3), transparent 62%);
  background-size: 26px 26px, cover, cover, cover;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
  background-attachment: fixed, fixed, fixed, fixed;
  scroll-padding-top: 5.5rem;
}
body {
  margin: 0;
  background: transparent;
  color: var(--fg);
  overflow-x: hidden;
  font: 16px/1.65 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 60rem; margin: 0 auto; padding: 0 1.5rem; }
a { color: inherit; }

/* ====================================================== header */
header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 1.1rem;
}
.logo { display: block; width: auto; height: 2.5rem; }
/* One lockup per theme; both files already exist in site/. */
.logo-dark { display: none; }
:root[data-theme='light'] .logo-light { display: none; }
:root[data-theme='light'] .logo-dark { display: block; }
.head-actions { display: flex; align-items: center; gap: 0.6rem; }

.themetoggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  background: var(--glass);
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--lift);
}
.themetoggle:hover { color: var(--accent-2); }
.themetoggle svg { width: 1.05rem; height: 1.05rem; display: block; }
.themetoggle .i-sun,
.themetoggle .i-moon,
.themetoggle .i-auto { display: none; }
:root[data-choice='auto'] .themetoggle .i-auto { display: block; }
:root[data-choice='light'] .themetoggle .i-sun { display: block; }
:root[data-choice='dark'] .themetoggle .i-moon { display: block; }
:root:not([data-choice]) .themetoggle .i-auto { display: block; }

/* ====================================================== buttons */
.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 0.72rem 1.3rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 650;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--btn-inset), var(--btn-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: var(--btn-inset), var(--btn-glow-hi);
}
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  color: var(--fg);
  box-shadow: var(--lift);
}
.btn.ghost:hover { filter: none; color: var(--accent-2); }

/* ====================================================== the piece */
/* .piece sits on the same element as .wrap, so a padding shorthand here
   would silently blank out .wrap's own 1.5rem side gutters and push the
   headline out of line with the body text below it. */
.piece { padding-block: 3.2rem 1rem; }
.piece .kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 0.9rem;
}
.piece h1 {
  font-size: clamp(1.8rem, 4.2vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.022em;
  color: var(--strong);
  margin: 0 0 1rem;
  max-width: 24ch;
}
.piece h1 .grad {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.piece .stand {
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--body);
  max-width: 44rem;
  margin: 0 0 1.4rem;
}
.piece .stand strong { color: var(--strong); }
.piece .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  margin: 0;
}

article.body { padding: 1.4rem 0 3rem; }
article.body > .wrap > * { max-width: 42rem; }
article.body h2 {
  font-size: 1.35rem;
  font-weight: 640;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--strong);
  margin: 2.6rem 0 0.8rem;
}
article.body h2:first-child { margin-top: 0; }
article.body h3 {
  font-size: 1.02rem;
  font-weight: 650;
  color: var(--fg);
  margin: 1.8rem 0 0.5rem;
}
article.body p { color: var(--body); margin: 0 0 1.05rem; }
article.body strong { color: var(--strong); font-weight: 620; }
article.body ul { color: var(--body); padding-left: 0; list-style: none; margin: 0 0 1.2rem; }
article.body ul li { position: relative; padding-left: 1.3rem; margin-bottom: 0.55rem; }
article.body ul li::before {
  content: '';
  position: absolute;
  left: 0.15rem;
  top: 0.62rem;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--accent-2);
}
article.body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
article.body a:hover { color: var(--accent-2); }

/* A short claim set off from the argument. */
.lift {
  margin: 1.8rem 0 2rem;
  padding: 1.2rem 1.4rem;
  border-left: 3px solid var(--accent-2);
  border-radius: 0 12px 12px 0;
  background: var(--glass);
  box-shadow: var(--lift);
}
.lift p { margin: 0; color: var(--fg); font-size: 1.04rem; line-height: 1.55; }
.lift p + p { margin-top: 0.7rem; }

/* The numbers that recur across the site, stated once per piece. */
.facts {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin: 2rem 0 2.2rem;
}
/* Prose is capped at a readable measure; the full-width blocks inside it are
   not, and they have to out-specify that cap rather than fight it. */
article.body > .wrap > .facts,
article.body > .wrap > .cards { max-width: none; }
@media (min-width: 40rem) { .facts { grid-template-columns: repeat(3, 1fr); } }
.fact {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: var(--glass);
  box-shadow: var(--lift);
}
.fact b {
  display: block;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--accent-2);
  margin-bottom: 0.3rem;
}
.fact span { font-size: 0.88rem; color: var(--muted); line-height: 1.45; display: block; }

/* End-of-piece call to action. */
.after {
  border-top: 1px solid var(--line);
  padding: 2.4rem 0 3.2rem;
}
.after h2 { font-size: 1.25rem; margin: 0 0 0.6rem; color: var(--strong); }
.after p { color: var(--body); max-width: 40rem; margin: 0 0 1.3rem; }
.after .actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.after .src {
  margin: 1.8rem 0 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 44rem;
}
.after .src a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* ====================================================== insight index */
.cards { display: grid; gap: 1.2rem; grid-template-columns: 1fr; margin: 0 0 1rem; }
@media (min-width: 46rem) { .cards { grid-template-columns: 1fr 1fr; } }
.cards .item {
  display: block;
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: var(--glass);
  box-shadow: var(--lift);
  text-decoration: none;
}
.cards .item:hover { border-color: var(--accent-2); }
.cards .item .when {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-2);
  display: block;
  margin-bottom: 0.6rem;
}
.cards .item h2 {
  font-size: 1.12rem;
  font-weight: 640;
  line-height: 1.3;
  color: var(--strong);
  margin: 0 0 0.55rem;
}
.cards .item p { margin: 0; color: var(--body); font-size: 0.93rem; line-height: 1.55; }

/* ====================================================== footer */
footer {
  border-top: 1px solid var(--line);
  background: var(--footer-bg);
  color: var(--muted);
}
footer .wrap { padding-block: 2rem; }
footer .footgrid { display: block; }
.footlinks { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-bottom: 1.1rem; }
.footlinks a { font-size: 0.86rem; font-weight: 550; color: var(--body); text-decoration: none; }
.footlinks a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.legal { margin: 0 0 0.5rem; font-size: 0.8rem; line-height: 1.55; color: var(--muted); max-width: 46rem; }
.legal strong { color: var(--body); font-weight: 600; }
.copy { margin: 0; font-size: 0.8rem; color: var(--muted); }
footer a:hover { color: var(--accent-2); }

/* ====================================================== phone */
.btn .sm { display: none; }
@media (max-width: 30rem) {
  header.site .wrap { padding-block: 0.75rem; gap: 0.5rem; }
  .logo { height: 1.9rem; }
  header.site .btn { padding: 0.5rem 0.85rem; font-size: 0.82rem; white-space: nowrap; }
  header.site .btn .lg { display: none; }
  header.site .btn .sm { display: inline; }
  .themetoggle { width: 2.1rem; height: 2.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:hover { transform: none; }
}
