/* ==========================================================================
   IDM Lab — site styles
   Colors and spacing are defined once as tokens below; change them here.
   ========================================================================== */

:root {
  --gold: #cfb87c;          /* CU gold — accents, hero */
  --gold-ink: #7d6320;      /* gold dark enough for text on light backgrounds */
  --ink: #16181d;           /* headings, header */
  --text: #2c2f36;
  --muted: #5d6270;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-alt: #f3f0e8;
  --line: #e4dfd2;
  --shadow: 0 1px 2px rgba(22, 24, 29, .06), 0 8px 24px rgba(22, 24, 29, .06);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;

  --radius: 12px;
  --container: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(48px, 8vw, 96px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --gold-ink: #dcc690;
    --ink: #f2efe8;
    --text: #d6d4ce;
    --muted: #a3a29c;
    --bg: #121317;
    --surface: #1b1d22;
    --surface-alt: #17181c;
    --line: #2c2e35;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

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

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font: 400 1rem/1.65 var(--font-sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; }
h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.05rem; font-weight: 600; }

p { margin: 0 0 1em; }

a { color: var(--gold-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 860px; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }

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

.eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 .75rem;
}
.eyebrow-dark { color: var(--gold-ink); }

.lede { font-size: clamp(1.05rem, 2vw, 1.2rem); max-width: 46rem; }

.date { font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gold-ink); margin: 0 0 .35rem; }

.prose p, .prose li { max-width: 68ch; }
.prose ul { padding-left: 1.2em; }

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

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.75rem 0 0; }
.split-body .actions { margin: 0 0 2.5rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .75em 1.3em; border-radius: 999px; font-weight: 600; font-size: .95rem;
  text-decoration: none; border: 1.5px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--gold); color: #16181d; }
.btn-primary:hover { background: #dcc690; }
.btn-ghost { border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn-outline { border-color: var(--gold-ink); color: var(--gold-ink); white-space: nowrap; }
.btn-outline:hover { background: var(--gold-ink); color: var(--bg); }

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

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(22, 24, 29, .94); backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }

.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { display: block; flex-shrink: 0; padding-right: 14px; border-right: 1px solid rgba(255, 255, 255, .18); }
.brand-logo img { height: 40px; width: auto; }
.brand-text { font-weight: 600; line-height: 1.15; color: #fff; text-decoration: none; }
.brand-text:hover .brand-sub { color: var(--gold); }
.brand-text { white-space: nowrap; }

.brand-sub { display: block; font-size: .75rem; font-weight: 400; color: rgba(255, 255, 255, .6); }

@media (max-width: 480px) {
  .brand { gap: 10px; }
  .brand-logo { padding-right: 10px; }
  .brand-logo img { height: 32px; }
  .brand-sub { display: none; }
}

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: rgba(255, 255, 255, .78); text-decoration: none; font-size: .93rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px;
}
.site-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.site-nav a[aria-current="page"] { color: var(--gold); }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 5px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; padding: 8px var(--gutter) 16px;
    background: #16181d; border-bottom: 1px solid rgba(255, 255, 255, .08);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px; font-size: 1rem; }
}

/* ---------- Hero (home) ---------- */

.home-hero { position: relative; color: #fff; isolation: isolate; overflow: hidden; }
.home-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.home-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(14, 15, 19, .92) 0%, rgba(14, 15, 19, .75) 45%, rgba(14, 15, 19, .25) 100%);
}
.home-hero-inner { padding-top: clamp(72px, 14vw, 160px); padding-bottom: clamp(72px, 12vw, 140px); }
.home-hero h1 { color: #fff; font-size: clamp(2.2rem, 6vw, 4rem); max-width: 18ch; margin-bottom: .4em; }
.home-hero .lede { color: rgba(255, 255, 255, .85); }

/* ---------- Page hero (inner pages) ---------- */

.page-hero {
  color: #fff; padding: clamp(48px, 9vw, 96px) 0 clamp(40px, 7vw, 72px);
  background:
    linear-gradient(100deg, rgba(14, 15, 19, .94), rgba(14, 15, 19, .72)),
    url("../img/hero-campus.webp") center 35% / cover no-repeat;
}
.page-hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: .3em; }
.page-hero .lede { color: rgba(255, 255, 255, .82); margin: 0; }
.page-hero-title { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.page-hero-title img { width: clamp(52px, 8vw, 72px); height: auto; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .35)); }
.page-hero-title h1 { margin: 0; }

