/* =====================================================================
   Sovereign Health Care — responsive + spacing layer
   Loaded AFTER the inline page styles on index.html and products.html.
   Only layout (padding, sizing, mobile nav, tap targets) is changed here.
   No text, images or colours are altered.
   ===================================================================== */

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  overflow-x:clip;              /* never allow sideways scrolling on phones */
  scroll-padding-top:72px;      /* anchors don't hide under the floating nav */
}
body{ overflow-x:clip; -webkit-tap-highlight-color:rgba(15,76,129,0.10); }
img, svg, video, iframe{ max-width:100%; }

/* --- Hamburger + mobile CTA are hidden on desktop --- */
.nav-toggle{ display:none; }
.nav-menu-cta{ display:none; }

/* Glows were fixed 460–520px wide and pushed the page wider than the screen */
.stage-glow{ width:min(520px,100%); height:min(520px,100%); }
.capsule-glow{ width:min(460px,100%); height:min(460px,100%); }
.founder-portrait-glow{ width:min(520px,100%); height:min(520px,100%); }

/* ---------------------------------------------------------------------
   DESKTOP (≥ 981px): trim the very large vertical gaps between sections
   --------------------------------------------------------------------- */
@media (min-width:981px){
  .hero{ min-height:100vh; min-height:100svh; padding-top:128px; padding-bottom:48px; }
  .about{ padding-top:110px; padding-bottom:120px; }
  .products{ padding-top:100px; padding-bottom:110px; }
  .founder{ padding-bottom:120px; }
  .footer-inner{ padding-top:76px; }
  .catalog-hero{ padding-bottom:28px; }
  .catalog-section{ padding-bottom:110px; }
}

/* small laptops / landscape tablets */
@media (min-width:981px) and (max-width:1180px){
  nav{ padding-left:36px; padding-right:36px; }
  .nav-links{ gap:24px; }
  .hero, .about, .products, .founder, .contact, .footer-inner,
  .catalog-hero, .catalog-section{ padding-left:36px; padding-right:36px; }
}

/* ---------------------------------------------------------------------
   TABLET + PHONE (≤ 980px)
   --------------------------------------------------------------------- */
