@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('    https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
  /* Base */
  --color-bg: #fafafa;
  --color-text: #1a1a1a;
  --main-bg: #fafafa;
  --page-bg-color: #f5f7fa;

  /* Brand Colors */
  --brand-primary: #b19cd9;    
  --brand-secondary: #598DC0;  
  --brand-tertiary: #0a2463;  

  /* UI Elements */
  --header-footer-bg: var(--main-bg);
  --link-color: #b19cd9;             
  --node-color: #0a2463;            
  --link-opacity: 0.35;
  --node-opacity: 0.6;
  --footer-border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --color-bg: #0d1117;
  --color-text: #f8f8f8; 
  --main-bg: #0d1117;
  --header-footer-bg: rgba(13, 17, 23, 0.95);
  --link-color: #b19cd9;
  --node-color: #b19cd9;
  --link-opacity: 0.20;
  --node-opacity: 0.7;
  --footer-border: 1px solid rgba(255, 255, 255, 0.1);
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--main-bg);
  color: var(--color-text);
  transition: background-color 0.4s ease;
  overflow-x: hidden;
  position: relative;
}

#ai-network {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;

  /* Prevent iOS scroll flicker */
  transform: translateZ(0);
  will-change: contents;
  -webkit-overflow-scrolling: touch;
}

#ai-network svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.page-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1400px;
  margin: 1rem auto;
  gap: 1rem;
  padding: 0 1rem;
  position: relative;
}

.logo {
  position: absolute;
  left: 0;
  width: 180px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
  z-index: 11;
}

header {
  max-width: 1000px;
  background: var(--header-footer-bg);
  backdrop-filter: blur(12px);
  border-radius: 50px;
  padding: 0.8rem 1.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(-45deg, #b19cd9, #598DC0, #0a2463, #b19cd9);
  background-size: 400% 400%;
  animation: gradientMove 15s ease infinite;
  z-index: -1;
  border-radius: 50px;
  opacity: 0.4;
}

/* Light  */
[data-theme="light"] nav a {
  color: #111; /* dark text */
}

[data-theme="light"] nav a.active {
  color: #7B3FBF; /* deeper purple, more contrast */
  font-weight: 600;
}

[data-theme="light"] nav a:hover {
  color: #b19cd9; /* pastel for hover */
}

[data-theme="light"] header::before {
  opacity: 0.45; /* stronger than 0.35 */
}

[data-theme="light"] header {
  background: rgba(255,255,255,0.95);
}

nav {
  display: flex;
  gap: 1.5rem;
  margin: 0 auto;
  font-weight: 500;
  flex: 1;
  justify-content: center;
}

nav a {
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s ease, transform 0.2s ease;
}

nav a:hover {
  color: #b19cd9;
  transform: scale(1.05);
}

nav a.active {
  color: #b19cd9;
  font-weight: 600;
  position: relative;
}

nav a.active::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--link-color); /* Was hardcoded */
  border-radius: 2px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-text);
  width: 60px;
  height: 30px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .theme-toggle {
  border-color: #e6e6e6;
}

