/* ============================================================
   PAL Lab — Physical Active Learning Laboratory at Stanford
   Visual identity derived from pal.png
   No build step. No framework.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;1,700&display=swap');

/* ── Palette & tokens ───────────────────────────────────── */
:root {
  /* Spectrum from pal.png dot grid (left → right) */
  --blue:         #2E6DC4;
  --cyan:         #1ABCCC;
  --teal:         #28B8A0;
  --green:        #5BC85A;
  --ygreen:       #9DD448;
  --yellow:       #E8D44C;

  /* Charcoal from PAL logotype */
  --charcoal:     #363D4A;

  /* Surfaces */
  --bg:           #f2fbf5;
  --bg-card:      #ffffff;
  --bg-soft:      #e6f7ec;
  --border:       #d4ead9;

  /* Text */
  --text:         #363D4A;
  --text-soft:    #5A6580;
  --text-faint:   #8A94A8;

  /* Primary accent = teal (center of spectrum = Physical Active Learning) */
  --accent:       #28B8A0;
  --accent-soft:  #e8f8f5;
  --accent-deep:  #1d907e;

  /* Spectrum gradient shorthand */
  --spectrum: linear-gradient(90deg,
    #2E6DC4 0%, #1ABCCC 22%, #28B8A0 42%,
    #5BC85A 62%, #9DD448 80%, #E8D44C 100%);

  --radius:     14px;
  --radius-sm:  9px;
  --maxw:       1000px;
  --shadow:     0 1px 3px rgba(40,50,80,.06), 0 8px 28px rgba(40,50,80,.09);
  --shadow-sm:  0 1px 2px rgba(40,50,80,.05), 0 3px 10px rgba(40,50,80,.07);
  --header-bg:  rgba(255,255,255,.92);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: clamp(15px, 0.94rem + 0.15vw, 17px);
  line-height: 1.68;
  color: var(--text);
  background: linear-gradient(170deg, #f7fdf9 0%, #eef9f3 45%, #e8f7ed 100%) fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img  { max-width: 100%; height: auto; display: block; }
a    { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  line-height: 1.13;
  color: var(--charcoal);
  letter-spacing: -0.03em;
  margin: 0 0 0.5em;
}

.wrap {
  width: 100%; max-width: var(--maxw);
  margin: 0 auto; padding: 0 36px;
}

/* ── Spectrum bar ────────────────────────────────────────── */
.spectrum-bar {
  height: 3px;
  background: var(--spectrum);
  border: none;
  margin: 0;
}

/* ── Navigation ──────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.nav-logo img { height: 36px; width: auto; }
.nav-logo:hover { opacity: 0.82; text-decoration: none; }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  display: block; color: var(--text-soft);
  font-size: 0.875rem; font-weight: 500;
  padding: 7px 12px; border-radius: 8px;
  transition: color .14s, background .14s;
}
.nav-links a:hover { color: var(--charcoal); background: var(--bg-soft); text-decoration: none; }
.nav-links a.active { color: var(--accent-deep); background: var(--accent-soft); font-weight: 600; }
.nav-links .nav-contact {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--teal); color: #fff; border-radius: 9px;
  padding: 7px 14px; margin-left: 6px; font-weight: 600; font-size: 0.875rem;
  transition: background .14s;
}
.nav-links .nav-contact:hover { background: var(--accent-deep); text-decoration: none; color: #fff; }

.nav-mobile-btn {
  display: none; padding: 8px; background: none;
  border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; color: var(--text-soft);
}
.nav-mobile-btn svg { display: block; }

/* Mobile overlay */
.mobile-nav {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(247,249,252,.97);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  flex-direction: column; align-items: center; justify-content: center; gap: 2.2rem;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-size: 1.6rem; font-weight: 800; color: var(--charcoal);
  letter-spacing: -0.03em;
}
.mobile-nav a:hover { color: var(--accent-deep); text-decoration: none; }
.mobile-nav-close {
  position: absolute; top: 18px; right: 18px;
  background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px; cursor: pointer; color: var(--text-soft);
}

@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav-mobile-btn { display: block; }
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  padding: 24px 0 12px;
}

.hero-lockup {
  display: flex; align-items: flex-start;
  width: fit-content; margin: 0 auto;
}
.hero-symbol {
  height: calc(3.3 * clamp(1.75rem, 1.1rem + 2.4vw, 2.9rem));
  width: auto; flex-shrink: 0; object-fit: contain;
}
.hero-sep {
  width: 1px;
  height: calc(3.3 * clamp(1.75rem, 1.1rem + 2.4vw, 2.9rem));
  background: #c0c8d4; flex-shrink: 0; margin: 0 24px;
}
.hero h1 {
  font-size: clamp(1.75rem, 1.1rem + 2.4vw, 2.9rem);
  margin: 0; line-height: 1.1; text-align: left;
}
.hero h1 em {
  font-style: normal;
  background: var(--spectrum);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; margin-top: 18px;
}
.hero-affiliation {
  font-size: 0.85rem; color: var(--text-soft);
  margin: 0; letter-spacing: 0.03em; text-align: center;
}
.hero-affiliation a { color: var(--text-soft); text-decoration: none; }
.hero-affiliation a:hover { color: var(--accent-deep); }
.hero-tagline {
  font-size: 1.02rem; color: var(--text-soft);
  margin: 0; line-height: 1.6; max-width: 52ch; text-align: center;
}

@media (max-width: 600px) {
  .hero-lockup { align-items: center; }
  .hero-symbol { height: 52px; }
  .hero-sep { height: 52px; margin: 0 14px; }
  .hero h1 { font-size: 1.3rem; }
}

@media (max-width: 480px) {
  /* Carousel: tighter padding so video and controls stay in sync on small phones */
  .carousel-slide { min-width: calc(100vw - 32px); }
  .carousel .wrap { padding: 0 16px; }
}

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

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 17px; border-radius: 10px;
  font-size: 0.9rem; font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--bg-card); color: var(--text);
  cursor: pointer; white-space: nowrap;
  transition: border-color .14s, background .14s, color .14s;
  text-decoration: none;
}
.btn:hover {
  border-color: var(--accent); background: var(--accent-soft);
  color: var(--accent-deep); text-decoration: none;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn.primary {
  background: var(--teal); border-color: var(--teal); color: #fff;
}
.btn.primary:hover {
  background: var(--accent-deep); border-color: var(--accent-deep); color: #fff;
}

/* ── Sections ────────────────────────────────────────────── */
section { padding: 36px 0; scroll-margin-top: 66px; }
section + section { border-top: 1px solid var(--border); }
#featured { border-top: none; background: var(--bg-card); padding: 28px 0; overflow: hidden; }

.section-label {
  font-size: 0.71rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--teal); margin: 0 0 14px;
}
.section-title {
  font-size: clamp(1.55rem, 1.1rem + 1.9vw, 2.35rem);
  margin: 0 0 10px;
}
.section-lead {
  color: var(--text-soft); font-size: 1.02rem;
  max-width: 60ch; margin: 0 0 32px; line-height: 1.7;
}
.text-section p { color: var(--text-soft); }

