/* coolpsychology.com — design system
 * Michael W. Magee, PhD · Social Cognition Lab
 * Built 2026-05-18 · Session 1
 */

/* ============================================================
   1. Tokens
   ============================================================ */
:root {
  /* Surface */
  --bg: #ece6db;            /* logo cream */
  --bg-elev: #f3eee4;       /* slightly lighter — for raised sections */
  --bg-deep: #e2dccf;       /* slightly darker — for sunken sections */

  /* Ink */
  --ink: #1a1a1a;
  --ink-2: #4a4a4a;
  --ink-3: #7a7565;
  --rule: #c9c2b3;

  /* Sage accent (locked 2026-05-18) */
  --accent: #4a6b3a;        /* deeper sage — meets WCAG AA on cream (4.9:1) */
  --accent-ink: #2f4825;    /* deepest sage — hover/active */
  --accent-leaf: #6f8e5c;   /* exact leaf color — decorative only */
  --accent-soft: #d8e2cc;   /* very light sage — surface tints */

  /* Layout */
  --max: 1120px;
  --measure: 64ch;
  --pad: clamp(20px, 4vw, 56px);

  /* Type scale (fluid) */
  --step--1: clamp(.86rem, .84rem + .1vw,  .92rem);
  --step-0:  clamp(1rem,   .98rem + .15vw, 1.125rem);
  --step-1:  clamp(1.18rem, 1.1rem + .35vw, 1.4rem);
  --step-2:  clamp(1.5rem,  1.3rem + .9vw,  2.1rem);
  --step-3:  clamp(2.1rem,  1.6rem + 2.2vw, 3.4rem);
  --step-4:  clamp(2.8rem,  2rem  + 3.6vw,  4.8rem);

  /* Radii */
  --r-sm: 6px;
  --r-md: 12px;
  --r-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 150ms;
  --t-base: 240ms;
}

/* ============================================================
   2. Reset + base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-underline-offset: 3px;
  transition: color var(--t-fast) var(--ease);
}
a:hover { color: var(--accent-ink); }

h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.1;
  margin: 0;
  font-variation-settings: "SOFT" 50, "opsz" 144;
  color: var(--ink);
}

p { margin: 0 0 1em; }

::selection { background: var(--accent-soft); color: var(--accent-ink); }

/* Skip link for keyboard users */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 10px 16px;
  font-size: .9rem; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ============================================================
   3. Layout primitives
   ============================================================ */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.section-label {
  font-family: "Inter", sans-serif;
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.section-rule {
  height: 2px;
  background: var(--accent-leaf);
  width: 36px;
  margin-top: 8px;
  border-radius: 2px;
}

/* ============================================================
   4. Navigation
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px var(--pad);
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-brand {
  font-family: "Fraunces", serif;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
}
.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: .92rem;
}
.nav-links a {
  color: var(--ink-2);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
.nav-links a:hover { color: var(--accent-ink); }
.nav-links a[aria-current="page"] {
  color: var(--accent-ink);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}
.nav-cta {
  margin-left: 6px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
  transition: background var(--t-fast) var(--ease);
}
.nav-cta:hover { background: var(--accent-ink); }
@media (max-width: 720px) {
  /* Wrap nav onto two rows: brand on top, links + CTA below.
     Links visible on mobile (no hamburger needed at this small set). */
  .nav-inner {
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 10px var(--pad);
  }
  .nav-brand {
    flex: 1 1 100%;
    font-size: .95rem;
  }
  .nav-links {
    margin-left: 0;
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: .82rem;
    align-items: center;
  }
  .nav-cta {
    margin-left: auto;
    padding: 6px 12px;
    font-size: .8rem;
  }
}
@media (max-width: 420px) {
  .nav-links { font-size: .78rem; gap: 5px 10px; }
}

/* ============================================================
   5. Buttons
   ============================================================ */
.btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-size: .94rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* ============================================================
   6. Hero
   ============================================================ */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 120px) var(--pad) clamp(48px, 7vw, 96px);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
}
.hero-eyebrow {
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: var(--step-4);
  font-weight: 500;
  font-variation-settings: "SOFT" 30, "opsz" 144;
  letter-spacing: -.02em;
}
.hero h1 .first { display: block; }
.hero h1 .last { display: block; color: var(--accent-ink); }
.hero-sub {
  margin-top: 22px;
  font-size: var(--step-1);
  color: var(--ink-2);
  max-width: 36ch;
  line-height: 1.4;
}
.hero-meta {
  margin-top: 18px;
  font-size: .95rem;
  color: var(--ink-3);
}
.hero-cta {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(8px, 2vw, 24px);
}
.hero-logo img { width: 100%; max-width: 460px; }

/* ============================================================
   7. About
   ============================================================ */
.about {
  border-top: 1px solid var(--rule);
  background: linear-gradient(to bottom, var(--bg) 0%, var(--bg-elev) 100%);
}
.about-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 8vw, 112px) var(--pad);
}
.about-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; gap: 16px; }
}
.about h2 {
  font-size: var(--step-3);
  margin-bottom: 28px;
  max-width: 22ch;
}
.bio p {
  max-width: var(--measure);
  font-size: var(--step-1);
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 1.1em;
}

.elsewhere {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px dashed var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: .94rem;
  color: var(--ink-2);
}
.elsewhere strong {
  font-weight: 600;
  color: var(--ink);
  margin-right: 4px;
}
.elsewhere a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.elsewhere a:hover {
  color: var(--accent-ink);
  border-bottom-color: var(--accent-ink);
}

/* ============================================================
   8. Featured Publication
   ============================================================ */
