/*! HTML5 Boilerplate v9.0.1 | https://html5boilerplate.com/ */

/* Comprehensive CSS Reset for Cross-Browser Compatibility */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Normalize cross-browser differences */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px; /* Explicit base font size */
  line-height: 1.15; /* Normalize line height */
}

body {
  margin: 0 ;
  padding: 0 ;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  line-height: 1.5; /* Consistent line height */
  /* Hide scrollbars while keeping scroll functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbars for WebKit browsers */
body::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

body::-webkit-scrollbar-thumb {
  background: transparent;
}

/* Reset default browser styles that differ between Chrome and Brave */
/* h1, h2, h3, h4, h5, h6, p, ul, ol, li, span,  section {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
} */

/* Ensure consistent sizing units */
html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

/* Browser-specific fixes for Brave */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  /* WebKit browsers including Brave */
  * {
    -webkit-text-size-adjust: none;
  }
  
  body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
}

/* Brave-specific fixes */
@supports (-webkit-appearance: none) {
  .iconic-title {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  
  .char {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

.main-content-container {
  position: relative;
  width: 100% !important;
  max-width: 100vw;
  box-sizing: border-box !important;
  padding: 0 1rem;
  margin: 0;
}

.containers {
  display: grid;
  /* Fixed 3-column grid layout */
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  row-gap: 4rem;
  justify-items: center;
  justify-content: center;
  max-width: 1400px;
  margin: 2rem auto;
  padding: 1rem 2rem;
  box-sizing: border-box !important;
  width: 100%;
}

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

   @font-face {
  font-family: 'eastwhile'; /* Name you'll use to reference the font */
  src: url('../fonts/EastwhileDemoRegular-BF684a4d6033afb.ttf') format('opentype'); /* Path relative to CSS file */
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* Improves performance */
}

@font-face {
  font-family: 'wanetta'; /* Name you'll use to reference the font */
  src: url('../fonts/Wanetta-Demo-BF6884fe145c082.otf') format('opentype'); /* Path relative to CSS file */
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'quick-gaseous'; /* Name you'll use to reference the font */
  src: url('../fonts/GC-Quick-Gaseous-Demo-BF68c3dfca8e2e0.ttf') format('truetype'); /* Path relative to CSS file */

}

@font-face {
  font-family: 'Lacture'; /* Name you'll use to reference the font */
  src: url('../fonts/LactureDemo-Regular-BF68cb6ed2a3b94.otf') format('opentype'); /* Path relative to CSS file */
  font-weight: normal;
  font-style: normal;
}

body{  

    min-height: 100vh;
    height: 100%;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Hide scrollbars while keeping scroll functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.main-content-container {
  position: relative;
  width: 100%;
}

.navbar{
    position: fixed;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    line-height: 1;
    font-family:'quick-gaseous';
    display: flex;
    width: 100%;
    background: transparent;
    z-index: 1000;
    margin: 10px 0;
    top: 0;
}

/* Hide nav toggle on larger screens; shown via media query on mobile */
.nav-toggle {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.nav-toggle:focus {
  outline: none;
}

/* Wavy lines hamburger */
.wavy-line {
  display: block;
  width: 28px;
  height: 3px;
  background: linear-gradient(to right, 
    rgb(255, 0, 0) 0%, 
    rgb(255, 0, 0) 15%, 
    transparent 15%, 
    transparent 25%,
    rgb(255, 0, 0) 25%,
    rgb(255, 0, 0) 40%,
    transparent 40%,
    transparent 50%,
    rgb(255, 0, 0) 50%,
    rgb(255, 0, 0) 65%,
    transparent 65%,
    transparent 75%,
    rgb(255, 0, 0) 75%,
    rgb(255, 0, 0) 100%);
  background-size: 100% 100%;
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* Wavy lines animation on toggle */
.nav-toggle.active .wavy-line:nth-child(1) {
  transform: rotate(45deg) translate(12px, 12px);
  width: 30px;
}

.nav-toggle.active .wavy-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .wavy-line:nth-child(3) {
  transform: rotate(-45deg) translate(11px, -11px);
  width: 30px;
}

.logo a{
  justify-content: flex-start;
  font-style: italic;
  font-weight: 100 !important; 
  color: rgb(255, 0, 0) !important;
  font-size: 4rem !important;
  text-decoration: none;
}

/* .nav-links {
  display: flex;
  gap: 20px;
} */

/* .nav-links a{
  padding: 10px;
  text-decoration: none;
  justify-content: flex-end;
  color: rgb(66, 34, 34) !important;
  font-weight: 100 !important; 
  font-size: 2rem;
} */

/* Hide nav-links by default - drawer is used instead */
.nav-links {
  display: none !important;
}

.nav-links a:hover{ 
  color: #ffa200 !important;
  transition: ease 0.1s  !important;
}

/* Profile Icon Styling */
.profile-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  text-decoration: none;
  flex-shrink: 0;
}

.profile-icon-link:hover {
  background: rgba(255, 162, 0, 0.4);
  transform: scale(1.15);
}

.profile-icon {
  width: 26px;
  height: 26px;
  color: #fff;
  stroke: #fff;
}

.profile-drawer-link {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 15px;
}

/* Side Drawer Navigation with Wavy Border */
.nav-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  background: linear-gradient(135deg, rgb(255, 210, 98) 0%, rgba(196, 169, 255, 0.98) 100%);
  z-index: 999;
  transition: left 0.2s cubic-bezier(0.38, -0.15, 0.165, .75);
  overflow-y: auto;
  padding-top: 80px;
  padding-left: 30px;
  padding-right: 30px;
  
  /* Wavy right border using clip-path */
  clip-path: polygon(
    0% 0%,
    100% 2%,
    100% 5%,
    95% 8%,
    100% 12%,
    100% 15%,
    95% 18%,
    100% 22%,
    100% 25%,
    95% 28%,
    100% 32%,
    100% 35%,
    95% 38%,
    100% 42%,
    100% 45%,
    95% 48%,
    100% 52%,
    100% 55%,
    95% 58%,
    100% 62%,
    100% 65%,
    95% 68%,
    100% 72%,
    100% 75%,
    95% 78%,
    100% 82%,
    100% 85%,
    95% 88%,
    100% 92%,
    100% 95%,
    100% 100%,
    0% 100%,
    0% 0%
  );
}

/* Show drawer when active */
body.nav-open .nav-drawer {
  left: 0;
}

.nav-drawer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  color: #ffffff;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  z-index: 1002;
}

.nav-drawer-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.nav-drawer-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-drawer-link {
  text-decoration: underline 2px;
  text-underline-offset: 3px;
  color: #ffffff;
  font-size: 3rem;
  font-weight: 100;
  font-family: 'quick-gaseous';
  transition: all 0.1s ease;
  padding: 12px 15px;
}

.nav-drawer-link:hover {
  color: #ffa200;
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(10px);
}

/* Backdrop overlay */
.nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(64, 157, 107);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s ease;
  pointer-events: none;
}

#plans-nav-drawer {
  font-style: italic;
  color: #007c0e;
  text-decoration: underline wavy 2px;
  text-underline-offset: 2.5px;
  /* Mobile drawer styling */
}

/* Media queries for Plans link in nav drawer */
@media (max-width: 768px) {
  #plans-nav-drawer {
    font-size: 1.8rem;
    text-decoration: underline wavy 1.5px;
    text-underline-offset: 2px;
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  #plans-nav-drawer {
    font-size: 1.4rem;
    text-decoration: underline wavy 1px;
    text-underline-offset: 1.5px;
    padding: 8px 10px;
  }

  #hero-cta::before {
    font-size: 1rem;
  }
}

#hero-faq:hover {
  color: white;
  background: linear-gradient(rgb(43, 121, 42), rgb(27, 155, 89));
  transition: .5s ease;
  

}
body.nav-open .nav-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* .card{
    width: 450px !important;
    height: 520px !important;
    padding: 30px !important;
    margin: 0 auto;
    font-family: monospace;
    background-color: #d0bca1;
    border-radius: 25px;
    box-shadow: 0 5px 15px rgb(255, 255, 255);
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    box-sizing: border-box !important;
} */

/* .card h1 {
    font-size: 2.2rem !important;
    line-height: 2.8rem !important;
    text-align: center;
    margin: 0;
    padding: 0;
    font-weight: normal;
}

/* Position each box directly above its card */

/* Food Compass Integration Styles */
#food-compass-container {
  min-height: 100vh;
  background-color: #1d0443;
  padding: 2rem;
  transition: opacity 0.5s ease-in-out;
}

.food-compass-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding: 1rem 0;
}

.back-button {
  background-color: #5f8cd5;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-button:hover {
  background-color: #34495e;
  transform: translateY(-2px);
}

.food-compass-header h2 {
  color: #7fb3d3;
  font-size: 2.5rem;
  margin: 0;
  font-family: 'wanetta', sans-serif;
}

/* Transition effects for smooth switching */
.main-content-container {
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.fade-out {
  opacity: 0;
  transform: translateY(-20px);
}


/* Hero Section Styles */
.hero-section {
  background: 
    radial-gradient(circle at 20% 80%, rgb(149, 0, 255) 10%, transparent 50%),
    radial-gradient(circle at 90% 30%, rgb(0, 17, 255) 0%, transparent 50%);

    
  height: 110vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding:auto;
  

}

.hero-text-container {
  text-align: center;
  color: white;
  z-index: 10;
}

.hero-buttons {
  font-family: 'quick-gaseous', monospace;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Research Pulse Dot Button */
.research-pulse-dot {
  pointer-events: none;

  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background: radial-gradient(circle at 30% 30%, rgba(0, 102, 255, 0.8), rgba(255, 255, 255, 0.2));
  border-radius: 50%;
  position: relative;
  margin: 2rem auto;
  cursor: pointer;
  z-index: 15;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.6);
  text-decoration: none;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.1);
  animation: pulse-glow 2s ease-in-out infinite;
}

.research-pulse-dot:hover {
  transform: scale(1.15);
  box-shadow: 0 0 50px rgba(255, 255, 255, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.3);
  animation: pulse-glow-intense 1.2s ease-in-out infinite;
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.5), inset 0 0 30px rgba(255, 255, 255, 0.2);
  }
  100% {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.1);
  }
}

@keyframes pulse-glow-intense {
  0% {
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 70px rgba(255, 255, 255, 0.8), inset 0 0 35px rgba(255, 255, 255, 0.4);
  }
  100% {
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.3);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* Breathing Glow Animation for Research Finds Section */
@keyframes breathing-glow {
  0% {
    box-shadow: 0 0 10px rgb(197, 0, 56), 0 0 20px rgb(255, 255, 255);
    border-color: rgba(255, 0, 225, 0.6);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.8), 0 0 40px rgba(6, 182, 212, 0.4);
    border-color: rgb(230, 0, 255);
  }
  100% {
    box-shadow: 0 0 10px rgba(255, 81, 0, 0.4), 0 0 20px rgba(6, 182, 212, 0.2);
    border-color: rgba(155, 0, 0, 0.6);
  }
}

.cta-button {
    background-color: #ffffff;

  align-items: center;
  display: inline-block;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 100;
  font-family: 'quick-gaseous', monospace;
  border-radius: 2rem;
  border: none;
  color: #000000;
  cursor: pointer;
  box-shadow: 0 2px 8px rgb(255, 255, 255);
}

.cta-button:hover {
  background: rgb(255, 255, 255);
  transition: .3s ease;
}

/* Food List Button with Emoji Background */
#hero-cta {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  color: #000000;
  background-color: #ff9500;
}

#hero-cta::before {
  content: '🍎 🍊 🥑 🍌 🥦 🌽 🍇 🍓 🍉 🥬';
  position: absolute;
  top: 92%;
  left: 40%;
  transform: translate(-50%, -50%);
  font-size: 1.8rem;
  opacity: 1;
  pointer-events: none;
  white-space: nowrap;
  z-index: -1;
}

/* Special styling for The Magic button */
.magic-button {
  background: #ffffff;
  color: #000000;
  position: relative;
  overflow: hidden;
}

.magic-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.magic-button:hover::before {
  left: 100%;
}

.magic-button:hover {
  background: linear-gradient(135deg, rgb(109, 98, 255) 0%, #5f8cd5 50%, #e67e22 100%);
  color: white;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(95, 140, 213, 0.5);
  transition: .2s ease;
}

/* Coming Soon button styling */
#hero-foodtree {
  color: transparent;
  cursor: not-allowed;
  opacity: 0.7;
  position: relative;
}

