/*
 * Technovation IV — Desktop curved-filmstrip header.
 * Install AFTER the existing assets/css/style.css.
 * Reel artwork: assets/img/reel.jpeg
 * Existing 700px-and-below hamburger navigation is intentionally unchanged.
 */
@media (min-width: 701px) {
  :root {
    /* Matches the reel's aspect ratio at common desktop widths. */
    --header-height: clamp(145px, 20.6vw, 170px);
  }

  .site-header {
    height: var(--header-height);
    background-image: url('../img/reel.png');
    background-size: 100% 95%, cover;
    background-repeat: no-repeat, no-repeat;
    /* Reveal the tech-design texture in the black filmstrip surroundings. */
    background-blend-mode: screen, normal;
    background-position: center 12px;
  }

  /* Header artwork is edge-to-edge rather than limited by .container. */
  .site-nav.container {
    width: 100%;
    max-width: none;
    height: 100%;
    padding: 0;
    margin: 0;
    display: block;
  }

  /* Remove the old CSS-built rectangular strip entirely. */
  .site-nav .nav-links {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }
  .site-nav .nav-links::before,
  .site-nav .nav-links::after {
    content: none;
    display: none;
  }

  /* Curved SVG navigation: every individual letter follows the reel's wave. */
  .site-nav .nav-links { display: none; }
  .site-nav .reel-curve-nav {
    position: absolute;
    top: 10px;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    z-index: 4;
    overflow: visible;
  }
  .reel-curve-link { cursor: pointer; }
  .reel-curve-link text {
    fill: white;
    font-family: var(--display, Georgia, 'Times New Roman', serif);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.3px;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
    paint-order: stroke fill;
    stroke: rgba(0, 0, 0, .5);
    stroke-width: .65px;
    filter: drop-shadow(0px 2px 3px rgba(0,0,0,.75));
    transition: fill .2s ease;
  }
  .reel-curve-link:hover text,
  .reel-curve-link:focus-visible text,
  .reel-curve-link.is-active text { fill: #fff7e7; }
  .reel-curve-link:focus-visible { outline: none; }
  .reel-curve-link:focus-visible text { stroke: #d4a18b; stroke-width: 1.5px; }

  /* The desktop header artwork contains the brand so these remain hidden. */
  .site-nav .mobile-brand,
  .site-nav .nav-toggle { display: none; }
}

/* On mobile keep the existing usable hamburger menu, not the giant reel. */
@media (max-width: 700px) {
  .reel-curve-nav { display: none; }
}
@media (max-width: 700px) {
  .site-header {
    background: linear-gradient(180deg, #303344 0%, #151d35 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reel-curve-link text { transition: none; }
}

/* ===== Smooth glass effect when the sticky header is scrolled =====
 * Doesn't resize, translate or reposition the existing reel or SVG navigation.
 * Works with the existing .site-header and .site-nav structure.
 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  isolation: isolate;
  transition: box-shadow 460ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* .site-header.is-scrolled {
  box-shadow: 0 9px 28px rgba(0, 0, 0, 0.22);
} */

/* Glass overlay appears only when JavaScript adds .is-scrolled. */
/* .site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(7, 12, 29, 0.28);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  backdrop-filter: blur(12px) saturate(1.15);
  opacity: 0;
  transition: opacity 460ms cubic-bezier(0.22, 1, 0.36, 1);
} */

/* .site-header.is-scrolled::before {
  opacity: 1;
} */

/* Keep navigation/text crisp above the blurred header background. */
.site-header .site-nav {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .site-header, .site-header::before { transition: none; }
}

/* BLUE GLASS BACKGROUND BEHIND THE REEL */
@media (min-width: 701px) {

    .site-header {
        position: sticky;
        top: 0;
        isolation: isolate;
        background: transparent !important;
    }

    /* Blue glass layer behind everything */
    .site-header::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 0;
        pointer-events: none;

        background: rgba(17, 27, 57, 0.82);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);

        opacity: 0;
        transition: opacity 0.5s ease;
    }

    /* Show blue glass when scrolling */
    /* .site-header.is-scrolled::before {
        opacity: 1;
    } */

    /* Keep the reel image ABOVE the blue glass */
    
    .site-header::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
        pointer-events: none;
        background-image: url(../img/r13.png)!important;
        background-size: 100% 100%!important;
        background-position: center 12px;
        background-repeat: no-repeat;
    }


    /* Keep navigation links above all layers */
    .site-header .site-nav {
        position: relative;
        z-index: 2;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .site-header::before {
        transition: none;
    }
}

@media (min-width: 701px) {
    .reel-curve-link text {
        transform-box: fill-box;
        transform-origin: center center;
        transform: scaleY(1.2);
    }
}

/* Disable sticky header on all devices */
.site-header,
.site-header.is-scrolled {
    position: relative !important;
    top: auto !important;
}

/* Remove sticky header scroll offset */
html {
    scroll-padding-top: 16px !important;
}

.category-detail-wrap {
    scroll-margin-top: 15px !important;
}

@media (min-width: 701px) {
    /* Red underline */
    .reel-curve-link text {
        fill: #550708 !important;
        text-decoration: underline !important;
    }

    /* Keep the actual lettering white */
    .reel-curve-link text > textPath,
    .reel-curve-link text > tspan {
        fill: #ffffff !important;
    }

    /* Hover lettering */
    .reel-curve-link:hover text > textPath,
    .reel-curve-link:hover text > tspan {
        fill: #fff7e7 !important;
    }
}

@media (min-width: 701px) {
    /* Remove original underline */
    .reel-curve-link text.reel-curve-label {
        text-decoration: none !important;
    }

    /* Separate maroon underline */
    .reel-curve-link text.reel-curve-underline {
        fill: #6e0e14 !important;
        text-decoration: underline !important;
        text-decoration-thickness: 3px !important;
        stroke: none !important;
        filter: none !important;
        pointer-events: none;
        transform: translateY(5px) scaleY(1.2) !important;
    }

    /* Hide duplicate letters, keep underline */
    .reel-curve-link text.reel-curve-underline textPath,
    .reel-curve-link text.reel-curve-underline tspan {
        fill: transparent !important;
        stroke: none !important;
    }
}