@media (max-width:980px){

  /* ----- Navigation: hamburger menu ----- */
  nav{
    padding:12px max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left));
  }
  nav.scrolled{ padding:8px 10px 8px 20px; }

  nav .nav-toggle{
    display:inline-flex; align-items:center; justify-content:center;
    position:relative; flex:0 0 auto;
    width:44px; height:44px; margin-left:auto;
    border-radius:50%;
    border:1px solid rgba(15,76,129,0.14);
    background:rgba(255,255,255,0.85);
    box-shadow:0 6px 16px -8px rgba(15,76,129,0.35);
    cursor:pointer; padding:0;
    -webkit-tap-highlight-color:transparent;
  }
  .nav-toggle span{
    position:absolute; left:12px; right:12px; height:2px; border-radius:2px;
    background:var(--blue);
    transition:transform .3s ease, opacity .2s ease, top .3s ease;
  }
  .nav-toggle span:nth-child(1){ top:15px; }
  .nav-toggle span:nth-child(2){ top:21px; }
  .nav-toggle span:nth-child(3){ top:27px; }
  nav.menu-open .nav-toggle span:nth-child(1){ top:21px; transform:rotate(45deg); }
  nav.menu-open .nav-toggle span:nth-child(2){ opacity:0; }
  nav.menu-open .nav-toggle span:nth-child(3){ top:21px; transform:rotate(-45deg); }

  /* the pill that sat in the bar (and ran off-screen) moves into the menu */
  nav > .nav-cta{ display:none; }

  nav .nav-links{
    display:none;
    position:absolute; top:calc(100% + 8px); left:12px; right:12px;
    flex-direction:column; gap:2px; padding:10px;
    background:rgba(255,255,255,0.98);
    -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px);
    border:1px solid rgba(15,76,129,0.08);
    border-radius:20px;
    box-shadow:0 24px 50px -20px rgba(15,76,129,0.35);
    max-height:calc(100vh - 96px); max-height:calc(100dvh - 96px);
    overflow-y:auto; -webkit-overflow-scrolling:touch;
  }
  nav.scrolled .nav-links{ left:0; right:0; top:calc(100% + 10px); }
  nav.menu-open .nav-links{ display:flex; }

  nav .nav-links li{ width:100%; }
  nav .nav-links a{
    width:100%; min-height:48px; padding:12px 14px;
    font-size:16px; opacity:1; border-radius:12px;
  }
  nav .nav-links a:active{ background:rgba(15,76,129,0.07); }
  nav .nav-links .nav-chevron{ display:none; }
  nav .nav-menu-cta{ display:block; padding:6px 4px 4px; }
  nav .nav-menu-cta .nav-cta{ display:block; width:100%; min-height:48px; font-size:15px; }

  /* ----- Hero ----- */
  .hero{
    min-height:0; gap:4px;
    padding:84px max(20px, env(safe-area-inset-right)) 36px max(20px, env(safe-area-inset-left));
  }
  .hero-right{ height:clamp(290px, 84vw, 440px); margin-bottom:0; }
  .hero-left{ max-width:640px; margin:0 auto; width:100%; }
  .eyebrow{ margin-bottom:14px; }
  h1.headline{ margin-bottom:16px; }
  .sub{ font-size:16px; line-height:1.65; margin-bottom:26px; max-width:none; }
  .cta-row{ gap:12px; margin-bottom:28px; }
  .btn-primary, .btn-secondary{
    flex:1 1 0; min-height:50px; padding:14px 18px;
    white-space:nowrap; text-align:center;
    -webkit-tap-highlight-color:transparent;
  }
  .trust-row{ gap:10px 22px; }

  /* soft fade so the stage's shadow doesn't end in a hard line */
  #stage-canvas{ -webkit-mask-image:linear-gradient(to bottom,#000 78%,transparent 100%); mask-image:linear-gradient(to bottom,#000 78%,transparent 100%); }

  /* ----- Section spacing: tighter, consistent side padding ----- */
  .about{ padding:64px 24px 72px; gap:28px; }
  .about-right{ height:380px; margin-top:8px; }
  .products{ padding:64px 24px 72px; }
  .products-head{ margin-bottom:36px; }
  .products-cta{ padding:40px 28px; }
  .founder{ padding:8px 24px 80px; }
  .founder-grid{ gap:44px; }
  .contact{ padding:8px 24px 0; }
  .contact-grid{ gap:36px; }
  .contact-map{ margin-top:40px; padding-bottom:64px; }
  .footer-inner{ padding:56px 24px 0; }
  .footer-top{ padding-bottom:36px; gap:36px 30px; }
  .footer-bottom{ padding:20px 0 84px; }
  .back-to-top{ right:max(16px, env(safe-area-inset-right)); bottom:max(16px, env(safe-area-inset-bottom)); }

  /* products page */
  .catalog-hero{ padding:112px 24px 18px; }
  .catalog-section{ padding:12px 24px 72px; }

  /* ----- Forms: 16px text stops iOS zooming in on focus, 48px tap height ----- */
  .contact-form-panel input,
  .contact-form-panel select,
  .contact-form-panel textarea,
  .form-field input,
  .form-field select,
  .form-field textarea{ font-size:16px; }
  .form-field input, .form-field select{ min-height:48px; }
  .btn-form{ min-height:52px; }

  /* ----- Footer links / contact: comfortable tap size ----- */
  .footer-links a{ display:inline-block; padding:7px 0; }
  .footer-contact-value a{ display:block; width:fit-content; padding:4px 0; }
  .footer-legal a{ display:inline-block; padding:6px 0; }
  .social-icon{ min-width:44px; min-height:44px; }
}

/* ---------------------------------------------------------------------
   PHONES (≤ 620px)
   --------------------------------------------------------------------- */
@media (max-width:620px){
  h1.headline{ font-size:clamp(28px, 8vw, 36px); line-height:1.16; }
  .about h2.headline, .founder h2.headline, .contact h2.headline{ font-size:clamp(26px, 7.2vw, 34px); }
  .about, .products, .founder, .contact, .footer-inner{ padding-left:20px; padding-right:20px; }
  .about{ padding-top:56px; padding-bottom:60px; }
  .about-right{ height:320px; }
  .products{ padding-top:56px; padding-bottom:60px; }
  .products-head{ margin-bottom:28px; }
  .founder{ padding-bottom:64px; }
  .contact-form-panel{ padding:24px 18px; }
  .contact-map-frame{ height:280px; }
  .footer-inner{ padding-top:48px; }
  .catalog-hero{ padding-left:20px; padding-right:20px; }
  .catalog-section{ padding-left:20px; padding-right:20px; }
}

/* very small phones: stack the two hero buttons full width */
@media (max-width:400px){
  .cta-row{ flex-direction:column; align-items:stretch; }
  .btn-primary, .btn-secondary{ flex:0 0 auto; width:100%; }
}

/* ---------------------------------------------------------------------
   Short landscape phones: don't force a full-height hero
   --------------------------------------------------------------------- */
@media (max-height:520px) and (orientation:landscape){
  .hero{ min-height:0; }
}

/* ---------------------------------------------------------------------
   Touch screens: hover-only lift effects shouldn't "stick" after a tap
   --------------------------------------------------------------------- */
@media (hover:none){
  .btn-primary:hover, .nav-cta:hover{ transform:none; }
}
