/* ─── RESET ─────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-padding-top: 90px;
  scroll-behavior: smooth;
}

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --brand-purple:  #667eea;
  --brand-violet:  #764ba2;
  --brand-teal:    #00c4d8;
  --text-dark:     #1a1a2e;
  --text-body:     #444;
  --text-muted:    #666;
  --bg-light:      #f8f9fc;
  --bg-white:      #ffffff;
  --border:        #e2e8f0;
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.10);
  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-pill:   50px;
  --max-w:         1100px;
  --section-pad:   5rem 1.5rem;
}

/* ─── BASE ───────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.75;
  color: var(--text-body);
  background: var(--bg-white);
}

a {
  color: var(--brand-purple);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand-violet);
}

img {
  display: block;
  max-width: 100%;
}

ul {
  list-style: disc;
  padding-left: 1.5rem;
  color: var(--text-body);
  margin-bottom: 1.25rem;
}

ul li {
  margin-bottom: 0.5rem;
}

/* ─── HEADER ─────────────────────────────────────────────── */
header {
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 0 2rem;
  height: 72px;
  display: flex;
  align-items: center;
}

.header-content {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  height: 48px;
  width: auto;
}

/* ─── NAV ────────────────────────────────────────────────── */
nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

nav a {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

nav a:hover {
  background: #f0f4ff;
  color: var(--brand-purple);
}

/* CHANGED: .nav-cta styles removed since the Login button is gone from the nav */

/* ─── MOBILE MENU ────────────────────────────────────────── */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  width: 28px;
  height: 22px;
  gap: 5px;
  background: none;
  border: none;
  padding: 0;
}

.menu-toggle span {
  display: block;
  height: 2.5px;
  width: 100%;
  background: var(--text-dark);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  nav {
    position: absolute;
    top: 72px;
    right: 0;
    left: 0;
    background: var(--bg-white);
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
    gap: 0;
  }

  nav.open {
    max-height: 400px;
  }

  nav a {
    padding: 1rem 1.5rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
  }
}

/* ─── HERO CAROUSEL ──────────────────────────────────────── */
.hero-carousel {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  overflow: hidden;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center; /* CHANGED: center the active (relative) panel horizontally */
}

.hero-carousel::before,
.hero-carousel::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  pointer-events: none;
}

.hero-carousel::before {
  width: 500px;
  height: 500px;
  top: -150px;
  right: -100px;
  background: var(--brand-purple);
}

.hero-carousel::after {
  width: 350px;
  height: 350px;
  bottom: -100px;
  left: -80px;
  background: var(--brand-teal);
}

.hero-panel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 5rem 7rem;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.hero-panel.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
  width: 100%; /* CHANGED: ensure active panel spans full width so inner centering works */
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.hero-inner h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: #cbd5e1;
  max-width: 640px;
  margin: 0 auto 1.5rem; /* CHANGED: explicit left/right auto ensures paragraph is centered within hero-inner */
  line-height: 1.7;
  text-align: center; /* CHANGED: explicit center in case inherited styles override */
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* ─── CAROUSEL CONTROLS ──────────────────────────────────── */
.carousel-controls {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  z-index: 10;
}

.carousel-dot {
  background: rgba(255,255,255,0.25);
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: var(--radius-pill);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.9rem;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
  white-space: nowrap;
}

.carousel-dot:hover {
  background: rgba(255,255,255,0.35);
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}

.carousel-dot.active {
  background: var(--brand-purple);
  border-color: var(--brand-purple);
  color: #fff;
}

.dot-label {
  pointer-events: none;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}

.carousel-arrow:hover {
  background: rgba(255,255,255,0.25);
}

.carousel-prev { left: 1rem; }
.carousel-next { right: 1rem; }

@media (max-width: 600px) {
  .carousel-arrow { display: none; }

  .hero-panel {
    padding: 4rem 1.5rem 7rem;
  }

  .carousel-dot {
    font-size: 0.65rem;
    padding: 0.25rem 0.65rem;
  }
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.85rem 2.25rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-violet));
  color: #fff;
  box-shadow: 0 4px 15px rgba(102,126,234,0.45);
}

.btn-primary:hover {
  box-shadow: 0 8px 25px rgba(102,126,234,0.6);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.7);
  color: #fff;
}

/* ─── SECTION WRAPPER ────────────────────────────────────── */
.section-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--section-pad);
}