.featured-pub {
  border-top: 1px solid var(--rule);
  background: var(--bg);
}
.featured-pub-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) var(--pad);
}
.featured-pub-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
@media (max-width: 880px) {
  .featured-pub-grid { grid-template-columns: 1fr; gap: 32px; }
}
.featured-pub-cover {
  position: relative;
}
.featured-pub-cover img {
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: var(--r-sm);
  box-shadow:
    0 1px 2px rgba(0,0,0,.06),
    0 12px 28px -8px rgba(47, 72, 37, 0.20),
    0 2px 6px -2px rgba(0,0,0,.08);
  background: #fff;
}
.featured-pub-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 14px;
}
.featured-pub h2 {
  font-size: var(--step-2);
  line-height: 1.15;
  margin-bottom: 16px;
  max-width: 26ch;
}
.featured-pub .apa-cite {
  font-family: "Inter", sans-serif;
  font-size: .98rem;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 24px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.featured-pub .apa-cite em { font-style: italic; }
.featured-pub .pull-quote {
  margin: 0 0 24px;
  padding: 18px 22px;
  border-left: 3px solid var(--accent-leaf);
  background: color-mix(in srgb, var(--accent-soft) 50%, transparent);
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--ink);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.featured-pub .abstract {
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  max-width: var(--measure);
}
.featured-pub .abstract-label {
  display: inline-block;
  font-family: "Inter", sans-serif;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}
.featured-pub .pub-links {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: .94rem;
}
.featured-pub .pub-links a {
  text-decoration: none;
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding-bottom: 1px;
}
.featured-pub .pub-links a:hover {
  color: var(--accent-ink);
  border-bottom-color: var(--accent-ink);
}

/* ============================================================
   9. Publications list
   ============================================================ */
.pubs {
  border-top: 1px solid var(--rule);
  background: var(--bg-elev);
}
.pubs-inner {
  max-width: var(--max);
  margin: 0 auto;
  /* Tightened top padding so first publication starts higher on the page. */
  padding: clamp(28px, 4vw, 48px) var(--pad) clamp(64px, 8vw, 96px);
}
.pubs-head {
  display: block;
  text-align: left;
  margin-bottom: clamp(24px, 3.5vw, 40px);
}
.pubs-head .section-rule { margin-bottom: 10px; }
.pubs h1, .pubs h2 {
  font-size: var(--step-3);
  max-width: 18ch;
  margin: 8px 0 0;
  text-align: left;
}

.pubs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(28px, 4vw, 48px);
}
.pub-item {
  display: grid;
  grid-template-columns: clamp(120px, 14vw, 160px) 1fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  padding-top: clamp(20px, 3vw, 32px);
  border-top: 1px solid var(--rule);
}
.pub-item:first-child { padding-top: 0; border-top: 0; }
.pub-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: start;
}
.pub-year {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 1.4rem;
  color: var(--accent);
  letter-spacing: -.01em;
}
.pub-cover {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-sm);
  box-shadow: 0 10px 28px -12px rgba(40, 40, 30, .35),
              0 1px 3px rgba(40, 40, 30, .12);
}
/* Cover wrapped in an anchor → entire cover clicks through to the PDF. */
.pub-cover-link {
  display: block;
  border-radius: var(--r-sm);
  transition: transform var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease);
  cursor: pointer;
  outline: none;
}
.pub-cover-link:hover {
  transform: translateY(-2px);
}
.pub-cover-link:hover .pub-cover {
  box-shadow: 0 16px 36px -12px rgba(40, 40, 30, .42),
              0 2px 6px rgba(40, 40, 30, .15);
}
.pub-cover-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
@media (max-width: 720px) {
  .pub-item { grid-template-columns: 1fr; gap: 10px; }
  .pub-aside {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }
  .pub-cover { width: 88px; flex-shrink: 0; }
}
.pub-body { min-width: 0; }
.pub-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: var(--step-1);
  line-height: 1.25;
  margin: 0 0 8px;
  color: var(--ink);
}
.pub-cite {
  font-size: .96rem;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 10px;
}
.pub-cite em { font-style: italic; }
.pub-summary {
  font-size: .98rem;
  line-height: 1.6;
  color: var(--ink);
  max-width: var(--measure);
  margin: 0 0 12px;
}
.pub-links {
  font-size: .9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.pub-links a {
  text-decoration: none;
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.pub-links a:hover {
  color: var(--accent-ink);
  border-bottom-color: var(--accent-ink);
}

/* ============================================================
   10. Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--rule);
  padding: 36px var(--pad);
  font-size: .9rem;
  color: var(--ink-3);
  text-align: center;
}
.footer strong { color: var(--ink-2); }
.footer a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule); }
.footer a:hover { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* ============================================================
   11. Posters (scroll-driven showcase)
   ============================================================ */
.posters-section {
  background: var(--bg);
}
.posters-heading {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px var(--pad) 24px;
}
.posters-eyebrow {
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 36px;
}
.posters-heading h2 {
  font-size: var(--step-3);
  max-width: 22ch;
}
.posters-heading p {
  max-width: 56ch;
  color: var(--ink-2);
  margin: 14px 0 0;
  font-size: var(--step-1);
}

/* Pinned stage */
.poster-stage {
  position: relative;
  height: 100vh;
  overflow: hidden;
}
.poster-stage-inner {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: clamp(24px, 3.5vw, 64px);
  align-items: start;
  /* Top padding clears the sticky nav (~56px) + 5vh breathing room */
  padding: clamp(96px, calc(56px + 5vh), 132px) var(--pad) 0;
  max-width: var(--max);
  margin: 0 auto;
  left: 0;
  right: 0;
}

/* Image stack */
.poster-images {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  /* Cap height so it fits below nav offset + 5vh top breathing room */
  max-height: 82vh;
}
.poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 24px 60px rgba(40, 40, 30, .22));
  will-change: transform, opacity;
  opacity: 0;
  transform: scale(.4) translateY(180px);
}

