/* ============================================
   OUR PRODUCTS — HIGH-TECH / SCARY ANIMATED
   ============================================ */

.products-page {
    background: #030308;
    --prod-cyan: #00f5ff;
    --prod-cyan-dim: #00b8c4;
    --prod-green: #00ff88;
    --prod-red: #ff3366;
    --prod-orange: #ff6600;
    --prod-card-bg: rgba(8, 12, 18, 0.9);
    --prod-border: rgba(0, 245, 255, 0.12);
    --prod-font-mono: 'JetBrains Mono', monospace;
    --prod-font-display: 'Orbitron', sans-serif;
}

/* ---- Scanlines ---- */
.products-scanlines {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.12) 2px,
        rgba(0, 0, 0, 0.12) 4px
    );
    opacity: 0.45;
}

/* ---- Noise ---- */
.products-noise {
    position: fixed;
    inset: 0;
    z-index: 9997;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Grid background ---- */
.products-grid-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 245, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 255, 0.025) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, black 0%, transparent 60%);
    animation: prod-grid-pulse 10s ease-in-out infinite;
}

@keyframes prod-grid-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.products-main {
    position: relative;
    z-index: 1;
    padding-top: var(--header-h, 72px);
}

/* ---- Hero ---- */
.products-hero {
    position: relative;
    min-height: 55vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 0 100px;
    overflow: hidden;
}

.products-hero-bg {
    position: absolute;
    inset: 0;
}

.products-hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 245, 255, 0.03) 30%,
        transparent 60%,
        rgba(0, 255, 136, 0.03) 80%,
        transparent 100%
    );
    background-size: 100% 400%;
    animation: prod-data-stream 14s linear infinite;
    pointer-events: none;
}

@keyframes prod-data-stream {
    0% { background-position: 0 0; }
    100% { background-position: 0 400%; }
}

.products-hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.18;
    animation: prod-glow-float 18s ease-in-out infinite;
}

.products-hero-glow-1 {
    width: 500px;
    height: 500px;
    background: var(--prod-cyan);
    top: -150px;
    left: -100px;
}

.products-hero-glow-2 {
    width: 400px;
    height: 400px;
    background: var(--prod-green);
    bottom: -100px;
    right: -80px;
    animation-delay: -6s;
}

.products-hero-glow-3 {
    width: 280px;
    height: 280px;
    background: var(--prod-orange);
    top: 40%;
    right: 15%;
    animation-delay: -12s;
}

@keyframes prod-glow-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -25px) scale(1.08); }
    66% { transform: translate(-25px, 40px) scale(0.95); }
}

.products-hero-lines {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 245, 255, 0.04) 50%, transparent 100%);
    animation: prod-line-sweep 5s ease-in-out infinite;
}

@keyframes prod-line-sweep {
    0%, 100% { opacity: 0.2; transform: translateY(-80%); }
    50% { opacity: 0.7; transform: translateY(80%); }
}

.products-hero-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.products-hero-label {
    font-family: var(--prod-font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.35em;
    color: var(--prod-green);
    margin-bottom: 20px;
    opacity: 0;
    animation: prod-fade-in 0.7s ease-out 0.15s forwards;
}

.products-bracket {
    color: var(--prod-cyan);
    animation: prod-bracket-blink 1.2s step-end infinite;
}

@keyframes prod-bracket-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

@keyframes prod-fade-in {
    to { opacity: 1; }
}

/* ---- Glitch title ---- */
.products-hero-title {
    font-family: var(--prod-font-display);
    font-size: clamp(1.75rem, 4.5vw, 3.25rem);
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--prod-cyan);
    text-transform: uppercase;
    margin-bottom: 14px;
    position: relative;
    opacity: 0;
    animation: prod-fade-in 0.8s ease-out 0.4s forwards;
}

.glitch-products {
    position: relative;
}

