/* Multiphysical Geomechanics Research — site styles
   Plain CSS (no build step). Colors are defined once below. */

:root {
  --ink: #1d2126;
  --ink-soft: #3d434b;
  --muted: #646b73;
  --line: #e6e3dc;
  --bg: #ffffff;
  --bg-soft: #f7f6f2;
  --gold: #cfb87c;        /* CU Boulder gold */
  --gold-dark: #8a733a;
  --link: #1f5a99;
  --link-hover: #143f6d;
  --dark: #15181c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 28, .06), 0 6px 18px rgba(20, 24, 28, .06);
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.25; color: var(--ink); margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 2.4vw, 1.8rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
sup { line-height: 0; font-size: .72em; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--dark); color: #fff; padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark {
  flex: none; width: 40px; height: 40px; border-radius: 8px;
  background: var(--dark); color: var(--gold);
  font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: .02em;
  display: grid; place-items: center;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-title { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.brand-sub { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-soft); font-size: .94rem; font-weight: 500;
  padding: 8px 11px; border-radius: 6px; position: relative;
}
.site-nav a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.site-nav a.active { color: var(--ink); }
.site-nav a.active::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 3px; height: 2px; background: var(--gold); border-radius: 2px;
}
.nav-toggle {
  display: none; border: 1px solid var(--line); background: #fff; border-radius: 8px;
  width: 42px; height: 40px; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink);
}
@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; background: #fff; border-bottom: 1px solid var(--line);
    padding: 6px 12px 12px; box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 11px 10px; border-radius: 6px; }
  .site-nav a.active::after { left: 10px; right: auto; width: 28px; bottom: 6px; }
  .brand-sub { display: none; }
}

