/* ==========================================================================
   Supporting Children, Families and Communities — Digital Portfolio
   Light theme only. Plum and warm grey. No external dependencies.
   ========================================================================== */

/* --------------------------------------------------------------- 1. Tokens */

:root {
  --bg:            #faf8f7;
  --bg-tint:       #f3eef1;
  --surface:       #ffffff;
  --surface-2:     #f8f4f6;
  --ink:           #241e26;
  --ink-soft:      #453a48;
  --muted:         #6b5f70;
  --line:          #e8dfe6;
  --line-strong:   #d6cad5;

  --brand:         #6b4a73;
  --brand-deep:    #472f4e;
  --brand-soft:    #f1e9f3;
  --accent:        #c07a4a;

  /* Per-context accent, overridden on each context page via [data-context] */
  --ctx:           var(--brand);
  --ctx-soft:      var(--brand-soft);
  --ctx-ink:       var(--brand-deep);

  --shadow-sm: 0 1px 2px rgb(36 30 38 / .06), 0 1px 3px rgb(36 30 38 / .05);
  --shadow-md: 0 4px 12px rgb(36 30 38 / .08), 0 2px 4px rgb(36 30 38 / .05);
  --shadow-lg: 0 18px 40px rgb(36 30 38 / .13), 0 4px 10px rgb(36 30 38 / .07);

  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1180px;
  --measure: 68ch;
  --header-h: 66px;

  --ease: cubic-bezier(.4, 0, .2, 1);

  color-scheme: light;
}

[data-context="economic"] { --ctx: #b0603a; --ctx-soft: #faf0e9; --ctx-ink: #7e4123; }
[data-context="social"]   { --ctx: #6b4a73; --ctx-soft: #f2eaf4; --ctx-ink: #4a3151; }
[data-context="cultural"] { --ctx: #a87c2e; --ctx-soft: #f9f1df; --ctx-ink: #74551a; }
[data-context="health"]   { --ctx: #43786b; --ctx-soft: #e7f1ee; --ctx-ink: #2b5249; }
[data-context="crisis"]   { --ctx: #a04a4c; --ctx-soft: #faeaea; --ctx-ink: #713033; }

/* ----------------------------------------------------------- 2. Base reset */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow-x: hidden;
}

main { flex: 1 0 auto; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 .6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + .5vw, 1.35rem); }
h4 { font-size: 1.05rem; font-family: var(--sans); font-weight: 650; letter-spacing: 0; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

ul, ol { margin: 0 0 1.15em; padding-left: 1.3em; }
li { margin-bottom: .45em; }

strong, b { font-weight: 650; color: var(--ink); }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

:focus-visible { outline: 3px solid var(--ctx); outline-offset: 3px; border-radius: 4px; }

::selection { background: var(--brand); color: #fff; }

/* -------------------------------------------------------- 3. Layout helpers */

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2.5rem, 860px); }

.prose { max-width: var(--measure); }
.prose p { color: var(--ink-soft); }

.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section--tint { background: var(--bg-tint); border-block: 1px solid var(--line); }

.eyebrow {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ctx);
  margin: 0 0 .8rem;
  display: block;
}

.lede {
  font-size: clamp(1.08rem, 1rem + .4vw, 1.25rem);
  line-height: 1.65;
  color: var(--ink-soft);
}

.skip-link {
  position: absolute;
  left: 1rem; top: -100px;
  z-index: 200;
  background: var(--brand);
  color: #fff;
  padding: .7rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 0; color: #fff; }

/* --------------------------------------------------------------- 4. Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
  min-width: 0;
}
.brand__mark {
  width: 34px; height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  transition: transform .3s var(--ease);
}
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.06); }
.brand__mark svg { width: 20px; height: 20px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__title {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__sub {
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.nav { display: flex; align-items: center; gap: .15rem; }
.nav a {
  position: relative;
  display: inline-block;
  padding: .45rem .7rem;
  border-radius: 8px;
  font-size: .93rem;
  font-weight: 550;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
/* Underline that grows from the centre on hover. */
.nav a::after {
  content: "";
  position: absolute;
  left: 50%; right: 50%; bottom: .18rem;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
  transition: left .22s var(--ease), right .22s var(--ease);
}
.nav a:hover::after { left: .7rem; right: .7rem; }
.nav a[aria-current="page"] {
  color: var(--ctx);
  background: var(--ctx-soft);
  font-weight: 650;
}
.nav a[aria-current="page"]::after { display: none; }

.icon-btn {
  width: 38px; height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover { border-color: var(--ctx); color: var(--ctx); }
.icon-btn svg { width: 18px; height: 18px; }

.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: .2rem;
    padding: 1rem 1.25rem 1.4rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateY(-130%);
    transition: transform .28s var(--ease);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }
  .nav[data-open="true"] { transform: translateY(0); }
  .nav a { padding: .7rem .8rem; font-size: 1rem; }
  .nav a::after { display: none; }
}

.progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--ctx), var(--accent));
  z-index: 95;
  pointer-events: none;
}

