/* =========================================================
   STAR Lab — Science & Technology for Atmospheric Research
   Quiet academic layout over a light solarpunk sky.
   ========================================================= */

:root {
  --bg: #FBFCF9;
  --surface: #FFFFFF;
  --cloud: #F3F6F2;
  --ink: #161A19;
  --ink-2: #3F4A47;
  --muted: #6E7A76;
  --line: #E3E8E4;

  --sky: #2E8FB8;
  --sky-2: #7EC8E3;
  --teal: #1D7D74;
  --leaf: #4FA36B;
  --sun: #E9A23B;
  --sun-2: #F6C453;
  --coral: #E07A5F;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 28, .04), 0 10px 30px -18px rgba(20, 30, 28, .25);

  --font-head: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --wrap: 1120px;
  --read: 760px;
  --gutter: clamp(18px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.075rem/1.7 var(--font-sans); letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: underline; text-decoration-color: rgba(29,125,116,.35); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--ink); text-decoration-color: currentColor; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 400; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.015em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 4.2vw, 2.9rem); font-weight: 300; letter-spacing: -.025em; }
h2 { font-size: clamp(1.45rem, 2.4vw, 1.75rem); }
h3 { font-size: 1.15rem; font-weight: 500; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.read { max-width: var(--read); }
.section { padding-block: clamp(44px, 6vw, 80px); }
.section + .section { padding-top: 0; }
.lead { font-size: clamp(1.08rem, 1.5vw, 1.2rem); color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; }

/* Section heading with a hairline, used instead of magazine-style kickers */
.sec-title { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.4rem; }
.sec-title h2 { margin: 0; white-space: nowrap; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--line); transform: translateY(-.35em); }
.sec-title a { font-size: .92rem; white-space: nowrap; order: 2; }

.text-link { font-weight: 500; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  /* Tinted frosted glass: clearly its own band over the busy sky, but not browser-chrome white */
  background:
    linear-gradient(90deg, rgba(214, 236, 243, .78), rgba(226, 239, 228, .74) 50%, rgba(250, 238, 208, .74));
  backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid rgba(22, 26, 25, .14);
  box-shadow: 0 8px 24px -16px rgba(22, 26, 25, .45);
}
/* Thin sky → leaf → sun accent along the bottom edge */
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--sky), var(--leaf) 50%, var(--sun));
  opacity: .75;
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 80px; }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--ink); }
.brand img { width: 54px; height: 54px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font: 500 1.5rem/1 var(--font-head); letter-spacing: .24em; }
.brand-sub { font: 400 .7rem/1.3 var(--font-sans); color: var(--ink-2); letter-spacing: .08em; text-transform: uppercase; margin-top: .3rem; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: .97rem; padding-block: .3rem; border-bottom: 2px solid transparent; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.nav-toggle { display: none; background: none; border: 0; padding: .4rem; cursor: pointer; color: var(--ink); }
.nav-toggle svg { width: 26px; height: 26px; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; inset: 80px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); padding: .5rem var(--gutter) 1rem; border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: .75rem 0; border-bottom: 1px solid var(--line); }
  .nav-links a[aria-current="page"] { border-bottom-color: var(--line); font-weight: 600; }
}

