/* Kesavaraju Family Website */

/* Self-hosted cursive font */
@font-face {
  font-family: 'Science Gothic';
  src: url('/fonts/science-gothic.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Playwrite IE';
  src: url('/fonts/playwrite-ie.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* CSS Custom Properties for Theme Support */
:root {
  /* Dark mode — deep navy biotech */
  --bg: #0a0f1e;
  --text: #f4f7fb;
  --muted: #9aa6bd;
  --accent: #6ee7f2;
  --accent-warm: #ff8f6b;
  --section-bg-alt: #111827;
  --border: #25304a;
  --radius: 16px;
  /* Animated mesh gradient */
  --mesh-1: rgba(110, 231, 242, 0.25);
  --mesh-2: rgba(123, 92, 255, 0.22);
  --mesh-3: rgba(255, 143, 107, 0.20);
  --mesh-4: rgba(64, 211, 164, 0.18);
  --mesh-glow-1: rgba(110, 231, 242, 0.22);
  --mesh-glow-2: rgba(255, 143, 107, 0.18);
  --aurora-opacity: 1;
}

[data-theme="light"] {
  --bg: #f7f3ec;
  --text: #1c2436;
  --muted: #667089;
  --accent: #2f7cf6;
  --accent-warm: #e07040;
  --section-bg-alt: #efe8dd;
  --border: #d6ccbf;
  --radius: 16px;
  /* Animated mesh gradient — light mode */
  --mesh-1: rgba(47, 124, 246, 0.22);
  --mesh-2: rgba(108, 92, 231, 0.18);
  --mesh-3: rgba(233, 122, 74, 0.20);
  --mesh-4: rgba(74, 214, 170, 0.16);
  --mesh-glow-1: rgba(90, 157, 255, 0.18);
  --mesh-glow-2: rgba(233, 122, 74, 0.15);
  --aurora-opacity: 0.9;
}

/* Global Reset & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Cursive name cycling in hero */
.hero-names {
  font-family: 'Playwrite IE', cursive;
  font-style: normal;
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 400;
  color: var(--accent);
  height: 1.3em;
  position: relative;
  margin-top: 4rem;
  overflow: hidden;
}

.hero-names span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  white-space: nowrap;
  animation: none;
  -webkit-text-stroke: 0.5px currentColor;
}

@keyframes nameFadeIn {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); letter-spacing: 0.1em; }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); letter-spacing: 0.02em; }
  85% { opacity: 1; transform: translateX(-50%) translateY(0); letter-spacing: 0.02em; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); letter-spacing: 0.1em; }
}

body {
  font-family: 'Science Gothic', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-weight: 500;
  background-color: var(--bg);
  background-image: url('/topo-bg.svg');
  background-size: 800px 800px;
  background-repeat: repeat;
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
}

[data-theme="light"] body {
  background-image: url('/topo-bg.svg');
  background-size: 800px 800px;
}

/* Animated Gradient Mesh Background */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: var(--aurora-opacity);
  transition: opacity 0.6s ease;
  background: 
    radial-gradient(ellipse 80% 60% at 10% 20%, var(--mesh-1) 0%, transparent 60%),
    radial-gradient(ellipse 70% 80% at 90% 30%, var(--mesh-2) 0%, transparent 60%),
    radial-gradient(ellipse 60% 70% at 70% 80%, var(--mesh-3) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 20% 90%, var(--mesh-4) 0%, transparent 60%);
  background-size: 200% 200%;
  animation: meshDrift 25s ease-in-out infinite;
}

body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
  background: 
    radial-gradient(circle 600px at 25% 35%, var(--mesh-glow-1) 0%, transparent 70%),
    radial-gradient(circle 500px at 75% 65%, var(--mesh-glow-2) 0%, transparent 70%);
  background-size: 250% 250%;
  animation: meshDrift 30s ease-in-out infinite reverse;
}

@keyframes meshDrift {
  0%   { background-position: 0% 0%; }
  20%  { background-position: 60% 20%; }
  40%  { background-position: 100% 50%; }
  60%  { background-position: 80% 100%; }
  80%  { background-position: 20% 80%; }
  100% { background-position: 0% 0%; }
}

/* Ensure content sits above mesh gradient */
nav, main, footer {
  position: relative;
  z-index: 1;
}

/* Typography Scale */
h1 {
  font-family: 'Science Gothic', sans-serif;
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin-bottom: 2rem;
}

h2 {
  font-family: 'Science Gothic', sans-serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  margin-bottom: 1rem;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 15, 30, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(37, 48, 74, 0.4);
  padding: 1rem 2rem;
  border-radius: 0;
  transition: background-color 0.3s ease;
}

[data-theme="light"] nav {
  background: rgba(247, 243, 236, 0.6);
  border-bottom: 1px solid rgba(214, 204, 191, 0.4);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
}

.nav-logo img {
  height: 32px;
  width: auto;
  filter: var(--logo-filter, none);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

/* Liquid Glass Theme Toggle */
.theme-toggle-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 50px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  padding: 0;
  height: 2.4rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.12);
  transition: all 0.25s ease;
}

.theme-toggle-pill:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(110,231,242,0.15), inset 0 1px 0 rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.theme-toggle-pill:hover .theme-slider {
  animation: sliderNudge 0.6s ease;
}

@keyframes sliderNudge {
  0% { translate: 0; }
  40% { translate: 5px; }
  100% { translate: 0; }
}