/* ------------------------------------------------------------- 5. Home hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem);
  background:
    radial-gradient(1100px 520px at 12% -10%, var(--brand-soft), transparent 65%),
    radial-gradient(760px 420px at 96% 8%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 70%);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (max-width: 900px) { .hero__grid { grid-template-columns: 1fr; } }

.hero h1 { margin-bottom: .35em; }
.hero__sub {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem);
  color: var(--brand);
  font-style: italic;
  margin-bottom: 1.4rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .38rem .85rem .38rem .6rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}
.pill__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .72rem 1.35rem;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn svg { width: 17px; height: 17px; transition: transform .22s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-md); }
.btn--primary:hover { background: var(--brand-deep); color: #fff; transform: translateY(-2px); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }

.lens-stack { display: grid; gap: .6rem; }
.lens-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ctx);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.lens-card:hover { transform: translateX(5px); box-shadow: var(--shadow-md); color: var(--ink); }
.lens-card__num {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ctx);
  width: 1.6rem;
  flex: none;
}
.lens-card__label { font-weight: 600; font-size: .95rem; }
.lens-card__arrow { margin-left: auto; color: var(--muted); flex: none; transition: transform .2s var(--ease); }
.lens-card:hover .lens-card__arrow { transform: translateX(4px); color: var(--ctx); }
.lens-card__arrow svg { width: 16px; height: 16px; }

/* ------------------------------------------------------ 6. Imagery: frames */

.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
  line-height: 0;
}
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s var(--ease);
}
.media-frame:hover img { transform: scale(1.045); }
/* A soft wash in the context colour ties each photo to its section. */
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg,
    color-mix(in srgb, var(--ctx) 16%, transparent),
    transparent 55%);
  pointer-events: none;
}

/* Full-bleed image band with an overlaid pull-quote */
.band {
  position: relative;
  overflow: hidden;
  min-height: clamp(300px, 34vw, 420px);
  display: grid;
  place-items: center;
  isolation: isolate;
}
.band__img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
}
.band__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(100deg,
      color-mix(in srgb, var(--brand-deep) 92%, transparent) 0%,
      color-mix(in srgb, var(--brand-deep) 74%, transparent) 48%,
      color-mix(in srgb, var(--brand-deep) 40%, transparent) 100%);
}
.band__inner { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.band blockquote {
  margin: 0;
  max-width: 34ch;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 1.05rem + 1.3vw, 2.05rem);
  line-height: 1.32;
  color: #fff;
  text-wrap: balance;
}
.band cite {
  display: block;
  margin-top: 1.1rem;
  font-family: var(--sans);
  font-style: normal;
  font-size: .84rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
  color: #e6d6ec;
}

/* Text + image split */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(2rem, 5vw, 3.75rem);
  align-items: center;
}
.split--flip .split__media { order: -1; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split--flip .split__media { order: 0; }
}
.split__media { aspect-ratio: 4 / 3; }

/* ---------------------------------------------------------- 7. Context grid */

.ctx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
}
@media (min-width: 1000px) {
  .ctx-grid { grid-template-columns: repeat(3, 1fr); }
}