/* ---------- Sections ---------- */

.section { padding: var(--section) 0; }
.section-alt { background: var(--surface-alt); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.more { font-weight: 600; text-decoration: none; white-space: nowrap; }

.group-title {
  font-size: clamp(1.35rem, 2.5vw, 1.7rem); margin: 56px 0 24px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.group-title:first-child, .pub-jump + .group-title { margin-top: 0; }

/* ---------- PI block ---------- */

.pi { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.pi-photo { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 11 / 14; object-fit: cover; }
.pi-body h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: .2em; }
.pi-role { color: var(--muted); margin-bottom: 1.75rem; }
.pi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; }
.pi-grid h3 { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .5em; }
.pi-grid li { margin-bottom: .2em; }
.pi-courses { grid-column: 1 / -1; }
.pill-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 1.75rem 0 0; }
.pill-links a {
  text-decoration: none; font-size: .88rem; font-weight: 500; color: var(--text);
  border: 1px solid var(--line); background: var(--surface); padding: 6px 14px; border-radius: 999px;
}
.pill-links a:hover { border-color: var(--gold); color: var(--ink); }

@media (max-width: 720px) {
  .pi { grid-template-columns: 1fr; }
  .pi-photo { max-width: 280px; }
  .pi-grid { grid-template-columns: 1fr; }
}

/* ---------- Cards (research on home) ---------- */

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold); }
.card img { aspect-ratio: 16 / 10; object-fit: contain; width: 100%; padding: 10px; background: #fff; border-bottom: 1px solid var(--line); }
.card-body { padding: 18px 20px 22px; }
.card h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.card p { color: var(--muted); font-size: .93rem; margin: 0; }

/* Five research areas: two wide cards on top, three below */
@media (min-width: 900px) {
  .card-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .card { grid-column: span 2; }
  .card:nth-child(-n+2) { grid-column: span 3; }
  .card:nth-child(-n+2) img { aspect-ratio: 2 / 1; }
}

/* ---------- News ---------- */

.news-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.news-mini-item { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; }
.news-mini-item img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border-radius: var(--radius); transition: opacity .2s; }
.news-mini-item:hover img { opacity: .85; }
.news-mini-item h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin: 0; }

.news-item {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 48px);
  align-items: start; padding: 40px 0; border-top: 1px solid var(--line);
}
.news-item:first-child { border-top: 0; padding-top: 0; }
.news-media { margin: 0; }
.news-media img { border-radius: var(--radius); width: 100%; }
.news-body h2 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); }

/* ---------- Research page ---------- */

.research-toc { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 32px; }
.research-toc a {
  font-size: .88rem; text-decoration: none; color: var(--text);
  border: 1px solid var(--line); background: var(--surface); padding: 6px 14px; border-radius: 999px;
}
.research-toc a:hover { border-color: var(--gold); }

.research-item + .research-item { padding-top: 0; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.split-top { align-items: start; }
.split-media { margin: 0; }
.split-media img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.is-flipped .split-media { order: 2; }

@media (max-width: 860px) {
  .split, .news-item { grid-template-columns: 1fr; }
  .is-flipped .split-media { order: 0; }
}

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

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); gap: 20px; align-items: start; }
.person {
  display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
}
.person img { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; }
.avatar {
  width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-alt); border: 1px solid var(--line);
  font: 700 2.2rem/1 var(--font-display); color: var(--gold-ink); letter-spacing: .02em;
}
.person h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin-bottom: .2em; }
.person-research { color: var(--gold-ink); font-weight: 500; font-size: .93rem; margin-bottom: .6em; }
.person p:not(.person-research) { font-size: .93rem; color: var(--muted); }
.person p:last-of-type { margin-bottom: .6em; }
.text-link { font-weight: 600; font-size: .9rem; text-decoration: none; }

.is-alumni .person { grid-template-columns: 72px 1fr; align-items: center; }
.is-alumni .person img, .is-alumni .avatar { width: 72px; height: 72px; font-size: 1.4rem; }

/* In the two-column layout, every card in a group (Ph.D., Master's, ...)
   matches the tallest card in that group. */
@media (min-width: 1000px) {
  .people-grid { grid-auto-rows: 1fr; align-items: stretch; }
}

@media (max-width: 480px) {
  .person { grid-template-columns: 1fr; }
}

/* ---------- Publications ---------- */

