/* The Clot Thickens — site styles
   Light and dark themes are driven by [data-theme] on <html> (set in each page's <head>
   and toggled by js/theme.js). Without JavaScript, the system preference is used. */

:root {
  --bg: #F4F5F6;
  --surface: #FFFFFF;
  --ink: #15191D;
  --muted: #4B5560;
  --line: #D5DADF;
  --accent: #A3161C;
  --on-accent: #FFFFFF;
  --tint: #F7E6E6;
  --band: #121619;
  --band-ink: #EEF0F2;
  --band-muted: #A9B2BB;
  --band-line: #2C343B;
  --hero-accent: #FF9A95;
  --cta: #F06A66;
  --on-cta: #16090A;

  --font-display: "Archivo", "Helvetica Neue", sans-serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 6px;
  --max: 1200px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0D1013;
  --surface: #151A1F;
  --ink: #E9ECEE;
  --muted: #A3ADB7;
  --line: #2A323A;
  --accent: #F06A66;
  --on-accent: #1A0B0B;
  --tint: #2A1517;
  --band: #151A1F;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1013;
    --surface: #151A1F;
    --ink: #E9ECEE;
    --muted: #A3ADB7;
    --line: #2A323A;
    --accent: #F06A66;
    --on-accent: #1A0B0B;
    --tint: #2A1517;
    --band: #151A1F;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); }
a:hover { color: var(--ink); }

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

h1, h2, h3 { margin: 0; font-family: var(--font-display); }
p { margin: 0; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 12px 16px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: var(--radius);
}
.skip-link:focus { top: 16px; color: var(--on-accent); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.mono { font-family: var(--font-mono); }

.section-title {
  font-weight: 700;
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }

.mark { flex: none; color: var(--ink); }
.mark__clot { fill: var(--accent); }

.brand__text { display: flex; flex-direction: column; gap: 2px; }

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 112%;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  line-height: 1;
}

.brand__tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.nav a:hover { color: var(--accent); }

.nav a[aria-current="page"] {
  font-weight: 700;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  margin-left: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--muted); }

.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--muted);
  transition: background-color 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.theme-toggle[aria-pressed="true"] .switch { background: var(--accent); }
.theme-toggle[aria-pressed="true"] .switch::after { transform: translateX(16px); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.btn--cta { background: var(--cta); color: var(--on-cta); }
.btn--cta:hover { background: #F4847F; color: var(--on-cta); }

.btn--accent { background: var(--accent); color: var(--on-accent); }
.btn--accent:hover { color: var(--on-accent); filter: brightness(1.08); }

.btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #FFFFFF;
  font-weight: 600;
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.1); color: #FFFFFF; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: #0B0E10;
  color: #F2F4F5;
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}

.hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: clamp(72px, 10vw, 128px);
}

.hero .eyebrow { color: var(--hero-accent); }

.hero h1 {
  font-weight: 800;
  font-stretch: 118%;
  font-size: clamp(3.25rem, 9vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  max-width: 11ch;
}

.hero__lede {
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1.35;
  max-width: 30ch;
  color: #DCE1E5;
}

.hero .btn-row { margin-top: 8px; }

.disciplines {
  margin: clamp(48px, 7vw, 88px) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 24px;
}

.disciplines li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 0 30px;
}

.disciplines .mono { font-size: 0.75rem; letter-spacing: 0.12em; color: #B9C1C8; }

.disciplines strong {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
}

/* ---------- About ---------- */

.about { padding-block: clamp(72px, 9vw, 112px) clamp(64px, 8vw, 96px); }

.about__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 80px;
}

.about__lead { flex: 1 1 360px; display: flex; flex-direction: column; gap: 20px; }

.about__body {
  flex: 1.4 1 480px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  font-size: 1.1875rem;
  line-height: 1.65;
}

.about__sign { font-style: italic; color: var(--muted); }

/* ---------- Model ---------- */

.model { padding-bottom: clamp(72px, 9vw, 112px); }

.model__inner {
  border-top: 1px solid var(--line);
  padding-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.model__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
}

.model__head h2 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; }
.model__head .mono { font-size: 0.8125rem; color: var(--muted); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card__num { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; color: var(--accent); }

.card__flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}
.card__flow svg { color: var(--accent); }

.card p { font-size: 1rem; line-height: 1.6; color: var(--muted); }

/* ---------- Resources teaser ---------- */

.teaser {
  background: var(--surface);
  border-block: 1px solid var(--line);
  padding-block: clamp(72px, 8vw, 96px);
}