/* ── Carousel ────────────────────────────────────────────── */
.carousel { position: relative; }
.carousel-viewport { width: 100%; }
.carousel-track {
  display: flex;
  gap: 20px;
  transition: transform .55s cubic-bezier(.22,.61,.36,1);
}
.carousel-slide {
  min-width: min(936px, calc(100vw - 64px));
  flex-shrink: 0;
  filter: blur(1.5px);
  opacity: 0.65;
  transition: filter .5s ease, opacity .5s ease;
}
.carousel-slide.active {
  filter: blur(0);
  opacity: 1;
}
.slide-media {
  aspect-ratio: 16 / 9; width: 100%;
  background: #0a0e14; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.slide-media video { width: 100%; height: 100%; object-fit: cover; display: block; }

.carousel-bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; margin-top: 18px;
}
.carousel-caption { min-height: 48px; position: relative; flex: 1; }
.carousel-cap-item {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  transition: opacity .4s ease;
}
.carousel-cap-item.active { opacity: 1; pointer-events: auto; position: relative; }
.carousel-cap-item h3 { font-size: 1.15rem; margin: 0; color: var(--charcoal); }
.carousel-cap-item h3 a { color: var(--charcoal); text-decoration: none; }
.carousel-cap-item h3 a:hover { color: var(--accent-deep); text-decoration: underline; }
.slide-link { display: block; }