.glitch-products::before,
.glitch-products::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.glitch-products::before {
    left: -2px;
    text-shadow: 2px 0 var(--prod-red);
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
    animation: prod-glitch-1 2.8s infinite linear alternate-reverse;
}

.glitch-products::after {
    left: 2px;
    text-shadow: -2px 0 var(--prod-green);
    clip-path: polygon(0 66%, 100% 66%, 100% 100%, 0 100%);
    animation: prod-glitch-2 2.2s infinite linear alternate-reverse;
}

@keyframes prod-glitch-1 {
    0% { transform: translate(0); }
    25% { transform: translate(-1px, 1px); }
    50% { transform: translate(1px, -1px); }
    75% { transform: translate(-1px, -1px); }
    100% { transform: translate(0); }
}

@keyframes prod-glitch-2 {
    0% { transform: translate(0); }
    25% { transform: translate(1px, -1px); }
    50% { transform: translate(-1px, 1px); }
    75% { transform: translate(1px, 1px); }
    100% { transform: translate(0); }
}

.products-hero-sub {
    font-family: var(--prod-font-mono);
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    color: var(--text-muted);
    letter-spacing: 0.15em;
    opacity: 0;
    animation: prod-fade-in 0.7s ease-out 0.6s forwards;
}

/* ---- Section ---- */
.products-section {
    padding: 80px 0 120px;
    position: relative;
}

.products-section-title {
    font-family: var(--prod-font-display);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--prod-cyan);
    margin-bottom: 48px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.products-title-line {
    display: inline-block;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--prod-cyan), transparent);
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.products-section-title.visible .products-title-line {
    width: 80px;
}

.products-title-text {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.products-section-title.visible .products-title-text {
    opacity: 1;
    transform: translateX(0);
}

/* ---- Product grid ---- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.product-card {
    position: relative;
    padding: 32px 28px;
    background: var(--prod-card-bg);
    border: 1px solid var(--prod-border);
    border-radius: 4px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(28px) scale(0.98);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.35s,
                box-shadow 0.35s;
}

.product-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.product-card:hover {
    border-color: rgba(0, 245, 255, 0.35);
    box-shadow: 0 0 50px rgba(0, 245, 255, 0.08),
                inset 0 0 60px rgba(0, 245, 255, 0.03);
}

.product-card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 20%,
        rgba(0, 245, 255, 0.04) 0%,
        transparent 45%
    );
    pointer-events: none;
}

.product-num {
    display: inline-block;
    font-family: var(--prod-font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--prod-cyan);
    letter-spacing: 0.1em;
    margin-bottom: 14px;
    opacity: 0.85;
}

.product-title {
    font-family: var(--prod-font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text);
    margin-bottom: 14px;
    line-height: 1.35;
}

.product-desc {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Stagger delays for product cards */
.product-card:nth-child(1)  { transition-delay: 0.02s; }
.product-card:nth-child(2)  { transition-delay: 0.05s; }
.product-card:nth-child(3)  { transition-delay: 0.08s; }
.product-card:nth-child(4)  { transition-delay: 0.11s; }
.product-card:nth-child(5)  { transition-delay: 0.14s; }
.product-card:nth-child(6)  { transition-delay: 0.17s; }
.product-card:nth-child(7)  { transition-delay: 0.2s; }
.product-card:nth-child(8)  { transition-delay: 0.23s; }
.product-card:nth-child(9)  { transition-delay: 0.26s; }
.product-card:nth-child(10) { transition-delay: 0.29s; }
.product-card:nth-child(11) { transition-delay: 0.32s; }
.product-card:nth-child(12) { transition-delay: 0.35s; }
.product-card:nth-child(13) { transition-delay: 0.38s; }
.product-card:nth-child(14) { transition-delay: 0.41s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .products-grid-bg,
    .products-hero-glow,
    .products-hero-lines,
    .products-hero-bg::after,
    .glitch-products::before,
    .glitch-products::after {
        animation: none;
    }
}
