/* ============================================================
   Solar Insight - base layout & components
   Theme tokens live in themes.css; this file is theme-agnostic
   ============================================================ */

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

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .4s ease, color .4s ease;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--display-weight); line-height: 1.12; margin: 0; color: var(--ink); letter-spacing: var(--display-tracking, -0.01em); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; }

.wrap { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }
.section { padding: clamp(72px, 9vw, 140px) 0; position: relative; }
.section--alt { background: var(--bg-alt); }

/* ---- shared bits ---- */
.eyebrow {
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--accent); opacity: .8; }
.eyebrow--center { justify-content: center; }

.section-head { max-width: 720px; margin: 0 auto clamp(40px, 5vw, 72px); }
.section-head--center { text-align: center; }
.section-head h2 { font-size: clamp(30px, 4vw, 46px); margin-bottom: 18px; }
.section-head p { color: var(--ink-soft); font-size: clamp(17px, 1.6vw, 20px); }

.lede { font-size: clamp(19px, 2vw, 24px); line-height: 1.5; color: var(--ink-soft); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  padding: 14px 26px; border-radius: var(--btn-radius); cursor: pointer;
  border: 1px solid transparent; transition: transform .2s ease, background-color .2s ease, color .2s, box-shadow .2s, border-color .2s;
  letter-spacing: .005em; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-accent); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--light { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--light:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
  transition: background-color .3s ease, box-shadow .3s ease, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-mark { width: 26px; height: 26px; flex-shrink: 0; color: var(--accent); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 19px; letter-spacing: -0.01em; color: var(--nav-ink, var(--ink)); white-space: nowrap; }
.brand-sub { font-family: var(--font-body); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-family: var(--font-body); font-size: 14.5px; font-weight: 500; color: var(--nav-ink, var(--ink-soft));
  padding: 8px 13px; border-radius: 8px; position: relative; transition: color .2s, background-color .2s; opacity: .85;
}
.nav-links a:hover { opacity: 1; color: var(--accent); }
.nav-links a.active { opacity: 1; color: var(--accent); }
.nav-cta { margin-left: 8px; }
.nav-cta .btn { padding: 10px 20px; font-size: 14px; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; color: var(--nav-ink, var(--ink)); }
.nav-toggle svg { width: 26px; height: 26px; }

/* scrolled state - solid surface */
.nav.scrolled { background: var(--nav-bg); border-bottom-color: var(--line); box-shadow: var(--shadow-sm); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.nav.scrolled { --nav-ink: var(--ink); }

/* ============================================================
   HERO (base = split layout)
   ============================================================ */
.hero { position: relative; padding-top: 150px; padding-bottom: clamp(70px, 8vw, 120px); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(36px, 5vw, 80px); align-items: center; }
.hero-title { font-size: clamp(40px, 6.2vw, 80px); line-height: 1.02; letter-spacing: -0.02em; }
.hero-title .accent { color: var(--accent); }
.hero-lead { margin-top: 26px; font-size: clamp(18px, 1.9vw, 22px); line-height: 1.55; color: var(--ink-soft); max-width: 38ch; }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero-stats { margin-top: 48px; display: flex; gap: clamp(24px, 4vw, 52px); border-top: 1px solid var(--line); padding-top: 28px; }
.hero-stat .num { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(26px, 3vw, 36px); color: var(--ink); line-height: 1; }
.hero-stat .lbl { margin-top: 8px; font-size: 13px; color: var(--ink-faint); letter-spacing: .02em; }

.hero-media { position: relative; }
.hero-media figure { margin: 0; position: relative; border-radius: var(--media-radius); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 4/5; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-badge {
  position: absolute; left: 22px; bottom: 22px; right: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-md); backdrop-filter: blur(6px);
}
.hero-badge .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.hero-badge .t { font-size: 13.5px; line-height: 1.45; color: var(--ink-soft); }
.hero-badge .t b { color: var(--ink); font-weight: 600; }

/* ============================================================
   MISSION
   ============================================================ */
.mission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: start; }
.mission-statement { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(26px, 3.2vw, 40px); line-height: 1.22; letter-spacing: -0.01em; }
.mission-statement .accent { color: var(--accent); }
.mission-body p { color: var(--ink-soft); font-size: 18px; margin-bottom: 18px; }
.mission-body p:last-child { margin-bottom: 0; }
.pillars { margin-top: 30px; display: grid; gap: 2px; border-top: 1px solid var(--line); }
.pillar { display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.pillar .k { font-family: var(--font-display); color: var(--accent); font-size: 15px; font-weight: 600; flex: none; width: 30px; }
.pillar .v { font-size: 15.5px; color: var(--ink-soft); }
.pillar .v b { color: var(--ink); font-weight: 600; }

/* ============================================================
   RESEARCH
   ============================================================ */
.focus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--card-radius); overflow: hidden; }
.focus-card { background: var(--surface); padding: 32px 30px; display: flex; flex-direction: column; gap: 14px; transition: background-color .25s; }
.focus-card:hover { background: var(--bg-alt); }
.focus-card .idx { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 15px; color: var(--accent); letter-spacing: .04em; }
.focus-card h3 { font-size: 21px; line-height: 1.2; }
.focus-card p { color: var(--ink-soft); font-size: 15.5px; }