/* Blurb stack */
.poster-blurbs {
  position: relative;
  min-height: 320px;
}
.poster-blurb {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(40px);
  will-change: transform, opacity;
}
.poster-blurb .year {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--accent);
  letter-spacing: -.01em;
  margin: 0 0 6px;
}
.poster-blurb h3 {
  font-size: var(--step-2);
  line-height: 1.15;
  margin: 0 0 14px;
  max-width: 18ch;
}
.poster-blurb .authors {
  font-size: .96rem;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 16px;
}
.poster-blurb .authors em { font-style: italic; }
.poster-blurb .summary {
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  max-width: 36ch;
  margin: 0 0 18px;
}
.poster-blurb .links {
  font-size: .9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.poster-blurb .links a {
  text-decoration: none;
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  transition: color var(--t-fast) var(--ease);
}
.poster-blurb .links a:hover {
  color: var(--accent-ink);
  border-bottom-color: var(--accent-ink);
}

/* Progress dots */
.poster-progress {
  position: absolute;
  right: clamp(12px, 2vw, 28px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
}
.poster-progress span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--rule);
  transition: background 240ms var(--ease), transform 240ms var(--ease);
}
.poster-progress span.active {
  background: var(--accent);
  transform: scale(1.4);
}

/* Mobile: stack columns */
@media (max-width: 860px) {
  .poster-stage-inner {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 96px;
    align-content: start;
  }
  .poster-images { aspect-ratio: 4 / 3; max-height: 42vh; }
  .poster-blurbs { min-height: 280px; }
  .poster-blurb h3 { font-size: var(--step-1); }
  .poster-progress { right: 8px; }
}

/* Reduced-motion fallback: static stack, blurbs always visible */
@media (prefers-reduced-motion: reduce) {
  .poster-stage {
    height: auto !important;
    overflow: visible !important;
  }
  .poster-stage-inner {
    position: static;
    display: block;
    padding: 32px var(--pad) 80px;
  }
  .poster-images, .poster-blurbs {
    position: static;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
  }
  .poster-img, .poster-blurb {
    position: static;
    opacity: 1 !important;
    transform: none !important;
  }
  .poster-img {
    width: 100%;
    height: auto;
    max-height: 78vh;
    filter: drop-shadow(0 12px 36px rgba(40, 40, 30, .18));
  }
  .poster-progress { display: none; }

  /* JS injects .reduced-pair wrappers when matchMedia hits */
  .reduced-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    padding: 48px 0;
    border-top: 1px solid var(--rule);
  }
  .reduced-pair:first-child { border-top: 0; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 860px) {
  .reduced-pair { grid-template-columns: 1fr; gap: 18px; }
}

/* ============================================================
   12. Page stubs (Talks, Lab — coming soon pages)
   ============================================================ */
.page-stub {
  min-height: 70vh;
  display: flex;
  align-items: center;
}
.page-stub-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px var(--pad);
}
.page-stub-inner h1 {
  font-size: var(--step-3);
  margin: 8px 0 24px;
  max-width: 14ch;
}
.page-stub-body {
  max-width: 56ch;
  font-size: var(--step-1);
  color: var(--ink-2);
  line-height: 1.55;
}
.page-stub-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.page-stub-body a:hover {
  color: var(--accent-ink);
  border-bottom-color: var(--accent-ink);
}

/* ============================================================
   13. Motion preferences (global)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   14. Questionnaires (Take a Scale)
   Added 2026-05-18 · Session 5
   ============================================================ */

/* nav-cta gets a sage outline on active page (not the underline used elsewhere) */
.nav-cta[aria-current="page"] {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-ink);
}

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

/* Hero */
.qx-hero {
  padding: clamp(48px, 8vw, 96px) 0 clamp(24px, 4vw, 48px);
  border-bottom: 1px solid var(--rule);
}
/* Tight variant: tiles come right under the heading. */
.qx-hero-tight {
  padding: clamp(32px, 5vw, 56px) 0 clamp(12px, 2vw, 20px);
  border-bottom: 0;
}
.qx-hero-tight + .qx-tiles-section { padding-top: clamp(12px, 2vw, 24px); }
.qx-hero-inner { max-width: 880px; }
/* Tight variant: hero-inner spans the full container so eyebrow + H1
   align with nav-brand (left edge) instead of being centered. */