#hero-foodtree::before {
  content: 'Explore the Food Tree';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #ff0000;
}

#hero-foodtree:hover::before {
  content: 'Coming Soon!';
}

#hero-foodtree:hover {
  background: rgb(255, 255, 255);
  transition: .3s ease;
}

/* Special styling for ML button */
.ml-button { 
  display: none !important;
  background: #ffffff;
  color: #000000;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 3px solid transparent;
  box-sizing: border-box;
}

.ml-button:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border-color: #ff0000 !important;
}

/* Special styling for Citations button */
.citations-button {
  background: #ffffff;
  color: #000000;
  position: relative;
  overflow: hidden;
  transition: 0.5s ease;
}

.citations-button:hover {
  background: linear-gradient(135deg, rgb(109, 98, 255) 0%, #ffffff 100%) !important;
}


/* Page Layout Styles for separate pages */
.page-container {
  min-height: 100vh;
  background-color: #490f9f;
  color: white;
}

.page-header {
  text-align: center;
  margin-bottom: 3rem;
}

.page-header .back-button {
  position: absolute;
  top: 2rem;
  left: 2rem;
  background-color: #5f8cd5;
  color: white;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: bold;
  transition: all 0.3s ease;
}

.page-header .back-button:hover {
  background-color: #34495e;
  transform: translateY(-2px);
}

.page-header h1 {
  color: #7fb3d3;
  font-size: 3rem;
  margin: 0 0 1rem 0;
  font-family: 'wanetta', sans-serif;
}

.page-header p {
  color: #ddeaf7;
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Food Tree specific styles */
.food-tree-interface {
  max-width: 1200px;
  margin: 0 auto;
}

.food-selector {
  text-align: center;
  margin-bottom: 3rem;
}

.food-selector h3 {
  color: #7fb3d3;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.food-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.food-select-btn {
  background: linear-gradient(90deg, #5f8cd5 0%, #7fb3d3 100%);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.food-select-btn:hover {
  background: linear-gradient(90deg, #34495e 0%, #5f8cd5 100%);
  color: white;
  transform: translateY(-2px);
}

.tree-container {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 2rem;
  min-height: 400px;
}

/* Simple food grid fallback styles */
.simple-food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.simple-food-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s ease;
}

.simple-food-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.2);
}

.simple-food-card h3 {
  color: #7fb3d3;
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
}

.simple-food-card p {
  color: #ddeaf7;
  margin: 0;
  font-size: 0.9rem;
}


.hero-title {
  font-family: 'quick-gaseous'; /* Use monospace fonts for consistent character width */
  font-weight: 100;
  font-size: 12rem;
  letter-spacing: -9px;
  color: rgb(255, 255, 255);
  cursor: default;
  transform-origin: center;
  text-rendering: optimizeLegibility;
  will-change: transform,  text-shadow;
  -webkit-font-smoothing:antialiased;
}

/* Letter-by-letter animation styles for hero title */
.hero-letter {
  display: inline-block;
  transform-origin: center bottom;
  transition: transform 1s ease;
}

.hero-letter.space {
  width: 0.3em; /* Preserve space width */
}
  
.hero-subtitle {
  font-family: 'quick-gaseous'; /* Changed from monospace to quick-gaseous */
  font-size: clamp(3.5rem, 3vw, 2rem);
  color:  rgb(255, 255, 255);
/* text-shadow:2px 2px 2px rgb(255, 145, 0);  transform-origin: center; */
  will-change: transform, opacity;
  

}

/* Call to Action Button */
.cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  min-height: 60px;
  margin-top: 2rem;
  padding: 1rem 2.5rem;
  background-color: #ffffff;
  color: #000000;
  font-family: 'quick-gaseous', monospace;
  font-size: 1.2rem;
  font-weight: normal;
  text-decoration: none;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: none; /* Let GSAP handle all transitions */
  box-shadow: 0 5px 15px rgba(0, 94, 9, 0.3);
  transform-origin: center;
  will-change: transform, opacity, box-shadow, background-color;
}

.cta-button:focus {
  outline: 2px solid #7fb3d3;
  outline-offset: 2px;
}





/* Responsive adjustments */
@media (max-width: 768px) {
  /* Make the hero the main focus on small screens */
  .hero-section {
    height: 150vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .hero-title {
    padding: 10px;
    font-size:6rem;
    letter-spacing: -3px;
    margin: 0;
    line-height: 1;
  }

  .hero-subtitle { 
    margin: 19px;
    text-align: center;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.95);
    max-width: 100%;
    line-height: 1;
  }

  .hero-buttons {
    padding: 40px;
    display: flex;
    gap: 0rem;
    justify-content: center;
    flex-wrap: wrap;
  }

  .cta-button {
    font-size: 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgb(255, 255, 255);
  }

  /* Mobile: make hoverburst icons small for touch devices
     The JS creates a container inside .hoverpop-wrapper and appends
     div children containing emoji icons. Inline styles set font-size;
     override on mobile with !important to ensure a small size. */
  .hoverpop-wrapper > div > div {
    font-size: 40px !important;
    line-height: 1 !important;
    transform-origin: center center !important;
  }

  /* Layout adjustments for content blocks on small screens */

  .card {
    width: 100%;
    height: auto;
    padding: 1.25rem;
  }

  .card h1 {
    font-size: 1.4rem;
  }

  .box-container {
    top: 0;
  }
}


/* Ensure 3x3 grid on large screens */
@media (min-width: 1200px) {
  .containers {
    grid-template-columns: repeat(3, 450px); /* Fixed width columns for perfect alignment */
    justify-content: center;
    gap: 3rem;
  }
}

/* Tagline Slider Section */
.tagline-slider-section {
   background: linear-gradient(to bottom, rgb(224, 199, 255) , #0073ff 100%);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.tagline-slider-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  padding: 40px;
  text-align: center; /* center heading + inline-block slider */
}

.tagline-content {
  display: inline-block;
  white-space: nowrap;
  animation: scrollText 15s linear infinite;
}

.tagline-text {
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 400;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.1);
  display: inline-block;
  padding-right: 100px; /* Add spacing between repetitions */
}

/* Slider Logo Styles */
.slider-logo {
  height: 100px;
  width: auto;
  display: inline-block;
  margin: 0 80px;
  vertical-align: middle;
  /* Convert black/solid SVGs to white for light-on-dark layouts */
  /* If you prefer a different tint, replace or remove the filter */
}

/* Preserve original colors for colored logos */
.slider-logo[alt="Harvard University"],
.slider-logo[alt="Carnegie Mellon University"],
.slider-logo[alt="Nature Journal"],
.slider-logo[alt="PubMed"] {
  filter: none;
  opacity: 0.85;
}

/* Static centered label above the sliding logos */
.slider-powered-by {
  font-family: 'Quick-Gaseous', 'QuickGaseous', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  font-size: 6rem;
  font-weight: 500;
  margin: 0 0 24px 0; /* spacing between label and logos */
  color: #ffffff;
  display: block;
  text-align: center;
  letter-spacing: -3px;
  text-decoration: underline 4px;
  text-underline-offset: 6px;
  padding-bottom: 50px;
  padding-top: 50px;
}

@media (max-width: 768px) {
  .slider-powered-by {
    text-align: center !important;
    color: #ffffff !important;
    font-size: 1.9rem !important;
    margin-bottom: 32px !important;
  }
}

@media (max-width: 480px) {
  .slider-powered-by {
    text-align: center;
    color: #ffffff;
    font-size: clamp(1.4rem, 5vw, 2rem);
    margin-bottom: 32px;
    padding-bottom: 2rem;
    padding-top: 2rem;
  }
}

@media (max-width: 380px) {
  .slider-powered-by {
    text-align: center;
    color: #ffffff;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    margin-bottom: 32px;
    padding-bottom: 1.5rem;
    padding-top: 1.5rem;
  }
}
/* Continuous scrolling animation */
@keyframes scrollText {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .tagline-slider-section {
    padding: 1.5rem 0;
  }
  
  .tagline-text {
    font-size: clamp(1.4rem, 5vw, 2rem);
  }
  
  .slider-logo {
    height: 60px;
    margin: 0 20px;
  }
}

/* ICONIC Animation Section */
.iconic-animation-section {
background-color: #0073ff;
  height: auto;
  min-height: 60vh;
  position: relative;
  overflow: hidden;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 40px 20px;
  width: 100vw !important;
  max-width: 100vw;
  margin: 0;
  box-sizing: border-box !important;
  z-index: 0; /* Create new stacking context */
}

.iconic-container {
  width: 100% !important;
  height: auto;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  margin: 0;
  padding: 0;
  box-sizing: border-box !important;
}

.iconic-title {
  font-family: 'lacture', sans-serif;
  -webkit-perspective: 1000px;
  -moz-perspective: 1000px;
  perspective: 1000px;
  color: #fb9d5a;
  text-align: center;
  letter-spacing: -80px;
  margin: auto;
  font-variant-ligatures: common-ligatures discretionary-ligatures historical-ligatures contextual;
  font-feature-settings: "liga" 1, "dlig" 1, "hlig" 1, "clig" 1;
  text-rendering: optimizeLegibility;
  position: relative;
  z-index: 2; /* Put above slider animation */
  font-weight: normal;
}


.char {
  display: inline-block;
  -webkit-transform-style: preserve-3d;
  -moz-transform-style: preserve-3d;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  -webkit-will-change: transform, opacity;
  text-shadow: 
    0 0 20px rgba(255, 222, 182, 0.767),
    0 0 40px rgba(219, 165, 100, 0.2),
    0 0 60px rgba(219, 165, 100, 0.1);
}

/* NOTE: mobile sizing for .iconic-title is replaced by a single comprehensive
   media query later in this file to avoid fragmentation and conflicting rules. */


@media (min-width: 1200px) {
  .iconic-title {
    font-size: 40rem; /* Fallback for browsers without clamp support */
    font-size: clamp(30rem, 25vw, 40rem);
  }
}

/* Additional browser-specific fixes */
@supports not (font-size: clamp(1rem, 2vw, 3rem)) {
  .iconic-title {
    font-size: 16rem; /* Fallback for browsers without clamp support */
  }
  
  /* Removed nested mobile overrides for .iconic-title - handled by the
     dedicated mobile media query further below. */
  
  @media (min-width: 1200px) {
    .iconic-title {
      font-size: 22rem;
    }
  }
}

/* ========================================
   SWEET FOOD EMOJI SLIDER (Behind Sugar Animation)
   ======================================== */

.sweet-slider-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1; /* Above background but below sugar word */
  overflow: hidden;
  pointer-events: none; /* Don't interfere with interactions */
}

.sweet-slider {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.sweet-slide-track {
  display: flex;
  align-items: center;
  animation: sweetSlide 20s linear infinite;
  white-space: nowrap;
  will-change: transform;
}

.sweet-emoji {
  font-size: 10rem;
  margin: 0 3rem;
  animation: sweetFloat 3s ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
  flex-shrink: 0;
  user-select: none;
  pointer-events: none;
  will-change: transform; /* GPU acceleration for smooth animation */
}

/* Stagger the floating animation for each emoji */
.sweet-emoji:nth-child(1) { --delay: 0s; }
.sweet-emoji:nth-child(2) { --delay: 0.2s; }
.sweet-emoji:nth-child(3) { --delay: 0.4s; }
.sweet-emoji:nth-child(4) { --delay: 0.6s; }
.sweet-emoji:nth-child(5) { --delay: 0.8s; }
.sweet-emoji:nth-child(6) { --delay: 1s; }
.sweet-emoji:nth-child(7) { --delay: 1.2s; }
.sweet-emoji:nth-child(8) { --delay: 1.4s; }
.sweet-emoji:nth-child(9) { --delay: 1.6s; }
.sweet-emoji:nth-child(10) { --delay: 1.8s; }
.sweet-emoji:nth-child(11) { --delay: 2s; }
.sweet-emoji:nth-child(12) { --delay: 2.2s; }
.sweet-emoji:nth-child(13) { --delay: 2.4s; }
.sweet-emoji:nth-child(14) { --delay: 2.6s; }
.sweet-emoji:nth-child(15) { --delay: 2.8s; }

/* Keyframe animations */
@keyframes sweetSlide {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%); /* Move by half since we have duplicate set */
  }
}

@keyframes sweetFloat {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(10deg);
  }
  100% {
    transform: translateY(0px) rotate(-5deg);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .sweet-emoji {
    font-size: 3rem;
    margin: 0 2rem;
  }
}

@media (max-width: 480px) {
  .sweet-emoji {
    font-size: 2.5rem;
    margin: 0 1.5rem;
  }
}