.capabilities { margin-top: clamp(40px, 5vw, 72px); display: grid; grid-template-columns: 0.85fr 0.85fr 1.3fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.cap-col h3 { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); font-family: var(--font-body); font-weight: 700; margin-bottom: 18px; }
.cap-list { display: flex; flex-direction: column; }
.cap-list li { list-style: none; display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; color: var(--ink); }
.cap-list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.cap-figure { border-radius: var(--media-radius); overflow: hidden; box-shadow: var(--shadow-md); position: relative; aspect-ratio: 4/3; }
.cap-figure img { width: 100%; height: 100%; object-fit: cover; }
.cap-figure figcaption { position: absolute; inset: auto 0 0 0; padding: 26px 18px 14px; font-size: 12.5px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.72)); }

/* ============================================================
   TEAM
   ============================================================ */
.lead-person { display: grid; grid-template-columns: 280px 1fr; gap: clamp(28px, 4vw, 56px); align-items: center; margin-bottom: clamp(48px, 6vw, 80px); padding-bottom: clamp(48px, 6vw, 80px); border-bottom: 1px solid var(--line); }
.lead-person .photo { border-radius: var(--media-radius); overflow: hidden; aspect-ratio: 1; box-shadow: var(--shadow-md); }
.lead-person .photo img { width: 100%; height: 100%; object-fit: cover; }
.lead-person h3 { font-size: clamp(26px, 3vw, 38px); margin-bottom: 6px; }
.lead-person .role { color: var(--accent); font-weight: 600; font-size: 16px; margin-bottom: 18px; }
.lead-person p { color: var(--ink-soft); font-size: 17px; max-width: 56ch; margin-bottom: 16px; }
.lead-links { display: flex; gap: 12px; flex-wrap: wrap; }
.lead-links a { font-size: 14px; font-weight: 600; color: var(--ink); border-bottom: 1.5px solid var(--accent); padding-bottom: 2px; transition: color .2s; }
.lead-links a:hover { color: var(--accent); }

