/* Homepage Variables */
  :root {
    --home-primary: #3498db;
    --home-secondary: #2c3e50;
    --home-accent: #e74c3c;
    --home-gradient-start: #edf6f9;
    --home-gradient-end: #fdfcfa;
    --home-card-bg: #ffffff;
    --home-light-bg: #f7fbfe;
    --home-shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
    --home-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --home-shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --home-shadow-xl: 0 20px 40px rgba(0,0,0,0.15);
  }

  /* Reset & Base Mobile Styles */
  * {
    box-sizing: border-box;
  }

  /* MOBILE-FIRST HERO SECTION */
  .hero-section {
    background: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%);
    padding: 80px 15px 75px; /* Extra bottom padding for dots */
    position: relative;
    overflow-x: hidden; /* Only clip horizontal, not vertical */
  }

  .hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
  }

  .hero-container {
    max-width: 100%; /* Full width on mobile */
    margin: 0 auto;
    position: relative;
    z-index: 1;
  }

  /* Mobile-first text styles */
  .hero-text {
    text-align: center; /* Center on mobile */
    margin-bottom: 30px;
    animation: slideInUp 0.8s ease;
  }

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

  .hero-text h1 {
    font-size: 2rem; /* Smaller on mobile */
    color: #ffffff;
    margin-bottom: 15px;
    line-height: 1.2;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
  }

  .hero-text p {
    font-size: 1.1rem; /* Smaller on mobile */
    color: rgba(255,255,255,0.9);
    margin-bottom: 25px;
    line-height: 1.5;
    padding: 0 10px; /* Add padding for better readability */
  }

  /* Mobile-first button styles */
  .hero-buttons {
    display: flex;
    flex-direction: column; /* Stack vertically on mobile */
    gap: 15px;
    padding: 0 10px;
  }

  .hero-buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%; /* Full width on mobile */
    text-align: center;
    position: relative;
    overflow: hidden;
  }

  .hero-buttons a.primary-cta {
    background: linear-gradient(135deg, var(--home-accent), #c0392b);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
  }

  .hero-buttons a.secondary-cta {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    color: #ffffff;
    border: 2px solid rgba(255,255,255,0.3);
  }

  .hero-buttons a i {
    margin-right: 8px;
  }

  /* Mobile-first slideshow styles */
  .hero-slideshow {
    position: relative;
    text-align: center;
    padding: 0;
    width: 100%;
    animation: fadeIn 0.8s ease 0.3s both;
  }

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

  .hero-slideshow-track {
    position: relative;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--home-shadow-lg);
    aspect-ratio: 4 / 3;
    background: rgba(0,0,0,0.15);
  }

  .hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
  }

  .hero-slide.active {
    opacity: 1;
  }

  .hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 15px;
  }

  /* Prev / Next arrows */
  .slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;
    font-size: 0.85rem;
  }

  .slide-arrow:hover {
    background: rgba(255,255,255,0.35);
  }

  .slide-arrow.prev { left: 10px; }
  .slide-arrow.next { right: 10px; }

  .slide-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .slide-toggle:focus-visible {
    left: 50%;
    bottom: 10px;
    z-index: 11;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    height: auto;
    min-height: 36px;
    padding: 7px 12px;
    margin: 0;
    overflow: visible;
    clip: auto;
    transform: translateX(-50%);
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 999px;
    background: rgba(23,43,58,0.92);
    color: #fff;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: normal;
    cursor: pointer;
  }


  /* MOBILE-FIRST MAIN CONTENT */
  .home-content {
    max-width: 100%;
    margin: 30px auto 40px; /* Less negative margin on mobile */
    padding: 0 15px; /* Less padding on mobile */
  }

  /* Mobile-first section blocks */
  .section-block {
    background: var(--home-card-bg);
    border-radius: 12px; /* Smaller radius on mobile */
    padding: 25px 20px; /* Less padding on mobile */
    margin-bottom: 25px;
    box-shadow: var(--home-shadow-md);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease both;
  }

  .section-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px; /* Thinner on mobile */
    background: linear-gradient(90deg, var(--home-accent) 0%, var(--home-primary) 50%, var(--home-accent) 100%);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
  }

  @keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
  }

  .section-block h2 {
    font-size: 1.6rem; /* Smaller on mobile */
    color: var(--home-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
  }

  .section-block h2 i {
    color: var(--home-accent);
    font-size: 1.3rem;
  }

  .section-block > p {
    font-size: 1rem; /* Smaller on mobile */
    color: #4a5568;
    margin-bottom: 20px;
    line-height: 1.6;
  }

  /* Mobile-first card grid */
  .home-card-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
    margin-top: 20px;
  }

  .home-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--home-shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
  }

  .home-card h3 {
    font-size: 1.2rem; /* Smaller on mobile */
    color: var(--home-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start; /* Align icon to first line, not block center */
    gap: 8px;
    line-height: 1.3; /* Tighter heading rhythm for 2-line titles */
  }

  .home-card h3 i {
    color: var(--home-accent);
    font-size: 0.78em; /* Scales with heading size at every breakpoint */
    line-height: 1.3; /* Match heading so glyph centers on line 1 */
    flex-shrink: 0; /* Never let the icon squish */
    margin-top: 0.18em; /* Proportional optical nudge onto first line */
  }

  .home-card p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #4a5568;
    margin-bottom: 15px;
  }

  .home-card a {
    color: var(--home-accent);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.95rem;
  }

  .home-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: var(--home-primary);
  }

  /* Dose-size link pills inside cards */
  .home-card .dose-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
  }

  .home-card .dose-links a {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 20px;
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.25);
    color: var(--home-accent);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.25s ease;
  }

  .home-card .dose-links a:hover {
    background: var(--home-accent);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
  }


  .why-section {
    display: flex;
    flex-direction: column; /* Stack on mobile */
    gap: 25px;
  }

  .why-content {
    order: 2; /* Image first on mobile */
  }

  .why-content ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
  }

  .why-content li {
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #4a5568;
  }

  .why-content li i {
    color: var(--home-accent);
    font-size: 1.1rem;
    flex-shrink: 0; /* Prevent icon from shrinking */
  }

  .why-image {
    order: 1; /* Image first on mobile */
    text-align: center;
  }

  .why-image img {
    width: 100%;
    max-width: 100%; /* Full width on mobile */
    height: auto;
    border-radius: 10px;
    box-shadow: var(--home-shadow-md);
  }

  /* MOBILE-FIRST CALCULATOR SECTION */
  .calc-container {
    display: flex;
    flex-direction: column; /* Stack on mobile */
    gap: 30px;
  }

  .calc-intro-section {
    order: 1;
  }

  .calc-calculator-section {
    order: 2;
  }

  .calc-intro-section h3 {
    font-size: 1.1rem;
    color: var(--home-primary);
    margin: 20px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .calc-intro-section h3 i {
    color: var(--home-accent);
    font-size: 1rem;
  }

  .calc-intro-section ul {
    list-style: none;
    padding: 0;
  }

  .calc-intro-section li {
    padding: 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.9rem;
    color: #4a5568;
  }

  .calc-intro-section li i {
    color: var(--home-accent);
    margin-top: 2px;
    flex-shrink: 0;
  }

  /* Mobile-optimized calculator */
  #peptide-calculator {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--home-shadow-md);
    border: 1px solid #e2e8f0;
    width: 100%; /* Ensure full width */
    max-width: 100%; /* Prevent overflow */
  }

  #peptide-calculator h3 {
    color: var(--home-primary);
    font-size: 1.3rem;
    margin-bottom: 12px;
  }

  #peptide-calculator p {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 15px;
  }

  #peptide-calculator label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--home-secondary);
    font-size: 0.95rem;
  }

  /* Mobile-optimized form inputs */
  #peptide-calculator input,
  #peptide-calculator select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px; /* Prevents zoom on iOS */
    transition: all 0.3s ease;
    -webkit-appearance: none; /* Remove iOS default styling */
  }

  #peptide-calculator .input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
  }

  #peptide-calculator .input-group input {
    flex: 1;
    min-width: 0; /* Prevent overflow */
  }

  #peptide-calculator .input-group select {
    width: 80px;
    flex-shrink: 0;
  }

  #peptide-calculator input:focus,
  #peptide-calculator select:focus {
    outline: none;
    border-color: var(--home-primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
  }

  #peptide-calculator button {
    background: linear-gradient(135deg, var(--home-accent), #c0392b);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 15px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  #calcResults {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
    font-size: 0.95rem;
  }

  /* Secondary CTA below the embedded calculator — outlined style matching
     the hero's secondary ("Latest Articles") button, adapted for the light
     background of this section */
  .calc-full-link {
    text-align: center;
    margin-top: 20px;
  }

  .calc-full-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 25px;
    border-radius: 30px;
    background: transparent;
    border: 2px solid var(--home-primary);
    color: var(--home-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
  }

  .calc-full-cta:hover {
    background: var(--home-primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
  }

  .calc-full-cta i {
    font-size: 0.85rem;
  }

  /* Mobile-first CTA Section */
  .extra-cta-section {
    background: linear-gradient(135deg, var(--home-primary), #5ba3e0);
    border-radius: 12px;
    padding: 35px 20px; /* Less padding on mobile */
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
  }

  .extra-cta-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
    pointer-events: none;
    transform-origin: center center;
  }

  @keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

  .extra-cta-section h2 {
    font-size: 1.8rem; /* Smaller on mobile */
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
  }

  .extra-cta-section p {
    font-size: 1rem;
    margin-bottom: 25px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    padding: 0 10px;
  }

  .extra-cta-section a {
    display: inline-block;
    background: white;
    color: var(--home-primary);
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
  }

  /* CTA button row — 2×2 grid on mobile, 4 columns on desktop */
  .extra-cta-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
    position: relative;
    z-index: 1;
  }

  .extra-cta-buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 15px;
  }

  /* Animation delays */
  .delay-1 { animation-delay: 0.1s; }
  .delay-2 { animation-delay: 0.2s; }
  .delay-3 { animation-delay: 0.3s; }
  .delay-4 { animation-delay: 0.4s; }
  .delay-5 { animation-delay: 0.5s; }

  /* TABLET STYLES (min-width: 768px) */
  @media (min-width: 768px) {
    .hero-section {
      padding: 90px 30px 70px;
    }

    .hero-container {
      max-width: 1200px;
      display: flex;
      flex-wrap: wrap;
      gap: 40px;
      align-items: center;
    }

    .hero-text {
      flex: 1;
      min-width: 300px;
      text-align: left; /* Left align on tablet+ */
      margin-bottom: 0;
    }

    .hero-text h1 {
      font-size: 3rem;
    }

    .hero-text p {
      font-size: 1.2rem;
      padding: 0;
    }

    .hero-buttons {
      flex-direction: row; /* Horizontal on tablet+ */
      padding: 0;
    }

    .hero-buttons a {
      width: auto;
      min-width: 180px;
    }

    .hero-slideshow {
      flex: 1;
      min-width: 300px;
      padding: 0;
    }

    .hero-slideshow-track {
      max-width: 450px;
      margin: 0 auto;
      aspect-ratio: 4 / 3;
    }

    .home-content {
      max-width: 1200px;
      margin: -40px auto 60px;
      padding: 0 30px;
    }

    .section-block {
      padding: 35px 30px;
      border-radius: 16px;
      margin-bottom: 35px;
    }

    .section-block h2 {
      font-size: 2rem;
    }

    .home-card-grid {
      grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet */
      gap: 25px;
    }

    .why-section {
      flex-direction: row; /* Side by side on tablet+ */
    }

    .why-content {
      order: 1; /* Reset order */
      flex: 1;
    }

    .why-image {
      order: 2; /* Reset order */
      flex: 1;
    }

    .why-image img {
      max-width: 400px;
    }

    .calc-container {
      flex-direction: row; /* Side by side on tablet+ */
    }

    .calc-intro-section,
    .calc-calculator-section {
      flex: 1;
    }

    #peptide-calculator {
      padding: 25px;
    }

    .extra-cta-section {
      padding: 45px 35px;
      border-radius: 16px;
    }

    .extra-cta-section h2 {
      font-size: 2.2rem;
    }

    .extra-cta-section p {
      font-size: 1.1rem;
      padding: 0;
    }
  }

  /* DESKTOP STYLES (min-width: 1024px) */
  @media (min-width: 1024px) {
    .hero-section {
      padding: 100px 20px 80px;
    }

    .hero-text h1 {
      font-size: 3.5rem;
    }

    .hero-text p {
      font-size: 1.3rem;
    }

    .hero-slideshow-track {
      max-width: 500px;
    }

    .section-block {
      padding: 40px;
      margin-bottom: 40px;
    }

    .section-block h2 {
      font-size: 2.2rem;
    }

    .section-block > p {
      font-size: 1.1rem;
    }

    .home-card-grid {
      grid-template-columns: repeat(3, 1fr); /* 3 columns on desktop */
      gap: 30px;
    }

    .home-card {
      padding: 30px;
    }

    .home-card h3 {
      font-size: 1.4rem;
    }

    .home-card p {
      font-size: 1rem;
    }

    .calc-intro-section h3 {
      font-size: 1.3rem;
    }

    .calc-intro-section li {
      font-size: 1rem;
    }

    #peptide-calculator {
      padding: 30px;
    }

    #peptide-calculator h3 {
      font-size: 1.5rem;
    }

    .extra-cta-section {
      padding: 50px 40px;
    }

    .extra-cta-section h2 {
      font-size: 2.5rem;
    }

    .extra-cta-section p {
      font-size: 1.2rem;
    }

    .extra-cta-buttons {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      max-width: 980px;
      margin-left: auto;
      margin-right: auto;
    }
  }

  /* Ensure nothing overflows on any screen size */
  html,
  body {
    overflow-x: hidden;
  }

  .home-content,
  .hero-container {
    overflow-x: hidden;
  }

/* Homepage interaction refinements */
/* Ensure pseudo-elements don't block clicks */
.hero-section::before,
.section-block::before,
.extra-cta-section::before {
  pointer-events: none;
}

/* CTA button hovers */
.hero-buttons a.primary-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(231, 76, 60, 0.45);
  filter: brightness(1.08);
}

.hero-buttons a.secondary-cta:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-3px);
}

/* Extra CTA section button hover */
.extra-cta-section a:hover {
  background: #f0f4ff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Read more / card link hovers */
.home-card a:hover {
  text-decoration: underline;
}