.ctx-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
/* A muted bar is always present so the cards read as a set; hovering wipes
   the full-strength colour across it from the left. */
.ctx-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: color-mix(in srgb, var(--ctx) 32%, transparent);
}
.ctx-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--ctx);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .4s var(--ease);
}
.ctx-card:hover::after { transform: scaleX(1); }
.ctx-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--ctx) 40%, var(--line));
  color: var(--ink);
}
.ctx-card__icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--ctx-soft);
  color: var(--ctx);
  display: grid;
  place-items: center;
  margin-bottom: 1.1rem;
  transition: transform .3s var(--ease);
}
.ctx-card:hover .ctx-card__icon { transform: scale(1.08) rotate(-5deg); }
.ctx-card__icon svg { width: 24px; height: 24px; }
.ctx-card__num {
  position: absolute;
  top: 1.3rem; right: 1.5rem;
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 600;
  color: var(--ctx);
  opacity: .16;
  line-height: 1;
}
.ctx-card h3 { margin-bottom: .5rem; }
.ctx-card p { font-size: .93rem; color: var(--muted); margin-bottom: 1.2rem; }
.ctx-card__lens {
  margin-top: auto;
  padding-top: .9rem;
  border-top: 1px dashed var(--line-strong);
  font-size: .8rem;
  color: var(--ctx);
  font-weight: 600;
}

/* ------------------------------------------------------- 8. Pattern / steps */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}
.step {
  position: relative;
  padding: 1.25rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.step:hover { transform: translateY(-3px); border-color: var(--brand); }
.step__n {
  display: inline-grid;
  place-items: center;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: .7rem;
}
.step h4 { margin-bottom: .3rem; }
.step p { font-size: .87rem; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------- 9. Stats */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.stat {
  padding: 1.4rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-top: 3px solid var(--ctx);
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat__value {
  font-family: var(--serif);
  font-size: clamp(1.85rem, 1.5rem + 1.4vw, 2.5rem);
  font-weight: 600;
  color: var(--ctx);
  line-height: 1.05;
  margin-bottom: .4rem;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat__label { font-size: .89rem; color: var(--ink-soft); line-height: 1.5; }
.stat__src { display: block; margin-top: .55rem; font-size: .75rem; color: var(--muted); }

/* ---------------------------------------------------- 10. Context page hero */

.ctx-hero {
  position: relative;
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(2rem, 4vw, 3rem);
  background:
    radial-gradient(900px 460px at 8% -20%, var(--ctx-soft), transparent 68%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}
.ctx-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}
@media (max-width: 900px) { .ctx-hero__grid { grid-template-columns: 1fr; } }
.ctx-hero__media { aspect-ratio: 45 / 32; }

.ctx-hero__meta {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.1rem;
}
.ctx-hero__badge {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--ctx);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: var(--shadow-md);
}
.ctx-hero__badge svg { width: 27px; height: 27px; }
.ctx-hero h1 { margin-bottom: .5rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .8rem;
  border-radius: 999px;
  background: var(--ctx-soft);
  color: var(--ctx-ink);
  border: 1px solid color-mix(in srgb, var(--ctx) 25%, transparent);
  font-size: .8rem;
  font-weight: 600;
}

/* --------------------------------------------------- 11. Context page body */

.doc {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
  padding: clamp(2.5rem, 5vw, 4rem) 0 4rem;
}
@media (max-width: 1000px) { .doc { grid-template-columns: 1fr; } }

.toc {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  font-size: .88rem;
}
@media (max-width: 1000px) {
  .toc {
    position: static;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-sm);
  }
}
.toc__title {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: .8rem;
}
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: .42rem .9rem;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.4;
  transition: color .18s var(--ease), border-color .18s var(--ease), padding-left .18s var(--ease);
}
.toc a:hover { color: var(--ink); }
.toc a.is-active {
  color: var(--ctx);
  border-left-color: var(--ctx);
  font-weight: 650;
  padding-left: 1.1rem;
}

.doc__body > section { scroll-margin-top: calc(var(--header-h) + 20px); }
.doc__body > section + section { margin-top: clamp(2.75rem, 5vw, 4rem); }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding-bottom: .8rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--line);
}
.sec-head__n {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--ctx);
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  align-self: center;
}
.sec-head h2 { margin: 0; }

