/* ============ PLATFORMS HELIX HERO ============
   A rotating helical carousel of ASTROC hardware with the green galaxy
   spiral spinning behind it. Lives at the top of the #products section.
   Uses CSS-3D transforms for the helix; galaxy backdrop is delegated to
   assets/galaxy.js mount({ autoMorph: false }).
*/

.ph-hero {
    position: relative;
    margin: 40px 0 60px;
    padding: 32px 0;
    border: 1px solid rgba(170, 195, 230, 0.10);
    background: #04060a;
    overflow: hidden;
}
.ph-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.ph-canvas canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
.ph-veil {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 60% at 30% 50%, rgba(2, 6, 13, 0.35), transparent 80%),
        radial-gradient(ellipse 60% 60% at 80% 50%, rgba(2, 6, 13, 0.75), transparent 80%),
        linear-gradient(180deg, rgba(2, 6, 13, 0.35) 0%, transparent 25%, transparent 75%, rgba(2, 6, 13, 0.55) 100%);
}

/* Corner brackets that frame the hero */
.ph-hero::before,
.ph-hero::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(209, 140, 44, 0.7);
    z-index: 4;
    pointer-events: none;
}
.ph-hero::before { top: 8px;    left: 8px;   border-right: 0; border-bottom: 0; }
.ph-hero::after  { bottom: 8px; right: 8px;  border-left: 0;  border-top: 0; }

/* Top HUD strip */
.ph-hud {
    position: absolute;
    top: 20px;
    left: 30px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 14px;
    font: 600 10.5px/1 'JetBrains Mono', monospace;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(220, 230, 245, 0.85);
    pointer-events: none;
}
.ph-hud .dot {
    width: 6px;
    height: 6px;
    background: #5bf08a;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(91, 240, 138, 0.6);
    animation: ph-dot-pulse 1.6s ease-in-out infinite;
}
.ph-hud .tag { color: #d18c2c; }
@keyframes ph-dot-pulse { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }

.ph-hud-right {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 5;
    font: 500 10px/1 'JetBrains Mono', monospace;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(180, 200, 230, 0.5);
    pointer-events: none;
}

/* 2-column stage layout: helix on the left, spec panel on the right */
.ph-stage {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 0;
    min-height: 520px;
    padding: 60px 0 40px;
}

/* ------- Helix scene ------- */
.ph-helix-scene {
    position: relative;
    perspective: 1500px;
    perspective-origin: 50% 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
.ph-helix-wrap {
    position: relative;
    width: 260px;
    height: 320px;
    transform-style: preserve-3d;
    transform: rotateX(-12deg);
    animation: ph-helix-spin 30s linear infinite;
}
@keyframes ph-helix-spin {
    from { transform: rotateX(-12deg) rotateY(0deg); }
    to   { transform: rotateX(-12deg) rotateY(-360deg); }
}
/* Central subtle spindle line — makes the axis visible */
.ph-helix-scene::before {
    content: '';
    position: absolute;
    top: 40px;
    bottom: 40px;
    left: 50%;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(91, 240, 138, 0.32), transparent);
    pointer-events: none;
}

.ph-card {
    position: absolute;
    left: 0;
    top: 0;
    width: 260px;
    height: 320px;
    background: rgba(6, 12, 22, 0.88);
    border: 1px solid rgba(170, 195, 230, 0.16);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(4px);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(91, 140, 255, 0.05);
    transform-style: preserve-3d;
}
.ph-card::before, .ph-card::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1px solid rgba(209, 140, 44, 0.7);
}
.ph-card::before { top: 4px; left: 4px;   border-right: 0; border-bottom: 0; }
.ph-card::after  { bottom: 4px; right: 4px; border-left: 0; border-top: 0; }
.ph-card:nth-child(1) { transform: rotateY(0deg)    translateZ(300px) translateY(-100px); }
.ph-card:nth-child(2) { transform: rotateY(90deg)   translateZ(300px) translateY(-35px); }
.ph-card:nth-child(3) { transform: rotateY(180deg)  translateZ(300px) translateY( 35px); }
.ph-card:nth-child(4) { transform: rotateY(270deg)  translateZ(300px) translateY( 100px); }
.ph-card img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    margin: auto;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.6));
}
.ph-card-code {
    font: 700 10px/1 'JetBrains Mono', monospace;
    letter-spacing: 0.24em;
    color: #d18c2c;
}
.ph-card-name {
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.005em;
    color: #fff;
    margin-bottom: 6px;
}
.ph-card-meta {
    font: 500 9.5px/1 'JetBrains Mono', monospace;
    letter-spacing: 0.2em;
    color: rgba(180, 200, 230, 0.6);
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(170, 195, 230, 0.08);
}

