:root {
  --bg: #fbf6ec;
  --surface: rgba(255,250,242,0.92);
  --surface-strong: #fffdf8;
  --text: #1d1b16;
  --muted: #6f6556;
  --line: rgba(111,78,46,0.18);
  --brand: #7c3f16;
  --brand-2: #a75d24;
  --brand-3: #e7bd78;
  --accent: #16645a;
  --shadow: 0 22px 55px rgba(84,54,28,0.12);
  --shadow-soft: 0 12px 32px rgba(84,54,28,0.09);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max: 1160px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #08111f;
  --surface: rgba(13, 25, 42, 0.86);
  --surface-strong: #0d192a;
  --text: #edf5ff;
  --muted: #aebbd0;
  --line: rgba(114,198,255,0.18);
  --brand: #77c3ff;
  --brand-2: #9ed6ff;
  --brand-3: #175e9e;
  --accent: #ffd166;
  --shadow: 0 20px 70px rgba(0,0,0,0.38);
  --shadow-soft: 0 12px 40px rgba(0,0,0,0.32);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max: 1180px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(114, 198, 255, .28), transparent 34rem),
    radial-gradient(circle at 90% 10%, rgba(255, 176, 0, .12), transparent 26rem),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; display: block; }
.skip-link {
  position: absolute;
  top: -999px;
  left: 1rem;
  background: var(--surface-strong);
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 1000;
}
.skip-link:focus { top: 1rem; }
.container { width: min(100% - 2rem, var(--max)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -.03em;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), var(--shadow-soft);
  display: grid;
  place-items: center;
  color: white;
}
.brand small { display: block; color: var(--muted); font-weight: 650; letter-spacing: 0; line-height: 1.1; }
.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.nav-links a, .theme-toggle, .menu-toggle {
  border: 0;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  border-radius: 999px;
  padding: .65rem .85rem;
  font-weight: 700;
  cursor: pointer;
}
.nav-links a[aria-current="page"], .nav-links a:hover, .theme-toggle:hover, .menu-toggle:hover {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
}
.menu-toggle { display: none; }
.hero {
  width: min(100% - 2rem, var(--max));
  margin: 3.5rem auto 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(310px, .8fr);
  gap: 2rem;
  align-items: stretch;
}
.hero-copy, .profile-card, .panel, .resource-card, .video-card, .note-card, .talk-card, .contact-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
}
.hero-copy {
  padding: clamp(2rem, 6vw, 4.2rem);
  position: relative;
  overflow: hidden;
}
.hero-copy::after {
  content: "";
  position: absolute;
  width: 350px;
  height: 350px;
  right: -120px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand-3) 42%, transparent), transparent 68%);
  pointer-events: none;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  padding: .45rem .75rem;
  border-radius: 999px;
  font-weight: 850;
  font-size: .88rem;
  letter-spacing: .02em;
}
.kicker::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.045em; }
h1 { font-size: clamp(3.1rem, 8vw, 6.6rem); margin: 1.2rem 0 .8rem; }
h2 { font-size: clamp(2rem, 4.5vw, 3.5rem); margin: 0 0 .8rem; }
h3 { font-size: 1.25rem; margin: 0 0 .45rem; }
.lead { font-size: clamp(1.1rem, 2.1vw, 1.45rem); color: var(--muted); max-width: 66ch; }
.hero-actions, .card-actions, .filter-row, .tag-row, .metric-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .7rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .78rem 1rem;
  font-weight: 850;
  background: var(--surface-strong);
  color: var(--text);
}
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: white; border-color: transparent; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.profile-card { padding: 1rem; display: grid; gap: 1rem; align-content: start; }
.profile-photo {
  width: 100%;
  aspect-ratio: 5 / 6;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 8px);
  border: 1px solid var(--line);
  background: var(--surface-strong);
}
.profile-card-body { padding: .3rem .5rem 1rem; }
.profile-card-body p { color: var(--muted); margin: .25rem 0 0; }
.metric-row { margin-top: 1rem; }
.metric {
  flex: 1 1 90px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: .85rem;
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}
.metric strong { display: block; font-size: 1.35rem; line-height: 1; }
.metric span { color: var(--muted); font-size: .84rem; }
.section { width: min(100% - 2rem, var(--max)); margin: 4.5rem auto; }
.section-header { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1.35rem; }
.section-header p { color: var(--muted); margin: 0; max-width: 66ch; }
.panel { padding: clamp(1.25rem, 4vw, 2rem); }
.finder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  margin-top: 1rem;
}
.search-input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  border-radius: 999px;
  padding: .92rem 1rem;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
