/* ============================================================
   Helix — Home Page Styles (Modern Graphics Edition)
   3D canvas hero, glass morphism cards, ambient glow effects.
   ============================================================ */

/* ── Login Modal ───────────────────────────────────────────────────────────── */

.login-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
}
.login-overlay.show { display: flex; }

.login-modal {
    background: rgba(18, 18, 26, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    width: 340px;
    max-width: calc(100vw - 32px);
    text-align: center;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
.login-modal h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 4px; }
.login-sub { color: var(--color-text-muted); font-size: 0.82rem; margin-bottom: 24px; }
.login-modal input {
    width: 100%;
    padding: 12px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 0.9rem;
    margin-bottom: 10px;
    outline: none;
    transition: border-color 0.2s;
    font-family: var(--font-sans);
}
.login-modal input:focus { border-color: var(--color-accent); }
.login-submit { width: 100%; justify-content: center; margin-top: 4px; }
.login-error { color: #f87171; font-size: 0.82rem; margin-top: 10px; min-height: 1.2em; }

/* ── Hero ───────────────────────────────────────────────────────────────────── */

.hero {
    position: relative;
    min-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 120px 0 100px;
}

/* Animated gradient mesh behind canvas */
.hero::before {
    content: '';
    position: absolute;
    top: -60%;
    left: -40%;
    width: 180%;
    height: 220%;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(124, 106, 239, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(167, 139, 250, 0.06) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(99, 102, 241, 0.04) 0%, transparent 45%);
    z-index: 0;
    animation: meshDrift 25s ease-in-out infinite;
    pointer-events: none;
}

@keyframes meshDrift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33%      { transform: translate(2%, -1.5%) rotate(0.5deg); }
    66%      { transform: translate(-1.5%, 2%) rotate(-0.5deg); }
}

/* Bottom fade to page background */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, transparent, var(--color-bg));
    z-index: 2;
    pointer-events: none;
}

/* Canvas */
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto;
}

.hero > .container {
    position: relative;
    z-index: 3;
    text-align: center;
}

/* Title */
.hero-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -2.5px;
    line-height: 1.05;
    margin-bottom: 20px;
}

.hero-title span {
    background: linear-gradient(135deg, #7c6aef 0%, #a78bfa 35%, #818cf8 65%, #c084fc 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease-in-out infinite;
    filter: drop-shadow(0 0 40px rgba(124, 106, 239, 0.25));
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    max-width: 520px;
    margin: 0 auto 40px;
    line-height: 1.7;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

/* CTA Buttons */
.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.btn-glow {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    border-radius: var(--radius-lg);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    color: #fff;
    background: linear-gradient(135deg, var(--color-accent), #818cf8);
    transition: all 350ms cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1;
}

.btn-glow::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(135deg, var(--color-accent), #a78bfa, #818cf8);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    filter: blur(14px);
    transition: opacity 350ms ease;
}

.btn-glow:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(124, 106, 239, 0.3);
    color: #fff;
}

.btn-glow:hover::before {
    opacity: 1;
}

.btn-glass {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    border-radius: var(--radius-lg);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 350ms cubic-bezier(0.23, 1, 0.32, 1);
}

.btn-glass:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.btn-glow svg,
.btn-glass svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Services ──────────────────────────────────────────────────────────────── */

.services {
    position: relative;
    padding: 60px 0 80px;
}

.services-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-text-dim);
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.services-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--color-border), transparent 80%);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 18px;
}

.tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ── Glass Cards ───────────────────────────────────────────────────────────── */

.service-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 28px;
    background: rgba(18, 18, 26, 0.5);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
}

/* Colored glow overlay on hover */
.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 450ms ease;
    border-radius: inherit;
    pointer-events: none;
}

/* Animated gradient border shimmer */
.service-card::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        transparent 20%,
        rgba(124, 106, 239, 0.15) 40%,
        rgba(167, 139, 250, 0.1) 60%,
        transparent 80%
    );
    background-size: 300% 300%;
    z-index: -1;
    opacity: 0;
    transition: opacity 450ms ease;
    animation: borderShimmer 4s ease-in-out infinite;
}

@keyframes borderShimmer {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.service-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-6px) scale(1.01);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 1px rgba(255, 255, 255, 0.1);
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover::after {
    opacity: 1;
}

/* Per-color glow backgrounds */
.service-card:has(.icon-box.purple)::before {
    background: radial-gradient(ellipse at 15% 30%, rgba(167, 139, 250, 0.07) 0%, transparent 55%);
}
.service-card:has(.icon-box.pink)::before {
    background: radial-gradient(ellipse at 15% 30%, rgba(244, 114, 182, 0.07) 0%, transparent 55%);
}
.service-card:has(.icon-box.blue)::before {
    background: radial-gradient(ellipse at 15% 30%, rgba(96, 165, 250, 0.07) 0%, transparent 55%);
}
.service-card:has(.icon-box.cyan)::before {
    background: radial-gradient(ellipse at 15% 30%, rgba(34, 211, 238, 0.07) 0%, transparent 55%);
}
.service-card:has(.icon-box.green)::before {
    background: radial-gradient(ellipse at 15% 30%, rgba(52, 211, 153, 0.07) 0%, transparent 55%);
}
.service-card:has(.icon-box.orange)::before {
    background: radial-gradient(ellipse at 15% 30%, rgba(249, 115, 22, 0.07) 0%, transparent 55%);
}

/* ── Icon Boxes (with glow) ────────────────────────────────────────────────── */

.service-card .icon-box {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: box-shadow 400ms ease, transform 400ms ease;
}