.carousel-nav { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.carousel-dots { display: flex; gap: 7px; }
.carousel-dot {
  width: 8px; height: 8px; border-radius: 50%; padding: 0;
  border: none; background: var(--border); cursor: pointer;
  transition: background .2s, transform .2s;
}
.carousel-dot.active { background: var(--teal); transform: scale(1.25); }
.carousel-btns { display: flex; gap: 8px; }
.carousel-ctrl {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--bg-card);
  color: var(--text-soft); cursor: pointer;
  transition: border-color .14s, color .14s, background .14s;
}
.carousel-ctrl:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.carousel-ctrl svg { width: 18px; height: 18px; }

@media (max-width: 560px) {
  .carousel-bottom { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ── News ────────────────────────────────────────────────── */
.news-list { list-style: none; margin: 12px 0 0; padding: 0; }
.news-item {
  display: grid; grid-template-columns: 78px 1fr;
  gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: none; }
.news-date {
  font-size: 0.76rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-faint); padding-top: 3px;
  white-space: nowrap;
}
.news-body { margin: 0; color: var(--text); }
.news-body a { color: var(--accent-deep); }
.news-tag {
  display: inline-block; background: var(--teal); color: #fff;
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: 5px; margin-right: 7px; vertical-align: 2px;
}

/* ── Publications ────────────────────────────────────────── */
.pub-year-group { margin-bottom: 4px; }

.pub-year-heading {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--text-faint);
  padding: 22px 0 10px; border-bottom: 2px solid var(--border);
  margin: 0 0 4px;
}
.pub {
  padding: 15px 0; border-bottom: 1px solid var(--border);
}
.pub:last-child { border-bottom: none; }

.pub-title {
  display: block; font-weight: 700; color: var(--charcoal);
  font-size: 0.97rem; margin-bottom: 4px; line-height: 1.4;
}
.pub-authors { color: var(--text-soft); font-size: 0.88rem; margin-bottom: 2px; }
.pub-authors strong { color: var(--charcoal); font-weight: 700; }
.pub-venue { color: var(--text-soft); font-size: 0.88rem; font-style: italic; }
.pub-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }

.tag {
  display: inline-flex; align-items: center;
  padding: 3px 11px; border-radius: 6px;
  font-size: 0.73rem; font-weight: 700; color: #fff;
  letter-spacing: 0.02em; transition: opacity .14s;
  text-decoration: none;
}
.tag:hover { opacity: .80; text-decoration: none; }
.tag.pdf     { background: #2f8f4e; }
.tag.bib     { background: #2E6DC4; }
.tag.article { background: #c98a1a; }
.tag.vid     { background: #7a4fb0; }
.tag.code    { background: #b4453a; }
.tag.thesis  { background: #5A6580; }

/* ── People grid ─────────────────────────────────────────── */
.people-grid {
  display: grid;
  grid-template-columns: repeat(4, 140px);
  gap: 20px; margin-top: 16px;
}
/* ── PI featured card ────────────────────────────────────── */
a.pi-card {
  display: flex; align-items: flex-start; gap: 28px;
  max-width: 680px; margin: 20px auto 0;
  text-decoration: none; color: inherit;
}
.pi-photo-col { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.pi-photo-wrap { overflow: hidden; border-radius: var(--radius-sm); }
.pi-photo-label { font-size: 0.8rem; color: var(--text-soft); margin: 6px 0 0; text-align: center; }
.pi-photo {
  width: 150px; height: 150px;
  object-fit: cover; object-position: top center; display: block;
  border: 1px solid var(--border);
  transition: transform 0.25s ease;
}
a.pi-card:hover .pi-photo { transform: scale(1.05); }
.pi-bio { flex: 1; text-align: left; }
.pi-name { font-size: 1rem; font-weight: 700; color: var(--charcoal); margin: 0 0 2px; line-height: 1.3; }
.pi-role { font-size: 0.83rem; color: var(--teal); font-weight: 600; margin: 0 0 10px; }
.pi-text { font-size: 0.9rem; color: var(--text-soft); margin: 0; line-height: 1.65; }
@media (max-width: 520px) {
  a.pi-card { flex-direction: column; align-items: center; }
  .pi-bio { text-align: left; width: 100%; }
}

/* ── Lab member grid (future) ────────────────────────────── */
a.person-card { text-decoration: none; color: inherit; }
.person-photo-wrap {
  overflow: hidden; border-radius: var(--radius-sm); margin-bottom: 8px;
}
.person-photo {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: top center;
  display: block; border: 1px solid var(--border);
  transition: transform 0.25s ease;
}
.person-card:hover .person-photo { transform: scale(1.05); }
.person-name {
  font-size: 0.88rem; font-weight: 700; color: var(--charcoal);
  margin: 0 0 2px; line-height: 1.3;
}
.person-role { font-size: 0.8rem; color: var(--text-soft); margin: 0; }
.people-join { margin-top: 20px; font-size: 0.88rem; color: var(--text-soft); }

/* ── Overview card ───────────────────────────────────────── */
.overview-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 32px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.overview-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--spectrum);
}
.overview-card .section-title { margin-bottom: 10px; }
.overview-card p { color: var(--text-soft); margin: 0; }

/* ── Join callout ─────────────────────────────────────────── */
.join-callout {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 36px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow); margin-top: 36px;
}
.join-callout::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--spectrum);
}
.join-callout h3 { font-size: 1.25rem; margin: 0 0 10px; }
.join-callout p  { color: var(--text-soft); margin: 0 0 18px; }

/* ── Contact ─────────────────────────────────────────────── */
.contact-block { margin-bottom: 32px; }
.contact-block:last-child { margin-bottom: 0; }
.contact-block h3 { font-size: 1.05rem; margin: 0 0 8px; }
.contact-block p { color: var(--text-soft); margin: 0 0 14px; max-width: 70ch; }

.funding-list {
  list-style: none; margin: 4px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 9px;
}
.funding-list li { display: flex; align-items: baseline; gap: 9px; }
.funding-list li::before {
  content: '→'; color: var(--teal); font-weight: 700; flex-shrink: 0;
}
.funding-list a { color: var(--accent-deep); font-weight: 500; }
.funding-list a:hover { text-decoration: underline; }

/* ── Page hero (inner pages) ──────────────────────────────── */
.page-hero {
  padding: 56px 0 48px;
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.page-hero-dots {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(28,188,204,0.12) 2px, transparent 2px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 60% 100% at 100% 50%, black 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 100% at 100% 50%, black 10%, transparent 70%);
}
.page-hero .wrap { position: relative; }
.page-hero h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3.1rem); margin: 0 0 14px; }
.page-hero .lead {
  color: var(--text-soft); max-width: 60ch; font-size: 1.06rem; margin: 0; line-height: 1.7;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border); background: var(--bg-soft);
  padding: 30px 0; margin-top: 4px;
  color: var(--text-faint); font-size: 0.88rem;
}
.foot-inner {
  display: flex; flex-wrap: wrap;
  justify-content: space-between; gap: 12px; align-items: center;
}
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { color: var(--text-soft); }
.foot-links a:hover { color: var(--accent-deep); text-decoration: none; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  section { padding: 28px 0; }
  .news-item { grid-template-columns: 1fr; gap: 4px; }
  .news-date { padding-top: 0; }
  .people-grid { grid-template-columns: repeat(3, 1fr); width: 100%; }
  .slide-media { max-height: 175px; }
}