select { min-width: 160px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.resource-list { display: grid; gap: 1rem; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.resource-card, .video-card, .note-card, .talk-card, .contact-card { padding: 1.2rem; box-shadow: var(--shadow-soft); }
.resource-card.featured { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.resource-meta, .card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  color: var(--muted);
  font-size: .9rem;
  margin: .5rem 0 .75rem;
}
.pill, .tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  padding: .25rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
}
.status { color: var(--text); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.card-description { color: var(--muted); margin: .6rem 0 1rem; }
.card-actions { margin-top: .9rem; }
.card-actions a { font-size: .9rem; padding: .5rem .72rem; }
.page-hero { width: min(100% - 2rem, var(--max)); margin: 3.5rem auto 2rem; }
.page-hero .panel { overflow: hidden; position: relative; }
.page-hero .panel::after {
  content: "";
  position: absolute;
  inset: auto -8rem -12rem auto;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand-3) 32%, transparent), transparent 70%);
  pointer-events: none;
}
.filter-bar {
  position: sticky;
  top: 88px;
  z-index: 50;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-lg);
  padding: .9rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-soft);
}
.filter-row { align-items: stretch; }
.filter-row .search-input { flex: 2 1 320px; }
.filter-row select { flex: 1 1 160px; }
.count { color: var(--muted); margin: .4rem 0 0; font-size: .95rem; }
.research-area {
  min-height: 210px;
  position: relative;
  overflow: hidden;
}
.research-area::after {
  content: attr(data-number);
  position: absolute;
  right: 1rem;
  bottom: -.55rem;
  font-size: 5rem;
  font-weight: 900;
  color: color-mix(in srgb, var(--brand) 10%, transparent);
  line-height: 1;
}
.video-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #0b1220;
}
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.contact-card dl { display: grid; grid-template-columns: 120px 1fr; gap: .65rem 1rem; margin: 0; }
.contact-card dt { color: var(--muted); font-weight: 800; }
.contact-card dd { margin: 0; }
.footer {
  margin-top: 5rem;
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  color: var(--muted);
}
.footer-inner { width: min(100% - 2rem, var(--max)); margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius-lg); padding: 2rem; color: var(--muted); text-align: center; }
.hidden { display: none !important; }
@media (max-width: 920px) {
  .hero, .contact-layout { grid-template-columns: 1fr; }
  .grid-3, .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-links {
    position: absolute;
    inset: 74px 1rem auto 1rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: .5rem;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .menu-toggle { display: inline-flex; }
}
@media (max-width: 640px) {
  .grid-3, .grid-2, .card-grid { grid-template-columns: 1fr; }
  .finder { grid-template-columns: 1fr; }
  .section-header { align-items: start; flex-direction: column; }
  h1 { font-size: clamp(2.65rem, 16vw, 4.2rem); }
  .filter-bar { position: static; }
  .contact-card dl { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .resource-card, .note-card, .talk-card, .video-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
  .resource-card:hover, .note-card:hover, .talk-card:hover, .video-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
}


/* Design option overrides */
body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 4% -4%, rgba(231,189,120,.30), transparent 28rem),
    linear-gradient(180deg, #fffaf0 0%, var(--bg) 55%, #f6eddc 100%);
}
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
h1 { font-size: clamp(3.0rem, 7.5vw, 6.1rem); }
.kicker { text-transform: uppercase; letter-spacing: .13em; font-size: .75rem; background: rgba(124,63,22,.08); }
.brand-mark { border-radius: 50%; background: linear-gradient(135deg, var(--brand), #bc7a32); }
.hero-copy, .profile-card, .panel, .resource-card, .video-card, .note-card, .talk-card, .contact-card { backdrop-filter: none; }
.hero-copy::after, .page-hero .panel::after { background: radial-gradient(circle, rgba(231,189,120,.42), transparent 68%); }
.btn { border-radius: 12px; }
.search-input, select { border-radius: 12px; }
.pill, .tag { border-radius: 8px; }
.footer { background: rgba(255,250,242,.5); }