/* Icon Container – centered inside compact button */
.toggle-icon {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-sun,
.icon-moon {
  position: absolute;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  inset: 0;
  margin: auto;
}

/* Sun visible in light mode */
[data-theme="light"] .icon-sun {
  opacity: 1;
  transform: scale(1);
}

[data-theme="light"] .icon-moon {
  opacity: 0;
  transform: scale(0.7);
}

/* Moon visible in dark mode */
[data-theme="dark"] .icon-moon {
  opacity: 1;
  transform: scale(1);
}

[data-theme="dark"] .icon-sun {
  opacity: 0;
  transform: scale(0.7);
}

/* Subtle glow in dark mode */
[data-theme="dark"] .theme-toggle {
  box-shadow: 0 0 0 2px rgba(177, 156, 217, 0.3), 0 3px 10px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .theme-toggle:hover {
  box-shadow: 0 0 0 2px rgba(177, 156, 217, 0.5), 0 5px 15px rgba(0, 0, 0, 0.2);
}

.theme-toggle#themeToggleMobile {
  /* Reduced width, natural fit */
  height: 45px;
  padding: 0 12px;
  border-radius: 24px;

  /* Layout */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  /* Style */
  background: rgba(177, 156, 217, 0.1);
  border: 1px solid rgba(177, 156, 217, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

/* Hover Effect */
.theme-toggle#themeToggleMobile:hover {
  background: rgba(177, 156, 217, 0.2);
  border-color: var(--link-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Icon inside toggle */
.theme-toggle#themeToggleMobile .toggle-icon {
  width: 20px;
  height: 20px;
}

.theme-toggle#themeToggleMobile .toggle-icon svg {
  width: 18px !important;
  height: 18px !important;
}

/* Homepage */
.hero {
  height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 2rem;
}

.hero h1 {
  font-size: 3rem;
  margin: 0 0 1rem;
  font-weight: 700;
  max-width: 800px;
  line-height: 1.2;
}

.hero p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  opacity: 0.9;
}

.cta-buttons a {
  display: inline-block;
  margin: 0 0.6rem;
  padding: 0.9rem 1.6rem;
  background: rgba(128, 128, 128, 0.1);
  border-radius: 30px;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cta-buttons a:hover {
  background: rgba(128, 128, 128, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.cta-buttons a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #b19cd915, #007ea715);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  border-radius: 30px;
}

.cta-buttons a:hover::before {
  opacity: 1;
  background: linear-gradient(135deg, #b19cd915, #b19cd915);
}

/* Philosophy & Research & Insights & Contact */
main {
  max-width: 850px;
  margin: 4rem auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
  line-height: 1.7;
}

main h1,
main h2 {
  font-weight: 700;
  line-height: 1.2;
}

main h1 {
  font-size: 2.1rem;
  margin: 1.8rem 0 1rem;
}

main h2 {
  font-size: 1.55rem;
  margin: 1.6rem 0 0.8rem;
  color: var(--link-color);
}

/* Center intro text under "Our Philosophy" */
main > p:first-of-type {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 2rem;
}

main p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 0.9rem 0;
  opacity: 0.9;
}

/* ===== Founder's Letter ===== */
.founder-letter {
  background: rgba(177, 156, 217, 0.08);
  border: 1px solid rgba(177, 156, 217, 0.2);
  border-radius: 16px;
  padding: 2rem;
  margin: 3rem auto;
  max-width: 800px;
  position: relative;
  transition: all 0.3s ease;
}

.founder-letter:hover {
  border-color: var(--link-color);
  background: rgba(177, 156, 217, 0.05);
}

.letter-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.letter-header i {
  font-size: 1.5rem;
  color: var(--link-color);
}

.letter-header h2 {
  font-size: 1.4rem;
  margin: 0;
  color: var(--link-color);
}

.letter-body p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 0.8rem 0;
}

.letter-expand {
  opacity: 0.9;
  font-style: italic;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(177, 156, 217, 0.3);
}

/* ===== Mission/Vision - Animated Tabs ===== */
.mission-vision {
  margin: 4rem auto;
  max-width: 800px;
}

.tab-header {
  display: flex;
  position: relative;
  background: rgba(177, 156, 217, 0.08);
  border: 1px solid rgba(177, 156, 217, 0.2);
  border-radius: 50px;
  padding: 0.5rem;
  margin-bottom: 2rem;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 1rem 1.5rem;
  font-weight: 500;
  font-size: 1rem;
  color: var(--color-text);
  cursor: pointer;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: none; /* 👈 Disable hover transition */
  z-index: 2;
}

.tab-btn.active {
  color: var(--link-color);
}

.tab-btn i {
  font-size: 1.1rem;
}

.tab-slider {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  width: calc(50% - 0.5rem);
  height: calc(100% - 1rem);
  background: rgba(177, 156, 217, 0.1);
  border: 1px solid var(--link-color);
  border-radius: 50px;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.tab-header .tab-btn:nth-child(2).active ~ .tab-slider {
  transform: translateX(100%);
}

.tab-content {
  background: rgba(177, 156, 217, 0.08);
  border: 1px solid rgba(177, 156, 217, 0.2);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.content-panel {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease-out;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem;
  pointer-events: none;
}

.content-panel.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.tab-content h3 {
  font-size: 1.6rem;
  margin: 0 0 1rem;
  color: var(--link-color);
}

.tab-content p {
  font-size: 1.1rem;
  line-height: 1.7;
  opacity: 0.9;
  margin: 0;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== CORE VALUES - FLIP ON CLICK ===== */
.values-interactive h2 {
  text-align: center;
  margin: 3rem 0 2rem;
  font-weight: 700;
}

.values-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.8rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.value-flip-card {
  width: 260px;
  height: 180px;
  cursor: pointer;
  perspective: 800px;
}

.value-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  border-radius: 16px;
  background: rgba(177, 156, 217, 0.03);
  border: 1px solid rgba(177, 156, 217, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.value-card-front,
.value-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.3rem;
  border-radius: 16px;
  box-sizing: border-box;
  text-align: center;
}

.value-card-front {
  color: var(--color-text);
  z-index: 2;
}

.value-card-back {
  background: rgba(177, 156, 217, 0.08);
  border: 1px solid var(--link-color);
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.6;
  transform: rotateY(180deg);
}

.value-card-front i {
  font-size: 2rem;
  color: var(--link-color);
  margin-bottom: 0.8rem;
}

.value-card-front h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.value-card-inner.flipped {
  transform: rotateY(180deg);
}

/* Optional: Add fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile: Static front face */
@media (max-width: 768px) {
  .value-flip-card {
    height: auto;
    min-height: 160px;
    cursor: default;
  }

  .value-card-front {
    padding: 1.2rem !important;
  }
}

/* Research & Insights */
/* ===== Research & Development Cards ===== */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem !important; /* Reduced from 2.5rem/2rem */
  margin-top: 3rem;
}

.rd-card {
  background: rgba(177, 156, 217, 0.04);
  border: 1px solid rgba(10, 10, 10, 0.08);
  border-radius: 16px;
  padding: 1.8rem;
  transition: all 0.4s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.rd-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.12);
  background: rgba(177, 156, 217, 0.08);
  border-color: #b19cd9;
}

.rd-card h2 {
  font-size: 1.3rem;
  margin: 0 0 0.8rem;
  color: var(--link-color);
  line-height: 1.4;
}

.rd-card .research-meta {
  font-size: 0.85rem;
  color: #888;
  margin: 0 0 1rem;
  display: block;
}

.rd-card p {
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 1.2rem;
  opacity: 0.92;
}

.rd-card .research-link {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  background: rgba(128, 128, 128, 0.1);
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.3s ease;
}

.rd-card .research-link:hover {
  background: rgba(128, 128, 128, 0.2);
  transform: translateY(-2px);
}

/* Mobile Optimization */
@media (max-width: 768px) {
  .rd-card {
    padding: 1.5rem !important;
  }

  .rd-card h2 {
    font-size: 1.2rem !important;
  }

  .research-intro {
    padding: 0 1.5rem !important;
    margin: 1.5rem auto 2.5rem !important;
  }
}

.rd-card, .journal-card {
  background: rgba(177, 156, 217, 0.04);
  border: 1px solid rgba(10, 10, 10, 0.08);
  border-radius: 16px;
  padding: 1.6rem;
  margin: 2.2rem 0;
  transition: all 0.4s ease;
  cursor: pointer;
}

.rd-card:hover, .journal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  background: rgba(177, 156, 217, 0.08);
  border-color: var(--link-color);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
}

.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--color-text);
  color: var(--color-text);
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

.social-icon:hover {
  background: var(--color-text);
  color: var(--main-bg);
  transform: translateY(-2px);
}

.social-links {
  display: flex;
  gap: 0.8rem;
}

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

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  opacity: 0.85;
  transition: all 0.2s ease;
}

