/* ============================================================
   MAGIC INSTITUTE — Site components (header, footer, sections)
   ============================================================ */

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.container-wide { max-width: 1340px; margin: 0 auto; padding: 0 32px; }
.section { padding: 100px 0; }
.section-sm { padding: 64px 0; }

/* ─────────────── Header ─────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: oklch(0.985 0.008 92 / 0.86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header.on-forest {
  background: oklch(0.27 0.045 158 / 0.55);
  border-bottom-color: oklch(1 0 0 / 0.14);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brandmark { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 1.32rem; font-weight: 600; letter-spacing: -0.01em; color: var(--forest-900); }
.on-forest .brandmark { color: var(--cream); }
.crest { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--forest-700); color: var(--cream); font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; flex: none; }
.on-forest .crest { background: var(--cream); color: var(--forest-800); }

.nav-links { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; }
.nav-links a { font-weight: 500; font-size: 0.97rem; color: var(--ink-soft); padding: 6px 0; position: relative; transition: color .18s; }
.nav-links a:hover { color: var(--forest-700); }
.nav-links a.active { color: var(--forest-800); }
.nav-links a.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--ochre); border-radius: 2px; }
.on-forest .nav-links a { color: oklch(1 0 0 / 0.8); }
.on-forest .nav-links a:hover, .on-forest .nav-links a.active { color: var(--cream); }
.on-forest .nav-links a.active::after { background: var(--ochre-soft); }
.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-right .link-quiet { font-weight: 600; font-size: 0.95rem; color: var(--ink-soft); }
.on-forest .nav-right .link-quiet { color: oklch(1 0 0 / 0.85); }
.nav-right .link-quiet:hover { color: var(--forest-700); }

/* ─────────────── Generic hero header (interior pages) ─────────────── */
.page-hero { background: var(--forest-800); color: var(--cream); padding: 64px 0 76px; position: relative; overflow: hidden; }
.page-hero .eyebrow { color: var(--ochre-soft); }
.page-hero h1 { color: var(--cream); font-size: clamp(2.6rem, 5vw, 4.2rem); max-width: 760px; }
.page-hero p { color: oklch(1 0 0 / 0.84); font-size: 1.18rem; max-width: 580px; margin-top: 20px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 0.84rem; color: oklch(1 0 0 / 0.62); margin-bottom: 28px; }
.crumbs a:hover { color: var(--cream); }
.crumbs .sep { opacity: 0.5; }

/* ─────────────── Section heads ─────────────── */
.section-head { max-width: 680px; margin-bottom: 52px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(2rem, 3.6vw, 3rem); margin-top: 14px; }
.section-head p { font-size: 1.12rem; color: var(--ink-soft); margin-top: 18px; }

/* ─────────────── Buttons row ─────────────── */
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ─────────────── Cards / grids ─────────────── */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.prog-card {
  background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.prog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--sand); }
.prog-card .ph { height: 168px; align-items: flex-end; }
.prog-card .pc-body { padding: 24px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.prog-card .pc-kicker { font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--forest-600); }
.prog-card h3 { font-size: 1.5rem; margin-top: 8px; }
.prog-card p { font-size: 0.98rem; color: var(--ink-soft); margin-top: 10px; flex: 1; }
.pc-link { margin-top: 18px; font-weight: 600; font-size: 0.95rem; color: var(--forest-700); display: inline-flex; align-items: center; gap: 7px; }
.prog-card:hover .pc-link { gap: 11px; }
.pc-link .arrow { transition: transform .2s; }

/* feature / split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split.tight { gap: 40px; }
.split .ph { border-radius: var(--radius-lg); min-height: 440px; }

/* stat band */
.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat-band .stat { padding: 8px 22px; border-left: 1px solid var(--line); }
.stat-band .stat:first-child { border-left: none; padding-left: 0; }
.stat-band .stat .n { font-family: var(--font-display); font-size: 2.8rem; font-weight: 600; color: var(--forest-700); line-height: 1; }
.stat-band .stat .l { font-size: 0.9rem; color: var(--ink-soft); margin-top: 8px; }

/* feature list */
.feature { display: flex; gap: 18px; }
.feature .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ochre); margin-top: 8px; flex: none; }
.feature h4 { font-family: var(--font-sans); font-weight: 700; font-size: 1.08rem; color: var(--forest-900); }
.feature p { font-size: 0.98rem; color: var(--ink-soft); margin-top: 6px; }

