/* ==========================================================================
   KYNORIA — Responsive Breakpoints
   --------------------------------------------------------------------------
   Loaded with its own <link> AFTER style.css (not @imported at the top of
   it), so these rules win over the base rules of equal specificity.
   Max-width blocks run from widest to narrowest so the smallest matching
   breakpoint always has the last word.
   ========================================================================== */


/* ==========================================================================
   MAX-WIDTH 1024px — Tablets Landscape / Small Desktops
   ========================================================================== */

@media (max-width: 1024px) {

  /* Navigation collapses to hamburger */
  .nav-menu {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-header {
    width: calc(100% - var(--space-8));
  }

  /* Drawer slides in BELOW the header so the hamburger (now an X) stays
     visible and tappable while the menu is open. */
  .mobile-nav {
    z-index: calc(var(--z-nav) - 1);
    height: 100vh;
    height: 100dvh;
    padding-top: calc(var(--space-5) + 84px + var(--space-6));
  }

  body.home .mobile-nav {
    padding-top: calc(48px + var(--space-3) + 84px + var(--space-6));
  }

  .mobile-nav-backdrop {
    z-index: calc(var(--z-nav) - 2);
  }

  /* Grids */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Mega Menu hidden on tablet */
  .mega-menu {
    display: none;
  }

  /* Footer */
  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }

  .footer__about {
    grid-column: 1 / -1;
    padding-right: 0;
  }

  /* Stats */
  .stats__grid {
    gap: var(--space-6);
  }
}


/* ==========================================================================
   MAX-WIDTH 768px — Tablets Portrait / Phones
   ========================================================================== */

@media (max-width: 768px) {

  :root {
    --section-py: var(--space-16);
  }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }

  /* Header: the CTA lives in the drawer on small screens */
  .nav-cta {
    display: none;
  }

  .nav-header {
    padding: var(--space-3) var(--space-4);
  }

  .nav-header.scrolled {
    padding: var(--space-2) var(--space-4);
  }

  /* Buttons may wrap instead of overflowing narrow screens */
  .btn {
    white-space: normal;
    text-align: center;
  }

  /* Grid collapses */
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-auto {
    grid-template-columns: 1fr;
  }

  /* Inline 64px gaps are meant for side-by-side columns */
  .grid[style*="space-16"] {
    gap: var(--space-10) !important;
  }

  /* Inline fixed-height feature images (420–480px) are too tall stacked */
  .grid img[style*="height"] {
    height: 280px !important;
  }

  /* Contact form rows use inline two-column grids */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  /* Hero */
  .hero {
    min-height: 85vh;
  }

  .hero--short {
    min-height: 40vh;
  }

  .hero__content {
    padding-top: var(--space-24);
  }

  /* Home slider: leave room for the emergency bar + header on top and the
     wave on the bottom, and never squash the slide content. */
  body.home .hero {
    min-height: 680px;
    min-height: max(100svh, 680px);
  }

  body.home .hero__slide {
    padding: calc(48px + var(--space-3) + 72px + var(--space-4)) 0 96px;
  }

  .hero__slide .container {
    margin: 0 var(--space-4);
    padding: var(--space-6) var(--space-5);
  }

  .hero__subtitle {
    margin-bottom: var(--space-6);
  }

  /* Arrows sit on top of the text on phones — swipe works instead */
  .hero__arrow {
    display: none;
  }

  .hero__dots {
    bottom: var(--space-8);
  }

  .hero__dot {
    width: 32px;
    height: 3px;
  }

  /* Section headers */
  .section__header {
    margin-bottom: var(--space-10);
  }

  .section__title {
    font-size: var(--text-2xl);
  }

  .section__desc {
    font-size: var(--text-base);
  }

  /* Decorative watermark must not widen the page */
  .watermark-container {
    overflow-x: clip;
  }

  .watermark-emblem {
    width: 300px;
    height: 300px;
  }

  /* Stats */
  .stats__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }

  .stat + .stat::before {
    display: none;
  }

  .stat__number {
    font-size: var(--text-3xl);
  }

  /* Timeline collapses to single column */
  .timeline::before {
    left: 20px;
  }

  .timeline__item,
  .timeline__item:nth-child(even) {
    width: 100%;
    margin-left: 0;
    padding-left: var(--space-12);
    padding-right: 0;
    text-align: left;
  }

  .timeline__item:nth-child(odd) {
    padding-right: 0;
    text-align: left;
  }

  .timeline__dot,
  .timeline__item:nth-child(odd) .timeline__dot,
  .timeline__item:nth-child(even) .timeline__dot {
    left: 12px;
    right: auto;
  }

  /* Footer */
  .footer {
    padding-top: var(--space-12);
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
    padding-bottom: var(--space-10);
  }

  .footer__certs {
    gap: var(--space-3) var(--space-6);
  }

  /* CTA */
  .cta {
    padding: var(--space-16) 0;
  }

  .cta__title {
    font-size: var(--text-2xl);
  }

  /* Forms */
  .form-row {
    grid-template-columns: 1fr;
  }

  /* Map embeds */
  iframe {
    max-width: 100%;
  }

  #google-map-embed iframe {
    height: 360px;
  }

  /* World Map */
  .world-map {
    margin-left: calc(-50vw + 50%);
  }

  /* Testimonials */
  .testimonial {
    padding: var(--space-6);
  }

  /* Toasts span the screen instead of sliding off its right edge */
  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
  }

  .toast {
    max-width: none;
  }
}


