.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    display: inline-block;
    vertical-align: middle;
}

.supergraphic-overlay {
    mask-image: linear-gradient(to bottom, transparent, black, transparent);
    opacity: 0.03;
    pointer-events: none;
}

.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.text-gradient-red {
    background: linear-gradient(135deg, #b90014 0%, #e31b23 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.expertise-card,
.product-card,
.case-study-card,
.testimonial-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.expertise-card:hover,
.product-card:hover,
.case-study-card:hover,
.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    border-bottom: 2px solid #b90014;
}

.tech-mesh {
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 24px 24px;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Carousel Controls */
#carousel-prev,
#carousel-next {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

#carousel-prev.visible,
#carousel-next.visible {
    opacity: 1;
    pointer-events: auto;
}

/* --- Carousel: safe-zone gutter keeps card shadows inside their own slide --- */
#products .carousel-slide {
    padding: clamp(1.25rem, 3.5vw, 2.25rem);
}

/* Trim the stage shadow so it never bleeds past the gutter */
#products .shadow-stage {
    box-shadow: 0 8px 24px 10px rgba(7, 10, 15, 0.4);
}

/* ==========================================================================
   Redesign system - "Signal & Voltage"
   Dark stage + brand red heat + kinetic detail. Utility-first everywhere else;
   these classes exist only for effects Tailwind can't express inline.
   ========================================================================== */

/* --- Atmosphere: texture that stops flat panels reading as an AI template --- */
.grain::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.35;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.grid-lines {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 40%, transparent 100%);
}

.dot-grid {
    background-image: radial-gradient(rgba(15, 23, 42, 0.10) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 20%, transparent 90%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 20%, transparent 90%);
}

/* --- Typography accents --- */
.text-gradient-ember {
    background: linear-gradient(100deg, #ff2a34 0%, #ff5a3c 55%, #ff8a5b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.eyebrow {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* Oversized ghost numeral used to index case studies */
.ghost-numeral {
    font-family: "Hanken Grotesk", sans-serif;
    font-weight: 800;
    line-height: 0.8;
    -webkit-text-stroke: 1px rgba(15, 23, 42, 0.18);
    color: transparent;
    transition: -webkit-text-stroke-color 0.4s ease, color 0.4s ease;
}

.case-row:hover .ghost-numeral {
    -webkit-text-stroke-color: rgba(227, 27, 35, 0.55);
    color: rgba(227, 27, 35, 0.06);
}

/* Inset the content so it breathes against the hover background,
   while the borders and highlight still span the full row width */
.case-row {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
}

/* --- Phone device frame for the app showcase --- */
.phone-frame {
    position: relative;
    width: 260px;
    aspect-ratio: 9 / 19;
    border-radius: 2.5rem;
    background: linear-gradient(160deg, #1E2735, #070A0F);
    padding: 12px;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.08),
        0 30px 60px -20px rgba(7, 10, 15, 0.7),
        0 0 80px -20px rgba(227, 27, 35, 0.35);
}

.phone-frame::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 18px;
    border-radius: 0 0 14px 14px;
    background: rgba(255, 255, 255, 0.14);
    z-index: 2;
}

.phone-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1.9rem;
    display: block;
}

/* Gallery screens: hover lift and an ember rim */
.ben-screen {
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s ease, border-color 0.45s ease;
}

.ben-screen:hover {
    transform: translateY(-8px) rotate(var(--tilt, 0deg));
    box-shadow: 0 24px 50px -18px rgba(7, 10, 15, 0.55), 0 0 40px -12px rgba(227, 27, 35, 0.35);
    border-color: rgba(227, 27, 35, 0.45) !important;
}

/* --- Buttons: weight, glow and a light sweep on hover --- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 700;
    border-radius: 0.5rem;
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, background-color 0.25s ease;
}

.btn::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    transform: translateX(-120%) skewX(-18deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transition: transform 0.7s ease;
}

.btn:hover::before {
    transform: translateX(120%) skewX(-18deg);
}

.btn-primary {
    background: linear-gradient(120deg, #e31b23 0%, #ff4530 100%);
    color: #fff;
    box-shadow: 0 12px 30px -12px rgba(227, 27, 35, 0.85);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 45px -14px rgba(227, 27, 35, 0.95);
}

.btn-ghost-light {
    border: 1px solid rgba(233, 237, 244, 0.28);
    color: #e9edf4;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(6px);
}

.btn-ghost-light:hover {
    border-color: rgba(233, 237, 244, 0.6);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

/* --- Cards: cursor-tracked spotlight (set --mx/--my from JS) --- */
.spotlight {
    position: relative;
    isolation: isolate;
}

.spotlight::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.35s ease;
    background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(227, 27, 35, 0.14), transparent 62%);
}

.spotlight:hover::before {
    opacity: 1;
}

.spotlight>* {
    position: relative;
    z-index: 1;
}

/* Gradient hairline that only appears on hover */
.edge-glow::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(130deg, rgba(227, 27, 35, 0.7), rgba(255, 138, 91, 0.25), transparent 60%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.edge-glow:hover::after {
    opacity: 1;
}

/* --- Kinetic ticker --- */
.marquee {
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee__track {
    display: flex;
    width: max-content;
}

.marquee:hover .marquee__track {
    animation-play-state: paused;
}

.marquee__track.is-paused {
    animation-play-state: paused;
}

/* --- Interior page hero: the homepage stage, reduced to a single class --- */
.hero-stage {
    position: relative;
    overflow: hidden;
    background-color: #001E33;
}

.hero-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(36rem 36rem at 88% -10%, rgba(227, 27, 35, 0.38), transparent 62%),
        radial-gradient(32rem 32rem at 2% 110%, rgba(255, 90, 60, 0.24), transparent 62%);
}

.hero-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    /* Reset so the grid survives co-existing classes that style ::after (e.g. .grain) */
    opacity: 1;
    mix-blend-mode: normal;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 40%, transparent 100%);
}