/* ---------- Site-wide sky backdrop (fixed, parallax) ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop .sky {
  position: absolute; left: 0; right: 0; top: 0; height: 160vh; will-change: transform;
  background:
    radial-gradient(900px 520px at 85% 6%, rgba(246,196,83,.38), transparent 62%),
    radial-gradient(820px 560px at 8% 2%, rgba(126,200,227,.42), transparent 66%),
    radial-gradient(900px 600px at 95% 70%, rgba(126,200,227,.22), transparent 65%),
    radial-gradient(800px 600px at 0% 95%, rgba(169,212,154,.30), transparent 65%),
    linear-gradient(180deg, #EAF5F9 0%, #F5FAF5 45%, #F9FBF4 100%);
}
.wind-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .75; }
.backdrop .drift { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.backdrop .drift img { position: absolute; width: clamp(260px, 32vw, 460px); opacity: .42; }

/* ---------- Home hero ---------- */
.hero { position: relative; min-height: min(78vh, 660px); display: flex; align-items: center; padding-block: 56px 72px; }
.hero-inner { position: relative; max-width: 720px; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.8rem); font-weight: 700; line-height: 1.08; letter-spacing: -.025em; margin-bottom: .45em; }
.hero h1 em { color: var(--teal); }
.hero h1 .sun-word { background: linear-gradient(90deg, var(--sun), var(--coral)); -webkit-background-clip: text; background-clip: text; color: transparent; font-style: italic; }
.hero .lead { margin-bottom: 1.6rem; max-width: 58ch; }
.hero-links { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; font-weight: 600; }
.hero-links a { text-decoration: none; color: var(--ink); border-bottom: 2px solid var(--ink); padding-bottom: 2px; }
.hero-links a:hover { color: var(--teal); border-color: var(--teal); }
.hero-place { font-size: .82rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
/* Centered name-only hero */
.hero-center { margin-inline: auto; text-align: center; max-width: 780px; }
.hero .hero-center h1 { font-size: clamp(3.2rem, 10vw, 7rem); font-weight: 200; letter-spacing: .02em; line-height: 1; margin-bottom: .3em; }
.hero-sub { font-size: clamp(.85rem, 1.6vw, 1.05rem); font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--teal); margin-bottom: 1.6rem; }
.hero-center .lead { margin-inline: auto; margin-bottom: 1.4rem; max-width: 46ch; }
.hero-center .hero-place { margin-bottom: 1.8rem; }
.hero-center .hero-links { justify-content: center; }
.rotor { transform-box: fill-box; transform-origin: center; animation: spin var(--spin, 6s) linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Interior page header */
.page-hero { position: relative; padding-block: clamp(48px, 7vw, 88px) clamp(28px, 4vw, 44px); }
.page-hero h1 { margin-bottom: .35em; }
.page-hero .lead { margin: 0; max-width: 62ch; }

/* ---------- Pop-in: on load (.pop) and on scroll (.reveal) ---------- */
.pop { animation: popIn .75s cubic-bezier(.17, 1.4, .36, 1) both; animation-delay: var(--d, 0ms); }
@keyframes popIn { from { opacity: 0; transform: translateY(40px) scale(.96); } }
.reveal {
  opacity: 0; transform: translateY(60px) scale(.95);
  transition: opacity .3s ease-out, transform .5s cubic-bezier(.17, 1.45, .36, 1);
  transition-delay: var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Home ---------- */
.welcome { display: grid; grid-template-columns: 180px 1fr; gap: clamp(20px, 4vw, 48px); align-items: start; }
.welcome img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; }
@media (max-width: 640px) { .welcome { grid-template-columns: 1fr; } .welcome img { width: 140px; height: 140px; } }
.signature { font-family: var(--font-head); font-style: italic; color: var(--ink-2); }

.explore { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.explore li { border-bottom: 1px solid var(--line); }
.explore a {
  display: grid; grid-template-columns: 180px 1fr auto; gap: 1rem; align-items: baseline;
  padding: 1.05rem .25rem; text-decoration: none; color: var(--ink-2);
  transition: background .2s, padding .2s;
}
.explore a:hover { background: var(--cloud); padding-inline: .9rem; }
.explore b { font: 500 1.12rem/1.3 var(--font-head); color: var(--ink); }
.explore .go { color: var(--muted); }
@media (max-width: 640px) { .explore a { grid-template-columns: 1fr auto; } .explore a span:not(.go) { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- Research ---------- */
.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: .25rem 2.5rem; margin: 0; padding: 0; list-style: none; }
.areas li { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.areas b { display: flex; align-items: center; gap: .55rem; font: 500 1.05rem/1.3 var(--font-head); }
.areas b i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.areas span { display: block; color: var(--ink-2); font-size: .95rem; margin-top: .2rem; }

.filters { display: flex; flex-wrap: wrap; gap: .35rem 1.2rem; margin-bottom: 1.6rem; font-size: .93rem; }
.filter { background: none; border: 0; padding: .25rem 0; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 1.5px solid transparent; }
.filter:hover { color: var(--ink); }
.filter[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 2.2rem 1.8rem; }
.project-card {
  display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer;
  font: inherit; color: inherit; width: 100%; background: none; border: 0;
}
.project-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius); background: var(--cloud); border: 1px solid var(--line); }
.project-media img { width: 100%; height: 100%; object-fit: cover; object-position: center top; background: #fff; transition: transform .5s ease; }
.project-card:hover .project-media img, .project-card:hover .ph svg { transform: scale(1.04); }
.project-card h3 { margin: .9rem 0 .3rem; font-size: 1.12rem; transition: color .15s; }
.project-card:hover h3 { color: var(--teal); }
.project-card p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.project-card .yrs { font-size: .82rem; color: var(--muted); margin-top: .45rem; }

/* Placeholder art (clearly marked) */
.ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(255,255,255,.4) 14px 15px),
    linear-gradient(135deg, var(--ph-a, #D9EDF4), var(--ph-b, #E8F2E5));
  color: var(--ink-2);
}
.ph svg { width: 30%; max-width: 100px; opacity: .45; transition: transform .5s ease; }
.ph-badge {
  position: absolute; left: 10px; top: 10px;
  font: 600 .66rem/1 var(--font-sans); letter-spacing: .06em; text-transform: uppercase;
  padding: .45em .65em; border-radius: 5px; background: #FFF4D6; color: #8A5A00; border: 1px dashed #E9A23B;
}
.credit { position: absolute; right: 8px; bottom: 8px; font-size: .68rem; padding: .3em .55em; border-radius: 4px; background: rgba(255,255,255,.9); color: var(--ink-2); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }
.plain-list { margin: 0; padding-left: 1.1em; }
.plain-list li { margin-bottom: .45em; color: var(--ink-2); }
.plain-list b { color: var(--ink); font-weight: 600; }

/* ---------- Modal ---------- */
dialog.modal {
  width: min(860px, calc(100% - 24px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: 18px; background: var(--surface); color: var(--ink);
  box-shadow: 0 40px 100px -30px rgba(20,30,28,.5); overflow: hidden;
}
dialog.modal::backdrop { background: rgba(20, 30, 28, .4); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: pop .38s cubic-bezier(.17, 1.35, .36, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.modal-scroll { max-height: calc(100dvh - 32px); overflow-y: auto; }
.modal-media { position: relative; background: #fff; aspect-ratio: 16 / 8; border-bottom: 1px solid var(--line); }
.modal-media img { width: 100%; height: 100%; object-fit: contain; }
.modal-content { padding: clamp(20px, 4vw, 40px); }
.modal-content h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); margin-bottom: .25em; }
.modal-content h4 { font: 600 1rem/1.3 var(--font-head); margin: 1.6rem 0 .5rem; }
.modal-content ul { padding-left: 1.2em; margin: 0; }
.modal-content li { margin-bottom: .35em; }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer;
  background: rgba(255,255,255,.95); color: var(--ink); display: grid; place-items: center;
}
.modal-close:hover { background: var(--ink); color: #fff; }
.modal-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.modal-figs figure { margin: 0; }
.modal-figs img { border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.modal-figs figcaption { font-size: .82rem; color: var(--muted); margin-top: .45rem; }
.meta { color: var(--muted); font-size: .9rem; margin-bottom: 1.1rem; }
.note { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 10px; background: #FFF8E6; border: 1px dashed #E9A23B; color: #6B4A00; font-size: .9rem; margin: 1rem 0; }
.note svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 3px; }

/* ---------- Publications ---------- */
.selected { display: grid; gap: 1.6rem; }
.sel { display: grid; grid-template-columns: 220px 1fr; gap: 1.4rem; align-items: start; }
.sel-fig { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.sel-fig img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
@media (max-width: 640px) { .sel { grid-template-columns: 1fr; } .sel-fig { max-width: 320px; } }
.sel h3 { font-size: 1.12rem; margin-bottom: .25rem; }
.sel .why { margin: .5rem 0 0; color: var(--ink-2); font-size: .96rem; }
.cite { font-size: .93rem; color: var(--ink-2); }
.cite b { color: var(--ink); font-weight: 600; }
.cite i { color: var(--ink-2); }
.cite-links { display: inline-flex; gap: .8rem; margin-left: .2rem; font-size: .88rem; }
.badge { display: inline-block; font-size: .72rem; padding: .15em .5em; border-radius: 4px; background: var(--cloud); color: var(--ink-2); margin-left: .35rem; vertical-align: 1px; }
.badge--new { background: #E6F3EC; color: #2D6A47; }

.pub-tools { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; margin-bottom: .5rem; }
.search { flex: 1 1 240px; max-width: 360px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font: inherit; font-size: .95rem; padding: .45rem 0; color: var(--ink); outline: 0; }
.search:focus { border-bottom-color: var(--ink); }
.pub-year { font: 500 1.05rem/1 var(--font-head); color: var(--muted); margin: 2rem 0 .6rem; }
.pubs { list-style: none; margin: 0; padding: 0; }
.pubs li { padding: .7rem 0; border-bottom: 1px dashed var(--line); line-height: 1.55; }
.pubs .t { color: var(--ink); font-weight: 600; }

/* ---------- People ---------- */
.pi-row { display: grid; grid-template-columns: 120px 1fr; gap: 1.5rem; align-items: center; }
.pi-row img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 1.8rem 1.5rem; }
.person { display: grid; grid-template-columns: 64px 1fr; gap: .9rem; align-items: start; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  font: 600 1.2rem/1 var(--font-head); color: var(--ink-2);
  background: linear-gradient(135deg, #E3F1F6, #E8F2E5);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person b { display: block; font-weight: 600; }
.person span { display: block; font-size: .88rem; color: var(--ink-2); line-height: 1.45; }
.person em { display: inline-block; margin-top: .35rem; font-style: normal; font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; padding: .3em .55em; border-radius: 4px; background: #FFF4D6; color: #8A5A00; border: 1px dashed #E9A23B; }

/* ---------- News ---------- */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 110px 1fr; gap: 1.2rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.news time { font-size: .88rem; color: var(--muted); padding-top: .1rem; }
.news p { margin: 0; color: var(--ink-2); }
.news b { color: var(--ink); font-weight: 600; }
@media (max-width: 560px) { .news li { grid-template-columns: 1fr; gap: .15rem; } }

/* ---------- About (PI) ---------- */
.about-head { display: grid; grid-template-columns: 220px 1fr; gap: clamp(20px, 4vw, 48px); align-items: center; }
.about-head img { width: 220px; height: 220px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; box-shadow: var(--shadow); }
@media (max-width: 640px) { .about-head { grid-template-columns: 1fr; } .about-head img { width: 150px; height: 150px; } }
.cv-list { list-style: none; margin: 0; padding: 0; }
.cv-list li { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; padding: .55rem 0; }
.cv-list .yr { font-size: .88rem; color: var(--muted); padding-top: .1rem; }
.cv-list b { font-weight: 600; }
.cv-list small { display: block; color: var(--ink-2); font-size: .9rem; }
.inline-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-weight: 500; }

/* Courses */
.course { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.course h3 { margin: 0 0 .2rem; }
.course .code { font-size: .85rem; color: var(--muted); }
.course p { margin: .4rem 0 0; color: var(--ink-2); }
.course em { display: inline-block; margin-left: .4rem; font-style: normal; font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; padding: .3em .55em; border-radius: 4px; background: #FFF4D6; color: #8A5A00; border: 1px dashed #E9A23B; vertical-align: 2px; }

/* ---------- Footer ---------- */
.site-footer { padding-top: 48px; font-size: .92rem; color: var(--ink-2); margin-top: 32px; }
.contact { position: relative; z-index: 1; }
.contact h2 { font-weight: 300; font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 1.2rem; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 1.4rem 2.5rem; padding: 1.4rem 1.6rem; border-radius: 14px; background: rgba(255,255,255,.82); border: 1px solid rgba(22,26,25,.1); box-shadow: 0 10px 30px -20px rgba(22,26,25,.35); }
.contact-grid .label { display: block; font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; }
.contact-grid address { font-style: normal; line-height: 1.55; color: var(--ink); }
.contact-grid a { color: var(--ink); }
.contact-grid a:hover { color: var(--teal); }
.contact-links { display: flex; flex-direction: column; gap: .2rem; }
/* Landscape: layers sit behind the page and drift slower than the content scrolling over them */
.footer-scene { position: relative; height: clamp(150px, 19vw, 280px); margin-top: 24px; }
.scene-layer { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; z-index: -1; will-change: transform; }
.scene-layer svg { width: 100%; height: 100%; display: block; overflow: visible; }
.footer-ground { position: relative; background: #AFCBA8; height: 22px; }
body { overflow-x: hidden; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .pop { animation: none; }
  .rotor { animation: none; }
  * { transition-duration: 0s !important; animation-duration: 0s !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 8px; }
.skip-link:focus { left: 8px; color: #fff; }
