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

:root {
  /* Color Tokens */
  --navy-950: #0B1120;
  --navy-800: #1E293B;
  --gold-500: #F59E0B;
  --coral-500: #F43F5E;
  --text-primary: #F8FAFC;
  --text-muted: #94A3B8;

  /* Legacy aliases to avoid breaking old CSS completely while transitioning */
  --ink: var(--navy-950);
  --paper: var(--text-primary);
  --white: #FFFFFF;
  --gold: var(--gold-500);
  --coral: var(--coral-500);
  --thread-blue: var(--text-muted);

  --max-width: 1100px;
  --radius: 12px;
}

/* Base Reset & Typography */
body {
  margin: 0;
  padding: 0;
  background-color: var(--navy-950);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .serif, .title, .section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0;
}

.text-hero { font-size: clamp(3rem, 5vw, 4rem); line-height: 1.1; margin-bottom: 1rem; }
.text-h2 { font-size: clamp(2rem, 4vw, 2.5rem); line-height: 1.2; }
.text-h3 { font-size: clamp(1.375rem, 3vw, 1.5rem); line-height: 1.3; }
.text-body { font-size: 1.125rem; }

/* Layout & Spacing */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.section {
  padding: 5rem 0; /* 80px desktop */
}
@media (max-width: 640px) {
  .section { padding: 3rem 0; /* 48px mobile */ }
}

/* Reusable Components */
.card {
  background-color: var(--navy-800);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  padding: 2.5rem;
  box-sizing: border-box;
}

.pill, .tag, .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 0.25rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}
.pill-coral, .coral-badge { background-color: var(--coral-500); color: white; }
.pill-gold, .gold-badge { background-color: var(--gold-500); color: var(--navy-950); }

.heading-accent {
  position: relative;
  display: inline-block;
  margin-bottom: 2rem;
}
.heading-accent::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.5rem;
  width: 3rem;
  height: 4px;
  background: linear-gradient(90deg, var(--coral-500), var(--gold-500));
  border-radius: 2px;
}

/* Buttons */
.btn, .primary-btn, .secondary-btn, .tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}
.btn-primary, .primary-btn {
  background: linear-gradient(135deg, var(--coral-500), var(--gold-500));
  color: white;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
}
.btn-primary:hover, .primary-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
}
.btn-primary:disabled, .primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-secondary, .secondary-btn {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-primary);
}
.btn-secondary:hover, .secondary-btn:hover {
  border-color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

/* Navbar Updates */
.navbar {
  width: 100%;
  background-color: rgba(11, 17, 32, 0.85); /* navy-950 */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-logo { font-size: 1.8rem; color: var(--text-primary); font-weight: 700; text-decoration: none; }
.nav-logo .vaad { color: var(--coral-500); }
.nav-links { display: flex; gap: 2.5rem; align-items: center; }
.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 600;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--gold-500); }

/* Hero / Header */
header {
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  max-width: 900px;
  margin: 0 auto;
}
.subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-inline: auto;
}
.flow-row {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  background: var(--navy-800);
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--text-primary);
  font-weight: 500;
}
.flow-row .arrow { color: var(--gold-500); }

/* Tab Nav */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem;
  border-radius: 999px;
  margin: 0 auto 3rem;
  max-width: fit-content;
  border: 1px solid rgba(255,255,255,0.05);
}
.tab-btn {
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
}
.tab-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.tab-btn.active { background: var(--text-primary); color: var(--navy-950); font-weight: 700; }

/* Main Panels */
main {
  flex: 1;
  width: 100%;
  padding-bottom: 4rem;
}
.panel {
  display: none;
  opacity: 0;
  transform: translateY(10px);
}
.panel.active {
  display: block;
  animation: fadeUp 0.4s ease forwards;
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* App Specific overrides inside panels */
.panel-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.panel-header h2 { margin: 0; }
.panel-subtitle { color: var(--text-muted); margin-bottom: 2.5rem; }

/* Grid / Translation areas */
.sign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.sign-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  padding: 1.25rem 1rem;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.sign-btn:hover { background: rgba(255,255,255,0.08); transform: translateY(-2px); }
.sign-btn.selected {
  background: var(--coral-500);
  border-color: var(--coral-500);
}
.sign-label { font-weight: 700; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.05em; }
.sign-sub { font-size: 0.75rem; opacity: 0.7; }

.translation-area {
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid rgba(255,255,255,0.05);
}
.seq-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; min-height: 2.5rem; }
.chip {
  background: var(--navy-950);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.1);
}

.output-box {
  background: var(--navy-950);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.hindi-out {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  color: var(--gold-500);
  min-height: 2.5rem;
}
.hindi-sub { color: var(--text-muted); font-size: 0.95rem; }

.action-buttons { display: flex; gap: 1rem; }

/* Mic Section */
.mic-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  background: rgba(0,0,0,0.2);
  padding: 3rem;
  border-radius: var(--radius);
  border: 1px dashed rgba(255,255,255,0.2);
}
.mic-btn {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: var(--coral-500);
  color: white;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.4);
}
.mic-btn:hover { transform: scale(1.05); }
.mic-btn.listening { animation: pulse 1.5s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7); }
  70% { box-shadow: 0 0 0 20px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}
.transcript-box { min-height: 3rem; font-size: 1.25rem; font-style: italic; color: var(--text-primary); text-align: center; width: 100%; }
.avatar-stage { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.5rem; padding: 1rem 0; }
.stick-avatar svg { width: 96px; height: 120px; background: var(--navy-950); border-radius: 0.5rem; border: 1px solid rgba(255,255,255,0.1); }

/* Camera Section */
.cam-container { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.cam-frame {
  position: relative;
  width: 100%;
  max-width: 100%;
aspect-ratio: 4/3;
  background: var(--navy-950);
  border-radius: 1rem;
  overflow: hidden;
  border: 4px solid rgba(255,255,255,0.1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.cam-frame video { width: 100%; height: 100%; object-fit: contain; transform: scaleX(-1); }
.output-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; transform: scaleX(-1); }
.cam-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: rgba(255,255,255,0.5); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; pointer-events: none; }
.scan-line { position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: var(--gold-500); box-shadow: 0 0 15px 5px rgba(245, 158, 11, 0.4); opacity: 0; pointer-events: none; }
.cam-frame.scanning .scan-line { opacity: 1; animation: scanAnim 1.4s linear; }




/* Nav Link Active & Underline */
.nav-links a {
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--gold-500);
  transition: width 0.3s ease;
  border-radius: 2px;
}
.nav-links a.active {
  color: var(--coral-500);
}
.nav-links a.active::after, .nav-links a:hover::after {
  width: 100%;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: 0.3s;
  border-radius: 2px;
}

/* Footer Restyling */
.site-footer {
  background-color: var(--navy-950);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 3rem 0;
  margin-top: auto;
}
.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.footer-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
}
.footer-logo .vaad { color: var(--coral-500); }
.footer-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(11, 17, 32, 0.98);
    flex-direction: column;
    padding: 2rem 0;
    gap: 2rem;
    transform: translateY(-150%);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: -1;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    z-index: 99;
  }
  .nav-links a::after { display: none; }
  
  .footer-container {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}


/* Global Layout Fixes */
html, body {
  overflow-x: hidden;
  width: 100%;
}

/* Scroll Animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}