.theme-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  border-radius: 50px;
  background: linear-gradient(135deg, rgba(110,231,242,0.25) 0%, rgba(123,92,255,0.2) 100%);
  border: 1px solid rgba(110,231,242,0.3);
  box-shadow: 0 0 10px rgba(110,231,242,0.15), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  z-index: 1;
  overflow: hidden;
}

.theme-slider::after {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
  border-radius: 50px 50px 0 0;
}

.theme-slider.light {
  transform: translateX(100%);
}

[data-theme="light"] .theme-toggle-pill {
  border-color: rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.7);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

[data-theme="light"] .theme-toggle-pill:hover {
  border-color: var(--accent);
}

[data-theme="light"] .theme-slider {
  background: linear-gradient(135deg, rgba(47,124,246,0.3) 0%, rgba(100,80,180,0.2) 100%);
  border-color: rgba(47,124,246,0.3);
  box-shadow: 0 0 10px rgba(47,124,246,0.15), inset 0 1px 0 rgba(255,255,255,0.3);
}

.theme-opt {
  padding: 0 0.8rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--muted);
  white-space: nowrap;
  font-family: 'Science Gothic', sans-serif;
  position: relative;
  z-index: 2;
}

.theme-opt.active {
  color: var(--accent);
}

/* User Menu */
.user-menu {
  position: relative;
}

.user-menu-btn {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid var(--border);
  border-radius: 50px;
  color: var(--muted);
  font-family: 'Science Gothic', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 1.2rem;
  height: 2.4rem;
  cursor: pointer;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
}

.user-menu-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

[data-theme="light"] .user-menu-btn {
  background: rgba(255,255,255,0.7);
  border-color: rgba(0,0,0,0.15);
  color: var(--text);
}

[data-theme="light"] .user-menu-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.user-dropdown {
  display: none;
  position: absolute;
  top: 110%;
  right: 0;
  min-width: 180px;
  background: rgba(17,24,39,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.4rem 0;
  z-index: 10001;
}

.user-dropdown.open {
  display: block;
}

.user-dropdown a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: background 0.2s;
}

.user-dropdown a:hover {
  background: rgba(110,231,242,0.08);
  color: var(--accent);
}

[data-theme="light"] .user-dropdown {
  background: rgba(247,243,236,0.95);
  border-color: rgba(0,0,0,0.12);
}

[data-theme="light"] .user-dropdown a {
  color: var(--text);
}

[data-theme="light"] .user-dropdown a:hover {
  background: rgba(47,124,246,0.08);
  color: var(--accent);
}

/* Layout Containers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 5rem 0;
  border-bottom: none;
}

.section:last-child {
  border-bottom: none;
}

#enter-btn:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(110, 231, 242, 0.3);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 5rem;
  position: relative;
  overflow: hidden;
}

#smoke-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}


.hero h1 {
  font-size: clamp(3.5rem, 10vw, 9rem);
  margin-bottom: 1rem;
}

.hero .subtitle {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--text);
  font-weight: 400;
  opacity: 0.7;
}

/* By The Numbers Section */
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
  text-align: center;
}

.number-item {
  text-align: center;
}

.number {
  font-size: clamp(3rem, 5vw, 6rem);
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  display: block;
  margin-bottom: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.number-label {
  font-size: clamp(0.8rem, 2vw, 1rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 3rem;
  margin-top: 4rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  margin-top: 4rem;
}

/* Cards */
.card {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  padding: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  transition: all 0.3s ease;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
[data-theme="dark"] .card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card:hover {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
[data-theme="dark"] .card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card-date {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.card-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
  letter-spacing: 0.01em;
}

.card-subtitle {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.card-description {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.75;
  letter-spacing: 0.015em;
  opacity: 0.85;
}

.card-link {
  display: inline-block;
  margin-top: 2rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}

.card-link:hover {
  color: var(--text);
}

.card-link::after {
  content: " →";
  margin-left: 0.5rem;
}

footer .card-link::after {
  content: none;
}

/* Timeline Style */
.timeline-item {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  padding: 2.5rem;
  border-left: 4px solid var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
[data-theme="dark"] .timeline-item {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  border-left: 4px solid var(--accent);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.timeline-date {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.timeline-description {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.75;
  letter-spacing: 0.015em;
  opacity: 0.85;
}

/* Forms */
.form-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 4rem 0;
}

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

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--section-bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  border-radius: calc(var(--radius) / 2);
  transition: border-color 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  border-radius: calc(var(--radius) / 2);
}

.btn:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(110, 231, 242, 0.25);
}

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

/* Footer */
footer {
  position: relative;
  padding: 3rem 0 2rem;
  border-top: none;
  z-index: 1;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.footer-container:hover {
  opacity: 0.8;
}

.footer-copyright {
  color: var(--muted);
  font-size: 0.8rem;
}

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

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

/* Age Counter */
.age-display {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 2rem;
}

/* Error States */
.error-message {
  background: #dc3545;
  color: white;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 600;
}

/* Loading States */
.loading {
  opacity: 0.7;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .nav-links {
    gap: 1rem;
  }
  
  .nav-links a {
    font-size: 0.8rem;
  }
  
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .numbers-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .card {
    padding: 2rem;
  }
  
  .timeline-item {
    padding: 2rem;
  }
  
  .section {
    padding: 4rem 0;
  }
  
  .container {
    padding: 0 1rem;
  }
  
  .footer-container {
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .numbers-grid {
    grid-template-columns: 1fr;
  }
  
  .nav-links {
    gap: 0.5rem;
  }
  
  .nav-links a {
    font-size: 0.7rem;
  }
}

/* Counter Animation */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.counter-animate {
  animation: countUp 0.6s ease-out;
}

/* Smooth transitions for theme switching */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}