.qx-hero-tight .qx-hero-inner { max-width: var(--max); }
.qx-hero h1 {
  font-size: var(--step-3);
  margin: 16px 0 18px;
}
.qx-hero-tight h1 {
  margin: 12px 0 6px;
  max-width: none;
  text-align: left;
}
/* Force the two H1 phrases onto their own lines, both left-aligned. */
.qx-hero-tight h1 .h1-row { display: block; }

/* Belowtiles: the sub-paragraph + disclaimer that used to sit in the hero */
.qx-belowtiles {
  margin-top: clamp(24px, 3vw, 36px);
  padding-top: clamp(20px, 3vw, 28px);
  border-top: 1px solid var(--rule);
  max-width: 70ch;
}
.qx-belowtiles .qx-hero-sub { margin-bottom: 18px; }
.qx-hero-sub {
  font-size: var(--step-1);
  color: var(--ink-2);
  max-width: 60ch;
  margin-bottom: 18px;
}
.qx-disclaimer {
  font-size: var(--step--1);
  color: var(--ink-3);
  background: var(--bg-elev);
  border-left: 3px solid var(--accent-leaf);
  padding: 12px 16px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  max-width: 60ch;
}

/* Tile grid */
.qx-tiles-section {
  padding: clamp(36px, 6vw, 72px) 0 clamp(48px, 8vw, 96px);
}
.qx-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 24px);
  margin-bottom: 32px;
}
/* Prose block lives inside the tile grid, placed to the right of the
   bottom (4th) tile. Spans the two remaining columns on row 2. */
.qx-tiles-aside {
  grid-column: 2 / -1;
  align-self: center;
  margin: 0;
  padding: 0 4px;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 62ch;
}
@media (max-width: 860px) {
  .qx-tiles { grid-template-columns: repeat(2, 1fr); }
  .qx-tiles-aside { grid-column: 1 / -1; padding: 6px 2px 0; }
}
@media (max-width: 560px) {
  .qx-tiles { grid-template-columns: 1fr; }
}
.qx-tile {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 24px 22px;
  cursor: pointer;
  transition: border-color var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease),
              transform var(--t-base) var(--ease),
              background var(--t-base) var(--ease);
  outline: none;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}
.qx-tile:hover,
.qx-tile:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 8px 28px -16px rgba(74, 107, 58, .45), 0 0 0 3px var(--accent-soft);
  transform: translateY(-2px);
  background: #f6f1e6;
}
.qx-tile-eyebrow {
  font-family: "Inter", sans-serif;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
}
.qx-tile-title {
  font-size: var(--step-1);
  line-height: 1.15;
  margin-bottom: 10px;
}
.qx-tile-title .qx-tile-and {
  display: block;
  font-style: italic;
  font-weight: 400;
  color: var(--ink-2);
  font-size: .85em;
  margin-top: 2px;
}
.qx-tile-blurb {
  color: var(--ink-2);
  font-size: var(--step-0);
  margin-bottom: auto;
}
.qx-tile-meta {
  font-size: var(--step--1);
  color: var(--ink-3);
  border-top: 1px solid var(--rule);
  padding-top: 12px;
  margin-top: 14px;
  letter-spacing: .02em;
}

/* Mount area for forms / results */
.qx-mount:not(:empty) {
  margin-top: clamp(32px, 4vw, 56px);
  padding: clamp(24px, 4vw, 40px);
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
}

/* Form */
.qx-progress {
  font-family: "Inter", sans-serif;
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 16px;
}
.qx-form-header { margin-bottom: 28px; }
.qx-form-header h2 {
  font-size: var(--step-2);
  margin-bottom: 12px;
}
.qx-cite {
  font-size: var(--step--1);
  color: var(--ink-3);
  margin-bottom: 14px;
}
.qx-instructions {
  font-size: var(--step-0);
  color: var(--ink-2);
  background: var(--bg);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  max-width: 70ch;
}