/* testimonial / story */
.story { background: var(--forest-800); color: var(--cream); border-radius: var(--radius-lg); overflow: hidden; display: grid; grid-template-columns: 0.9fr 1.1fr; }
.story .ph { min-height: 100%; }
.story .story-body { padding: 56px; display: flex; flex-direction: column; justify-content: center; }
.story blockquote { font-family: var(--font-display); font-size: 1.8rem; line-height: 1.28; margin: 0; color: var(--cream); }
.story .who { margin-top: 26px; }
.story .who .name { font-weight: 700; }
.story .who .role { color: oklch(1 0 0 / 0.7); font-size: 0.92rem; margin-top: 3px; }

/* tags / pills */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; background: var(--cream-2); border: 1px solid var(--line); font-size: 0.86rem; font-weight: 500; color: var(--forest-800); }
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* CTA band */
.cta-band { background: var(--forest-900); color: var(--cream); border-radius: var(--radius-lg); padding: 64px 56px; text-align: center; position: relative; overflow: hidden; }
.cta-band h2 { color: var(--cream); font-size: clamp(2rem, 3.4vw, 3rem); max-width: 640px; margin: 0 auto; }
.cta-band p { color: oklch(1 0 0 / 0.82); font-size: 1.12rem; max-width: 520px; margin: 18px auto 32px; }
.cta-band .btn-row { justify-content: center; }
.cta-glow { position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, oklch(0.60 0.115 162 / 0.4), transparent 70%); filter: blur(20px); }

/* ─────────────── Footer ─────────────── */
.site-footer { background: var(--forest-900); color: oklch(1 0 0 / 0.72); padding: 72px 0 36px; margin-top: 0; }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid oklch(1 0 0 / 0.12); }
.footer-brand .brandmark { color: var(--cream); margin-bottom: 16px; }
.footer-brand p { font-size: 0.95rem; max-width: 300px; color: oklch(1 0 0 / 0.62); }
.footer-col h5 { font-family: var(--font-sans); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ochre-soft); margin: 0 0 16px; font-weight: 600; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.footer-col a { font-size: 0.95rem; color: oklch(1 0 0 / 0.72); }
.footer-col a:hover { color: var(--cream); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 28px; font-size: 0.85rem; color: oklch(1 0 0 / 0.5); }
.footer-bottom .fb-links { display: flex; gap: 22px; }

/* utility */
.muted { color: var(--ink-soft); }
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.arrow-link { font-weight: 600; color: var(--forest-700); display: inline-flex; gap: 8px; align-items: center; }
.arrow-link:hover { gap: 12px; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; }
.step { padding-top: 24px; border-top: 2px solid var(--ochre); }
.step .num { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--forest-600); }
.step h4 { font-family: var(--font-sans); font-weight: 700; font-size: 1.15rem; margin: 10px 0 8px; color: var(--forest-900); }
.step p { font-size: 0.95rem; color: var(--ink-soft); }

/* fact rows */
.facts { display: flex; flex-direction: column; }
.fact { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: none; }
.fact .k { color: var(--ink-soft); font-size: 0.98rem; }
.fact .v { font-weight: 600; color: var(--forest-900); font-size: 0.98rem; text-align: right; }

/* ─────────────── Mission statement (large type) ─────────────── */
.mission-statement { font-family: var(--font-display); font-size: clamp(1.7rem, 3.4vw, 2.8rem); line-height: 1.28; color: var(--forest-900); max-width: 940px; }
.mission-statement em { font-style: italic; color: var(--forest-600); }

/* ─────────────── Research area cards ─────────────── */
.area-card { padding: 30px 30px 32px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--cream); transition: transform .2s, box-shadow .2s, border-color .2s; display: flex; flex-direction: column; }
.area-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--sand); }
.area-card-anomaly { border-color: var(--ochre-soft); }
.area-card .idx { font-family: ui-monospace, Menlo, monospace; font-size: 0.78rem; color: var(--forest-600); letter-spacing: 0.06em; }
.area-card h3 { font-size: 1.5rem; margin: 12px 0 10px; }
.area-card p { font-size: 0.98rem; color: var(--ink-soft); flex: 1; }
.area-card .meta { margin-top: 18px; font-size: 0.84rem; color: var(--ink-soft); display: flex; gap: 16px; }
.area-card .meta b { color: var(--forest-700); font-weight: 700; }