.callout {
  display: flex;
  gap: 1rem;
  padding: 1.15rem 1.3rem;
  background: var(--ctx-soft);
  border: 1px solid color-mix(in srgb, var(--ctx) 22%, transparent);
  border-left: 4px solid var(--ctx);
  border-radius: var(--radius-sm);
  margin: 1.6rem 0;
  font-size: .96rem;
}
.callout svg { width: 20px; height: 20px; flex: none; color: var(--ctx); margin-top: .18rem; }
.callout p { color: var(--ink-soft); }
.callout strong { color: var(--ctx-ink); }

.theory-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.4rem 0; }
.theory {
  padding: .5rem .9rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  font-size: .84rem;
  color: var(--ink-soft);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.theory:hover { border-color: var(--ctx); transform: translateY(-2px); }
.theory b { color: var(--ctx); font-weight: 650; }

/* --------------------------------------------------------- 12. Strategies */

.strategies { display: grid; gap: .9rem; margin-top: 1.5rem; counter-reset: strat; }
.strategy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.1rem;
  padding: 1.25rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.strategy:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--ctx) 35%, var(--line));
}
.strategy__n {
  counter-increment: strat;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--ctx-soft);
  color: var(--ctx);
  display: grid;
  place-items: center;
  flex: none;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.strategy:hover .strategy__n { background: var(--ctx); color: #fff; }
.strategy__n::before { content: counter(strat); }
.strategy h4 { margin-bottom: .25rem; color: var(--ink); }
.strategy p { font-size: .93rem; color: var(--muted); margin: 0; }

/* ----------------------------------------------------------- 13. Partners */

.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: .9rem;
  margin-top: 1.5rem;
}
.partner {
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.partner:hover { border-color: var(--ctx); transform: translateY(-3px); }
.partner__name { font-weight: 650; font-size: .96rem; margin-bottom: .3rem; color: var(--ink); }
.partner__role { font-size: .86rem; color: var(--muted); line-height: 1.5; }

/* ----------------------------------------------------------- 14. Resources */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 1.5rem 0 1.3rem;
  padding: .35rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
}
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: .5rem 1.05rem;
  border-radius: 999px;
  font: inherit;
  font-size: .89rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--ctx);
  box-shadow: var(--shadow-sm);
}

.tabpanel[hidden] { display: none; }
.js .tabpanel:not([hidden]) { animation: fade-in .32s var(--ease) both; }

.res-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.res-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .85rem;
  align-items: start;
  padding: .95rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin: 0;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.res-item:hover { border-color: var(--ctx); transform: translateX(4px); }
.res-item__icon { color: var(--ctx); flex: none; margin-top: .1rem; }
.res-item__icon svg { width: 18px; height: 18px; }
.res-item__title { font-weight: 600; font-size: .95rem; }
.res-item__note { font-size: .86rem; color: var(--muted); }

/* ------------------------------------------------------------ 15. Figures */