/* Legend row (column headers above items) */
.qx-legend {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(var(--qx-cols, 5), minmax(54px, 64px));
  gap: 8px;
  align-items: end;
  padding: 0 6px 10px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4px;
  position: sticky;
  top: 56px;
  background: var(--bg-elev);
  z-index: 2;
}
.qx-form[data-scale="mrnivb"] .qx-legend { --qx-cols: 7; }
.qx-legend-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: .68rem;
  color: var(--ink-3);
  line-height: 1.15;
}
.qx-legend-num {
  font-weight: 600;
  color: var(--accent);
  font-size: .82rem;
}
.qx-legend-label {
  font-size: .68rem;
  margin-top: 2px;
}

/* Items */
.qx-items {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}
.qx-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(var(--qx-cols, 5), minmax(54px, 64px));
  gap: 8px;
  align-items: center;
  padding: 14px 6px;
  border-bottom: 1px solid var(--rule);
  transition: background var(--t-fast) var(--ease);
}
.qx-form[data-scale="mrnivb"] .qx-item { --qx-cols: 7; }
.qx-item:hover { background: rgba(216, 226, 204, .25); }
.qx-item.qx-item-missing {
  background: #fff1ea;
  border-color: #d99672;
}
.qx-item-text {
  font-size: var(--step-0);
  color: var(--ink);
  line-height: 1.45;
  padding-right: 12px;
}
.qx-item-n {
  font-weight: 600;
  color: var(--ink-3);
  margin-right: 4px;
  display: inline-block;
  min-width: 1.6em;
}
.qx-item-radios {
  display: contents;
}
.qx-radio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast) var(--ease);
  position: relative;
}
.qx-radio:hover { background: var(--accent-soft); }
.qx-radio input {
  position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%;
  cursor: pointer;
}
.qx-radio-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--rule);
  background: #fff;
  transition: border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qx-radio-dot::after {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform var(--t-fast) var(--ease);
}
.qx-radio input:checked + .qx-radio-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.qx-radio input:checked + .qx-radio-dot::after { transform: scale(1); }
.qx-radio input:focus-visible + .qx-radio-dot {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}
.qx-radio-num {
  font-size: .72rem;
  color: var(--ink-3);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* Mobile: stack item text above radio row */
@media (max-width: 720px) {
  .qx-legend { display: none; }
  .qx-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .qx-item-radios {
    display: grid;
    grid-template-columns: repeat(var(--qx-cols, 5), 1fr);
    gap: 6px;
  }
  .qx-form[data-scale="mrnivb"] .qx-item-radios { grid-template-columns: repeat(7, 1fr); }
  .qx-radio {
    flex-direction: row;
    gap: 6px;
    border: 1px solid var(--rule);
    background: var(--bg);
    padding: 8px 6px;
  }
  .qx-radio-num { margin-top: 0; }
}

/* Demographics */
.qx-demo {
  margin: 28px 0 24px;
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
}
.qx-demo legend {
  padding: 0 8px;
  font-family: "Inter", sans-serif;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.qx-demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.qx-demo-grid label {
  display: flex;
  flex-direction: column;
  font-size: var(--step--1);
  color: var(--ink-2);
  gap: 6px;
}
.qx-demo-grid input,
.qx-demo-grid select {
  font: inherit;
  font-size: var(--step-0);
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
}
.qx-demo-grid input:focus,
.qx-demo-grid select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* Actions */
.qx-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.qx-cancel { background: transparent; border: 1px solid var(--rule); color: var(--ink-2); }
.qx-cancel:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--bg); }