.people-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(18px, 2vw, 28px); }
.person { text-align: left; }
.person .avatar { width: 100%; aspect-ratio: 1; border-radius: var(--card-radius); overflow: hidden; background: var(--bg-alt); margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.person .avatar img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.person:hover .avatar img { transform: scale(1.05); }
.person h4 { font-family: var(--font-display); font-size: 18px; margin-bottom: 3px; }
.person .role { font-size: 14px; color: var(--ink-faint); }

.subhead { font-family: var(--font-body); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; margin: clamp(48px,6vw,72px) 0 28px; display: flex; align-items: center; gap: 16px; }
.subhead::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.people-grid--alumni .avatar { border-radius: 50%; width: 96px; aspect-ratio: 1; margin-inline: 0; }
.people-grid--alumni { grid-template-columns: repeat(5, 1fr); gap: 22px; }
.people-grid--alumni .person { display: flex; align-items: center; gap: 14px; }
.people-grid--alumni .avatar { margin-bottom: 0; flex: none; }
.people-grid--alumni h4 { font-size: 15px; }
.people-grid--alumni .role { font-size: 12.5px; }

/* ============================================================
   PUBLICATIONS
   ============================================================ */
.pub-controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 36px; }
.pub-search { position: relative; flex: 1; min-width: 240px; }
.pub-search input {
  width: 100%; font-family: var(--font-body); font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--btn-radius);
  padding: 13px 16px 13px 44px; transition: border-color .2s, box-shadow .2s;
}
.pub-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.pub-search input::placeholder { color: var(--ink-faint); }
.pub-search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-faint); }
.pub-count { font-size: 14px; color: var(--ink-faint); white-space: nowrap; }
.year-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.year-chips button {
  font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink-soft); transition: all .18s;
}
.year-chips button:hover { border-color: var(--accent); color: var(--accent); }
.year-chips button.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* --- Horizontal year-scroller --- */
#pubList {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  gap: 0;
  padding-bottom: 18px;
  margin-top: 30px;
}
#pubList::-webkit-scrollbar { height: 4px; }
#pubList::-webkit-scrollbar-track { background: var(--line); border-radius: 99px; }
#pubList::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 99px; }

.pub-year-group {
  flex: 0 0 min(420px, calc(100vw - 48px));
  min-width: 0;
  scroll-snap-align: start;
  padding-right: 32px;
  margin-right: 32px;
  border-right: 1px solid var(--line);
}
.pub-year-group:last-child { border-right: none; padding-right: 0; margin-right: 0; }

/* Search mode: revert to vertical list */
#pubList.is-searching {
  display: block;
  overflow-x: visible;
  padding-bottom: 0;
}
#pubList.is-searching .pub-year-group {
  flex: none;
  padding-right: 0;
  margin-right: 0;
  border-right: none;
  margin-bottom: 14px;
}

.pub-year-head { display: flex; align-items: baseline; gap: 16px; padding: 16px 0 14px; background: var(--bg); }
.section--alt .pub-year-head { background: var(--bg-alt); }
.pub-year-head .yr { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 28px; color: var(--accent); }
.pub-year-head .ln { height: 1px; background: var(--line); flex: 1; }
.pub-year-head .ct { font-size: 12.5px; color: var(--ink-faint); }
.pub-item { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr; gap: 5px; }
.pub-item .title { font-size: 16.5px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.pub-item .meta { font-size: 14px; color: var(--ink-soft); }
.pub-item .meta .au b { color: var(--ink); font-weight: 600; }
.pub-item .meta .venue { font-style: italic; color: var(--ink-soft); }
.pub-item .tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--line-strong); padding: 2px 8px; border-radius: 5px; margin-right: 8px; }
.pub-empty { padding: 40px 0; text-align: center; color: var(--ink-faint); }

/* ============================================================
   TEACHING
   ============================================================ */
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 2.5vw, 30px); }
.course {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--card-radius);
  padding: 32px 30px; display: flex; flex-direction: column; gap: 14px; transition: transform .25s, box-shadow .25s, border-color .25s;
}
.course:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.course .ico { width: 46px; height: 46px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, transparent); display: grid; place-items: center; color: var(--accent); margin-bottom: 6px; }
.course .ico svg { width: 24px; height: 24px; }
.course h3 { font-size: 22px; }
.course p { color: var(--ink-soft); font-size: 15.5px; flex: 1; }
.course .lnk { font-size: 14px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 7px; }
.course .lnk svg { width: 15px; height: 15px; transition: transform .2s; }
.course:hover .lnk svg { transform: translate(3px,-3px); }
.course--soon { opacity: .82; }
.course--soon .badge { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }

/* ============================================================
   JOIN / CTA
   ============================================================ */