/* ---------- Heroes ---------- */
.hero, .page-hero { position: relative; color: #fff; background: var(--dark) center / cover no-repeat; }
.hero::before, .page-hero::before { content: ""; position: absolute; inset: 0; }
.hero::before { background: linear-gradient(90deg, rgba(12, 15, 19, .82) 0%, rgba(12, 15, 19, .55) 55%, rgba(12, 15, 19, .25) 100%); }
.page-hero::before { background: linear-gradient(90deg, rgba(12, 15, 19, .86), rgba(12, 15, 19, .6)); }
.hero > .container, .page-hero > .container { position: relative; }
.hero { padding: clamp(72px, 12vw, 128px) 0 clamp(64px, 10vw, 112px); }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 5vw, 3.2rem); max-width: 20ch; margin-bottom: .35em; }
.hero .lead { font-size: clamp(1.02rem, 1.6vw, 1.18rem); max-width: 60ch; color: rgba(255, 255, 255, .9); margin-bottom: 1.6em; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; font-weight: 600; color: var(--gold); margin: 0 0 .8em; }
.kicker a { color: var(--gold); }
.page-hero { padding: 54px 0 40px; }
.page-hero h1 { color: #fff; max-width: 34ch; margin-bottom: .2em; }
.page-hero .lead { color: rgba(255, 255, 255, .86); max-width: 70ch; margin: .4em 0 0; font-size: 1.05rem; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn-gold { background: var(--gold); color: #1a1a1a; }
.btn-gold:hover { background: #dcc78f; color: #000; }
.btn-ghost { border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.btn-outline { border-color: var(--line); color: var(--ink); background: #fff; }
.btn-outline:hover { border-color: var(--gold); color: var(--ink); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Sections & layout ---------- */
.section { padding: clamp(44px, 6vw, 72px) 0; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head .more { font-weight: 600; font-size: .95rem; }
.eyebrow { display: block; font-family: var(--sans); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-dark); font-weight: 700; margin-bottom: .4em; }
.page-body { padding-top: 40px; padding-bottom: 64px; }
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 44px; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 28px; } }
.prose { max-width: 74ch; }
.prose h2 { margin-top: 1.6em; padding-top: .2em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: .25em 0; }
.prose .pub-list, .prose .plain-list { padding-left: 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.callout {
  background: var(--bg-soft); border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: var(--radius); padding: 20px 22px; margin: 0 0 28px;
}
.callout p:last-child { margin-bottom: 0; }

/* ---------- Cards ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s, border-color .2s;
}
a.card { color: inherit; }
a.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #d9d3c4; text-decoration: none; }
.card-img { aspect-ratio: 16 / 10; background: #fff; border-bottom: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.card-img.cover img { object-fit: cover; padding: 0; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-family: var(--serif); font-weight: 700; font-size: 1.06rem; line-height: 1.35; margin: 0; color: var(--ink); }
.card-meta { font-size: .86rem; color: var(--muted); margin: 0; }
.card-foot { margin-top: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: #fff;
}
.badge-active { color: #1e6b3a; border-color: #b9dfc6; background: #eef8f1; }
.badge-ongoing { color: var(--gold-dark); border-color: #e6d9b3; background: #fbf7ec; }
.badge-completed { color: #5b6168; background: #f3f4f5; }

.theme-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; display: flex; flex-direction: column; gap: 8px; }
a.theme-card { color: inherit; }
a.theme-card:hover { box-shadow: var(--shadow); text-decoration: none; border-color: #d9d3c4; }
.theme-num { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--gold); line-height: 1; }
.theme-card h3 { margin: 4px 0 0; }
.theme-card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.theme-card .card-meta { margin-top: auto; padding-top: 6px; }

/* ---------- Research page ---------- */
.theme-block { padding: 44px 0 10px; border-top: 1px solid var(--line); }
.theme-block:first-of-type { border-top: 0; padding-top: 8px; }
.theme-block header { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: start; margin-bottom: 22px; }
.theme-block .theme-num { font-size: 2.6rem; grid-row: span 2; }
.theme-block h2 { margin: 0; }
.theme-block header p { margin: 0; color: var(--ink-soft); max-width: 80ch; }
@media (max-width: 620px) { .theme-block header { grid-template-columns: 1fr; } .theme-block .theme-num { grid-row: auto; } }

.sponsor-strip { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: center; }
.sponsor-strip a { display: block; padding: 8px; border-radius: 8px; }
.sponsor-strip a:hover { background: #fff; box-shadow: var(--shadow); }
.sponsor-strip img { height: 64px; width: auto; max-width: 180px; object-fit: contain; }

/* ---------- Project page ---------- */
.project-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; padding-top: 40px; padding-bottom: 64px; align-items: start; }
@media (max-width: 960px) { .project-layout { grid-template-columns: 1fr; gap: 28px; } .project-meta { order: -1; } }
.project-meta { position: sticky; top: 92px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
@media (max-width: 960px) { .project-meta { position: static; } }
.project-meta dl { margin: 0; display: grid; gap: 12px; }
.project-meta dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.project-meta dd { margin: 2px 0 0; font-size: .95rem; }
.project-meta .back { display: inline-block; margin-top: 16px; font-weight: 600; font-size: .92rem; }
.figure { margin: 26px 0; }
.figure img { margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 8px; max-height: 560px; width: auto; }
.figure figcaption { font-size: .9rem; color: var(--muted); text-align: center; margin-top: 8px; font-style: italic; }
.plain-list { list-style: none; padding: 0; margin: 0 0 1em; }
.plain-list li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.plain-list li:last-child { border-bottom: 0; }

/* ---------- Publications ---------- */
.pub-list { list-style: none; padding: 0; margin: 0 0 2em; counter-reset: none; }
.pub { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: .97rem; }
.pub-list.no-labels .pub { grid-template-columns: minmax(0, 1fr); }
.pub-label { font-weight: 600; color: var(--gold-dark); font-variant-numeric: tabular-nums; padding-top: 1px; }
.pub-title { font-weight: 600; color: var(--ink); }
.pub-venue { color: var(--ink-soft); }
.pub-links { display: inline-flex; gap: 10px; margin-left: 4px; }
.pub-links a { font-size: .84rem; font-weight: 600; white-space: nowrap; }
.pub[hidden] { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .88rem; color: var(--muted); margin: 0 0 20px; padding: 14px 18px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); }
.legend b { color: var(--ink); font-weight: 700; margin-right: 4px; }
.pub-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 18px; }
.pub-tools input {
  flex: 1 1 280px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: .95rem;
}
.pub-tools input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.jump { display: flex; flex-wrap: wrap; gap: 8px; }
.jump a { font-size: .86rem; font-weight: 600; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); }
.jump a:hover { border-color: var(--gold); text-decoration: none; color: var(--ink); }
.pub-section-title { display: flex; align-items: baseline; gap: 10px; margin: 34px 0 6px; scroll-margin-top: 90px; }
.pub-section-title .count { font-family: var(--sans); font-size: .85rem; color: var(--muted); font-weight: 500; }
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.video { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.video .frame { aspect-ratio: 16 / 9; background: #000; }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.video p { margin: 0; padding: 12px 14px; font-size: .92rem; }

/* ---------- People ---------- */
.pi-card { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: center; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.pi-card img { width: 220px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; }
.pi-card h3 { font-size: 1.5rem; margin-bottom: .3em; }
.pi-card p { margin: .15em 0; color: var(--ink-soft); }
@media (max-width: 620px) { .pi-card { grid-template-columns: 1fr; } .pi-card img { width: 180px; } }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px; }
.person { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.person img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--bg-soft); }
.person .info { padding: 14px 16px 16px; }
.person h3 { font-size: 1.08rem; margin: 0 0 4px; }
.person .role { font-size: .85rem; color: var(--muted); margin: 0 0 6px; }
.person ul { margin: 6px 0 0; padding-left: 1.05em; font-size: .87rem; color: var(--ink-soft); }
.person li { margin: 2px 0; }
.person .note { font-size: .85rem; margin: 6px 0 0; color: var(--ink-soft); }
.people-grid.compact { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.people-grid.compact .person img { aspect-ratio: 1 / 1; }
.group-title { margin: 44px 0 18px; padding-bottom: 8px; border-bottom: 2px solid var(--gold); display: inline-block; }
.cv img.portrait { float: right; width: 240px; margin: 0 0 18px 28px; border-radius: 8px; }
@media (max-width: 620px) { .cv img.portrait { float: none; margin: 0 0 18px; } }
.cv ul ul { list-style: circle; }

/* ---------- Teaching ---------- */
.course { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; background: #fff; }
.course .code { font-weight: 700; color: var(--gold-dark); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.course h3 { margin: 4px 0 6px; }
.course .terms { font-size: .88rem; color: var(--muted); margin: 0 0 10px; }
.course .former { font-size: .85rem; color: var(--muted); font-style: italic; margin: -2px 0 8px; }
.course p.desc { font-size: .95rem; color: var(--ink-soft); margin: 0; }

/* ---------- Gallery / news ---------- */
.social-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 30px; }
.event { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 28px; padding: 30px 0; border-top: 1px solid var(--line); }
.event:first-of-type { border-top: 0; padding-top: 6px; }
.event-date { font-weight: 700; color: var(--gold-dark); font-size: .92rem; padding-top: 4px; }
.event h2 { font-size: 1.35rem; margin-bottom: .4em; scroll-margin-top: 90px; }
@media (max-width: 720px) { .event { grid-template-columns: 1fr; gap: 6px; } }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 14px; }
.photo-grid figure { margin: 0; }
.photo-grid a { display: block; border-radius: 8px; overflow: hidden; background: var(--bg-soft); }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .25s; }
.photo-grid a:hover img { transform: scale(1.03); }
.photo-grid figcaption { font-size: .84rem; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.news-card .card-img { aspect-ratio: 4 / 3; }
.news-card .date { font-size: .8rem; font-weight: 700; color: var(--gold-dark); text-transform: uppercase; letter-spacing: .06em; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(10, 12, 15, .92); display: none; align-items: center; justify-content: center; z-index: 200; padding: 24px; }
.lightbox.open { display: flex; }
.lightbox figure { margin: 0; max-width: min(1200px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-height: calc(100vh - 120px); width: auto; border-radius: 6px; }
.lightbox figcaption { color: #e9e9e9; margin-top: 10px; font-size: .95rem; text-align: center; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 22px; cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, .25); }
.lightbox .lb-close { top: 18px; right: 18px; }
.lightbox .lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 18px; top: 50%; transform: translateY(-50%); }

/* ---------- Carousel ---------- */
.carousel { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; box-shadow: var(--shadow); }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; margin: 0; }
.slide img { width: 100%; aspect-ratio: 2 / 1; object-fit: contain; background: #fff; padding: 10px; }
.slide figcaption { padding: 10px 16px 14px; font-size: .9rem; color: var(--ink-soft); text-align: center; min-height: 3.6em; }
.carousel-nav { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 0 14px; }
.carousel-nav button.arrow { border: 1px solid var(--line); background: #fff; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; color: var(--ink); font-size: 15px; line-height: 1; }
.carousel-nav button.arrow:hover { border-color: var(--gold); }
.dots { display: flex; gap: 6px; }
.dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: #d5d0c4; cursor: pointer; }
.dots button.on { background: var(--gold-dark); }

/* ---------- Code page ---------- */
.repo { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: #fff; }
.repo h3 { font-family: var(--sans); font-size: 1.05rem; margin: 0 0 6px; }
.repo p { margin: 0 0 6px; font-size: .94rem; color: var(--ink-soft); }
.empty-state { text-align: center; padding: 38px 20px; border: 1px dashed #d8d2c3; border-radius: var(--radius); color: var(--muted); background: var(--bg-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #c9ccd1; padding: 46px 0 26px; font-size: .93rem; }
.site-footer a { color: #e7d9ad; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 22px; } }
.site-footer h4 { font-family: var(--sans); color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 4px 0; }
.site-footer .fine { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 30px; padding-top: 16px; font-size: .82rem; color: #8d939a; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

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