/* ------- Spec panel ------- */
.ph-spec-panel {
    position: relative;
    padding: 32px 34px;
    margin-right: 40px;
    border-left: 1px solid rgba(170, 195, 230, 0.10);
    background: linear-gradient(180deg, rgba(6, 10, 20, 0.55), rgba(2, 5, 10, 0.75));
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: opacity 0.4s ease;
}
.ph-spec-panel.is-swapping { opacity: 0.35; }
.ph-spec-eyebrow {
    font: 600 10px/1 'JetBrains Mono', monospace;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #d18c2c;
    padding-bottom: 14px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(170, 195, 230, 0.10);
    display: flex;
    justify-content: space-between;
}
.ph-spec-eyebrow .cnt { color: rgba(180, 200, 230, 0.55); }
.ph-spec-name {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin-bottom: 6px;
    color: #fff;
}
.ph-spec-cat {
    font: 500 10.5px/1.3 'JetBrains Mono', monospace;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(180, 200, 230, 0.68);
    margin-bottom: 22px;
}
.ph-spec-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px dashed rgba(170, 195, 230, 0.10);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}
.ph-spec-row:last-child { border-bottom: 0; }
.ph-spec-row .k {
    color: rgba(180, 200, 230, 0.55);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 500;
}
.ph-spec-row .v {
    color: rgba(232, 240, 252, 0.96);
    font-weight: 600;
    text-align: right;
}
.ph-spec-row .v em {
    font-style: normal;
    color: #5b8cff;
}

/* Bottom index strip — small dots that show which product is up */
.ph-index {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    display: flex;
    justify-content: center;
    gap: 14px;
    z-index: 5;
    pointer-events: none;
}
.ph-index-dot {
    width: 22px;
    height: 2px;
    background: rgba(170, 195, 230, 0.25);
    transition: background 0.3s ease;
}
.ph-index-dot.is-active {
    background: #d18c2c;
    box-shadow: 0 0 8px rgba(209, 140, 44, 0.6);
}

/* ------- Mobile ------- */
@media (max-width: 900px) {
    .ph-hero { margin: 24px 0 36px; padding: 20px 0; }
    .ph-stage {
        grid-template-columns: 1fr;
        grid-template-rows: 380px auto;
        min-height: auto;
        padding: 42px 0 30px;
    }
    .ph-helix-wrap {
        width: 200px;
        height: 260px;
        transform: rotateX(-10deg) scale(0.75);
    }
    .ph-card { width: 200px; height: 260px; }
    .ph-card img { max-height: 130px; }
    .ph-spec-panel { padding: 22px 20px; margin: 0 20px; border-left: 0; border-top: 1px solid rgba(170, 195, 230, 0.10); }
    .ph-hud { top: 14px; left: 20px; letter-spacing: 0.24em; font-size: 9.5px; }
    .ph-hud-right { display: none; }
    @keyframes ph-helix-spin {
        from { transform: rotateX(-10deg) scale(0.75) rotateY(0deg); }
        to   { transform: rotateX(-10deg) scale(0.75) rotateY(-360deg); }
    }
}
@media (prefers-reduced-motion: reduce) {
    .ph-helix-wrap { animation: none; }
}