/* Comprehensive mobile-only rules for the ICONIC title (sugar animation)
   This replaces fragmented/mobile rules and ensures predictable
   sizing/spacing/transform behaviour on phones. */
@media (max-width: 768px) {
  .iconic-animation-section {
    padding: 20px 12px;
    min-height: 40vh;
  }

  .iconic-title {
    /* Use clamp so very small phones stay readable while larger phones
       scale the title moderately. Avoid extreme negative letter-spacing. */
    font-family: 'quick-gaseous', 'lacture', sans-serif;
  /* increased by 2rem on mobile devices */
  font-size: 6rem;
    line-height: 0.55;
    letter-spacing: -10px;     /* reduced from desktop -80px */
    text-align: center;
    -webkit-perspective: 800px;
    perspective: 800px;
    -webkit-transform: none;
    transform: none;
    color: #ffffff;
    white-space: nowrap; /* keep word intact for animation */
    overflow: visible;
  }

  /* Characters inside the title should be inline-block and inherit sizing.
     Limit heavy 3D transforms/offsets so the animation remains visible but
     doesn't push layout or overflow on small viewports. */
  .iconic-title .char {
    display: inline-block;
    font-size: inherit;
    line-height: 1;
    will-change: transform, opacity;
    transform-origin: center;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  /* If the sugar/sweet emoji slider sits behind the title, reduce its size
     further on phones to avoid overlap and improve contrast. (Non-destructive)
  */
  .iconic-animation-section .sweet-emoji {
    font-size: 3rem;
    opacity: 0.95;
  }

  /* Make sure very small screens don't wrap the title awkwardly; allow a
     single break if needed. */
  @media (max-width: 360px) {
    .iconic-title {
      /* increased by 2rem for very small screens */
      font-size: clamp(4.8rem, 10vw, 8.2rem);
      letter-spacing: -6px;
    }
  }
}

/* Subtle hover effect when near the sugar animation */
.iconic-animation-section:hover .sweet-slider-container .sweet-emoji {
  transition: opacity 0.3s ease;
}

#storyContainer {
background-color: #0073ff;
  padding-top: 2rem;
  display: flex;

}
#storyContainer > div {
  flex: 1; /* Each div takes equal width */
}
#story1{
  font-family: 'quick-gaseous', monospace;
  color: white;
  font-size: 2rem;
  margin: 1rem;
  padding: 10px;
  text-align: center;
  letter-spacing: -20px;
  line-height: 1;
    font-variant-ligatures: common-ligatures discretionary-ligatures historical-ligatures contextual;
  font-feature-settings: "liga" 1, "dlig" 1, "hlig" 1, "clig" 1;

}
#story2{  
  color: rgb(255, 164, 148);
  text-align:left;
  font-size: 5rem;
  margin: 1rem;
  padding: 10px;
  font-style: italic;
  line-height: 0.8;


}

.story-line {
  margin: 1.2rem 0;
  padding: 10px;
  overflow: hidden; /* Hide initial overflow from transforms */
  position: relative; /* Ensure proper positioning context */
  
  /* Hide initially to prevent text flash before animation */
  opacity: 0;
  visibility: hidden;
}

/* Show story line when animation is ready */
.story-line.animation-ready {
  opacity: 1;
  visibility: visible;
}

.story-word {
  display: inline-block;
  transform-origin: center bottom;
  margin-right: 0.25em;
  margin-bottom: 5px;
  font-family: 'quick-gaseous', monospace;
  font-weight: 100;
  letter-spacing: 0.01em;
  
  /* Initial hidden state - prevents flash before animation */
  opacity: 0;
  transform: translateY(80px) scale(0.95) rotate(-10deg) skewX(15deg);
  filter: blur(18px);
  
  /* Enhanced visual effects */
  text-shadow: 0 2px 4px rgb(255, 0, 0);
  
  /* Hardware acceleration for smooth animations */
  will-change: transform, opacity, filter;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Subtle hover effect */
  transition: text-shadow 0.2s ease;
}

.story-word:hover {
  text-shadow: 0 4px 8px rgb(255, 255, 255);
}

/* Responsive adjustments for story words */
 @media (max-width: 768px) {
  #story1{
    font-size: 2rem !important;
  }
  #story2{  
   display: none;

  }
  
  #story1-line1 {
    margin-bottom: 2.5rem;
  }
  
  .story-line {

    line-height: 1;
  }
  
  .story-word {
    letter-spacing: 0.05em;
  }
} 

@media (max-width: 480px) {
  .story-word {
    margin-right: 0.15em;
  }
}

/* Epic Text Animation Section */
.epic-text-section {
  min-height: 100vh;
  background: 
    radial-gradient(circle at 20% 70%, rgb(14, 0, 139) 20%, transparent 50%),
    radial-gradient(circle at 90% 30%, rgb(80, 94, 255) 0%, transparent 50%);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  position: relative;
  z-index: 10;
  padding: 0;
}

.epic-container {
  border-radius: 40px;
  max-width: 1200px;
  padding: 40px;
  padding-left: 100px;
  margin: 20px;
  width: 100%;
}

.epic-title {
  font-family: 'quick-gaseous', monospace;
  font-size: 7rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: left;
}

.epic-word {
  display: inline-block;
  color: #00c414 !important;
}

.epic-word:last-child {
  margin-right: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .epic-title {
    font-size: 3rem;
  }
}

@media (max-width: 768px) {
  .epic-word {
    font-size: 3rem;
  }
  
  .epic-word {
    margin-right: 0.2em;
  }
}

@media (max-width: 480px) {
  .epic-title {
    font-size: 1.8rem;
  }
}

/* ========================================
   TIME MACHINE STYLES
   ======================================== */

.time-machine-button {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  color: rgb(255, 255, 255) !important;
  border: none !important;
  position: relative;
  overflow: hidden;
  font-weight: 900;
}