.join-band {
  background: var(--cta-bg); color: var(--cta-ink); border-radius: var(--card-radius);
  padding: clamp(48px, 6vw, 80px) clamp(40px, 6vw, 90px); position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center;
}
.join-band::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 40%, transparent), transparent 70%); pointer-events: none; }
.join-band .eyebrow { color: var(--accent); }
.join-band h2 { font-size: clamp(28px, 3.6vw, 44px); color: var(--cta-ink); margin-bottom: 16px; position: relative; }
.join-band p { color: color-mix(in srgb, var(--cta-ink) 78%, transparent); font-size: 18px; position: relative; }
.join-actions { display: flex; flex-direction: column; gap: 14px; position: relative; }
.join-actions .btn { justify-content: center; }
.join-note { font-size: 13.5px; color: color-mix(in srgb, var(--cta-ink) 60%, transparent); text-align: center; }

/* ============================================================
   PARTNERS (funding + collaborators)
   ============================================================ */
.partner-block + .partner-block { margin-top: clamp(44px, 5vw, 64px); }
.partner-block h3 { font-family: var(--font-body); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; text-align: center; margin-bottom: 30px; }
.logo-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(28px, 4vw, 56px); }
.logo-row img { height: 46px; width: auto; max-width: 150px; object-fit: contain; opacity: .62; filter: var(--logo-filter); transition: opacity .25s, filter .25s; }
.logo-row img:hover { opacity: 1; filter: none; }
.logo-chip { background: #fff; padding: 10px 14px; border-radius: 10px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--footer-bg); color: var(--footer-ink); padding: clamp(60px, 7vw, 96px) 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(32px, 4vw, 64px); }
.footer .brand-name { color: var(--footer-ink); }
.footer-about { font-size: 15px; color: color-mix(in srgb, var(--footer-ink) 70%, transparent); max-width: 38ch; margin-top: 20px; }
.footer h4 { font-family: var(--font-body); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: color-mix(in srgb, var(--footer-ink) 55%, transparent); margin-bottom: 18px; }
.footer-col p, .footer-col a { font-size: 15px; color: color-mix(in srgb, var(--footer-ink) 82%, transparent); line-height: 1.7; }
.footer-col a { transition: color .2s; }
.footer-col a:hover { color: var(--accent); }
.footer-divider { height: 1px; background: color-mix(in srgb, var(--footer-ink) 16%, transparent); margin: clamp(44px,5vw,64px) 0 28px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; color: color-mix(in srgb, var(--footer-ink) 50%, transparent); }

/* ============================================================
   reveal animation
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
  .reveal.in { opacity: 1; transform: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-media { max-width: 460px; }
  .mission-grid { grid-template-columns: 1fr; gap: 40px; }
  .focus-grid { grid-template-columns: repeat(2, 1fr); }
  .capabilities { grid-template-columns: 1fr 1fr; }
  .cap-figure { grid-column: 1 / -1; aspect-ratio: 16/7; }
  .people-grid { grid-template-columns: repeat(3, 1fr); }
  .people-grid--alumni { grid-template-columns: repeat(3, 1fr); }
  .course-grid { grid-template-columns: 1fr 1fr; }
  .join-band { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .nav.menu-open { background: var(--nav-bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm); backdrop-filter: blur(14px); }
  .nav.menu-open .nav-links {
    display: flex; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0;
    background: var(--nav-bg); border-bottom: 1px solid var(--line); padding: 12px 24px 22px; gap: 2px; box-shadow: var(--shadow-md); backdrop-filter: blur(14px);
  }
  .nav.menu-open { --nav-ink: var(--ink); }
  .nav.menu-open .nav-links a { padding: 13px 8px; border-bottom: 1px solid var(--line); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .lead-person { grid-template-columns: 1fr; text-align: center; }
  .lead-person .photo { max-width: 220px; margin: 0 auto; }
  .lead-links { justify-content: center; }
  .focus-grid { grid-template-columns: 1fr; }
  .capabilities { grid-template-columns: 1fr; }
  .people-grid { grid-template-columns: repeat(2, 1fr); }
  .people-grid--alumni { grid-template-columns: 1fr; }
  .course-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 22px; }
}