/* Modal */
.qx-modal {
  position: fixed; inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(26, 26, 26, .42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 24px;
}
.qx-modal.is-open { display: flex; }
body.qx-modal-locked { overflow: hidden; }
.qx-modal-card {
  background: var(--bg);
  border-radius: var(--r-md);
  max-width: 560px;
  width: 100%;
  padding: 32px 28px 26px;
  position: relative;
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, .35);
  animation: qxModalIn 220ms var(--ease);
}
@keyframes qxModalIn {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.qx-modal h2 {
  font-size: var(--step-2);
  margin-bottom: 10px;
  padding-right: 24px;
}
.qx-modal-blurb {
  color: var(--ink-2);
  margin-bottom: 22px;
  font-size: var(--step-0);
}
.qx-modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: transparent;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--r-sm);
}
.qx-modal-close:hover { background: var(--bg-deep); color: var(--ink); }
.qx-modal-choices {
  display: grid;
  gap: 12px;
}
.qx-choice {
  display: block;
  text-align: left;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 16px 18px;
  cursor: pointer;
  font: inherit;
  width: 100%;
  transition: border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.qx-choice:hover {
  border-color: var(--accent);
  background: #f6f1e6;
  transform: translateY(-1px);
}
.qx-choice-head {
  font-weight: 600;
  color: var(--accent-ink);
  margin-bottom: 4px;
  font-size: var(--step-0);
}
.qx-choice-sub {
  font-size: var(--step--1);
  color: var(--ink-2);
}
.qx-choice-disabled {
  opacity: .55;
  cursor: not-allowed;
}
.qx-choice-disabled:hover {
  transform: none;
  border-color: var(--rule);
  background: var(--bg-elev);
}

/* Results */
.qx-results-head { margin-bottom: 24px; }
.qx-results-head h2 { font-size: var(--step-2); margin-bottom: 6px; }
.qx-results-sub { color: var(--ink-2); }

.qx-result {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 24px;
  margin-bottom: 20px;
}
.qx-result-head h3 {
  font-size: var(--step-1);
  margin-bottom: 18px;
}
.qx-result-total {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 14px 18px;
  background: var(--accent-soft);
  border-radius: var(--r-sm);
  margin-bottom: 22px;
}
.qx-total-label {
  font-family: "Inter", sans-serif;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  font-weight: 600;
}
.qx-total-num {
  font-family: "Fraunces", serif;
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--accent-ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.qx-total-scale {
  font-size: var(--step--1);
  color: var(--ink-3);
}
.qx-total-rubric {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--accent-ink);
  font-size: .9rem;
  border: 1px solid var(--accent);
}
.qx-rubric-low      { color: #8a4a2a; border-color: #d99672; background: #fff1ea; }
.qx-rubric-moderate { color: var(--ink-2); border-color: var(--rule); background: var(--bg-elev); }
.qx-rubric-high     { color: var(--accent-ink); border-color: var(--accent); background: #fff; }

.qx-result-bars {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}
.qx-bar-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr 50px;
  gap: 12px;
  align-items: center;
  font-size: var(--step--1);
}
.qx-bar-label { color: var(--ink-2); }
.qx-bar-track {
  height: 10px;
  background: var(--bg-deep);
  border-radius: 999px;
  overflow: hidden;
}
.qx-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-leaf), var(--accent));
  border-radius: 999px;
  transition: width 600ms var(--ease);
}
.qx-bar-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  font-weight: 600;
}

.qx-result-blurb {
  color: var(--ink);
  font-size: var(--step-0);
  line-height: 1.55;
  max-width: 70ch;
  margin: 0;
}

.qx-thanks {
  margin-top: 28px;
  padding: 14px 18px;
  background: var(--bg-elev);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: var(--step--1);
  color: var(--ink-2);
  max-width: 70ch;
}

@media (max-width: 720px) {
  .qx-result-total {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "label rubric"
      "num   num"
      "scale scale";
  }
  .qx-total-label  { grid-area: label; }
  .qx-total-rubric { grid-area: rubric; justify-self: end; }
  .qx-total-num    { grid-area: num; }
  .qx-total-scale  { grid-area: scale; }
  .qx-bar-row {
    grid-template-columns: 1fr 50px;
    grid-template-areas:
      "label val"
      "track track";
    gap: 4px 12px;
  }
  .qx-bar-label { grid-area: label; }
  .qx-bar-val   { grid-area: val; }
  .qx-bar-track { grid-area: track; }
}

/* ============================================================
   15. Poster Lightbox
   Added 2026-05-18 · Click any poster to fill the viewport;
   click overlay, close button, or press Esc to close.
   ============================================================ */
