/* ==========================================================================
   Yale Existential Risks Initiative
   Research-institute editorial: warm paper, serif headlines, one navy accent.
   Each risk area carries its own muted colour family (nuclear / bio / AI).
   ========================================================================== */

:root {
  /* Ground and ink */
  --paper:   #F8F6F1;
  --paper-2: #EFECE4;   /* tinted bands */
  --card:    #FFFFFF;
  --ink:     #15181E;
  --ink-2:   #5A5E66;   /* secondary text: 6:1 on paper */
  --rule:    #DCD7CB;

  /* Brand */
  --navy:      #0E315F;
  --navy-2:    #1C4B8A;
  --navy-tint: #E4E9F1;

  /* Risk families: tint (background) + ink (glyphs, labels). Each ink is AA on its tint. */
  --nuc-tint: #F4E6CF;  --nuc-ink: #8A5300;
  --bio-tint: #DCEBDF;  --bio-ink: #1F6B45;
  --ai-tint:  #E3E1F3;  --ai-ink:  #4B3F99;

  /* Type */
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans:  "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --wrap: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(4rem, 8vw, 7rem);
  --radius: 20px;
}

/* ---------------------------------------------------------------- base -- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1.0313rem, 0.25vw + 1rem, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding: 0; list-style: none; }

h1, h2, h3 { margin: 0; text-wrap: balance; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: .75rem 1.25rem; border-radius: 0 0 12px 0;
  font-weight: 600; text-decoration: none;
}
.skip:focus { left: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: var(--section); }
.section--tint { background: var(--paper-2); }
.section--flush-top { padding-top: 0; }

/* ---------------------------------------------------------- typography -- */

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.75rem, 6.2vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.028em;
  font-variation-settings: "opsz" 72;
}

.page-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.026em;
  font-variation-settings: "opsz" 72;
}

.h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.4vw, 2.85rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 60;
}

.h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.meta {
  font-family: var(--mono);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink-2);
}

.prose { max-width: 38em; }
.prose p + p { margin-top: 1em; }
.muted { color: var(--ink-2); }