/* --- Closing call-to-action band --- */
.cta-band {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #b90014 0%, #e31b23 55%, #ff5a3c 100%);
}

/* Feature ticks inside the product carousel - one rule for repeated markup */
#products .carousel-slide li>.material-symbols-outlined {
    display: grid;
    place-items: center;
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    background: rgba(227, 27, 35, 0.08);
    color: #e31b23;
    font-size: 18px;
}

/* --- Hero entrance: plays once on load, then the stage sits still --- */
@keyframes hero-glow-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Focus-pull: the device resolves into sharpness rather than sliding in */
@keyframes hero-visual-in {
    from {
        opacity: 0;
        transform: translateY(32px) scale(0.97);
        filter: blur(8px);
    }

    to {
        opacity: 1;
        transform: none;
        filter: blur(0);
    }
}

.hero-enter-glow {
    animation: hero-glow-in 1600ms ease-out both;
}

.hero-enter-visual {
    animation: hero-visual-in 1100ms cubic-bezier(0.16, 1, 0.3, 1) both;
    will-change: transform, opacity, filter;
}

/* ==========================================================================
   Rotating proof chips
   Cycle: three pairs, 11s hold each, crossfaded. Pair 1 -> 2 -> 3 -> 1.
   One 40s animation drives every pair, offset by a third per pair.
   ========================================================================== */

/* Pair container: owns the crossfade so left/right chips move as one unit.
   Positioned above the hero image (z-10) - without this, the opacity
   animation's stacking context traps the chips behind it. */
.hero-chip-pair {
    position: absolute;
    inset: 0;
    z-index: 20;
    opacity: 0;
    will-change: opacity;
    animation: hero-chip-pair-cycle 40s linear infinite;
}

.hero-chip-pair--2 {
    animation-delay: 13.2s;
}

.hero-chip-pair--3 {
    animation-delay: 26.4s;
}

/* Chips carry their own fade + directional slide on the same cycle */
.hero-chip-pair .hero-enter-chip--left {
    animation: hero-chip-cycle-left 40s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.hero-chip-pair .hero-enter-chip--right {
    animation: hero-chip-cycle-right 40s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.hero-chip-pair--2 .hero-enter-chip {
    animation-delay: 13.2s;
}

.hero-chip-pair--3 .hero-enter-chip {
    animation-delay: 26.4s;
}

/* One full 40s cycle; each pair's 14s window starts 0.8s early so the
   fade-out of one pair overlaps the fade-in of the next */
@keyframes hero-chip-pair-cycle {
    /* in: 0.8s */
    0% {
        opacity: 0;
    }

    2% {
        opacity: 1;
    }

    /* hold: both chips shown for 11s */
    31.5% {
        opacity: 1;
    }

    /* out: 1.4s crossfade, done at 14s */
    35% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

/* Chips slide in over the pair's first ~1.6s, hold 11s, crossfade out */
@keyframes hero-chip-cycle-left {
    0% {
        opacity: 0;
        transform: translate3d(-32px, 14px, 0) scale(0.94);
    }

    4% {
        opacity: 1;
        transform: none;
    }

    31.5% {
        opacity: 1;
        transform: none;
    }

    35% {
        opacity: 0;
        transform: none;
    }

    100% {
        opacity: 0;
        transform: none;
    }
}

@keyframes hero-chip-cycle-right {
    0% {
        opacity: 0;
        transform: translate3d(32px, -14px, 0) scale(0.94);
    }

    4% {
        opacity: 1;
        transform: none;
    }

    31.5% {
        opacity: 1;
        transform: none;
    }

    35% {
        opacity: 0;
        transform: none;
    }

    100% {
        opacity: 0;
        transform: none;
    }
}

/* --- Standalone hero chips (pages outside the rotating pair system) --- */
@keyframes hero-chip-in-left {
    from {
        opacity: 0;
        transform: translate3d(-28px, 12px, 0) scale(0.95);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes hero-chip-in-right {
    from {
        opacity: 0;
        transform: translate3d(28px, -12px, 0) scale(0.95);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.hero-enter-chip {
    will-change: transform, opacity;
    animation: hero-chip-in-left 900ms cubic-bezier(0.16, 1, 0.3, 1) 500ms both;
}

.hero-enter-chip--right {
    animation-name: hero-chip-in-right;
    animation-delay: 680ms;
}

/* --- Attention cues: fire a few times on load, then rest --- */
@keyframes cue-pulse {
    0% {
        transform: scale(1);
        opacity: 0.75;
    }

    75%,
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

@keyframes cue-nudge {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(6px);
    }
}

.cue-pulse {
    animation: cue-pulse 1.5s cubic-bezier(0, 0, 0.2, 1) 3 both;
}

.cue-nudge {
    animation: cue-nudge 1.6s ease-in-out 1.4s 3 both;
}

/* --- Scroll reveal --- */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* --- Reading-progress rail in the header --- */
#scroll-progress {
    transform-origin: 0 50%;
    transform: scaleX(0);
    transition: transform 0.1s linear;
}

/* --- Respect motion preferences --- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }

    /* Rest the rotating chips on pair 1 instead of cycling */
    .hero-chip-pair,
    .hero-chip-pair .hero-enter-chip {
        animation: none !important;
        opacity: 1;
        transform: none;
    }

    .hero-chip-pair--2,
    .hero-chip-pair--3 {
        display: none;
    }
}