.contact-link:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.contact-link .icon {
  font-size: 1.1rem;
}

/* Mobile: Stack only if needed */
@media (max-width: 480px) {
  footer {
    max-width: 100%;
    margin: 1rem 0.75rem 0.5rem;
    padding: 0.8rem 1rem;
    font-size: 0.8rem;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    border-radius: 12px;
  }

  .footer-left,
  .footer-right {
    width: 100%;
    justify-content: center;
    padding: 0 0.5rem;
    box-sizing: border-box;
  }

  .social-icon {
    width: 30px;
    height: 30px;
  }
}

.alternative-contact {
  margin-top: 3rem;
  text-align: center;
}

.contact-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.quick-contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Tablet: 2 columns */
@media (min-width: 576px) {
  .quick-contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: 3 equal columns */
@media (min-width: 900px) {
  .quick-contact-grid {
    grid-template-columns: repeat(3, 1fr); /* Forces equal width */
  }
}

.quick-card {
  background: rgba(177, 156, 217, 0.04);
  border: 1px solid rgba(177, 156, 217, 0.2);
  border-radius: 16px;
  padding: 1.4rem;
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  /* 🔽 Key: Force equal height and full stretch */
  height: 180px; /* Uniform height */
  justify-content: center; /* Vertically center content */
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.quick-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--link-color);
  background: rgba(177, 156, 217, 0.08);
}

