/* ===========================================================
   CADIO Lab — shared stylesheet
   Edit the variables below to re-theme the whole site.
   =========================================================== */

:root {
  --ink: #0a0a0a;          /* near-black text + logo color   */
  --ink-soft: #4a4a4a;     /* secondary text                 */
  --line: #e6e6e6;         /* hairline borders               */
  --bg: #ffffff;           /* page background                */
  --bg-soft: #f6f6f6;      /* alternating section background  */
  --accent: #6d28d9;       /* single accent (links, buttons) */
  --maxw: 1080px;          /* content width                  */
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, "Apple Color Emoji", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

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

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

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

.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 38px; height: 38px; border-radius: 50%; }
.brand span { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 500;
}
.nav-links a:hover { background: var(--bg-soft); text-decoration: none; }
.nav-links a.active { color: var(--accent); background: var(--bg-soft); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 1.1rem;
}

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 64px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: #f7f5ff;
}
.hero img.logo { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 28px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 12px; letter-spacing: -0.02em; }
.hero p.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 640px; margin: 0 auto 10px; }

/* ---------- Page header (sub-pages) ---------- */
.page-head { padding: 64px 0 32px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 8px; letter-spacing: -0.02em; }
.page-head p { color: var(--ink-soft); font-size: 1.1rem; margin: 0; max-width: 680px; }

/* ---------- Generic sections ---------- */
section.block { padding: 56px 0; }
section.block.alt { background: var(--bg-soft); }
section.block h2 { font-size: 1.6rem; margin: 0 0 16px; letter-spacing: -0.01em; }
.prose p { color: var(--ink-soft); max-width: 720px; }
.prose ul { color: var(--ink-soft); max-width: 720px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  margin-top: 8px;
}
.btn:hover { text-decoration: none; opacity: 0.9; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

/* ---------- Card grids (people + applets) ---------- */
.grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-top: 8px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 22px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* People card */
.person { text-align: center; }
.person img,
.person .avatar {
  width: 104px; height: 104px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 14px;
  background: var(--bg-soft);
}
.person .avatar {
  display: flex; align-items: center; justify-content: center;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: 0.02em;
}
.person h3 { margin: 0 0 2px; font-size: 1.1rem; }
.person .role { color: var(--accent); font-size: 0.92rem; font-weight: 600; }
.person .affil { color: var(--ink-soft); font-size: 0.86rem; margin: 8px 0 0; }
.person .bio { color: var(--ink-soft); font-size: 0.9rem; margin: 10px 0 0; }
.person .links { margin-top: 12px; display: flex; gap: 12px; justify-content: center; font-size: 0.88rem; }

/* Compact card for the large ambassador roster */
.grid.compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.grid.compact .card { padding: 18px; }
.grid.compact .avatar { width: 76px; height: 76px; font-size: 1.25rem; }
.grid.compact h3 { font-size: 1rem; }

/* Applet card */
.applet h3 { margin: 0 0 8px; font-size: 1.2rem; }
.applet p { color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 16px; }
.applet .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.applet .tag {
  font-size: 0.75rem; font-weight: 600;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 3px 10px; border-radius: 999px;
}
.applet .mirror-note { font-size: 0.82rem; color: var(--ink-soft); margin: 0 0 12px; }
.applet .launch-row { display: flex; flex-wrap: wrap; gap: 10px; }
.applet .launch-row .btn { margin-top: 0; }

/* Section label for grouping people */
.group-label {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-soft);
  margin: 40px 0 4px;
}
.group-label:first-of-type { margin-top: 8px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  margin-top: 24px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
}

/* ---------- Faculty profile ---------- */

.faculty-profile {
    display: flex;
    align-items: flex-start;
    gap: 32px;
}

.faculty-photo {
    width: 240px;
    height: 240px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.faculty-info {
    flex: 1;
}

.faculty-info h2 {
    margin: 0 0 6px;
    font-size: 2rem;
}

.faculty-title {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 18px;
}

.faculty-info p {
    color: var(--ink-soft);
    margin-bottom: 14px;
}

@media (max-width: 720px) {

    .faculty-profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

.faculty-photo {
    width: 240px !important;
    height: 240px !important;
    max-width: 240px !important;
    max-height: 240px !important;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

}

.carousel {
    position: relative;
    max-width: 700px;
    margin: 40px auto;
    transition: height 0.4s ease;
}

.slide {
    display: none;
}

.slide.active {
    display: block;
}

.slide img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 550px;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.caption {
    margin-top: 12px;
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.95rem;
    font-style: italic;
}
.prev,
.next {
    position: absolute;
    top: 42%;
    transform: translateY(-50%);
    border: none;
    background: rgba(255,255,255,.85);
    font-size: 2rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
}

.prev {
    left: -20px;
}

.next {
    right: -20px;
}

.prev:hover,
.next:hover {
    background: white;
}

.about-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

/* Left column (text) */
.about-text {
  flex: 1.1;
}

/* Right column (carousel) */
.about-layout .carousel {
  flex: 1;
  max-width: 520px;
  margin: 0;
}

/* Responsive: stack on mobile */
@media (max-width: 900px) {
  .about-layout {
    flex-direction: column;
  }

  .about-layout .carousel {
    max-width: 100%;
  }
}

.about-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.about-text {
  flex: 1.2;
}

.about-layout .carousel {
  flex: 1;
  max-width: 520px;
  position: relative;
}

/* mobile stacking */
@media (max-width: 900px) {
  .about-layout {
    flex-direction: column;
  }

  .about-layout .carousel {
    max-width: 100%;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.research-areas {
  margin: 6px auto 56px;
  font-size: 0.95rem;
  color: #6d28d9;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}

.research-areas span::after {
  content: "•";
  margin: 0 10px;
  color: #bbb;
}

.research-areas span:last-child::after {
  content: "";
}