/* ─────────────── Publication list ─────────────── */
.pub-list { display: flex; flex-direction: column; }
.pub-item { display: grid; grid-template-columns: 92px 1fr auto; gap: 28px; padding: 26px 0; border-top: 1px solid var(--line); align-items: start; }
.pub-item:last-child { border-bottom: 1px solid var(--line); }
.pub-year { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--forest-600); line-height: 1; }
.pub-main h3 { font-size: 1.32rem; line-height: 1.2; }
.pub-main h3 a:hover { color: var(--forest-700); }
.pub-authors { font-size: 0.95rem; color: var(--ink); margin-top: 8px; }
.pub-venue { font-size: 0.92rem; color: var(--ink-soft); font-style: italic; margin-top: 4px; }
.pub-tags { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pub-actions { display: flex; flex-direction: column; gap: 9px; align-items: flex-end; }
.tag { display: inline-flex; align-items: center; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 5px 11px; border-radius: 6px; background: var(--cream-2); color: var(--forest-700); border: 1px solid var(--line); }
.tag.article { background: oklch(0.40 0.065 159 / 0.1); color: var(--forest-800); border-color: transparent; }
.tag.preprint { background: oklch(0.76 0.105 70 / 0.18); color: var(--clay); border-color: transparent; }
.tag.report { background: oklch(0.60 0.115 162 / 0.14); color: var(--forest-700); border-color: transparent; }
.doc-link { font-size: 0.86rem; font-weight: 600; color: var(--forest-700); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.doc-link:hover { gap: 9px; }
@media (max-width: 760px) {
  .pub-item { grid-template-columns: 1fr; gap: 12px; }
  .pub-actions { flex-direction: row; align-items: center; }
}

/* ─────────────── People / researchers ─────────────── */
.people-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.person { display: flex; flex-direction: column; }
.person .ph { aspect-ratio: 4/5; border-radius: 16px; height: auto; align-items: flex-end; }
.person .pname { font-family: var(--font-display); font-size: 1.28rem; font-weight: 600; color: var(--forest-900); margin-top: 16px; }
.person .ptitle { font-size: 0.9rem; color: var(--forest-600); font-weight: 600; margin-top: 4px; }
.person .parea { font-size: 0.9rem; color: var(--ink-soft); margin-top: 7px; }
.people-row-head { display: flex; align-items: baseline; gap: 16px; margin: 56px 0 28px; }
.people-row-head:first-of-type { margin-top: 0; }
.people-row-head h2 { font-size: 1.7rem; }
.people-row-head .ct { margin-left: auto; font-size: 0.88rem; color: var(--ink-soft); }
@media (max-width: 900px) { .people-grid { grid-template-columns: repeat(2, 1fr); } }

/* ─────────────── Events ─────────────── */
.event-row { display: grid; grid-template-columns: 132px 1fr auto; gap: 30px; padding: 28px 0; border-top: 1px solid var(--line); align-items: center; }
.event-row:last-child { border-bottom: 1px solid var(--line); }
.event-date { text-align: center; border-right: 1px solid var(--line); padding-right: 28px; }
.event-date .mon { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--clay); font-weight: 700; }
.event-date .day { font-family: var(--font-display); font-size: 2.4rem; font-weight: 600; color: var(--forest-900); line-height: 1; }
.event-body h3 { font-size: 1.3rem; }
.event-body .ev-meta { font-size: 0.92rem; color: var(--ink-soft); margin-top: 7px; display: flex; gap: 16px; flex-wrap: wrap; }
.event-body .ev-meta span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 760px) {
  .event-row { grid-template-columns: 1fr; gap: 14px; }
  .event-date { display: flex; gap: 10px; align-items: baseline; border-right: none; border-bottom: 1px solid var(--line); padding: 0 0 12px; text-align: left; }
}

/* ─────────────── Newsletter band ─────────────── */
.newsletter { background: var(--forest-800); border-radius: var(--radius-lg); padding: 56px; display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.newsletter h2 { color: var(--cream); font-size: clamp(1.7rem, 3vw, 2.4rem); }
.newsletter p { color: oklch(1 0 0 / 0.8); margin-top: 12px; max-width: 440px; }
.news-form { display: flex; gap: 10px; }
.news-form input { padding: 14px 16px; border-radius: 10px; border: 1px solid oklch(1 0 0 / 0.25); background: oklch(1 0 0 / 0.08); color: var(--cream); font-family: var(--font-sans); font-size: 1rem; min-width: 260px; }
.news-form input::placeholder { color: oklch(1 0 0 / 0.5); }
.news-form input:focus { outline: none; border-color: var(--ochre-soft); }
@media (max-width: 760px) { .newsletter { grid-template-columns: 1fr; } .news-form { flex-direction: column; } .news-form input { min-width: 0; } }

/* responsive */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .split, .story { grid-template-columns: 1fr; }
  .stat-band { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .stat-band .stat { border-left: none; padding-left: 0; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 72px 0; }
}
@media (max-width: 560px) {
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
}