.figures { display: grid; gap: 1.5rem; margin-top: 1.6rem; }
figure.fig {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .22s var(--ease);
}
figure.fig:hover { box-shadow: var(--shadow-md); }
.fig__frame {
  /* Charts were exported on white — keep that ground so labels stay crisp. */
  background: #fff;
  padding: .5rem;
  cursor: zoom-in;
  border: 0;
  display: block;
  width: 100%;
}
.fig__frame img { width: 100%; border-radius: 6px; }
figcaption {
  padding: .95rem 1.25rem 1.1rem;
  font-size: .87rem;
  color: var(--muted);
  line-height: 1.55;
  border-top: 1px solid var(--line);
}
figcaption b { color: var(--ctx); font-weight: 650; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgb(28 18 30 / .9);
  backdrop-filter: blur(4px);
  border: 0;
  animation: fade-in .2s var(--ease) both;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: min(1100px, 100%);
  max-height: 85dvh;
  width: auto;
  border-radius: var(--radius);
  background: #fff;
  padding: .5rem;
  box-shadow: var(--shadow-lg);
}
.lightbox__close {
  position: absolute;
  top: 1.25rem; right: 1.25rem;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgb(255 255 255 / .16);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.lightbox__close:hover { background: rgb(255 255 255 / .3); }
.lightbox__close svg { width: 20px; height: 20px; }

/* -------------------------------------------------------- 16. Prev/next nav */

.pager {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.pager__link {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: 1.1rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.pager__link:hover { transform: translateY(-3px); border-color: var(--brand); color: var(--ink); }
.pager__link--next { text-align: right; }
.pager__dir { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.pager__name { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }

/* --------------------------------------------------------- 17. References */

.ref-search { position: relative; max-width: 480px; margin-bottom: 2rem; }
.ref-search input {
  width: 100%;
  padding: .8rem 1rem .8rem 2.75rem;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.ref-search input::placeholder { color: var(--muted); }
.ref-search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.ref-search svg {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.ref-count { font-size: .85rem; color: var(--muted); margin-bottom: 1.2rem; }

.ref-list { list-style: none; margin: 0 0 2.5rem; padding: 0; }
.ref-list li {
  padding: 1rem 1.2rem 1rem 1.6rem;
  border-bottom: 1px solid var(--line);
  font-size: .93rem;
  line-height: 1.65;
  color: var(--ink-soft);
  text-indent: -1.6rem;  /* APA hanging indent */
  margin: 0;
  transition: background .15s var(--ease);
}
.ref-list li:hover { background: var(--surface-2); }
.ref-list li[hidden] { display: none; }
.ref-list a { word-break: break-word; }

.ref-empty { padding: 2rem; text-align: center; color: var(--muted); font-size: .95rem; }

/* ---------------------------------------------------------------- 18. Footer */

.site-footer {
  background: var(--brand-deep);
  color: #e2d6e6;
  padding: 3rem 0 2rem;
  margin-top: auto;
}
.site-footer h4 {
  color: #fff;
  margin-bottom: .8rem;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.site-footer a { color: #e2d6e6; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgb(255 255 255 / .14);
}
.footer__grid ul { list-style: none; margin: 0; padding: 0; }
.footer__grid li { margin-bottom: .45rem; font-size: .9rem; }
.footer__blurb { font-size: .9rem; line-height: 1.65; color: #c6b3cd; max-width: 40ch; }
.footer__bottom {
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  justify-content: space-between;
  font-size: .82rem;
  color: #b9a4c1;
}

.to-top {
  position: fixed;
  right: 1.25rem; bottom: 1.25rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
  z-index: 80;
}
.to-top[data-show="true"] { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { color: var(--brand); border-color: var(--brand); }
.to-top svg { width: 18px; height: 18px; }

/* --------------------------------------------------------- 19. Motion / a11y */

@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Scoped to .js so that without JavaScript everything is simply visible
   rather than stuck at opacity 0. The class is set by the inline head script. */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Hero entrance: a short, staggered rise on first paint only. */
.js .hero__enter > * { animation: rise .7s var(--ease) both; }
.js .hero__enter > :nth-child(1) { animation-delay: .05s; }
.js .hero__enter > :nth-child(2) { animation-delay: .13s; }
.js .hero__enter > :nth-child(3) { animation-delay: .21s; }
.js .hero__enter > :nth-child(4) { animation-delay: .29s; }
.js .hero__enter > :nth-child(5) { animation-delay: .37s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .media-frame:hover img { transform: none; }
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- 20. Print */

@media print {
  .site-header, .toc, .to-top, .pager, .progress, .btn-row,
  .site-footer, .tabs, .band { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .doc { grid-template-columns: 1fr; padding-top: 0; }
  .tabpanel[hidden] { display: block !important; }
  .tabpanel { margin-bottom: 1rem; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  a { color: #000; text-decoration: underline; }
  .ctx-card, .strategy, .partner, .stat, figure.fig, .res-item { break-inside: avoid; box-shadow: none; }
  .media-frame { box-shadow: none; }
  h1, h2, h3 { break-after: avoid; }
}