.inline-link {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.inline-link:hover { color: var(--navy-2); text-decoration-thickness: 2px; }

/* ------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-weight: 600; font-size: 1rem;
  text-decoration: none; line-height: 1;
  padding: .95rem 1.5rem;
  border-radius: 999px;
  border: 1.5px solid var(--navy);
  background: var(--navy); color: #fff;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn--ghost { background: transparent; color: var(--navy); }
.btn--ghost:hover { background: var(--navy); color: #fff; }
.btn--light { background: #fff; border-color: #fff; color: var(--navy); }
.btn--light:hover { background: var(--navy-tint); border-color: var(--navy-tint); }
.btn--outline-light { background: transparent; border-color: rgba(255,255,255,.55); color: #fff; }
.btn--outline-light:hover { border-color: #fff; background: rgba(255,255,255,.08); }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* -------------------------------------------------------------- header -- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(248, 246, 241, .92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
          backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }

.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  min-height: 4.75rem;
}

.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--navy); }
.brand img { width: 30px; height: auto; }
.brand__name { font-family: var(--sans); font-weight: 700; font-size: 1.125rem; letter-spacing: .06em; }
.brand__full {
  display: none; font-size: .8125rem; line-height: 1.25; color: var(--ink-2);
  border-left: 1px solid var(--rule); padding-left: .7rem;
}
@media (min-width: 1080px) { .brand__full { display: block; } }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2rem); }
.nav__list { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.25rem); }
.nav__link {
  font-weight: 500; font-size: .98rem; text-decoration: none; color: var(--ink);
  padding-block: .35rem; border-bottom: 1.5px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
.nav__link:hover { color: var(--navy); }
.nav__link[aria-current="page"] { color: var(--navy); border-bottom-color: var(--navy); }
.nav__cta { padding: .7rem 1.2rem; font-size: .95rem; }

/* Without JS the nav stays open; `.has-js` is set by an inline script in <head>. */
.nav-toggle {
  display: none; font: inherit; font-weight: 600; font-size: .95rem;
  background: transparent; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 999px; padding: .5rem 1rem; cursor: pointer;
}

@media (max-width: 860px) {
  .has-js .nav-toggle { display: block; }
  .nav {
    display: block; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: .5rem var(--gutter) 1.75rem;
  }
  .has-js .nav[data-open="false"] { display: none; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list li { border-bottom: 1px solid var(--rule); }
  .nav__link { display: block; font-family: var(--serif); font-size: 1.6rem; font-weight: 400; padding: .8rem 0; border-bottom: 0; }
  .nav__cta { margin-top: 1.5rem; }
}

/* ---------------------------------------------------------------- hero -- */

.hero { padding-block: clamp(3rem, 7vw, 6rem) var(--section); }
.hero__inner {
  display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 920px) { .hero__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.hero .display { max-width: 13ch; color: var(--ink); }
.hero__sub { font-size: clamp(1.125rem, .5vw + 1rem, 1.3rem); line-height: 1.55; max-width: 32em; margin-top: 1.75rem; }
.hero__actions { margin-top: 2.25rem; }

/* Event photo */
.hero__photo { margin: 0; }
.hero__photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--paper-2); }
.hero__photo figcaption { margin-top: .85rem; font-size: .925rem; line-height: 1.45; color: var(--ink-2); max-width: 36em; }

/* Tiles (issue pages) */
.hero__art {
  display: grid; grid-template-columns: 1fr 1fr; gap: .9rem;
  max-width: 420px; width: 100%; justify-self: center;
}
@media (min-width: 920px) { .hero__art { justify-self: end; } }
.tile {
  aspect-ratio: 1; border-radius: var(--radius);
  display: grid; place-items: center;
}
.tile svg { width: 58%; height: auto; }
.tile--brand { background: var(--navy-tint); }
.tile--brand img { width: 74%; }
.tile--nuc { background: var(--nuc-tint); color: var(--nuc-ink); }
.tile--bio { background: var(--bio-tint); color: var(--bio-ink); }
.tile--ai  { background: var(--ai-tint);  color: var(--ai-ink); }
.hero__art .tile:nth-child(2) { transform: translateY(1.5rem); }
.hero__art .tile:nth-child(4) { transform: translateY(1.5rem); }
@media (max-width: 919px) {
  .hero__art { grid-template-columns: repeat(4, 1fr); max-width: none; gap: .6rem; }
  .hero__art .tile:nth-child(2), .hero__art .tile:nth-child(4) { transform: none; }
  .tile { border-radius: 14px; }
}

/* Line glyphs */
.glyph { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.glyph .fill { fill: currentColor; stroke: none; }
.glyph--fine { stroke-width: 2.75; }

/* ------------------------------------------------------- section heads -- */

.section-head { margin-bottom: clamp(2rem, 4vw, 3rem); max-width: 40rem; }

/* Two-column: heading left, content right */
.split { display: grid; gap: 1.5rem clamp(2rem, 6vw, 6rem); grid-template-columns: 1fr; }
@media (min-width: 860px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }

/* ------------------------------------------------ what / why (poster) -- */

.whatwhy { display: grid; gap: 3rem clamp(2rem, 7vw, 7rem); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .whatwhy { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }

.define { margin: 0; }
.define dt { font-family: var(--serif); margin-bottom: 1rem; }
.define__term { font-size: clamp(2.2rem, 4.2vw, 3.4rem); letter-spacing: -0.025em; line-height: 1; font-variation-settings: "opsz" 72; }
.define__pos { font-style: italic; font-size: clamp(1.3rem, 2vw, 1.6rem); color: var(--ink-2); }
.define dd { margin: 0; }
.define__def { font-family: var(--serif); font-size: clamp(1.3rem, 2vw, 1.6rem); line-height: 1.35; max-width: 22em; }

.fire .h2 { margin-bottom: 1.5rem; }
.fire__list { border-top: 1px solid var(--ink); }
.fire__item {
  display: flex; align-items: baseline; gap: .9rem;
  padding: 1rem 0; border-bottom: 1px solid var(--rule); font-size: 1.125rem;
}
.fire__item::before { content: ""; flex: 0 0 .7rem; height: .7rem; border-radius: 50%; transform: translateY(.05em); }
.fire__item--nuc::before { background: var(--nuc-ink); }
.fire__item--ai::before  { background: var(--ai-ink); }
.fire__item--bio::before { background: var(--bio-ink); }
.fire__last { font-family: var(--serif); font-style: italic; font-size: clamp(1.35rem, 2.2vw, 1.75rem); margin-top: 1.5rem; }

.issue__lead { font-family: var(--serif); font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 1.25rem !important; }

/* ---------------------------------------------------------- risk cards -- */

.risk-cards { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .risk-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.risk-card {
  display: flex; flex-direction: column; gap: 3.5rem;
  padding: 1.75rem 1.75rem 2rem;
  border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
  border: 1px solid transparent;
  transition: border-color .15s ease, transform .2s ease;
}
.risk-card:hover { transform: translateY(-3px); }
.risk-card--nuc { background: var(--nuc-tint); }
.risk-card--bio { background: var(--bio-tint); }
.risk-card--ai  { background: var(--ai-tint); }
.risk-card--nuc .glyph { color: var(--nuc-ink); }
.risk-card--bio .glyph { color: var(--bio-ink); }
.risk-card--ai  .glyph { color: var(--ai-ink); }
.risk-card svg { width: 76px; height: 76px; }
.risk-card__title {
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 2.4vw, 2rem);
  line-height: 1.1; letter-spacing: -0.02em; margin-bottom: .5rem;
}
.risk-card__body { margin: 0; }
@media (max-width: 819px) { .risk-card { gap: 2rem; } }

/* -------------------------------------------------------- signup panel -- */

.panel {
  background: var(--navy); color: #fff;
  border-radius: calc(var(--radius) + 8px);
  padding: clamp(2.25rem, 5vw, 4rem);
  display: grid; gap: 2rem; align-items: end;
  grid-template-columns: 1fr;
}
@media (min-width: 860px) { .panel { grid-template-columns: minmax(0, 1.3fr) auto; } }
.panel .h2 { color: #fff; }
.panel p { color: rgba(255,255,255,.86); max-width: 30em; margin-top: 1rem; font-size: 1.125rem; }
.panel :focus-visible { outline-color: #fff; }

/* ------------------------------------------------------------ about -- */

.statement {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.35rem, 2.3vw, 1.95rem);
  line-height: 1.38; letter-spacing: -0.012em;
  font-variation-settings: "opsz" 36;
  margin: 0; max-width: 32em;
}
.statement p { margin: 0; }

.cols { display: grid; gap: 2rem clamp(1.5rem, 3vw, 2.5rem); grid-template-columns: 1fr; }
@media (min-width: 820px) { .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.col { border-top: 1px solid var(--ink); padding-top: 1.25rem; }
.col .h3 { margin-bottom: .6rem; }
.col p { color: var(--ink-2); }

/* -------------------------------------------------------------- issues -- */

.issue { padding-block: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--rule); }
.issue:first-of-type { border-top: 0; padding-top: 0; }
.issue__grid { display: grid; gap: 2rem clamp(2rem, 6vw, 6rem); grid-template-columns: 1fr; }
@media (min-width: 860px) { .issue__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }

.issue__aside { display: grid; gap: 1.25rem; align-content: start; }
.issue__aside .tile { max-width: 220px; }
@media (max-width: 859px) { .issue__aside { grid-template-columns: 96px 1fr; align-items: center; } .issue__aside .tile { border-radius: 14px; } }

.lead dt { margin-bottom: .3rem; }
.lead dd { margin: 0; }
.lead__name { font-weight: 600; font-size: 1.1rem; }
.lead__role { color: var(--ink-2); }

.issue__body .h2 { margin-bottom: 1.5rem; }
.issue__body p { max-width: 36em; }
.issue__body p + p { margin-top: 1em; }

/* ------------------------------------------------------ past speakers -- */

.speakers { border-top: 1px solid var(--ink); }
.speaker {
  display: grid; gap: .35rem 2rem; grid-template-columns: 1fr;
  padding: 1.35rem 0; border-bottom: 1px solid var(--rule); align-items: baseline;
}
@media (min-width: 760px) { .speaker { grid-template-columns: 9rem minmax(0, 1fr) minmax(0, 1fr); } }
.speaker p { margin: 0; }
.speaker__name { font-weight: 600; font-size: 1.1rem; }
.speaker__role { color: var(--ink-2); }
.speaker__topic { font-family: var(--serif); font-size: 1.2rem; line-height: 1.35; }

/* ---------------------------------------------------------------- team -- */

.team-grid { display: grid; gap: 2.25rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.person__portrait {
  aspect-ratio: 1; border-radius: var(--radius); overflow: hidden;
  background: var(--navy-tint); display: grid; place-items: center; margin-bottom: 1rem;
}
.person__portrait img { width: 100%; height: 100%; object-fit: cover; }
.person__initials { font-family: var(--serif); font-size: clamp(2.25rem, 4vw, 3rem); color: var(--navy); letter-spacing: -0.02em; }
.person__name { font-weight: 600; font-size: 1.1rem; margin: 0 0 .15rem; }
.person__class { margin: 0 0 .35rem; }
.person__role { margin: 0; color: var(--ink-2); }
.team-grid p { margin: 0; }

/* ---------------------------------------------------------------- form -- */

.form-card {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  overflow: hidden; max-width: 760px;
}
.form-card iframe { display: block; width: 100%; height: 1100px; border: 0; }
@media (max-width: 640px) { .form-card iframe { height: 1400px; } }
.note { color: var(--ink-2); max-width: 44em; }

/* -------------------------------------------------------------- footer -- */

.site-footer { background: var(--paper-2); padding-block: clamp(3.5rem, 6vw, 5rem) 2rem; font-size: .975rem; }
.site-footer__top {
  display: grid; gap: 2.5rem clamp(2rem, 5vw, 4rem); grid-template-columns: 1fr;
  padding-bottom: 2.5rem; border-bottom: 1px solid var(--rule);
}
@media (min-width: 760px) { .site-footer__top { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.site-footer__mark { width: 40px; margin-bottom: 1.25rem; }
.site-footer__name { font-family: var(--serif); font-size: 1.5rem; letter-spacing: -0.015em; margin-bottom: .4rem; }
.site-footer p { color: var(--ink-2); }
.site-footer .site-footer__name { color: var(--ink); }
.footer-col h2 { font-family: var(--mono); font-size: .8125rem; font-weight: 500; color: var(--ink-2); margin-bottom: 1rem; }
.footer-col ul { display: grid; gap: .55rem; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.site-footer__bottom {
  padding-top: 1.75rem; display: flex; flex-wrap: wrap; gap: .75rem 2rem; justify-content: space-between;
  font-size: .875rem;
}
.site-footer__bottom p { margin: 0; }

/* ------------------------------------------------------ focus & motion -- */

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 6px; }
.btn:focus-visible { border-radius: 999px; }
.risk-card:focus-visible { border-radius: var(--radius); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  .risk-card:hover { transform: none; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
[id] { scroll-margin-top: 6rem; }

@media print {
  .site-header, .nav-toggle, .skip { display: none; }
  .panel { background: #fff; color: #000; border: 1px solid #000; }
}