.section-title {
  color: var(--text-dark);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

.section-title-accent {
  display: block;
  width: 48px;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-purple), var(--brand-teal));
  border-radius: 2px;
  margin: 0.6rem auto 2.5rem;
}

/* ─── ABOUT SECTION ──────────────────────────────────────── */
#about {
  background: var(--bg-white);
}

/* ─── HIGHLIGHT BLOCK ────────────────────────────────────── */
.highlight {
  background: #f5f3ff;
  border-left: 4px solid var(--brand-purple);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}

.highlight p {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: var(--text-body);
}

.highlight p:last-child {
  margin-bottom: 0;
}

.highlight ul {
  margin-bottom: 0;
}

/* ─── ABOUT SUBSECTIONS ──────────────────────────────────── */
.about-block {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

.about-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.about-block-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-purple);
  margin-bottom: 1rem;
}

.about-block-label::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--brand-purple);
  border-radius: 1px;
}

.about-block h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.about-block p {
  font-size: 1.05rem;
  color: var(--text-body);
  margin-bottom: 1rem;
}

.about-block p:last-child {
  margin-bottom: 0;
}

/* ─── DIVIDER ────────────────────────────────────────────── */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ─── PROJECTS SECTION ───────────────────────────────────── */
#projects {
  background: var(--bg-light);
}

.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-white);
  margin-bottom: 1.25rem;
  overflow: hidden;
  transition: box-shadow 0.25s;
}

.project-card:last-child {
  margin-bottom: 0;
}

.project-card.open {
  box-shadow: var(--shadow-md);
}

.project-toggle {
  width: 100%;
  background: none;
  border: none;
  padding: 1.5rem 1.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  transition: background 0.2s;
}

.project-toggle:hover {
  background: #f5f3ff;
}

.project-toggle-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.project-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand-purple);
  opacity: 0.35;
  line-height: 1;
  min-width: 2rem;
}

.project-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 0.2rem;
}

.project-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.project-chevron {
  font-size: 1.4rem;
  color: var(--brand-purple);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.project-card.open .project-chevron {
  transform: rotate(180deg);
}

.project-body {
  padding: 0 1.75rem 1.75rem;
  border-top: 1px solid var(--border);
}

.project-body p {
  font-size: 1.05rem;
  color: var(--text-body);
  margin-bottom: 1rem;
  margin-top: 1.25rem;
}

.project-body ul {
  margin-bottom: 1.5rem;
}

.project-login-block {
  background: #f5f3ff;
  border-left: 4px solid var(--brand-purple);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.5rem 1.75rem;
  margin-top: 1.5rem;
}

.project-login-block h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.6rem;
}

.project-login-block p {
  font-size: 1rem;
  color: var(--text-body);
  margin: 0 0 1.25rem;
}

.project-login-block .btn {
  margin-bottom: 1rem;
}

.login-note {
  font-size: 0.92rem !important;
  color: var(--text-muted) !important;
  margin-top: 0.75rem !important;
  margin-bottom: 0 !important;
}

/* ─── GRANTS & NEWS SECTION ──────────────────────────────── */
/* CHANGED: New — alternating bg keeps visual rhythm with projects */
#grants {
  background: var(--bg-white);
}

/* ─── SUBSCRIBE SECTION ──────────────────────────────────── */
#subscribe {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
}

#subscribe .section-title {
  color: #fff;
}

#subscribe .section-title-accent {
  background: linear-gradient(90deg, var(--brand-teal), var(--brand-purple));
}

#subscribe p {
  color: #cbd5e1;
}

.action-section-inner {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.action-section-inner p {
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

/* ─── TEAM SECTION ───────────────────────────────────────── */

#contact {
  background: var(--bg-light);
}

#contact p {
  font-size: 1.05rem;
  color: var(--text-body);
  margin-bottom: 1.2rem;
}

#contact .team-text {
  text-align: center;
}

/* ─── PRESS / TALKS / FUNDING BLOCKS ────────────────────── */
.press-block {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

.press-block:last-child {
  margin-bottom: 0;
}

.press-block .press-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-purple);
  margin-bottom: 0.75rem;
}

.press-block p {
  font-size: 0.98rem;
  color: var(--text-body);
  margin: 0 0 0.75rem;
}

.press-block p:last-child {
  margin-bottom: 0;
}

/* ─── FOOTER ─────────────────────────────────────────────── */
footer {
  background: #0f172a;
  color: #94a3b8;
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.9rem;
}

footer a {
  color: #94a3b8;
}

footer a:hover {
  color: #fff;
}