.time-machine-button:hover {
  background: linear-gradient(135deg, #9d00ff, #ff5500) !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgb(255, 255, 255);
  transition:all .1s ease;
}

/* Prediction Button Styles */
.prediction-button {
  background-color: rgb(255, 255, 255);
  color: rgb(0, 0, 0) !important;
  border: none !important;
  position: relative;
  overflow: hidden;
}

.prediction-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.prediction-button:hover::before {
  left: 100%;
}

.prediction-button:hover {
  background: linear-gradient(135deg, #34495e, #16a085) !important;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 25px rgba(95, 140, 213, 0.5);
  color: white !important;
}

/* Research Button Styling */
.research-button {
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  color: white !important;
  border: 1px solid #444 !important;
  position: relative;
  overflow: hidden;
  font-weight: 600;
}

.research-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.4s ease;
}

.research-button:hover::before {
  left: 100%;
}

.research-button:hover {
  background: linear-gradient(135deg, #000, #1a1a1a) !important;
  border-color: #666 !important;
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  color: white !important;
}

/* AUTH REQUIRED MODAL */
.auth-required-modal-overlay {
  font-family: 'quick-gaseous', monospace;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(185, 69, 69, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.auth-required-modal-content {
  background: radial-gradient(circle at 10% 10%,#f9a7ff 15% , #ffea2a 15%);
  border-radius: 15px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  position: relative;
  animation: slideIn 0.3s ease-out;
}

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

.auth-modal-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.auth-required-modal-content h2 {
  color: #00600e;
  font-size: 2rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.auth-required-modal-content p {
  color: #a600ff;
  font-size: 1.4rem;
  margin-bottom: 30px;
  line-height: 1.3;
}

.auth-modal-buttons {
  font-family: 'quick-gaseous', monospace;
  display: flex;
  gap: 12px;
  flex-direction: column;
  margin-bottom: 15px;
}

.auth-modal-btn {
    font-family: 'quick-gaseous', monospace;

  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.05s ease;
  width: 100%;
}

.auth-modal-btn.signup-btn {
  background: #6366f1;
  color: white;
}

.auth-modal-btn.signup-btn:hover {
  background: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.auth-modal-btn.login-btn {
  background: #e5e7eb;
  color: #000;
}

.auth-modal-btn.login-btn:hover {
  background: #d1d5db;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.auth-modal-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #666;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.auth-modal-close-btn:hover {
  color: #000;
  transform: scale(1.1);
}

/* Mobile responsive */
@media (max-width: 480px) {
  .auth-required-modal-content {
    padding: 25px;
  }
  
  .auth-required-modal-content h2 {
    font-size: 1.5rem;
  }
  
  .auth-required-modal-content p {
    font-size: 0.95rem;
  }
}

.time-machine-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 35% 40%, rgb(182, 0, 210) 30%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgb(6, 183, 0) 20%, transparent 55%);
;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(15px);
}

.time-machine-content {
  font-family: 'quick-gaseous', monospace;
  background: radial-gradient(rgb(0, 33, 96) 0%, rgb(55, 0, 255) 100%);
  border-radius: 15px;
  padding: 30px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgb(255, 0, 0);
  border: 2px solid rgb(255, 255, 255);
  
  /* Hide scrollbar while maintaining scroll functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.time-machine-content::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.time-machine-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  border-bottom: 2px solid rgb(255, 255, 255);
  padding-bottom: 15px;
}

.time-machine-header h2 {
  color: #ffffff;
  font-size: 2.8rem;
  font-weight: normal;
  text-decoration: none;
  text-align: center;
  width: 100%;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: #ffffff;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgb(255, 255, 255);
  color: #ff0000;
  transform: rotate(90deg);
}

.medical-disclaimer {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.589);
  border-radius: 10px;
  padding: 15px 20px;
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: #ffffff;
  line-height: 1.6;
}

.medical-disclaimer p {
  margin: 0;
}

/* Mobile responsive - smaller text for medical disclaimer */
@media (max-width: 768px) {
  .medical-disclaimer {
    font-size: 1.2rem;
    padding: 12px 15px;
    margin-bottom: 15px;
  }
}

@media (max-width: 480px) {
  .medical-disclaimer {
    font-size: 0.8rem;
    padding: 10px 12px;
    margin-bottom: 12px;
    line-height: 1.4;
  }
} 

.time-machine-step h3 {
  color: #ffffff;
  font-size: 1.4rem;
  margin-bottom: 20px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.meal-search-container {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
}

.meal-search-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid rgb(255, 255, 255);
  border-radius: 8px;
  background: rgb(11, 82, 43);
  color: #ffffff;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.meal-search-input:focus {
  outline: none;
  border-color: rgb(255, 196, 196);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.meal-search-input::placeholder {
  color: rgb(255, 255, 255);
}

.food-grid-simple {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.food-option {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(186, 0, 0, 0.1);
  color: #ffffff;
}

.food-option:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.food-option.selected {
  border-color: #00ff3c;
  background: rgba(16, 185, 129, 0.3);
  color: #000000;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.food-name {
  text-decoration: underline;
  font-size: 1.2rem;
  margin-bottom: 5px;
  color: #ffffff;
}

.food-details {
  color: #ffffff;
  font-size: 1.1rem;
}

.food-option.selected .food-details {
  color: #000000;
}

/* Food Preview Styles */
.food-preview-content {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.food-card-preview {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  max-width: 500px;
  width: 100%;
}

.preview-info {
  margin-bottom: 20px;
}

.preview-macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.macro-item {
  
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.macro-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
  display: inline-block;
}

.macro-label {
  font-size: 1rem;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgb(255, 255, 255);
  margin-bottom: 4px;
}

.macro-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #00ff1e;
}

.question-group {
  margin-bottom: 25px;
}

.question-group h4 {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.radio-option {
  display: block;
  margin-bottom: 10px;
  cursor: pointer;
  padding: 10px 15px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.radio-option:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.2);
}

.radio-option input[type="radio"] {
  margin-right: 10px;
}

.radio-option input[type="radio"]:checked + span {
  color: #ffffff;
  font-weight: 700;
}

.question-group input[type="number"] {
  width: 100%;
  padding: 12px 15px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.question-group input[type="number"]:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.question-group input[type="number"]::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.input-hint {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 8px;
  font-style: italic;
}

.modal-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-actions button {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-actions button[type="submit"],
.modal-actions button:last-child {
  background: #6366f1;
  color: white;
}

.modal-actions button[type="submit"]:hover,
.modal-actions button:last-child:hover {
  background: #5858e8;
  transform: translateY(-1px);
}

.modal-actions button[type="button"]:first-child {
  background: #f3f4f6;
  color: #374151;
}

.modal-actions button[type="button"]:first-child:hover {
  background: #e5e7eb;
}

.prediction-summary {
  background: #ffffff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  border-left: 4px solid #7b00ff;
}

.prediction-summary h4 {
  color: #000000;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.prediction-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.stat {
  background: #ebf5ff;
  padding: 10px;
  border: solid turquoise 1.5px;
  border-radius: 6px;
  text-align: center;
}

.stat label {
  display: block;
  color: #000;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.stat .value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #6366f1;
}

.prediction-chart {
  margin: 30px 0;
  text-align: center;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.prediction-chart h4 {
  color: #000000;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.glucose-chart {
  border: 2px solid #e0e7ff;
  border-radius: 12px;
  padding: 0;
  background: linear-gradient(135deg, #fafbff 0%, #ffffff 100%);
  display: block;
  margin: 0 auto;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
  /* Responsive sizing */
  width: 100%;
  min-width: 1000px;
  height: auto;
}

@media (max-width: 1024px) {
  .glucose-chart {
    min-width: 800px;
  }
}

@media (max-width: 640px) {
  .glucose-chart {
    min-width: 600px;
  }

  .exercise-disclaimer strong {
    font-size: 0.9rem !important;
  }

  .exercise-disclaimer p {
    font-size: 0.9rem !important;
  }
}

.crash-analysis {
  background: #fff7ed;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  border-left: 4px solid #f59e0b;
}

.crash-analysis h4 {
  color: #000000;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.crash-analysis.severe {
  background: #fef2f2;
  border-left-color: #ef4444;
}

.crash-analysis.moderate {
  background: #fff7ed;
  border-left-color: #f59e0b;
}

.crash-analysis.mild {
  background: #f0fdf4;
  border-left-color: #10b981;
}

.stat .value.severe {
  color: #ef4444;
  font-weight: 700;
}

.stat .value.moderate {
  color: #f59e0b;
  font-weight: 700;
}

.stat .value.mild {
  color: #10b981;
  font-weight: 700;
}

.crash-details p {
  margin-bottom: 8px;
  color: #374151;
}

.crash-details .crash-advice {
  background: rgba(249, 115, 22, 0.1);
  padding: 10px;
  border-radius: 6px;
  font-style: italic;
  margin-top: 10px;
}

/* Protein Research Section Styles */
.protein-research-section {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 12px;
  padding: 25px;
  margin: 25px 0;
  border: 2px solid #0ea5e9;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.1);
}

.protein-research-section h4 {
  color: #0c4a6e;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.protein-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.protein-amount, .protein-reduction, .protein-insulin {
  background: white;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.protein-amount strong, .protein-reduction strong, .protein-insulin strong {
  display: block;
  font-size: 1.8rem;
  color: #0369a1;
  margin-bottom: 5px;
  font-weight: 800;
}

.protein-amount span, .protein-reduction span, .protein-insulin span {
  font-size: 0.85rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.research-findings {
  margin-top: 20px;
}

.research-findings h5 {
  color: #0c4a6e;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #bae6fd;
}

.study-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #0284c7;
}

.study-header {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0f2fe;
}

.study-header h6 {
  color: #0c4a6e;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.study-header .journal {
  color: #64748b;
  font-size: 0.9rem;
  font-style: italic;
}

.study-content p {
  margin-bottom: 12px;
  line-height: 1.6;
  color: #334155;
}

.study-content .finding {
  background: #f0f9ff;
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid #0ea5e9;
  font-weight: 500;
}

.study-content .dose-response {
  font-weight: 600;
  color: #0369a1;
  margin-top: 15px;
  margin-bottom: 8px;
}

.study-content ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

.study-content ul li {
  margin-bottom: 6px;
  color: #475569;
  line-height: 1.5;
}

.study-content ul li strong {
  color: #0c4a6e;
}

.study-content .mechanism {
  background: #fef3c7;
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid #eab308;
  font-size: 0.95rem;
  line-height: 1.6;
}

.study-content .mechanism em {
  font-style: italic;
  color: #92400e;
  font-weight: 600;
}

.study-content .clinical-impact {
  background: #f0fdf4;
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid #10b981;
  font-weight: 500;
  margin-top: 12px;
}

.study-content .combined-effect {
  background: #faf5ff;
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid #a855f7;
  font-weight: 500;
  margin-top: 12px;
}

.practical-recommendations {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
  border: 2px dashed #0ea5e9;
}

.practical-recommendations h5 {
  color: #0c4a6e;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.recommendation {
  background: #f8fafc;
  padding: 15px;
  border-radius: 8px;
  border-left: 3px solid #0ea5e9;
}

.recommendation strong {
  display: block;
  color: #0369a1;
  font-size: 1rem;
  margin-bottom: 8px;
}

.recommendation p {
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

/* ========================================
   MEAL BUILDER STYLING
   ======================================== */

.meal-builder-toggle {
  margin: 20px auto 30px;
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #ffb885 10%, #f0a2ff 100%);
  border-radius: 12px;
  border: 2px dashed #0ea5e9;
}

.meal-builder-btn {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  border: none;
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'quick-gaseous';
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3);
}

.meal-builder-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
}

.meal-builder-btn.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.meal-builder-hint {
  margin-top: 12px;
  color: #000000;
  font-size: 0.9rem;
  font-style: italic;
}

.meal-summary-panel {
  background: white;
  border: 2px solid #0ea5e9;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.meal-summary-panel h3 {
  color: #0369a1;
  margin: 0 0 16px;
  font-size: 1.3rem;
  border-bottom: 2px solid #e0f2fe;
  padding-bottom: 10px;
}

.meal-items-list {
  margin-bottom: 20px;
}

.meal-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 15px;
  align-items: start;
  padding: 12px 15px;
  margin-bottom: 10px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 4px solid #0ea5e9;
  transition: all 0.2s ease;
}

.meal-item:hover {
  background: #f0f9ff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

.meal-item-info h4 {
  margin: 0 0 6px;
  color: #2a260f;
  font-size: 1rem;
}

.meal-item-quantity {
  color: #ffbf00;
  font-size: 0.9rem;
  font-weight: 600;
}

.meal-item-macros {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.85rem;
  color: #696847;
}

.meal-item-macros span {
  background: white;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.meal-item-slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.slider-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #006aff;
  white-space: nowrap;
  min-width: 80px;
}

.meal-item-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #daffe3 0%, #00a51e 100%);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.meal-item-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #00942d;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid rgb(0, 117, 23);
  transition: all 0.2s ease;
}

.meal-item-slider::-webkit-slider-thumb:hover {
  background: #0369a1;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
  transform: scale(1.15);
}

.meal-item-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0284c7;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid white;
  transition: all 0.2s ease;
}

.meal-item-slider::-moz-range-thumb:hover {
  background: #0369a1;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
  transform: scale(1.15);
}

.meal-item-slider::-moz-range-track {
  background: transparent;
  border: none;
}

.portion-display {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0284c7;
  background: #f0f9ff;
  padding: 4px 10px;
  border-radius: 4px;
  min-width: 45px;
  text-align: center;
  border: 1px solid #bfdbfe;
}

/* Single Food Mode Portion Slider */
.single-food-portion-container {
  margin: 12px 0;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.portion-slider-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portion-slider-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
}

.portion-slider-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.single-food-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #dbeafe 0%, #0ea5e9 100%);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.single-food-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0284c7;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid white;
  transition: all 0.2s ease;
}

.single-food-slider::-webkit-slider-thumb:hover {
  background: #0369a1;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
  transform: scale(1.15);
}

.single-food-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0284c7;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid white;
  transition: all 0.2s ease;
}

.single-food-slider::-moz-range-thumb:hover {
  background: #0369a1;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
  transform: scale(1.15);
}

.single-food-slider::-moz-range-track {
  background: transparent;
  border: none;
}

.portion-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0284c7;
  background: #f0f9ff;
  padding: 4px 10px;
  border-radius: 4px;
  min-width: 45px;
  text-align: center;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

.meal-item-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #0ea5e9;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.qty-btn:hover {
  background: #0284c7;
  transform: scale(1.1);
}

.qty-btn:active {
  transform: scale(0.95);
}

.remove-btn {
  padding: 8px 12px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.remove-btn:hover {
  background: #dc2626;
  transform: scale(1.05);
}

.meal-totals {
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #06b6d4;
}

.meal-totals h4 {
  margin: 0 0 15px;
  color: #0e7490;
  font-size: 1.1rem;
  text-align: center;
}

.meal-totals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.total-stat {
  background: rgb(48, 193, 89);
  padding: 12px;
  border: rgb(29, 170, 19) solid;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(6, 182, 212, 0.1);
}

.total-stat-label {
  display: block;
  color: #64748b;
  font-size: 0.8rem;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.total-stat strong {
  display: block;
  color: #0f172a;
  font-size: 1.3rem;
  font-weight: 700;
}

/* Icon styling for total macros */
.total-stat span[style*="font-size: 1.2rem"] {
  font-size: 2rem !important;
  margin-right: 6px;
  display: inline-block;
}

.protein-ratio.good {
  color: #16a34a !important;
}

.protein-ratio.warning {
  color: #f97316 !important;
}

.meal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.meal-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-family: 'quick-gaseous';
  cursor: pointer;
  transition: all 0.2s ease;
}

.meal-actions button:first-child {
  background: #64748b;
  color: white;
}

.meal-actions button:first-child:hover {
  background: #475569;
}

.meal-actions button:last-child {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.meal-actions button:last-child:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* Animation for adding food to meal */
@keyframes addedToMeal {
  0% {
    transform: scale(1);
    background: white;
  }
  50% {
    transform: scale(1.05);
    background: #d1fae5;
  }
  100% {
    transform: scale(1);
    background: white;
  }
}

.added-to-meal {
  animation: addedToMeal 0.3s ease;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
  .meal-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .meal-item-controls {
    justify-content: flex-end;
  }
  
  .meal-totals-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Mobile icon sizing for total macros - tablet */
  .total-stat span[style*="font-size: 1.2rem"] {
    font-size: 2rem !important;
  }
  
  .meal-builder-btn {
    padding: 12px 24px;
    font-size: 1rem;
  }
  
  .meal-actions {
    flex-direction: column;
  }
}

@media screen and (max-width: 480px) {
  .meal-totals-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile icon sizing for total macros - small phones */
  .total-stat span[style*="font-size: 1.2rem"] {
    font-size: 2rem !important;
    margin-right: 4px;
  }
  
  .meal-item-macros {
    flex-wrap: wrap;
  }
}

/* ========================================
   PROTEIN DISCLAIMER STYLING
   ======================================== */

.protein-disclaimer {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 10px;
  border-left: 4px solid;
  font-size: 0.95rem;
  line-height: 1.6;
}

.protein-disclaimer.protein-active {
  background: linear-gradient(135deg, #c0c7fc 0%, #a7f3d0 100%);
  border-left-color: #10b981;
}

.protein-disclaimer.protein-inactive {
  background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
  border-left-color: #f97316;
}

.disclaimer-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.disclaimer-content {
  color: #1e293b;
}

.disclaimer-content strong {
  color: #0f172a;
  font-weight: 700;
}

.protein-disclaimer.protein-active .disclaimer-content {
  color: #064e3b;
}

.protein-disclaimer.protein-active .disclaimer-content strong {
  color: #065f46;
}

.protein-disclaimer.protein-inactive .disclaimer-content {
  color: #7c2d12;
}

.protein-disclaimer.protein-inactive .disclaimer-content strong {
  color: #9a3412;
}

@media screen and (max-width: 768px) {
  .protein-disclaimer {
    padding: 14px 16px;
    font-size: 0.9rem;
  }
  
  .disclaimer-icon {
    font-size: 1.5rem;
  }
}

/* Mobile optimization for Fiber Impact Analysis */
@media screen and (max-width: 768px) {
  .fiber-research-section {
    padding: 16px !important;
    margin: 16px 0 !important;
  }
  
  .fiber-research-section h4 {
    font-size: 1.1rem !important;
    margin-bottom: 12px !important;
  }
  
  .fiber-stats {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-bottom: 15px !important;
  }
  
  .fiber-stats > div {
    padding: 12px !important;
    border-radius: 6px !important;
  }
  
  .fiber-stats > div strong {
    font-size: 1.1rem !important;
  }
  
  .fiber-stats > div span {
    font-size: 0.85rem !important;
  }
  
  /* Toggle button optimization for mobile */
  .fiber-research-section button {
    width: 100% !important;
    padding: 12px 14px !important;
    font-size: 0.9rem !important;
    border-radius: 6px !important;
    margin-bottom: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
  }
  
  .research-findings {
    padding: 12px !important;
    margin-bottom: 12px !important;
  }
  
  .research-findings h5 {
    font-size: 1rem !important;
    margin-bottom: 10px !important;
  }
  
  .study-card {
    padding: 12px !important;
    margin-bottom: 12px !important;
    border-radius: 6px !important;
  }
  
  .study-header h6 {
    font-size: 0.95rem !important;
    margin-bottom: 4px !important;
  }
  
  .study-header span {
    font-size: 0.8rem !important;
  }
  
  .study-content {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
  }
  
  .study-content p {
    margin: 6px 0 !important;
  }
  
  .study-content ul {
    margin: 6px 0 !important;
    padding-left: 16px !important;
  }
  
  .study-content li {
    margin: 4px 0 !important;
    font-size: 0.9rem !important;
  }
  
  /* Key insight box mobile */
  .fiber-research-details > div[style*="background: #d1fae5"] {
    padding: 10px 12px !important;
    margin-bottom: 12px !important;
  }
  
  .fiber-research-details > div[style*="background: #d1fae5"] p {
    font-size: 0.9rem !important;
  }
  
  /* Recommendations section mobile */
  .recommendations {
    padding: 12px !important;
    border-radius: 6px !important;
  }
  
  .recommendations h6 {
    font-size: 0.95rem !important;
    margin-bottom: 10px !important;
  }
  
  .recommendations > div {
    margin: 8px 0 !important;
    padding: 8px !important;
    border-radius: 4px !important;
  }
  
  .recommendations strong {
    font-size: 0.9rem !important;
    display: block !important;
  }
  
  .recommendations p {
    font-size: 0.85rem !important;
    margin-top: 4px !important;
  }
  
  /* Citations section mobile */
  .study-citations {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid #e5e7eb !important;
  }
  
  .study-citations h6 {
    font-size: 0.9rem !important;
    margin-bottom: 8px !important;
  }
  
  .citation {
    font-size: 0.85rem !important;
    margin: 4px 0 !important;
  }
}

/* Extra small screens (max-width: 480px) */
@media screen and (max-width: 480px) {
  .fiber-research-section {
    padding: 12px !important;
    margin: 12px 0 !important;
  }
  
  .fiber-research-section h4 {
    font-size: 1rem !important;
  }
  
  .fiber-stats > div {
    padding: 10px !important;
  }
  
  .fiber-stats > div strong {
    font-size: 1rem !important;
  }
  
  .fiber-stats > div span {
    font-size: 0.8rem !important;
  }
  
  .fiber-research-section button {
    padding: 10px 12px !important;
    font-size: 0.85rem !important;
  }
  
  .research-findings {
    padding: 10px !important;
  }
  
  .study-card {
    padding: 10px !important;
  }
  
  .study-content {
    font-size: 0.85rem !important;
  }
  
  .recommendations > div {
    padding: 6px !important;
  }
  
  .citation {
    font-size: 0.8rem !important;
    margin: 3px 0 !important;
  }
}

.study-citations {
  background: #f1f5f9;
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
}

.study-citations h6 {
  color: #334155;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.study-citations .citation {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 8px;
  padding-left: 15px;
  text-indent: -15px;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .protein-stats {
    grid-template-columns: 1fr;
  }
  
  .recommendations-grid {
    grid-template-columns: 1fr;
  }
  
  .protein-amount strong, .protein-reduction strong, .protein-insulin strong {
    font-size: 1.5rem;
  }
}

.prediction-timeline h4 {
  color: #333;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.timeline-points {
  display: grid;
  gap: 10px;
}

.timeline-point {
  background: #f9fafb;
  padding: 12px 15px;
  border-radius: 8px;
  border-left: 3px solid #6366f1;
}

.timeline-point strong {
  color: #333;
  font-weight: 600;
}

.confidence {
  color: #0073ff;
  font-size: 0.85rem;
  margin-left: 10px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .time-machine-content {
    padding: 20px;
    margin: 10px;
  }
  
  .meal-search-input {
    font-size: 16px;
    padding: 10px 12px;
  }
  
  .food-grid-simple {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  /* ===== GLUCOSE CHART - MOBILE OPTIMIZATION ===== */
  .glucose-chart {
    width: 100%;
    height: 200px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  
  .prediction-chart {
    margin: 15px 0;
    padding: 0 10px;
    overflow-x: auto;
  }
  
  .prediction-chart h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    padding: 0 10px;
  }
  
  /* Ensure SVG chart has proper scaling and text visibility */
  .glucose-chart text {
    font-size: 9px !important;
  }
  
  .glucose-chart line {
    stroke-width: 1px;
  }
  
  .glucose-chart polyline {
    stroke-width: 2px;
  }
  
  /* ===== PREDICTION SUMMARY - MOBILE ===== */
  .prediction-summary {
    padding: 15px;
    margin: 15px 0;
  }
  
  .prediction-summary h4 {
    font-size: 1.1rem;
    margin-bottom: 12px;
  }
  
  .nutrition-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  
  .stat {
    padding: 8px;
    font-size: 0.9rem;
  }
  
  .stat label {
    font-size: 0.85rem;
  }
  
  .stat .value {
    font-size: 1rem;
  }
  
  /* ===== AMY-1 RATING SECTION - MOBILE ===== */
  .amy1-rating-section {
    padding: 12px !important;
    margin-top: 15px !important;
    border-radius: 6px !important;
  }
  
  .amy1-rating-badge {
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    display: inline-block;
  }
  
  /* ===== RESEARCH SECTION - MOBILE ===== */
  .research-section {
    padding: 15px !important;
    margin-top: 15px !important;
    border-radius: 6px !important;
  }
  
  .research-section h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
  }
  
  .research-text {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
  }
  
  /* ===== PROTEIN DISCLAIMER - MOBILE ===== */
  .protein-disclaimer {
    padding: 12px !important;
    margin: 15px 0 !important;
    font-size: 0.9rem;
  }
  
  .protein-disclaimer-content {
    margin-top: 8px;
  }
  
  /* ===== CRASH ANALYSIS - MOBILE ===== */
  .crash-analysis {
    padding: 15px;
    margin: 15px 0;
  }
  
  .crash-analysis h4 {
    font-size: 1.1rem;
    margin-bottom: 12px;
  }
  
  .crash-details {
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  .crash-details p {
    margin: 8px 0;
  }
  
  .metabolic-explanation {
    margin-top: 12px;
    font-size: 0.85rem;
  }
  
  .metabolic-explanation h5 {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }
}

/* ===== EXTRA SMALL PHONES (480px and below) ===== */
@media (max-width: 480px) {
  /* GLUCOSE CHART - SMALL PHONES */
  .glucose-chart {
    width: 100%;
    height: 220px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 5px;
  }
  
  .glucose-chart text {
    font-size: 8px !important;
    word-spacing: 2px;
  }
  
  .glucose-chart tspan {
    font-size: 8px !important;
  }
  
  /* Ensure SVG axes are visible */
  .glucose-chart line {
    stroke-width: 1px;
    stroke: #e5e7eb;
  }
  
  .glucose-chart polyline {
    stroke-width: 2px;
  }
  
  .glucose-chart circle {
    r: 4;
  }
  
  .prediction-chart {
    margin: 12px 0;
    padding: 0 8px;
    width: 100%;
  }
  
  .prediction-chart h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    word-break: break-word;
  }
  
  /* PREDICTION STATS - SMALL PHONES */
  .prediction-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .stat {
    padding: 6px 8px;
    font-size: 0.85rem;
    background: #d5eafe;
    border-radius: 4px;
  }
  
  .stat label {
    display: block;
    font-size: 0.75rem;
    color: #000;
    margin-bottom: 4px;
  }
  
  .stat .value {
    font-size: 0.95rem;
    font-weight: 600;
  }
  
  /* PREDICTION SUMMARY - SMALL PHONES */
  .prediction-summary {
    padding: 12px;
    margin: 12px 0;
    border-radius: 6px;
  }
  
  .prediction-summary h4 {
    font-size: 1rem;
    margin-bottom: 10px;
  }
  
  .metabolic-state-info {
    margin-bottom: 10px;
    font-size: 0.85rem;
  }
  
  .metabolic-state-info p {
    margin: 4px 0;
  }
  
  .medical-note {
    font-size: 0.8rem !important;
    color: #666;
  }
  
  .nutrition-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  /* AMY-1 SECTION - SMALL PHONES */
  .amy1-rating-section {
    padding: 10px !important;
    margin: 12px 0 !important;
    border-radius: 4px !important;
    border: 1px solid #22c55e !important;
  }
  
  .amy1-rating-section h4 {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }
  
  .amy1-rating-badge {
    padding: 5px 10px !important;
    font-size: 0.8rem !important;
    display: inline-block;
  }
  
  /* RESEARCH SECTION - SMALL PHONES */
  .research-section {
    padding: 12px !important;
    margin: 12px 0 !important;
    border-radius: 4px !important;
    border: 1px solid #9333ea !important;
  }
  
  .research-section h4 {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }
  
  .research-text {
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
  }
  
  /* PROTEIN DISCLAIMER - SMALL PHONES */
  .protein-disclaimer {
    padding: 10px !important;
    margin: 12px 0 !important;
    font-size: 0.85rem;
    border-radius: 4px;
  }
  
  .protein-disclaimer.protein-active {
    background: #ecfdf5 !important;
    border-left: 3px solid #10b981 !important;
  }
  
  .protein-disclaimer.protein-inactive {
    background: #fef3c7 !important;
    border-left: 3px solid #f59e0b !important;
  }
  
  .protein-disclaimer-content {
    margin-top: 6px;
    font-size: 0.8rem;
  }
  
  /* CRASH ANALYSIS - SMALL PHONES */
  .crash-analysis {
    padding: 12px;
    margin: 12px 0;
    border-left-width: 3px;
    border-radius: 4px;
  }
  
  .crash-analysis h4 {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }
  
  .crash-details {
    font-size: 0.8rem;
    line-height: 1.4;
  }
  
  .crash-details p {
    margin: 4px 0;
  }
  
  .metabolic-explanation {
    margin-top: 8px;
    font-size: 0.75rem;
  }
  
  .metabolic-explanation h5 {
    font-size: 0.85rem;
    margin-bottom: 4px;
  }
  
  /* TIME MACHINE MODAL - SMALL PHONES */
  .time-machine-content {
    padding: 15px;
    margin: 5px;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .time-machine-header {
    margin-bottom: 15px;
  }
  
  .time-machine-header h2 {
    font-size: 1.3rem;
    margin-bottom: 10px;
  }
  
  .food-grid-simple {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .food-option {
    padding: 15px;
    font-size: 1rem;
  }
  
  .food-name {
    font-weight: 600;
    font-size: 0.9rem;
  }
  
  .food-details {
    font-size: 0.75rem;
    color: #ffffff;
  }
}

/* ===== EXTRA SMALL DEVICES (380px and below) ===== */
@media (max-width: 380px) {
  /* GLUCOSE CHART - ULTRA SMALL */
  .glucose-chart {
    height: 180px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 4px;
  }
  
  .glucose-chart text {
    font-size: 7px !important;
  }
  
  .glucose-chart circle {
    r: 3;
  }
  
  .prediction-chart h4 {
    font-size: 0.85rem;
    margin-bottom: 8px;
  }
  
  /* PREDICTION STATS - ULTRA SMALL */
  .prediction-stats {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .stat {
    padding: 5px 6px;
    font-size: 0.8rem;
  }
  
  .stat label {
    font-size: 0.7rem;
    margin-bottom: 2px;
  }
  
  .stat .value {
    font-size: 0.9rem;
  }
  
  /* PREDICTION SUMMARY - ULTRA SMALL */
  .prediction-summary {
    padding: 10px;
    margin: 10px 0;
  }
  
  .prediction-summary h4 {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }
  
  .metabolic-state-info {
    font-size: 0.8rem;
  }
  
  .medical-note {
    font-size: 0.75rem !important;
  }
  
  .nutrition-stats {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  
  /* AMY-1 SECTION - ULTRA SMALL */
  .amy1-rating-section {
    padding: 8px !important;
    margin: 10px 0 !important;
  }
  
  .amy1-rating-section h4 {
    font-size: 0.85rem;
    margin-bottom: 6px;
  }
  
  .amy1-rating-badge {
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
  }
  
  /* RESEARCH SECTION - ULTRA SMALL */
  .research-section {
    padding: 10px !important;
    margin: 10px 0 !important;
  }
  
  .research-section h4 {
    font-size: 0.85rem;
    margin-bottom: 6px;
  }
  
  .research-text {
    font-size: 0.8rem !important;
    line-height: 1.25 !important;
  }
  
  /* PROTEIN DISCLAIMER - ULTRA SMALL */
  .protein-disclaimer {
    padding: 8px !important;
    margin: 10px 0 !important;
    font-size: 0.8rem;
  }
  
  .protein-disclaimer-content {
    margin-top: 4px;
    font-size: 0.75rem;
  }
  
  /* CRASH ANALYSIS - ULTRA SMALL */
  .crash-analysis {
    padding: 10px;
    margin: 10px 0;
  }
  
  .crash-analysis h4 {
    font-size: 0.85rem;
    margin-bottom: 6px;
  }
  
  .crash-details {
    font-size: 0.75rem;
    line-height: 1.3;
  }
  
  .metabolic-explanation {
    margin-top: 6px;
    font-size: 0.7rem;
  }
  
  .metabolic-explanation h5 {
    font-size: 0.8rem;
    margin-bottom: 3px;
  }
  
  /* TIME MACHINE MODAL - ULTRA SMALL */
  .time-machine-content {
    padding: 12px;
    margin: 3px;
  }
  
  .time-machine-header h2 {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }
  
  .food-option {
    padding: 8px;
    font-size: 0.8rem;
  }
  
  .food-name {
    font-size: 0.85rem;
  }
  
  .food-details {
    font-size: 0.7rem;
  }
}

/* Animated Prediction Modal Styles */
.prediction-animation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(99, 102, 241, 0.2));
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.prediction-animation-overlay.show {
  opacity: 1;
  visibility: visible;
}

.prediction-animation-overlay.fade-out {
  opacity: 0;
  transform: scale(1.5);
}

.prediction-animation-modal {
  background: linear-gradient(145deg, #ffffff, #a4d2ff);
  border-radius: 24px;
  box-shadow: 
    0 25px 50px -12px rgb(0, 156, 44),
    0 0 0 1px rgb(13, 128, 0);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.8) translateY(40px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.prediction-animation-overlay.show .prediction-animation-modal {
  transform: scale(1) translateY(0);
}

.prediction-animation-content {
  padding: 40px 30px;
  text-align: center;
}

.food-preview h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #00265c;
  margin-bottom: 15px;
}

.food-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.food-stats .stat {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.glucose-meter {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 30px auto;
  border-radius: 50%;
  background: linear-gradient(145deg, #f1f5f9, #f6b3ff);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    inset 0 10px 20px rgba(0, 0, 0, 0.1),
    inset 0 -10px 20px rgba(255, 255, 255, 0.8);
}

.meter-bg {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e2e8f0, #f8fafc);
  border: 3px solid #bccadc;
}

.meter-fill {
  position: absolute;
  bottom: 3px;
  left: 3px;
  right: 3px;
  width: auto;
  height: 0;
  background: linear-gradient(0deg, #ef4444, #f59e0b, #10b981);
  border-radius: 0 0 77px 77px;
  transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  z-index: 2;
}

.meter-fill.pulse-danger {
  animation: pulseDanger 1.2s ease-in-out infinite;
}

.meter-fill.pulse-warning {
  animation: pulseWarning 1s ease-in-out infinite;
}

@keyframes pulseDanger {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

@keyframes pulseWarning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Food Drop Animation */
.food-drop-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 15000;
  overflow: hidden;
}

.food-drop-item {
  position: absolute;
  font-size: 40px;
  opacity: 1;
  top: -60px;
  animation: foodDrop 4s linear forwards;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.8);
  z-index: 15001;
}


/* Responsive Navbar: desktop (default) and mobile adjustments 
/* Desktop: keep horizontal layout; Mobile: stack links and show compact layout 
/* @media (min-width: 768px) {
  .navbar {
    position: absolute;  overlay hero
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between; /* logo left, links right 
    background: transparent !important;
  }

  .logo a {
    font-size: 2.4rem !important;
  }

  .nav-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
  }

  .nav-links a {
    font-size: 1.05rem !important;
    color: #ffffff !important;
  }
} */

@media (max-width: 767px) {
  /* Mobile: show hamburger; hide nav links by default to keep hero visible */
  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row !important;
    gap: 0.5rem;
    z-index: 100;
  }

  .logo a {
    color: rgb(255, 0, 0) !important;
    font-size: 1.6rem !important;
  }

  /* Nav toggle (hamburger) */
  /* .nav-toggle {
    display: flex;
    align-items: flex-start;
    z-index: 1000;
    background: transparent;
    border: none;
    color: #00ff2a;
    font-size: 1.6rem;
padding-right: 15px;  } */

  /* Hide full nav links by default to keep hero animation visible */
  .nav-links {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background:navy;
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    z-index: 100;
    opacity: 90%;
  }

  /* Nav links always hidden on mobile - drawer is used instead */
  .nav-links {
    display: none !important;
  }

  .nav-links a {
    font-size: 2rem !important;
    color: #ffffff !important;
    padding: 0.5rem 0.25rem;
    width: 100%;
  }

  /* Make CTA buttons slightly smaller on narrow screens */
  .cta-button {
    font-size: 0.95rem;
    padding: 0.5rem 0.9rem;
    border-radius: 30px;
    width: auto;
  }
}
@keyframes foodDrop {
  0% {
    transform: translateY(0px) rotate(0deg);
    opacity: 1;
  }
  25% {
    opacity: 1;
    transform: translateY(25vh) rotate(90deg);
  }
  50% {
    opacity: 1;
    transform: translateY(50vh) rotate(180deg);
  }
  75% {
    opacity: 1;
    transform: translateY(75vh) rotate(270deg);
  }
  100% {
    transform: translateY(120vh) rotate(360deg);
    opacity: 0;
  }
}

.food-drop-item:nth-child(2n) {
  animation-delay: 0.2s;
  animation-duration: 3.5s;
}

.food-drop-item:nth-child(3n) {
  animation-delay: 0.4s;
  animation-duration: 4s;
}

.food-drop-item:nth-child(4n) {
  animation-delay: 0.6s;
  animation-duration: 3.2s;
}

.food-drop-item:nth-child(5n) {
  animation-delay: 0.8s;
  animation-duration: 3.8s;
}

/* Time Machine Button Sparkle Animation */
.time-machine-button {
  position: relative;
  overflow: visible;
}

.sparkle-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.sparkle-item {
  position: absolute;
  font-size: 16px;
  opacity: 0;
  transform: scale(0) rotate(0deg);
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
  z-index: 100;
}

.sparkle-item.animate {
  animation: sparkleAnimation 0.8s ease-out forwards;
}

@keyframes sparkleAnimation {
  0% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  30% {
    opacity: 1;
    transform: scale(1.2) rotate(180deg);
  }
  70% {
    opacity: 1;
    transform: scale(0.9) rotate(300deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.3) rotate(360deg);
  }
}

.meter-values {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  font-weight: 700;
  z-index: 2;
}

.baseline {
  color: #10b981;
  font-size: 0.9rem;
}

.peak {
  color: #ef4444;
  font-size: 1.2rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.prediction-text {
  margin: 30px 0;
}

.crash-severity {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 25px;
  line-height: 1.2;
}

.crash-severity.negligible {
  color: #10b981;
}

.crash-severity.moderate {
  color: #f59e0b;
}

.crash-severity.big {
  color: #ef4444;
}

.severity-word {
  text-transform: uppercase;
  letter-spacing: 1px;
  background: linear-gradient(135deg, currentColor, currentColor);
  -webkit-background-clip: text;
  background-clip: text;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 5px currentColor; }
  to { text-shadow: 0 0 15px currentColor, 0 0 25px currentColor; }
}

.crash-effects {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 25px 0;
  flex-wrap: wrap;
}

.effect {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 12px 18px;
  font-size: 1rem;
  font-weight: 600;
  color: #4b5563;
  transform: translateY(20px) scale(0.8);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.effect.animate {
  transform: translateY(0) scale(1);
  opacity: 1;
  border-color: #6366f1;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
}

.effect.laziness {
  background: linear-gradient(135deg, #fef3c7, #fed7aa);
  color: #92400e;
}

.effect.energy-crash {
  background: linear-gradient(135deg, #fecaca, #fca5a5);
  color: #991b1b;
}

.effect.insulin-response {
  background: linear-gradient(135deg, #ddd6fe, #c4b5fd);
  color: #5b21b6;
}

.timing-info {
  margin: 25px 0;
  padding: 20px;
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border-radius: 16px;
  border-left: 4px solid #0ea5e9;
}

.crash-timing {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0c4a6e;
  margin-bottom: 8px;
}

.description {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.5;
}

.go-deeper-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  transform: translateY(0);
}

.go-deeper-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, #5855eb, #7c3aed);
}

.go-deeper-btn:active {
  transform: translateY(0);
}

/* Mobile responsiveness for animation modal */
@media (max-width: 768px) {
  .prediction-animation-content {
    padding: 30px 20px;
  }
  
  .glucose-meter {
    width: 160px;
    height: 160px;
  }
  
  .meter-bg, .meter-fill {
    width: 120px;
    height: 120px;
  }
  
  .meter-fill {
    border-radius: 0 0 60px 60px;
  }
  
  .crash-severity {
    font-size: 1.4rem;
  }
  
  .crash-effects {
    flex-direction: column;
    align-items: center;
  }
  
  .effect {
    width: 100%;
    max-width: 200px;
  }
}

/* ========================================
   HEALTH NARRATIVE SECTIONS STYLES
   ======================================== */
.health-narrative-section {
  background: 
    radial-gradient(circle at 20% 80%, rgb(149, 0, 255) 10%, transparent 50%),
    radial-gradient(circle at 10% 10%, rgb(105, 140, 255), transparent 50%),
    radial-gradient(circle at 90% 30%, rgb(0, 17, 255) 0%, transparent 50%);
  padding: 80px 0;
  min-height: 100vh;
  
}

.narrative-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.narrative-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.narrative-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgb(255, 255, 255), transparent);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.narrative-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 
    0 40px 80px -12px rgb(255, 255, 255),
    inset 0 1px 0 rgb(255, 132, 0);
}

.narrative-card:hover::before {
  opacity: 1;
}

/* Theme Variations */
.narrative-card.dark-theme {
  background: linear-gradient(135deg, rgba(95, 140, 213, 0.15) 0%, rgba(44, 62, 80, 0.9) 100%);
  border-color: rgba(95, 140, 213, 0.4);
}

.narrative-card.light-theme {
  background: linear-gradient(135deg, rgba(127, 179, 211, 0.2) 0%, rgba(52, 73, 94, 0.85) 100%);
  border-color: rgba(127, 179, 211, 0.4);
}

.narrative-card.tech-theme {
  background: linear-gradient(135deg, rgba(95, 140, 213, 0.2) 0%, rgba(44, 62, 80, 0.9) 100%);
  border-color: rgba(95, 140, 213, 0.5);
}

.narrative-card.nature-theme {
  background: linear-gradient(135deg, rgba(52, 73, 94, 0.3) 0%, rgba(44, 62, 80, 0.9) 100%);
  border-color: rgba(95, 140, 213, 0.4);
}

.narrative-card.amy1-theme {
  background: linear-gradient(135deg, rgba(155, 89, 182, 0.2) 0%, rgba(52, 73, 94, 0.5) 50%, rgba(44, 62, 80, 0.9) 100%);
  border-color: rgba(155, 89, 182, 0.5);
}

.narrative-card.mission-theme {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.15) 0%, rgba(95, 140, 213, 0.2) 50%, rgba(44, 62, 80, 0.9) 100%);
  border-color: rgba(241, 196, 15, 0.4);
}

.card-header {
  display: flex;
  flex-direction: wrap;
  margin-bottom: 2rem;
  gap: 1rem;
}

.section-title {
  font-family: 'quick-gaseous', monospace;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.medical-badge, .database-badge, .tech-badge, .philosophy-badge, .mission-badge {
  background: linear-gradient(135deg, #5f8cd5, #7fb3d3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(95, 140, 213, 0.4);
  white-space: nowrap;
}

.database-badge {
  background: linear-gradient(135deg, #7fb3d3, #5f8cd5);
  box-shadow: 0 4px 15px rgba(127, 179, 211, 0.4);
}

.tech-badge {
  background: linear-gradient(135deg, #5f8cd5, #34495e);
  box-shadow: 0 4px 15px rgba(95, 140, 213, 0.5);
}

.philosophy-badge {
  background: linear-gradient(135deg, #34495e, #2c3e50);
  box-shadow: 0 4px 15px rgba(52, 73, 94, 0.4);
}

.mission-badge {
  background: linear-gradient(135deg, #f1c40f, #5f8cd5);
  box-shadow: 0 4px 15px rgba(241, 196, 15, 0.4);
}

.narrative-content {
  line-height: 1.8;
  font-size: 1.2rem;
  font-family: 'quick-gaseous', monospace;
}

.opening-line {
  font-size: 1.4rem ;
  font-weight: 100;
  color: #ffffff;
  margin-bottom: 1.5rem;
  line-height: 1.4;
  font-style: italic;
  font-family: 'quick-gaseous', monospace;
}

.medical-insight, .revelation, .mission-statement, .tech-explanation, .empowerment-message, .deep-insight, .philosophical-vision, .vision-statement, .impact-vision {
  color: #ffffff;
  margin-bottom: 1.5rem;
  text-align: center;
  font-family: 'quick-gaseous', monospace;
}

.dramatic-revelation {
  background: linear-gradient(135deg, rgb(134, 182, 255), rgb(0, 130, 211));
  border-left: 4px solid #5f8cd5;
  padding: 1.5rem;
  border-radius: 12px;
  color: #ddeaf7;
  font-weight: 800;
  margin: 2rem 0;
  font-family: 'quick-gaseous', monospace;
}

.medical-stats, .database-highlights, .prediction-features, .tree-connections, .mission-promises {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-item, .highlight-item, .feature-item, .connection-item, .promise-item {
  background: rgb(255, 255, 255);
  padding: .5rem;
  border-radius: 16px;
  text-align: center;
  border: 1px solid rgb(4, 255, 0);
  transition: all 0.1s ease;
}

.stat-item:hover, .highlight-item:hover, .feature-item:hover, .connection-item:hover, .promise-item:hover {
  background: rgb(185, 200, 255);
  transform: translateY(-5px);
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: #7fb3d3;
  margin-bottom: 0.5rem;
  font-family: 'quick-gaseous', monospace;
}

.stat-label {
  color: #000000;
  font-size: 1rem;
  font-weight: 100;
  font-family: 'quick-gaseous', monospace;
}

.highlight-icon, .feature-icon, .connection-icon, .promise-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.highlight-text, .connection-text, .promise-text {
  color: #9900ff;
  font-weight: 500;
  font-family: 'quick-gaseous', monospace;
}

.feature-title {
  display: block;
  color: #2f00ff;
  font-weight: 600;
  font-size: 2rem;
  padding: 4px;
  margin-bottom: 0.5rem;
  font-family: 'quick-gaseous', monospace;
}

.feature-desc {
  padding: 4px;
  color: #0073ff;
  font-size: 1.8rem;
  font-family: 'quick-gaseous', monospace;
}

.closing-call {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.367), rgba(95, 140, 213, 0.1));
  border: 2px solid rgb(121, 172, 255);
  padding: 2rem;
  border-radius: 16px;
  color: #ddeaf7;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  margin-top: 2rem;
  box-shadow: 0 10px 30px rgba(95, 140, 213, 0.3);
  font-family: 'quick-gaseous', monospace;
}

/* AMY-1 Genotype Card Styles */
.research-highlight {
  background: rgb(191, 0, 255);
  border-left: 4px solid rgb(255, 255, 255);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.7;
}

.research-highlight.evolutionary {
  border-left-color: rgb(0, 255, 106);
  background: rgba(46, 204, 112, 0.237);
}

.research-highlight.catastrophe {
  border-left-color: rgb(255, 25, 0);
  background: rgba(231, 77, 60, 0.347);
}

.research-highlight.mechanism {
  border-left-color: rgb(0, 153, 255);
  background: rgba(52, 152, 219, 0.268);
}

.research-label {
  display: block;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.evolution-benefits, .amy1-implications {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.benefit-item, .implication-card {
  background: rgb(12, 124, 53);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  gap: 1rem;
}

.benefit-item {
  align-items: flex-start;
}

.benefit-icon {
  color: #00ff6a;
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.benefit-text {
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.5;
}

.implication-card {
  flex-direction: column;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.implication-card h4 {
  color: #ffffff;
  font-size: 1.1rem;
  margin: 0 0 0.8rem 0;
  font-weight: 700;
}

.implication-card p {
  color: #ffffff;
  font-size: 0.9rem;
  margin: 0.5rem 0;
  line-height: 1.5;
}

.implication-card.high-copy-plus {
  border-color: rgba(46, 204, 113, 0.5);
  background: rgba(46, 204, 113, 0.1);
}

.catastrophe-list {
  margin: 1rem 0;
  padding-left: 1.5rem;
  color: #ffffff;
  font-size: 1.05rem;
  line-height: 1.6;
}

.catastrophe-list li {
  margin-bottom: 0.8rem;
  color: #ffffff;
  font-size: 1.1rem;
}

.catastrophe-list strong {
  color: #ff6b6b;
}

#death-spiral-item {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.3), rgba(192, 57, 43, 0.3));
  border: 2px solid #e74c3c;
  padding: 1.2rem;
  border-radius: 10px;
  margin: 1.5rem 0 !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: #000000 !important;
  box-shadow: 0 0 20px rgba(231, 76, 60, 0.5), inset 0 0 10px rgba(231, 76, 60, 0.1);
  animation: pulse-warning 1s ease-in-out infinite;
}

#death-spiral-item strong {
  color: #000000;
  font-size: 1.3rem;
  text-shadow: 0 0 10px rgba(231, 76, 60, 0.6);
}

@keyframes pulse-warning {
  0%, 100% {
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5), inset 0 0 10px rgba(231, 76, 60, 0.1);
  }
  50% {
    box-shadow: 0 0 40px rgb(231, 77, 60), inset 0 0 15px rgba(231, 76, 60, 0.2);
  }
}

/* Amy-1 Paradox Pulsing Animation - Green and Purple Theme */
#amy1-card-section {
  position: relative;
  animation: pulse-amy1 2s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(255, 165, 0, 0.9), 0 0 60px rgba(255, 165, 0, 0.7), inset 0 0 20px rgba(255, 165, 0, 0.3);
}

@keyframes pulse-amy1 {
  0%, 100% {
    box-shadow: 0 0 30px rgba(255, 165, 0, 0.6), 0 0 60px rgba(255, 165, 0, 0.4), inset 0 0 20px rgba(255, 165, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 60px rgba(255, 165, 0, 1), 0 0 120px rgba(255, 165, 0, 0.8), inset 0 0 40px rgba(255, 165, 0, 0.4);
  }
}

.understanding-header {
  font-size: 1.2rem;
  color: #ffffff;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-family: 'quick-gaseous', monospace;
}

.genetic-insight, .evolutionary-narrative, .historical-context, .catastrophic-shift, .solution-message, .empowerment-final {
  color: #ffffff;
  line-height: 1.7;
  margin: 1rem 0;
  font-size: 1rem;
}

.genetic-insight, .catastrophic-shift {
  font-weight: 500;
  background: rgba(155, 89, 182, 0.08);
  padding: 1rem;
  border-radius: 8px;
  border-left: 3px solid rgba(155, 89, 182, 0.4);
}

.empowerment-final {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(52, 152, 219, 0.1));
  padding: 1.5rem;
  border-radius: 10px;
  border: 2px solid rgba(46, 204, 113, 0.4);
  font-weight: 600;
  color: #7fb3d3;
  font-size: 1.05rem;
  text-align: center;
  font-family: 'quick-gaseous', monospace;
}

.genetics-badge {
  font-family: monospace;
  text-align: center;
  background: rgb(228, 160, 255);
  color: #ffffff;
  padding: 10px;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 600;
}

.amy1-food-database {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.15), rgba(155, 89, 182, 0.15)) !important;
  border-left-color: rgba(52, 152, 219, 0.8) !important;
}

.amy1-rating-criteria {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.8;
}

.amy1-rating-criteria li {
  margin-bottom: 1rem;
  color: #ffffff;
  font-size: 0.95rem;
}

.amy1-rating-criteria strong {
  color: #7fb3d3;
  font-weight: 700;
}

.clearli-revelation-header {
  text-align: center;
  font-size: 4rem;
  letter-spacing: -2px;
  font-weight: 100;
  color: #ffffff;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgb(0, 0, 0);
  font-family: 'quick-gaseous', monospace;
  text-shadow: 0 2px 8px rgba(155, 89, 182, 0.4);
}

/* ===== MOBILE MEDIA QUERIES - CLEARLI REVELATION & AMY-1 ===== */
@media (max-width: 768px) {
  /* Clearli Revelation Header - Tablet */
  .clearli-revelation-header {
    font-size: 3rem;
    letter-spacing: -1px;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    padding: 0 15px;
  }
}

@media (max-width: 480px) {
  /* Clearli Revelation Header - Mobile Phone */
  .clearli-revelation-header {
    font-size: 2.5rem;
    letter-spacing: 0px;
    padding: 0 12px 0.6rem;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(155, 89, 182, 0.3);
  }
  
  /* Extra small screens - even more aggressive scaling */
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Mobile Navbar */
  .navbar {
    padding: 15px;
  }

  .logo a {
    font-size: 2.5rem !important;
  }

  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: block;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
  }

  .nav-toggle:hover {
    transform: scale(1.05);
  }

  /* Hide wavy lines on mobile, show as circle button */
  .wavy-line {
    display: none;
  }

  .nav-toggle::after {
    content: '☰';
    color: rgb(255, 0, 0);
    font-size: 1.5rem;
    display: block;
  }

  .nav-drawer {
    max-width: 280px;
  }

  .nav-drawer-link {
    font-size: 1.2rem;
    padding: 15px 12px;
  }

  /* Navbar Tablet & Mobile adjustments */
  .narrative-container {
    padding: 0 1rem;
    gap: 2rem;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  
  .narrative-card {
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  
  .medical-stats, .database-highlights, .prediction-features, .tree-connections, .mission-promises {
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
  }
  
  .stat-item, .highlight-item, .feature-item, .connection-item, .promise-item {
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
  }
  
  .opening-line {
    font-size: 1.15rem;
  }
  
  .narrative-content {
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .health-narrative-section {
    padding: 40px 0;
    width: 100%;
    overflow-x: hidden;
  }
  
  .narrative-container {
    padding: 0 0.75rem;
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
  }
  
  .narrative-card {
    padding: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    overflow: hidden;
  }
  
  .section-title {
    font-size: 1.5rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  .medical-stats, .database-highlights, .prediction-features, .tree-connections, .mission-promises {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
    margin: 1rem 0;
  }
  
  .stat-item, .highlight-item, .feature-item, .connection-item, .promise-item {
    width: 100%;
    box-sizing: border-box;
    padding: 1rem;
    min-width: 0;
  }
  
  .feature-icon {
    font-size: 1.5rem;
  }
  
  .feature-title {
    font-size: 1rem;
  }
  
  .feature-desc {
    font-size: 0.85rem;
  }
}

@media (max-width: 380px) {
  .narrative-card {
    padding: 1rem;
  }
  
  .section-title {
    font-size: 1.3rem;
  }
  
  .narrative-content {
    font-size: 0.9rem;
  }
  
  .feature-item {
    padding: 0.75rem;
  }
  
  .feature-icon {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
  }
  
  .feature-title {
    font-size: 0.9rem;
  }
  
  .feature-desc {
    font-size: 0.75rem;
  }
}

/* ===================================
   COMPREHENSIVE RESPONSIVE DESIGN
   =================================== */

/* Large Desktops (1200px and up) */
/* Tablets (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .navbar {
    padding: 0 1.5rem;
    font-size: 28px;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .logo a {
    font-size: 2.8rem !important;
    text-align: center;
  }
  
  .nav-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
  }
  
  .nav-links a {
    font-size: 2.2rem;
  }
  
  .hero-title {
    font-size: clamp(3.5rem, 7vw, 6rem);
    text-align: center;
  }
  
  .hero-subtitle {
    font-size: clamp(1.5rem, 3vw, 2rem);
    text-align: center;
    margin: 2rem 0 0 0;
  }
  
  .hero-section {
  text-align: center;
  }
  
  .story-line {
    margin: 1.5rem 0;
    text-align: center;
  }
  
  #story1 {
    font-size: 3.5rem !important;
  }
  
  #story2 {
    font-size: 3.5rem !important;
  }
  
  .epic-title {
    font-size: 4.5rem;
    text-align: center;
  }
  
  .epic-container {
    padding: 30px;
    padding-left: 30px;
    text-align: center;
  }
  
  .cta-button {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
  }
}

/* Mobile Landscape (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  .navbar {
    font-size: 24px;
    flex-direction: column;
    padding: 0.8rem;
    gap: 0.8rem;
  }
  
  .logo a {
    font-size: 2.2rem !important;
    text-align: center;
  }
  
  .nav-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
  }
  
  .nav-links a {
    font-size: 1.8rem;
  }
  
  .hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    letter-spacing: 1px;
    text-align: center;
    line-height: 1.1;
  }
  
  .hero-subtitle {
    text-align: center;
    margin: 4rem;
  }
  
  .hero-section {
    min-height: 70vh;
  }
  
  .story-line {
    margin: 1.2rem 0;
    text-align: center;
    font-size: inherit;
  }
  
  .story-word {
    margin-right: 0.2em;
  }
  
  .epic-title {
    font-size: 3rem;
    text-align: center;
    line-height: 1.1;
  }
  
  .epic-container {
    padding: 20px;
    padding-left: 20px;
    text-align: center;
  }
  
  .epic-text-section {
    min-height: 80vh;
    padding: 2rem 0;
  }
  
  .cta-button {
    padding: 0.7rem 1.8rem;
    font-size: 1rem;
    margin-top: 1.5rem;
  }
}

/* Mobile Portrait (320px - 575px) */
@media (max-width: 575px) {
  .navbar {
    font-size: 20px;
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .logo a {
    font-size: 1.8rem !important;
    text-align: center;
  }
  
  .nav-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
  }
  
  .nav-links a {
    font-size: 1.4rem;
  }
  
  .hero-title {
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1;
  }
  
  .hero-subtitle {
    text-align: center;
    padding: 0 0.5rem;
  }
  
  
  .main-content-container {
    padding: 0 0.5rem;
  }
  
  .story-line {
    margin: 1rem 0;
    text-align: center;
    padding: 0 0.5rem;
    font-size: inherit;
  }
  
  .story-word {
    margin-right: 0.15em;
  }
  
  .epic-title {
    font-size: 2.2rem;
    text-align: center;
    line-height: 1;
    padding: 0 0.5rem;
  }
  
  .epic-container {
    padding: 15px;
    padding-left: 15px;
    text-align: center;
    margin: 10px;
  }
  
  .epic-text-section {
    min-height: 70vh;
    padding: 1.5rem 0;
  }
  
  .cta-button {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    margin-top: 1rem;
  }
  
  .containers {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0.5rem;
  }
}

/* Extra Small Devices (280px - 319px) */
@media (max-width: 319px) {
  .navbar {
    font-size: 16px;
    padding: 0.3rem;
  }
  
  .logo a {
    font-size: 1.5rem !important;
  }
  
  .nav-links a {
    font-size: 1.2rem;
  }
  
  .hero-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    letter-spacing: 0px;
  }
  
  .hero-subtitle {
    font-size: clamp(0.9rem, 1.8vw, 1.2rem);
  }
  
  .story-word {
    margin-right: 0.1em;
  }
  
  .epic-title {
    font-size: 1.8rem;
  }
  
  .epic-container {
    padding: 10px;
    margin: 5px;
  }
  
  .cta-button {
    padding: 0.5rem 1.2rem;
    font-size: 0.8rem;
  }
}

/* Landscape Orientation Adjustments */
@media (orientation: landscape) and (max-height: 500px) {
  .hero-section {
    min-height: 100vh;
    padding: 0.5rem;
  }
  
  .hero-title {
    font-size: clamp(1.8rem, 4vh, 3rem);
  }
  
  .hero-subtitle {
    font-size: clamp(1rem, 2vh, 1.5rem);
    margin: 0.5rem 0 0 0;
  }
  
  .navbar {
    padding: 0.3rem 1rem;
  }
  
  .epic-text-section {
    min-height: 100vh;
    padding: 1rem 0;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-title, .hero-subtitle, .epic-title, .story-word {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Responsive Styles for AMY-1 and Dive In Button Row */

/* Tablet and small screens (768px and below) */
@media (max-width: 768px) {
  /* AMY-1 and Dive In button row */
  [style*="amy1-and-button-row"] {
    gap: 0.75rem !important;
  }
  
  .amy1-rating-section {
    width: 160px !important;
    height: 160px !important;
    padding: 0.75rem !important;
  }
  
  .amy1-rating-section span:first-child {
    font-size: 1.5rem !important;
  }
  
  .amy1-rating-section label {
    font-size: 0.9rem !important;
  }
  
  .amy1-rating-badge {
    font-size: 0.7rem !important;
    padding: 0.3rem 0.5rem !important;
  }
  
  /* Dive In button tablet size */
  button[style*="200px"] {
    width: 160px !important;
    height: 160px !important;
    padding: 0.75rem !important;
    font-size: 0.85rem !important;
    border-radius: 12px !important;
  }
}

/* Mobile screens (480px and below) */
@media (max-width: 480px) {
  /* AMY-1 and Dive In button row - stack on small screens */
  [style*="amy1-and-button-row"] {
    flex-direction: column !important;
    gap: 1rem !important;
    align-items: stretch !important;
  }
  
  .amy1-rating-section {
    width: 100% !important;
    height: 140px !important;
    padding: 0.6rem !important;
  }
  
  .amy1-rating-section span:first-child {
    font-size: 1.3rem !important;
  }
  
  .amy1-rating-section label {
    font-size: 0.85rem !important;
  }
  
  .amy1-rating-badge {
    font-size: 0.65rem !important;
    padding: 0.25rem 0.4rem !important;
    min-width: 60px !important;
  }
  
  /* Dive In button mobile size */
  button[style*="200px"] {
    width: 100% !important;
    height: 140px !important;
    padding: 0.6rem !important;
    font-size: 0.8rem !important;
    border-radius: 10px !important;
  }
}

/* Extra small screens (380px and below) */
@media (max-width: 380px) {
  [style*="amy1-and-button-row"] {
    gap: 0.75rem !important;
  }
  
  .amy1-rating-section {
    width: 100% !important;
    height: 120px !important;
    padding: 0.5rem !important;
  }
  
  .amy1-rating-section span:first-child {
    font-size: 1.1rem !important;
  }
  
  .amy1-rating-section label {
    font-size: 0.75rem !important;
  }
  
  .amy1-rating-badge {
    font-size: 0.6rem !important;
    padding: 0.2rem 0.3rem !important;
    min-width: 50px !important;
  }
  
  /* Dive In button extra small */
  button[style*="200px"] {
    width: 100% !important;
    height: 120px !important;
    padding: 0.5rem !important;
    font-size: 0.75rem !important;
    border-radius: 8px !important;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .nav-links a {
    padding: 0.5rem;
    min-height: 44px;
  }
  
  .cta-button {
    min-height: 44px;
    padding: 0.8rem 2rem;
  }
  
  .story-word:hover {
    text-shadow: 0 2px 4px rgb(255, 0, 0);
  }
  
  /* Touch-friendly Dive In button */
  button[style*="200px"] {
    min-height: 44px !important;
  }
}

/* Desktop - Larger Chart for Readability */
@media (min-width: 1200px) {
  .glucose-chart {
    width: 100%;
    max-width: 100%;
    height: auto;
    overflow-x: visible;
    overflow-y: visible;
  }
  
  .prediction-chart {
    margin: 30px 0;
    padding: 0;
    overflow-x: visible;
  }
  
  .prediction-chart h4 {
    font-size: 1.4rem;
    margin-bottom: 20px;
  }
  
  .glucose-chart text {
    font-size: 12px !important;
  }
  
  .glucose-chart line {
    stroke-width: 1.5px;
  }

  .glucose-chart polyline {
    stroke-width: 4px;
  }

  .glucose-chart circle {
    r: 8px;
  }

  /* Slider Responsive Styles - Tablets (768px and below) */
  .meal-item-slider-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  .slider-label {
    font-size: 0.85rem;
    min-width: auto;
  }

  .meal-item-slider {
    width: 100%;
    height: 7px;
  }

  .meal-item-slider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  .meal-item-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }

  .portion-display {
    font-size: 0.9rem;
    padding: 6px 12px;
    min-width: 50px;
  }

  /* Single Food Slider - Tablet */
  .portion-slider-control {
    flex-direction: column;
    align-items: stretch;
  }

  .single-food-slider {
    width: 100%;
    height: 7px;
  }

  .single-food-slider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  .single-food-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }

  .portion-value {
    font-size: 0.9rem;
    padding: 6px 12px;
    min-width: 50px;
  }
}

/* Slider Responsive Styles - Mobile Phones (480px and below) */
@media (max-width: 480px) {
  .meal-item-slider-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    margin-top: 8px;
  }

  .slider-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #334155;
    min-width: auto;
  }

  .meal-item-slider {
    width: 100%;
    height: 8px;
    cursor: grab;
  }

  .meal-item-slider:active {
    cursor: grabbing;
  }

  .meal-item-slider::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  }

  .meal-item-slider::-webkit-slider-thumb:hover {
    width: 24px;
    height: 24px;
  }

  .meal-item-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  }

  .meal-item-slider::-moz-range-thumb:hover {
    width: 24px;
    height: 24px;
  }

  .portion-display {
    font-size: 0.8rem;
    padding: 5px 10px;
    min-width: 48px;
    text-align: center;
  }

  .meal-item {
    padding: 8px;
    gap: 8px;
  }

  .meal-item-info {
    gap: 6px;
  }

  .meal-item-macros {
    font-size: 0.75rem;
    line-height: 1.4;
  }

  /* Single Food Slider - Mobile */
  .portion-slider-control {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .single-food-slider {
    width: 100%;
    height: 8px;
    cursor: grab;
  }

  .single-food-slider:active {
    cursor: grabbing;
  }

  .single-food-slider::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  }

  .single-food-slider::-webkit-slider-thumb:hover {
    width: 24px;
    height: 24px;
  }

  .single-food-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  }

  .single-food-slider::-moz-range-thumb:hover {
    width: 24px;
    height: 24px;
  }

  .portion-value {
    font-size: 0.8rem;
    padding: 5px 10px;
    min-width: 48px;
    text-align: center;
  }
}

/* Slider Responsive Styles - Extra Small Phones (380px and below) */
@media (max-width: 380px) {
  .meal-item-slider-container {
    padding: 8px;
    gap: 6px;
  }

  .slider-label {
    font-size: 0.7rem;
  }

  .meal-item-slider {
    height: 6px;
  }


  .meal-item-slider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  .meal-item-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }

  .portion-display {
    font-size: 0.75rem;
    padding: 4px 8px;
    min-width: 44px;
  }

  .meal-item-macros {
    font-size: 0.7rem;
  }

  /* Single Food Slider - Extra Small */
  .single-food-portion-container {
    padding: 8px;
  }

  .portion-slider-label {
    font-size: 0.8rem;
  }

  .portion-slider-control {
    flex-direction: column;
    gap: 6px;
  }

  .single-food-slider {
    height: 6px;
  }

  .single-food-slider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  .single-food-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }

  .portion-value {
    font-size: 0.75rem;
    padding: 4px 8px;
    min-width: 44px;
  }
}

/* Print Styles */
@media print {
  .navbar, .cta-button {
    display: none;
  }
}
  .footer {
  background: rgba(0, 0, 0, 0.3);
  padding: 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

/* GLUCOSE CHART BUTTON AND MODAL */
.prediction-chart-container {
  margin: 20px 0;
}

.view-chart-btn {
  width: 100%;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  text-align: center;
}

.view-chart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.view-chart-btn:active {
  transform: translateY(0);
}

/* Glucose Chart Modal */
.glucose-chart-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.glucose-chart-modal-overlay.show {
  opacity: 1;
}

.glucose-chart-modal-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 30px;
  max-width: 95vw;
  width: 100%;
  max-height: 95vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
}

.glucose-chart-close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 32px;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glucose-chart-close-btn:hover {
  color: #1f2937;
}

.glucose-chart-modal-content h3 {
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 1.5rem;
}

.glucose-chart-full {
  display: block;
  max-width: 100%;
  height: auto;
  background: #f9fafb;
  border-radius: 8px;
  padding: 10px;
  box-sizing: border-box;
}

/* Mobile responsiveness for chart modal */
@media (max-width: 768px) {
  .glucose-chart-modal-content {
    padding: 20px;
    max-height: 90vh;
  }
  
  .glucose-chart-modal-content h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }
  
  .glucose-chart-close-btn {
    top: 10px;
    right: 10px;
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .glucose-chart-modal-overlay {
    padding: 10px;
  }
  
  .glucose-chart-modal-content {
    padding: 15px;
    border-radius: 12px;
  }
  
  .glucose-chart-modal-content h3 {
    font-size: 1rem;
    margin-bottom: 12px;
  }
}