.service-card:hover .icon-box {
    transform: scale(1.08);
}

.service-card .icon-box svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.service-card .icon-box.purple {
    background: rgba(167, 139, 250, 0.12);
    box-shadow: 0 0 24px rgba(167, 139, 250, 0.12);
}
.service-card .icon-box.purple svg { stroke: #a78bfa; }

.service-card .icon-box.pink {
    background: rgba(244, 114, 182, 0.12);
    box-shadow: 0 0 24px rgba(244, 114, 182, 0.12);
}
.service-card .icon-box.pink svg { stroke: #f472b6; }

.service-card .icon-box.blue {
    background: rgba(96, 165, 250, 0.12);
    box-shadow: 0 0 24px rgba(96, 165, 250, 0.12);
}
.service-card .icon-box.blue svg { stroke: #60a5fa; }

.service-card .icon-box.cyan {
    background: rgba(34, 211, 238, 0.12);
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.12);
}
.service-card .icon-box.cyan svg { stroke: #22d3ee; }

.service-card .icon-box.green {
    background: rgba(52, 211, 153, 0.12);
    box-shadow: 0 0 24px rgba(52, 211, 153, 0.12);
}
.service-card .icon-box.green svg { stroke: #34d399; }

.service-card .icon-box.orange {
    background: rgba(249, 115, 22, 0.12);
    box-shadow: 0 0 24px rgba(249, 115, 22, 0.12);
}
.service-card .icon-box.orange svg { stroke: #f97316; }

/* Intensify glow on card hover */
.service-card:hover .icon-box.purple { box-shadow: 0 0 36px rgba(167, 139, 250, 0.25); }
.service-card:hover .icon-box.pink   { box-shadow: 0 0 36px rgba(244, 114, 182, 0.25); }
.service-card:hover .icon-box.blue   { box-shadow: 0 0 36px rgba(96, 165, 250, 0.25); }
.service-card:hover .icon-box.cyan   { box-shadow: 0 0 36px rgba(34, 211, 238, 0.25); }
.service-card:hover .icon-box.green  { box-shadow: 0 0 36px rgba(52, 211, 153, 0.25); }
.service-card:hover .icon-box.orange { box-shadow: 0 0 36px rgba(249, 115, 22, 0.25); }

/* ── Service Info ──────────────────────────────────────────────────────────── */

.service-info {
    flex: 1;
    min-width: 0;
}

.service-info h3 {
    font-size: 1.08rem;
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Live status dot next to service name */
.status-dot-live {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--color-text-dim);
    opacity: 0;
    transition: opacity 400ms ease, background 400ms ease, box-shadow 400ms ease;
}
.status-dot-live.online {
    opacity: 1;
    background: #34d399;
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
}
.status-dot-live.offline {
    opacity: 1;
    background: #f87171;
    box-shadow: 0 0 6px rgba(248, 113, 113, 0.5);
    animation: pulse-red 2s ease-in-out infinite;
}
.status-dot-live.unknown {
    opacity: 0.5;
    background: var(--color-text-dim);
}
@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.service-info p {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    line-height: 1.55;
    margin-bottom: 14px;
}

.service-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--color-accent);
    transition: gap 300ms ease;
}

.service-link svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    transition: transform 300ms ease;
}

.service-card:hover .service-link {
    gap: 8px;
}

.service-card:hover .service-link svg {
    transform: translateX(3px);
}

/* ── Section divider glow ──────────────────────────────────────────────────── */

.section-divider {
    height: 1px;
    border: none;
    background: linear-gradient(
        to right,
        transparent 5%,
        rgba(124, 106, 239, 0.15) 30%,
        rgba(167, 139, 250, 0.25) 50%,
        rgba(124, 106, 239, 0.15) 70%,
        transparent 95%
    );
    margin: 0;
}

/* ── Noise texture overlay ─────────────────────────────────────────────────── */

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.018;
    mix-blend-mode: overlay;
    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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    /* ── Full-viewport app launcher layout ── */
    body {
        height: 100dvh;
        overflow: hidden;
    }

    main {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Hide hero entirely on mobile */
    .hero {
        display: none;
    }

    /* Hide dividers */
    .section-divider {
        display: none;
    }

    /* Hide footer */
    .footer {
        display: none;
    }

    /* ── Services as icon grid ── */
    .services {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 12px 0;
    }

    .services-title {
        margin-bottom: 14px;
        font-size: 0.68rem;
        padding: 0 4px;
    }

    .services-grid,
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Transform cards into compact icon+label tiles */
    .service-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 14px 8px;
        gap: 8px;
    }

    /* Hide description and link text on mobile tiles */
    .service-info p,
    .service-link {
        display: none;
    }

    .service-info {
        min-width: 0;
        width: 100%;
    }

    .service-info h3 {
        font-size: 0.76rem;
        justify-content: center;
        line-height: 1.2;
    }

    .service-card .icon-box {
        width: 56px;
        height: 56px;
    }

    .service-card .icon-box svg {
        width: 28px;
        height: 28px;
    }

    /* Status badge at bottom of screen */
    .nav .status-badge {
        display: none;
    }
}

/* Touch devices — disable hover transforms */
@media (pointer: coarse) {
    .service-card:hover {
        transform: none;
    }

    .service-card:active {
        transform: scale(0.98);
        transition-duration: 100ms;
    }

    .btn-glow:hover,
    .btn-glass:hover {
        transform: none;
    }

    .btn-glow:active,
    .btn-glass:active {
        transform: scale(0.97);
        transition-duration: 80ms;
    }
}