.quick-card .icon {
  font-size: 1.8rem;
  color: var(--link-color);
  margin-bottom: 0.6rem;
  transition: color 0.3s ease;
}

.quick-card:hover .icon {
  color: #b19cd9;
}

.quick-card .title {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0.4rem 0;
  color: var(--link-color);
}

.quick-card .detail {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-top: auto; /* Pushes detail to bottom */
}

.journal-card {
  background: rgba(177, 156, 217, 0.04);
  border: 1px solid rgba(10, 10, 10, 0.08);
  border-radius: 16px;
  padding: 1.8rem;
  transition: all 0.4s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.journal-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.12);
  background: rgba(177, 156, 217, 0.08);
  border-color: #b19cd9;
}

.journal-card h2 {
  font-size: 1.3rem;
  margin: 0 0 0.8rem;
  color: var(--link-color);
  line-height: 1.4;
  font-weight: 600;
}

.journal-card .journal-meta {
  font-size: 0.85rem;
  color: #888;
  margin: 0 0 1.2rem;
  display: block;
  font-weight: 500;
}

.journal-card .journal-link {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  background: rgba(128, 128, 128, 0.1);
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.3s ease;
}

.journal-card .journal-link:hover {
  background: rgba(128, 128, 128, 0.2);
  transform: translateY(-2px);
}

/* Mobile Optimization */
@media (max-width: 768px) {
  .cards-container {
    grid-template-columns: 1fr !important;
    gap: 0.8rem !important;
    padding: 0 1.5rem !important;
  }

  .journal-card {
    padding: 1.5rem !important;
    margin: 0.3rem !important;
  }

  .journal-card h2 {
    font-size: 1.2rem !important;
  }

  .research-intro {
    padding: 0 1.5rem !important;
    margin: 1.5rem auto 2.5rem !important;
    font-size: 1rem !important;
  }
}

/* Contact */
.contact-intro {
  text-align: center;
  max-width: 500px;
  margin: 2rem auto 3rem;
  opacity: 0.95;
}

.contact-form {
  margin-top: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(10, 10, 10, 0.1);
  border-radius: 12px;
  background: rgba(177, 156, 217, 0.04);
  color: var(--color-text);
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  font-size: 16px; /* Prevents mobile zoom */
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #b19cd9;
  background: rgba(177, 156, 217, 0.1);
  box-shadow: 0 0 0 4px rgba(177, 156, 217, 0.25);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.submit-btn {
  background: rgba(128, 128, 128, 0.1);
  border: none;
  width: 100%;
  padding: 1rem 2rem;
  margin-top: 1rem;
  box-sizing: border-box;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--color-text);
}