.teaser__inner { display: flex; flex-direction: column; gap: 40px; }

.teaser__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 48px;
}

.teaser__intro { flex: 1 1 520px; display: flex; flex-direction: column; gap: 16px; }
.teaser__intro p { font-size: 1.125rem; color: var(--muted); max-width: 52ch; }

.topic-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0 24px;
  border-top: 2px solid var(--ink);
}

.topic-grid a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.topic-grid a:hover span:first-child { color: var(--accent); }

.topic-grid span:first-child { font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; }
.topic-grid span:last-child { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); }

/* ---------- Podcast ---------- */

.podcast {
  background: var(--band);
  color: var(--band-ink);
  padding-block: clamp(72px, 9vw, 112px);
}

.podcast__grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px 64px;
}

.video {
  flex: 1.2 1 480px;
  min-width: 0;
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--band-line);
  background: #000;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.podcast__text { flex: 1 1 380px; display: flex; flex-direction: column; gap: 20px; }
.podcast .eyebrow { color: var(--hero-accent); }

.podcast h2 {
  font-weight: 700;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.podcast__desc { font-size: 1.125rem; color: var(--band-muted); }
.podcast__featuring { font-family: var(--font-mono); font-size: 0.875rem; }

/* ---------- People ---------- */

.people { padding-block: clamp(72px, 9vw, 112px); }
.people__inner { display: flex; flex-direction: column; gap: 48px; }
.people__head { display: flex; flex-direction: column; gap: 16px; }

.people__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  align-items: start;
}

.person {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.person__head { display: flex; align-items: center; gap: 18px; }

.person__photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.person__id { display: flex; flex-direction: column; gap: 6px; }
.person h3 { font-size: 1.375rem; font-weight: 700; line-height: 1.15; }
.person__role { font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.45; color: var(--muted); }
.person__bio { display: flex; flex-direction: column; gap: 12px; font-size: 1rem; line-height: 1.6; }

/* ---------- Contact ---------- */

.contact { background: var(--tint); padding-block: clamp(72px, 8vw, 104px); }

.contact__grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px 64px;
}

.contact__lead { flex: 1 1 420px; display: flex; flex-direction: column; gap: 16px; }

.contact h2 {
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(2.6rem, 5.5vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.contact__body { flex: 1.2 1 440px; display: flex; flex-direction: column; gap: 18px; }
.contact__body p { font-size: 1.1875rem; }

.contact__email {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 700;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
  overflow-wrap: anywhere;
}
.contact__email svg { flex: none; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding-block: 32px 40px; }

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

.site-footer__brand { display: flex; align-items: center; gap: 12px; }

.site-footer .mono,
.site-footer nav a { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); }

.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer nav a:hover { color: var(--accent); }

/* ---------- Resources page ---------- */

.page-head { padding-block: clamp(56px, 7vw, 88px) 56px; border-bottom: 1px solid var(--line); }
.page-head__inner { display: flex; flex-direction: column; gap: 20px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); }

.page-head h1 {
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  max-width: 16ch;
}

.page-head__lede { font-size: 1.25rem; line-height: 1.55; color: var(--muted); max-width: 60ch; }

.page-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.library {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 48px 64px;
  padding-block: 56px clamp(72px, 9vw, 112px);
}

.toc { flex: 1 1 240px; display: flex; flex-direction: column; gap: 12px; }

@media (min-width: 900px) {
  .toc { position: sticky; top: 24px; }
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--ink);
}

.toc li { border-bottom: 1px solid var(--line); }

.toc a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 0;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
}
.toc a:hover { color: var(--accent); }
.toc a span:last-child { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }

.ref-list { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 72px; }

.ref-section { scroll-margin-top: 24px; }

.ref-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
}

.ref-section__head h2 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; }
.ref-section__head .mono { font-size: 0.8125rem; color: var(--muted); }

.refs { margin: 0; padding: 0; list-style: none; }

.ref {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.ref__num {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  padding-top: 5px;
}

.ref__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.ref__title {
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}
.ref__title:hover { color: var(--accent); text-decoration-color: currentColor; }

.ref__authors { font-size: 0.9375rem; line-height: 1.55; color: var(--muted); }

.ref__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.cta-band { background: var(--band); color: var(--band-ink); padding-block: 72px; }

.cta-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 48px;
}

.cta-band__text { flex: 1 1 480px; display: flex; flex-direction: column; gap: 10px; }
.cta-band .eyebrow { color: var(--hero-accent); }

.cta-band__title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .switch,
  .switch::after { transition: none; }
}