.pub-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.pub-jump a {
  text-decoration: none; color: var(--text); font-weight: 500; font-size: .92rem;
  border: 1px solid var(--line); background: var(--surface); padding: 8px 16px; border-radius: 999px;
}
.pub-jump a:hover { border-color: var(--gold); }
.pub-jump span { color: var(--muted); font-weight: 400; margin-left: 4px; }

.pub-year { display: grid; grid-template-columns: 72px 1fr; gap: 16px; margin-bottom: 24px; }
.pub-year h3 { font-family: var(--font-display); font-size: 1.2rem; color: var(--gold-ink); padding-top: 12px; margin: 0; }
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-list li { border-bottom: 1px solid var(--line); }
.pub-list li:last-child { border-bottom: 0; }
.pub-list a { display: block; padding: 12px 0; color: var(--text); text-decoration: none; font-size: .95rem; line-height: 1.6; }
.pub-list a:hover { color: var(--ink); }
.pub-list a:hover .pub-title { text-decoration: underline; text-decoration-color: var(--gold); }
.pub-list strong { color: var(--ink); font-weight: 600; }

@media (max-width: 600px) {
  .pub-year { grid-template-columns: 1fr; gap: 0; }
  .pub-year h3 { padding-top: 0; }
}

/* ---------- Facilities ---------- */

.facility + .facility { margin-top: var(--section); padding-top: var(--section); border-top: 1px solid var(--line); }
.facility-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.facility-meta { color: var(--muted); font-size: .92rem; margin: 0 0 .5em; }
.facility-intro { font-size: 1.08rem; max-width: 72ch; }
.facility-img { margin: 28px 0; }
.facility-img img { width: 100%; border-radius: var(--radius); }

.equip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-bottom: 24px; }
.equip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.equip h3 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); }
.equip ul { margin: 0; padding-left: 1.1em; }
.equip li { margin-bottom: .3em; font-size: .94rem; }
.equip p { font-size: .94rem; margin: 0; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { border-left: 3px solid var(--gold); padding: 4px 0 4px 14px; }
.stat-num { display: block; font: 700 2rem/1.1 var(--font-display); color: var(--ink); }
.stat-label { font-size: .88rem; color: var(--muted); }

/* ---------- Software ---------- */

.video { position: relative; aspect-ratio: 16 / 9; margin-top: 2rem; border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.callout {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: var(--radius); padding: 24px 28px;
}
.callout h2 { font-size: 1.4rem; margin-bottom: .2em; }
.callout p { margin: 0; color: var(--muted); }

.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.pillar { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 24px 24px 20px; }
.pillar-num { display: block; font: 700 .85rem/1 var(--font-display); letter-spacing: .1em; color: var(--gold-ink); margin-bottom: 14px; }
.pillar h2 { font-size: 1.35rem; }
.pillar p { color: var(--muted); font-size: .95rem; margin: 0; }

.video-wide { margin-top: clamp(32px, 5vw, 56px); box-shadow: var(--shadow); }

.feature-list { margin-top: clamp(32px, 5vw, 56px); }
.feature-list h3 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.feature-list ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.feature-list li { font-size: .9rem; font-weight: 500; border: 1px solid var(--line); background: var(--surface); padding: 6px 14px; border-radius: 999px; }

.cta {
  margin-top: clamp(32px, 5vw, 56px); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: #16181d; color: rgba(255, 255, 255, .8); border-radius: var(--radius); padding: 28px 32px;
}
.cta-top { margin: 0 0 clamp(32px, 5vw, 48px); }
.cta h2 { color: #fff; font-size: 1.5rem; margin-bottom: .2em; }
.cta p { margin: 0; }

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

.site-footer { background: #16181d; color: rgba(255, 255, 255, .7); font-size: .92rem; padding: 56px 0 28px; }
.footer-inner { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 32px; align-items: start; }
.footer-title { color: #fff; font-weight: 600; margin-bottom: .6em; }
.site-footer address { font-style: normal; }
.site-footer a { color: rgba(255, 255, 255, .85); }
.site-footer a:hover { color: var(--gold); }
.footer-links a { display: block; text-decoration: none; margin-bottom: .2em; }
.footer-logo { display: block; }
.footer-logo img { width: 260px; }
.footer-meta { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .82rem; color: rgba(255, 255, 255, .5); }

@media (max-width: 960px) {
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-logo { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 520px) {
  .footer-inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