.submit-btn:hover {
  background: rgba(128, 128, 128, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Footer */
footer {
  max-width: 1100px;
  margin: 3rem auto 1rem;
  padding: 1.5rem 1.8rem;
  background: var(--header-footer-bg);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: var(--footer-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left {
  font-size: 0.95rem;
  opacity: 0.85;
}

.footer-right {
  display: flex;
  gap: 1rem;
}

.social-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--color-text);
  color: var(--color-text);
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-icon:hover {
  background: var(--color-text);
  color: var(--main-bg);
  transform: translateY(-2px);
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== MOBILE-FIRST RESPONSIVE DESIGN ===== */

/* Base mobile styles (applied to all, overridden on desktop) */
.mobile-header {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4.5rem; /* 👈 Increased from 4rem for more vertical space */
  background: var(--header-footer-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--footer-border);
  z-index: 100;
  align-items: center; /* 👈 This vertically centers children */
  padding: 0 1.2rem;
  justify-content: space-between;
  box-sizing: border-box; /* 👈 Ensures padding is included in height */
  margin-left: 0.5rem;
}

.header-logo {
  display: flex;
  align-items: center;
  height: 100%;
  padding-left: 0.5rem;
}

.header-logo .logo {
  height: 30px;
  width: auto;
  max-height: 80%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
  margin-left: 0.3rem; /* 👈 Tiny offset from absolute edge */
}

.hamburger-btn {
  display: flex;
  background: linear-gradient(135deg, #b19cd9, #007ea7);
  color: white;
  border: none;
  width: 48px; /* 👈 Slightly wider for breathing room */
  height: 48px; /* 👈 Taller to match new header */
  border-radius: 14px; /* 👈 Slightly softer corner */
  cursor: pointer;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: visible; /* 👈 Critical: prevents SVG stroke clipping */
}

.hamburger-btn:hover,
.hamburger-btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.hamburger-btn svg {
  width: 24px;
  height: 24px;
  stroke: white;
  stroke-width: 2.5;
}

.side-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 320px;
  height: 100vh;
  background: var(--main-bg);
  z-index: 999;
  flex-direction: column;
  padding: 2rem 1.5rem;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  backdrop-filter: blur(12px);
  border-left: 1px solid rgba(177, 156, 217, 0.1);
  transition: right 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.side-menu.active {
  right: 0;
}

/* Header with Close Button */
.menu-header {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(177, 156, 217, 0.1);
  margin-bottom: 1.5rem;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--color-text);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.close-btn:hover,
.close-btn:focus {
  background: rgba(177, 156, 217, 0.1);
}

/* Navigation Links */
.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin: 0;
  flex: 1;
  justify-content: center;
}

.menu-nav a {
  font-size: 1.2rem;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  transition: all 0.25s ease;
  position: relative;
}

.menu-nav a:hover,
.menu-nav a:focus {
  color: #b19cd9;
  background: rgba(177, 156, 217, 0.08);
  transform: translateX(-4px);
}

.menu-nav a.active {
  background: rgba(177, 156, 217, 0.15);
  color: #b19cd9;
  font-weight: 600;
}

/* Footer Section */
.menu-footer {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(177, 156, 217, 0.1);
  margin-top: auto;
}

.theme-toggle#themeToggleMobile {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.8rem;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  background: rgba(177, 156, 217, 0.1);
  border: 1px solid rgba(177, 156, 217, 0.3);
  border-radius: 12px;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle#themeToggleMobile:hover {
  background: rgba(177, 156, 217, 0.2);
  border-color: var(--link-color);
}

/* Contact in Menu */
.menu-contact {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.contact-link:hover {
  opacity: 1;
}

.contact-link i {
  color: var(--link-color);
  font-size: 1.1rem;
}
/* Contact Form Optimized for Mobile */
.contact-intro {
  font-size: 1rem;
  line-height: 1.6;
  margin: 1.5rem auto 2.5rem;
  padding: 0 0.5rem;
}

.contact-form:hover .submit-btn {
  transform: translateY(-1px);
}
.form-group {
  margin-bottom: 2rem;
}

.form-group label {
  font-size: 1rem;
  margin-bottom: 0.6rem;
  display: block;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid rgba(10, 10, 10, 0.1);
  border-radius: 12px;
  background: rgba(177, 156, 217, 0.04);
  color: var(--color-text);
  font-family: 'Inter', sans-serif;
  font-size: 16px; /* Prevents mobile zoom */
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #b19cd9;
  background: rgba(177, 156, 217, 0.08);
  box-shadow: 0 0 0 3px rgba(177, 156, 217, 0.4); /* Increase from 0.25 */
}

.form-group textarea {
  min-height: 160px;
  resize: vertical;
}

.submit-btn {
  background: rgba(128, 128, 128, 0.1);
  border: none;
  padding: 1rem 2rem;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--color-text);
  display: block; /* Ensures margin auto works */
  margin: 1rem auto 0; /* Center on all screens */
  text-align: center; /* Centers text inside button */
}

.submit-btn:hover,
.submit-btn:focus {
  background: rgba(128, 128, 128, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Main & Footer */
main {
  margin: 4rem 1rem 2rem; /* Top margin accounts for fixed header */
  padding: 1.5rem 1rem;
  max-width: 100%;
  box-sizing: border-box;
}

main h1 {
  font-size: 1.8rem;
  line-height: 1.3;
  margin: 0 0 1rem;
  text-align: center;
}

.tab-content {
  background: rgba(177, 156, 217, 0.08);
  border: 1px solid rgba(177, 156, 217, 0.2);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.content-panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.content-panel.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* ===== UNIVERSAL MOBILE HORIZONTAL PADDING ===== */
@media (max-width: 768px) {
  .mobile-header {
    padding: 0 1.5rem; /* 👈 More breathing room left/right */
  }

  .header-logo .logo {
    margin-left: 0.25rem; /* 👈 Tiny nudge right so it doesn’t feel glued */
  }

  main {
    margin: 4.5rem 0 2rem; /* Top margin accounts for taller header */
    padding: 0; /* Remove padding here — let container handle it */
    flex: 1;    
  }

  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .container {
    padding: 0 1.5rem; /* 👈 MAGIC: All content now inset equally */
    max-width: 100%;
    box-sizing: border-box;
  }

  .contact-form {
    margin-top: 2rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 1rem;
    font-size: 16px;
    box-sizing: border-box;
  }

  /* Ensure textarea doesn’t overflow */
  .form-group textarea {
    width: 100%;
    min-height: 160px;
    resize: vertical;
  }

  footer {
    max-width: 100%;
    margin: 1rem 1rem 0.5rem; /* 👈 Reduced top margin from 2rem → 1.5rem */
    padding: 0.8rem 1rem; /* 👈 Reduced from 1.5rem → 1rem */
    font-size: 0.85rem; /* 👈 Slightly smaller text */
    flex-direction: column;
    align-items: center;
    gap: 0.8rem; /* 👈 Reduced from 1.2rem → 0.8rem */
    border-radius: 12px; /* 👈 Softer, smaller curve */
    margin-top: auto !important; /* Pushes footer to bottom */
    margin-bottom: 1rem !important;
  }

  .footer-left,
  .footer-right {
    width: 100%;
    justify-content: center;
    display: flex;
    flex-wrap: wrap;
    padding: 0 0.5rem; /* 👈 Match global padding */
    box-sizing: border-box;
  }

  .social-icon {
    width: 32px; /* 👈 Slightly smaller icons */
    height: 32px;
  }
  
  [data-theme="light"] {
    --link-opacity: 0.18;
    --node-opacity: 0.35;
  }

  [data-theme="dark"] {
    --link-opacity: 0.10;
    --node-opacity: 0.45;
  }

  #desktopLayout {
    display: none !important;
  }

  .submit-btn {
    width: auto;           /* 👈 Let content define width */
    min-width: 180px;      /* 👈 Minimum comfortable tap target */
    padding: 0.8rem 2rem;  /* 👈 More horizontal padding */
    margin: 2rem auto 0;   /* 👈 Centered with top margin */
  }

  .social-icon {
    width: 32px; /* 👈 Slightly smaller icons */
    height: 32px;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 4rem 1.5rem 2rem; /* More side padding */
    height: auto; /* Let content dictate height */
    min-height: 70vh; /* Still spacious */
  }

  .hero h1 {
    font-size: 2.2rem; /* Slightly smaller */
    line-height: 1.3;
  }

  .hero p {
    font-size: 1rem;
    max-width: 100%; /* Full width but padded */
    margin: 0 auto 1.8rem;
  }

  .cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: nowrap; /* 👈 Prevent wrapping until absolutely necessary */
  }

  .cta-buttons a {
    width: 100%;
    max-width: 300px;
    text-align: center;
    min-width: 180px;
  }

  /* Target paragraph under "Our Philosophy" */
  main > p:first-of-type {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    box-sizing: border-box;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .founder-letter,
  .mission-vision,
  .values-interactive,
  .tab-content {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    box-sizing: border-box;
  }

  /* Ensure sections are centered and don't overflow */
  .founder-letter,
  .mission-vision,
  .values-interactive {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100% !important;
  }

  .founder-letter {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
    margin: 2.5rem auto !important;
    max-width: calc(100% - 3rem) !important; /* 1.5rem padding on each side */
    box-sizing: border-box !important;
    border-radius: 16px !important;
  }

    /* Target Mission/Vision Section */
  .mission-vision {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

    .tab-content {
    min-height: auto !important;
    height: auto !important;
    padding: 1.5rem !important;
    position: relative !important;
  }

  .content-panel {
    position: relative !important; /* Allow natural flow */    
    display: none; /* 👈 Hide all panels by default */
    opacity: 1;
    transform: translateY(20px);
    transition: all 0.5s ease-out;
    pointer-events: none;
    padding: 1.5rem !important;
  }

  .content-panel.active {
    display: flex !important; /* 👈 Show only active panel */
    flex-direction: column;
    justify-content: center;
    pointer-events: all;
    transform: translateY(0);
    opacity: 1;
  }

  .tab-content {
    min-height: auto !important;
    height: auto !important;
    padding: 1.5rem !important;
    position: relative !important; /* Allow natural flow */
    box-sizing: border-box;
  }

  .tab-content h3 {
    font-size: 1.4rem !important;
    margin: 0 0 1rem !important;
  }

  .tab-content p {
    font-size: 1rem !important;
    line-height: 1.6 !important;
  }

  .values-interactive {
    margin: 3rem auto !important;
  }

  .values-grid {
    grid-template-columns: 1fr !important; /* Single column */
    gap: 1.2rem !important;
    padding: 0 1.5rem !important;
  }

  .value-flip-card {
    width: 100% !important;
    max-width: 320px !important; /* 👈 Constrains width */
    margin: 0 auto !important; /* Centers it */
    min-height: 140px !important;
    height: auto !important;
  }

  .value-card-front {
    padding: 0.8rem !important;
  }

  .value-card-front h3 {
    font-size: 1.1rem !important;
    line-height: 1.4 !important;
  }

  .value-card-front i {
    font-size: 1.8rem !important;
    margin-bottom: 0.6rem !important;
  }
}

@media (max-width: 480px) {
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .cta-buttons a {
    width: 100%;
    max-width: 300px;
    text-align: center;
  }
}

/* Show Mobile Layout Only on Mobile */
@media (min-width: 769px) {
  .mobile-header,
  .side-menu,
  .hamburger-btn {
    display: none !important;
  }

  #desktopLayout {
    display: flex !important;
  }

  main {
    margin: 4rem auto;
    padding: 2rem;
  }

  footer {
    padding: 1.5rem 2rem; /* 👈 Match container padding */
    font-size: 0.9rem;
    flex-direction: row;
    align-items: center;
    gap: 1.2rem;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 16px;
    margin: 2rem 1.5rem 1.5rem; /* 👈 Add horizontal margin so it doesn’t touch screen edges */
    justify-content: space-between;
  }

  .footer-left,
  .footer-right {
    width: auto;
    justify-content: center;
    display: flex;
    flex-wrap: wrap;
    padding: 0; /* 👈 Match global padding */
    box-sizing: border-box;
    text-align: left; /* 👈 Left-align text */
  }

  .contact-form {
    max-width: 700px; /* 👈 Perfect readable width */
    margin: 2rem auto 0; /* Center it */
  }

  .form-group input,
  .form-group textarea {
    max-width: 100%; /* Respect container width */
  }

  .submit-btn {
    width: auto;           /* 👈 Let content define width */
    min-width: 180px;      /* 👈 Minimum comfortable tap target */
    padding: 0.8rem 2rem;  /* 👈 More horizontal padding */
    margin: 2rem auto 0;   /* 👈 Centered with top margin */
  }

  .container {
    position: relative;
    z-index: 1;
  }

  .container::before {
    content: "";
    position: absolute;
    inset: -2rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    z-index: -1;
    border-radius: 20px;
    opacity: 0.2;
    pointer-events: none;
  }

  [data-theme="dark"] .container::before {
    background: rgba(13, 17, 23, 0.4);
  }

  .cards-container {
    grid-template-columns: repeat(auto-fit, minmax(320px, 480px)) !important;
    justify-content: center;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 3rem auto 0;
  }

  .journal-card {
    padding: 1.5rem !important;
    margin: 0.3rem !important;
  }

  .rd-card {
    max-width: 480px; /* 👈 Prevents cards from stretching too wide */
  }
}

@media (max-width: 899px) {
  .quick-card {
    height: auto;
    min-height: 180px; /* Minimum uniform height */
    padding: 1.2rem;
  }
}  

.side-menu .menu-nav a {
  text-decoration: none !important;
  box-shadow: none !important;
  background-image: none !important;
  border: none !important;
  outline: none !important;
}

/* Prevent any pseudo-element lines */
.side-menu .menu-nav a::before,
.side-menu .menu-nav a::after {
  display: none !important;
}

/* Clean hover behavior — no hidden borders or shadows */
.menu-nav a:hover,
.menu-nav a:focus {
  color: #b19cd9;
  background: rgba(177, 156, 217, 0.08);
  transform: translateX(-4px);
  text-decoration: none; /* Double-down on no underline */
}

.menu-nav a {
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.menu-nav a:hover {
  background: rgba(177, 156, 217, 0.12);
  transform: translateX(-6px);
  box-shadow: inset 4px 0 0 #b19cd9; /* Subtle indicator on left */
} 