.poster-images,
.poster-img,
.poster-blurb .links a { cursor: zoom-in; }

.poster-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 18, .94);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms var(--ease), visibility 0s linear 220ms;
}
.poster-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 220ms var(--ease), visibility 0s linear 0s;
}
.poster-lightbox img {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
  transform: scale(.94);
  transition: transform 220ms var(--ease);
  user-select: none;
  -webkit-user-select: none;
}
.poster-lightbox.is-open img { transform: scale(1); }

.poster-lightbox-close {
  position: fixed;
  top: 14px;
  right: 16px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  border: 0;
  font: 600 .85rem/1 "Inter", system-ui, sans-serif;
  letter-spacing: .04em;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1;
  transition: background var(--t-fast) var(--ease);
}
.poster-lightbox-close:hover,
.poster-lightbox-close:focus-visible {
  background: rgba(255, 255, 255, .26);
  outline: none;
}
body.poster-lightbox-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .poster-lightbox,
  .poster-lightbox img { transition: none; }
  .poster-lightbox img { transform: none; }
}

/* ============================================================
   N. Talk feature (EPA 2024 long-form narrative)
   ============================================================ */
.talk-feature {
  background: var(--bg);
}
.talk-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 96px var(--pad) 32px;
}
.talk-hero .posters-eyebrow {
  margin: 0 0 24px;
}
.talk-hero h1 {
  font-size: var(--step-4);
  max-width: 18ch;
  margin: 0 0 32px;
  line-height: 1.05;
}
.talk-dek {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: var(--step-2);
  color: var(--ink-2);
  max-width: 38ch;
  margin: 0 0 40px;
  line-height: 1.3;
  font-variation-settings: "SOFT" 50, "opsz" 144;
}
.talk-meta {
  font-size: var(--step--1);
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
  font-weight: 500;
}
.talk-body {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px var(--pad) 96px;
}
.talk-prose {
  max-width: 62ch;
  margin: 0 auto;
  font-size: var(--step-1);
  color: var(--ink-2);
  line-height: 1.7;
}
.talk-prose p {
  margin: 0 0 1.15em;
}
.talk-prose em {
  font-style: italic;
  color: var(--ink);
}
.talk-prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.talk-prose a:hover { color: var(--accent-ink); }
.talk-prose--refs {
  font-size: var(--step-0);
  line-height: 1.55;
}
.talk-prose--refs p {
  padding-left: 2.2em;
  text-indent: -2.2em;
  margin: 0 0 1em;
}
.talk-section-h {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: var(--step-2);
  font-weight: 500;
  color: var(--ink);
  max-width: 62ch;
  margin: 64px auto 24px;
  letter-spacing: -.01em;
  font-variation-settings: "SOFT" 50, "opsz" 144;
}
.talk-emphasis {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.15em;
  color: var(--ink);
}
.talk-slide {
  margin: 56px auto;
  max-width: 960px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-elev);
  box-shadow: 0 20px 56px -32px rgba(26, 26, 26, .28);
}
.talk-slide svg {
  display: block;
  width: 100%;
  height: auto;
}
.talk-slide figcaption {
  padding: 14px 24px;
  font-size: var(--step--1);
  color: var(--ink-3);
  border-top: 1px solid var(--rule);
  background: var(--bg-deep);
  font-style: italic;
}
.talk-references {
  margin-top: 32px;
}
.talk-credit {
  max-width: 62ch;
  margin: 56px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  font-size: var(--step--1);
  color: var(--ink-3);
  text-align: center;
  line-height: 1.6;
}
.talk-credit strong {
  color: var(--ink);
  font-weight: 500;
}

@media (max-width: 640px) {
  .talk-hero { padding-top: 64px; }
  .talk-section-h { margin: 48px auto 20px; }
  .talk-slide { margin: 40px auto; border-radius: var(--r-sm); }
  .talk-slide figcaption { padding: 12px 16px; }
}