/* ==========================================================================
   MAX-WIDTH 480px — Small Phones
   ========================================================================== */

@media (max-width: 480px) {

  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }

  .section {
    padding: var(--space-12) 0;
  }

  /* Smaller logo so logo + hamburger fit on a 320px screen */
  .nav-logo {
    gap: var(--space-2);
  }

  .nav-logo img,
  .nav-header.scrolled .nav-logo img {
    height: 30px;
  }

  .nav-logo .logo-emblem,
  .nav-header.scrolled .nav-logo .logo-emblem {
    height: 38px;
  }

  .hero__title {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-4);
  }

  .hero__subtitle {
    font-size: var(--text-sm);
  }

  .hero__slide .container {
    padding: var(--space-5) var(--space-4);
  }

  .hero--short .hero__content {
    padding: var(--space-5);
  }

  .hero__actions {
    flex-direction: column;
    gap: var(--space-3);
  }

  .hero__actions .btn,
  .cta__actions .btn {
    width: 100%;
  }

  .btn-lg {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
  }

  .card:not(.card--team):not(.card--port) {
    padding: var(--space-6);
  }

  .stats__grid {
    gap: var(--space-6);
  }

  .stat__number {
    font-size: var(--text-2xl);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .faq-question {
    padding: var(--space-4);
  }

  .faq-answer__inner {
    padding: 0 var(--space-4) var(--space-4);
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer__bottom-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
  }
}


/* ==========================================================================
   MIN-WIDTH 1025px — Desktop
   ========================================================================== */

@media (min-width: 1025px) {

  /* Ensure mobile nav is hidden on desktop */
  .mobile-nav {
    display: none !important;
  }

  .mobile-nav-backdrop {
    display: none !important;
  }

  .nav-toggle {
    display: none !important;
  }
}


/* ==========================================================================
   MIN-WIDTH 1200px — Large Desktop
   ========================================================================== */

@media (min-width: 1200px) {

  .hero__title {
    font-size: var(--text-5xl);
  }

  .section__title {
    font-size: var(--text-3xl);
  }
}


/* ==========================================================================
   MIN-WIDTH 1440px — Extra Large
   ========================================================================== */

@media (min-width: 1440px) {

  .container {
    max-width: 1280px;
  }

  .container-wide {
    max-width: 1440px;
  }

  .hero__title {
    font-size: var(--text-6xl);
  }
}


/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
  .nav-header,
  .emergency-bar,
  .hero__particles,
  .hero__wave,
  .hero__dots,
  .hero__arrow,
  .toast-container,
  .mobile-nav,
  .mobile-nav-backdrop {
    display: none !important;
  }

  .hero {
    min-height: auto;
    padding: 2rem 0;
    background: #fff;
  }

  .hero__title,
  .hero__subtitle {
    color: #000;
  }

  .section {
    padding: 1.5rem 0;
  }

  body {
    color: #000;
    background: #fff;
  }
}
