/* Root Variables */
:root {
  --primary: #3C2F7F;
  --primary-dark: #2a1f5a;
  --primary-light: #5a4fa0;
  --secondary: #2a1f5a; /* darker blue accent */
  --secondary-light: #5a76e8; /* lighter royal */
  --accent: #10b981;
  --text-dark: #1a1a1a;
  --text-light: #4a4a4a; /* darker for improved contrast */
  --text-lighter: #999999;
  --border-light: #e5e7eb;
  --bg-light: #f9fafb;
  --bg-lighter: #f3f4f6;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.12);
}

/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-dark);
  letter-spacing: -0.01em;
}

h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

h4 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-light);
  line-height: 1.8;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
}

/* Skip Link */
.skip {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: var(--white);
  padding: 8px 16px;
  z-index: 100;
  border-radius: 0 0 4px 0;
  font-weight: 600;
}

.skip:focus {
  top: 0;
}

/* Header & Navigation */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex: 1;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.8;
}

.logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.navlinks {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  flex: 1;
}

.navlinks a {
  color: var(--text-dark);
  font-weight: 500;
  position: relative;
  transition: color 0.2s ease;
  font-size: 0.95rem;
}

.navlinks a:hover,
.navlinks a[aria-current="page"] {
  color: var(--primary);
}

.navlinks a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}

.ctas {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dark);
  padding: 0.5rem;
  line-height: 1;
}

.mobile-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  padding: 1rem;
  flex-direction: column;
  gap: 1rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1;
  white-space: nowrap;
}

.btn.primary {
  background: var(--secondary);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn.primary:hover {
  background: #3152b0; /* darker royal */
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn.ghost {
  background: transparent;
  color: var(--secondary);
  border: 2px solid var(--secondary);
}

.btn.ghost:hover {
  background: var(--secondary);
  color: var(--white);
}

.btn:not(.btn.primary):not(.btn.ghost) {
  background: transparent;
  color: var(--secondary);
  border: none;
  box-shadow: none;
}

.btn:not(.btn.primary):not(.btn.ghost):hover {
  color: var(--secondary);
  text-decoration: underline;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-secondary {
  background: var(--secondary);
  color: var(--white);
}

.btn-secondary:hover {
  background: var(--secondary);
  box-shadow: var(--shadow-lg);
}

/* Main Content */
main {
  min-height: calc(100vh - 200px);
}

/* Section Styles */
section {
  padding: 5rem 1.5rem;
}

section.light {
  background: var(--bg-light);
}

section.darker {
  background: var(--bg-lighter);
}

section h2 {
  margin-bottom: 0.75rem;
}

.section-title {
  text-align: center;
  margin-bottom: 3.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.section-title h2 {
  color: var(--primary);
  margin-bottom: 1rem;
}

.section-title p {
  font-size: 1.1rem;
  color: var(--text-light);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 6rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero .panel h1 {
  color: var(--white);
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.hero .panel p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.lede {
  font-size: 1.15rem !important;
  line-height: 1.8 !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

.kicker {
  display: inline-block;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1rem;
  font-weight: 600;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--secondary);
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0;
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.soft {
  background: rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
}

.soft h2 {
  color: var(--white);
}

.soft p {
  color: rgba(255, 255, 255, 0.9);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.75rem;
  padding-left: 1.75rem;
  position: relative;
  font-size: 0.95rem;
}

.list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--secondary-light);
  font-weight: bold;
}

/* Grid */
.grid {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 1px solid var(--border-light);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary);
}

.card h3 {
  color: var(--primary);
  margin-top: 0;
}

.card p {
  flex: 1;
}

.card-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  margin-bottom: 1rem;
}

/* Callout */
.callout {
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-lighter) 100%);
  padding: 3rem;
  border-radius: 1rem;
  border: 2px solid var(--border-light);
  margin: 2rem 0;
}

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
  list-style: none;
}

.stat {
  text-align: center;
}

.stat .num {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.stat .label {
  display: block;
  font-size: 0.95rem;
  color: var(--text-light);
  font-weight: 500;
}

/* Note text */
.note {
  color: var(--text-lighter);
  font-size: 0.9rem;
  font-style: italic;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark);
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 0.875rem;
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: var(--white);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(60, 47, 127, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* List Styles */
ul, ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.75rem;
  color: var(--text-light);
  line-height: 1.8;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

th {
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
}

tbody tr:hover {
  background: var(--bg-light);
}

/* Footer */
footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.9);
  padding: 4rem 1.5rem 2rem;
  margin-top: 4rem;
}

footer .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  margin-bottom: 2rem;
}

footer h3 {
  color: var(--white);
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
}

footer p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

footer a {
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--white);
}

footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

footer li {
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.85);
}

footer .note {
  color: rgba(255, 255, 255, 0.7);
}

/* buttons in footer partner link */
footer .btn.primary {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  background: var(--secondary);
}

footer .btn.primary:hover {
  background: #3152b0;
}

/* highlight programs & research in nav */
.navlinks a[href="programs.html"],
.navlinks a[href="research.html"] {
  color: var(--secondary);
}

.navlinks a[href="programs.html"]:hover,
.navlinks a[href="research.html"]:hover {
  color: var(--secondary-light);
}

/* optional pulse animation for attention 
   add class="pulse" where desired */
.navlinks a.pulse {
  animation: pulse 3s ease-in-out infinite;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-primary {
  color: var(--primary);
}

.text-secondary {
  color: var(--secondary);
}

/* special link type used for "See Programs" and nav highlights */
.secondary-link {
  color: var(--secondary);
  font-weight: 600;
  transition: color 0.3s ease;
}
.secondary-link:hover,
.secondary-link:focus {
  color: var(--secondary-light);
}

/* pulsing effect for attention-grab elements */
.pulse {
  animation: pulse 3s ease-in-out infinite;
}

.text-light {
  color: var(--text-light);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.opacity-75 { opacity: 0.75; }
.opacity-50 { opacity: 0.5; }

.hidden { display: none; }

.highlight {
  background: var(--secondary-light);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.85;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.slide-in {
  animation: slideIn 0.4s ease-out;
}

.count-up {
  animation: countUp 0.6s ease-out;
}

.pulse-effect {
  animation: pulse 2s ease-in-out infinite;
}

.slide-up {
  animation: slideUp 0.6s ease-out;
}

section {
  animation: fadeIn 0.8s ease-out;
}

/* Responsive Design */
@media (max-width: 1024px) {
  h1 {
    font-size: 2.75rem;
  }

  h2 {
    font-size: 2rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero .panel h1 {
    font-size: 2.75rem;
  }
}

@media (max-width: 768px) {
  section {
    padding: 3rem 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .nav {
    gap: 1rem;
  }

  .navlinks {
    display: none;
  }

  .menu-btn {
    display: block;
  }

  .mobile-panel[hidden] {
    display: none;
  }

  .mobile-panel:not([hidden]) {
    display: flex;
  }

  .hero {
    padding: 3rem 1rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero .panel h1 {
    font-size: 1.75rem;
  }

  .hero .panel p {
    font-size: 1rem;
  }

  .lede {
    font-size: 1rem !important;
  }

  .hero-actions {
    gap: 0.5rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 1.5rem;
  }

  .badges {
    gap: 0.5rem;
  }

  .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }

  .section-title {
    margin-bottom: 2rem;
  }

  footer .container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
