/* ============================================================================
   POLISH LAYER (Phase 3)
   ----------------------------------------------------------------------------
   Brass sextant custom cursor over the products section, DrawSVG threat-tape
   section dividers, and split-text wordmark reveals.

   Kept in a separate file so the core theme CSS stays maintainable.
   Loaded last so its rules win the cascade.
   ============================================================================ */
/* ----------------------------------------------------------------------------
   1) BRASS SEXTANT CURSOR over the products section
   ----------------------------------------------------------------------------
   Hide the native cursor when inside .individual-products. A JS-controlled
   #cursor-sextant element follows the mouse via transform translate3d.
   Its color shifts to the hovered theme's accent (CSS custom property
   --sextant-accent set by JS on hover). Mobile/touch users get no cursor
   (we leave the native one) — only desktop pointer-fine devices opt in. */

@media (pointer: fine) {
    .individual-products,
    .individual-products * {
        cursor: none;
    }

    /* Links + buttons inside the section still need a visual affordance —
       we'll express it via the sextant cursor's color shift, but also
       ensure focus rings still work for keyboard users. */
    .individual-products a:focus-visible,
    .individual-products button:focus-visible {
        outline: 2px solid var(--tt-caution, #fac638);
        outline-offset: 3px;
    }
}

.sextant-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    transform: translate3d(-100px, -100px, 0);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.05s linear;
    color: var(--sextant-accent, #fac638);
}

.sextant-cursor.is-visible {
    opacity: 1;
}

.sextant-cursor svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 2px 4px rgba(0,0,0,0.6));
    transition: transform 0.3s ease;
}

.sextant-cursor.is-pointer svg {
    transform: scale(1.25);
}

/* Hide on touch / coarse pointer */
@media (pointer: coarse), (hover: none) {
    .sextant-cursor { display: none; }
    .individual-products,
    .individual-products * { cursor: auto !important; }
}

/* ----------------------------------------------------------------------------
   2) DRAWSVG THREAT-TAPE SECTION DIVIDERS
   ----------------------------------------------------------------------------
   A thin yellow/black stripe drawn left-to-right on scroll-into-view.
   Used between major page sections. The "draw" is achieved via a clip-path
   inset animation triggered when the .is-drawn class is added by JS. */

.tape-rule {
    position: relative;
    height: 18px;
    margin: 0;
    overflow: hidden;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.4s cubic-bezier(0.7, 0, 0.3, 1);
    background-image: repeating-linear-gradient(
        -45deg,
        #fac638 0,
        #fac638 14px,
        #0a0908 14px,
        #0a0908 28px
    );
    border-top: 1px solid rgba(250, 198, 56, 0.6);
    border-bottom: 1px solid rgba(250, 198, 56, 0.6);
}

.tape-rule::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.18) 50%, transparent 100%);
}

.tape-rule.is-drawn {
    clip-path: inset(0 0 0 0);
}

@media (prefers-reduced-motion: reduce) {
    .tape-rule {
        clip-path: inset(0);
        transition: none;
    }
}

/* ----------------------------------------------------------------------------
   3) TYPEWRITER on hero tagline
   ----------------------------------------------------------------------------
   JS hides the original text, then types it back out one char at a time.
   The blinking caret is CSS. */

.typewriter {
    display: inline;
    white-space: pre-wrap;
}

.typewriter__caret {
    display: inline-block;
    width: 0.55ch;
    margin-left: 1px;
    background: currentColor;
    height: 1em;
    vertical-align: -0.18em;
    animation: typewriter-blink 1s steps(1) infinite;
}

@keyframes typewriter-blink {
    0%, 50%   { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ----------------------------------------------------------------------------
   4) SPLIT-TEXT wordmark cascade on scroll-into-view
   ----------------------------------------------------------------------------
   JS wraps each character of card h3 wordmarks in <span class="char">N</span>
   then sets staggered animation-delays via inline style. CSS handles the
   actual character animation. */

/* .word wraps every group of non-whitespace chars. Display inline-block
   + white-space: nowrap keeps the per-char inline-block .char spans
   from being broken mid-word by the line layout. */
.featured-card h3 .word {
    display: inline-block;
    white-space: nowrap;
}

.featured-card h3 .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(14px) rotate(-6deg);
    transition:
        opacity 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
        transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.featured-card.is-in-view h3 .char {
    opacity: 1;
    transform: translateY(0) rotate(0);
}

@media (prefers-reduced-motion: reduce) {
    .featured-card h3 .char {
        opacity: 1 !important;
        transform: none !important;
    }
}
