/* Nebry.AI Landing Page — v31 design system */

/* Reset and base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #050010;
    color: #ffffff;
    font-family: 'Inter', system-ui, sans-serif;
    overflow-x: hidden;
    position: relative;
}

.font-display {
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
}

/* Nebula background — randomized via JS */
#nebula-bg {
    /* gradient set dynamically on load */
}

/* Vignette overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(5, 0, 16, 0.7) 100%);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #0a0020;
}
::-webkit-scrollbar-thumb {
    background: #7b2ff7;
    border-radius: 3px;
}

/* Selection */
::selection {
    background: rgba(123, 47, 247, 0.4);
    color: #fff;
}

/* Scroll progress bar */
#scroll-progress {
    background: linear-gradient(90deg, #00d4ff, #7b2ff7, #ff6b35);
    transform-origin: left;
    transform: scaleX(0);
    box-shadow: 0 0 12px rgba(123, 47, 247, 0.6);
}

/* Glassmorphism */
.glass {
    background: rgba(10, 0, 32, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

.glass-light {
    background: rgba(10, 0, 32, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

/* Navigation glass */
.nav-glass {
    background: rgba(5, 0, 16, 0.55);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-glass.scrolled {
    background: rgba(5, 0, 16, 0.85);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.nav-logo {
    transition: opacity 0.2s ease;
}
.nav-logo:hover {
    opacity: 0.85;
}

.nav-link {
    position: relative;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 1px;
    background: linear-gradient(90deg, #00d4ff, #7b2ff7);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}
.nav-link:hover,
.nav-link.active {
    color: #fff;
}
.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

/* Glow effects */
.glow-blue {
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.15), 0 0 60px rgba(0, 212, 255, 0.05);
}

.glow-violet {
    box-shadow: 0 0 30px rgba(123, 47, 247, 0.15), 0 0 60px rgba(123, 47, 247, 0.05);
}

.glow-amber {
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.15), 0 0 60px rgba(255, 107, 53, 0.05);
}

/* CTA Buttons — instant glow, small lift */
.cta-primary {
    display: inline-block;
    background: linear-gradient(135deg, #7b2ff7 0%, #00d4ff 100%);
    color: white;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.15s ease, box-shadow 0s;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 0 0 rgba(123, 47, 247, 0);
}

.cta-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.cta-primary:hover::before {
    left: 100%;
}

.cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(123, 47, 247, 0.45);
    color: white;
}

.cta-sm {
    padding: 10px 22px;
    font-size: 0.875rem;
}

.cta-secondary {
    display: inline-block;
    background: rgba(255, 255, 255, 0.04);
    color: white;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
    text-decoration: none;
}

.cta-secondary:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transform: translateY(-2px);
}

/* Section typography */
.section-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.section-title {
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.25rem;
}

.section-sub {
    color: rgba(156, 163, 175, 0.9);
    max-width: 42rem;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Shared card icon */
.card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Card link */
.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #00d4ff;
    transition: color 0.15s ease, gap 0.15s ease;
    text-decoration: none;
}
.card-link:hover {
    color: #a78bfa;
    gap: 10px;
}
.card-link i {
    transition: transform 0.15s ease;
}
.card-link:hover i {
    transform: translateX(2px);
}

/* Card icon gradients */
.card-gradient-violet { background: linear-gradient(135deg, #7b2ff7, #4c1d95); box-shadow: 0 8px 24px rgba(123, 47, 247, 0.25); }
.card-gradient-blue   { background: linear-gradient(135deg, #00d4ff, #1e3a8a); box-shadow: 0 8px 24px rgba(0, 212, 255, 0.2); }
.card-gradient-amber  { background: linear-gradient(135deg, #ff6b35, #7c2d12); box-shadow: 0 8px 24px rgba(255, 107, 53, 0.2); }
.card-gradient-green  { background: linear-gradient(135deg, #34d399, #065f46); box-shadow: 0 8px 24px rgba(52, 211, 153, 0.2); }
.card-gradient-pink   { background: linear-gradient(135deg, #ec4899, #831843); box-shadow: 0 8px 24px rgba(236, 72, 153, 0.2); }
.card-gradient-teal   { background: linear-gradient(135deg, #2dd4bf, #0f766e); box-shadow: 0 8px 24px rgba(45, 212, 191, 0.2); }
.card-gradient-cyan   { background: linear-gradient(135deg, #22d3ee, #155e75); box-shadow: 0 8px 24px rgba(34, 211, 238, 0.2); }

/* Service card — frosted glass */
.service-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 36px 30px;
    cursor: default;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Cursor spotlight */
.service-card::after,
.pillar-card::after,
.problem-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(360px circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(123, 47, 247, 0.10), transparent 65%);
    opacity: var(--spot-opacity, 0);
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.service-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 21px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(123, 47, 247, 0.5), rgba(0, 212, 255, 0.25), rgba(255, 107, 53, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.service-card p {
    flex-grow: 1;
}

.service-card:hover {
    box-shadow:
        0 0 30px rgba(123, 47, 247, 0.14),
        0 0 60px rgba(123, 47, 247, 0.07),
        0 10px 40px rgba(0, 0, 0, 0.3);
}

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

/* Live badge */
.service-card-live {
    border-color: rgba(123, 47, 247, 0.25);
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 4px 10px;
    border-radius: 999px;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* Pillar card — frosted glass */
.pillar-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 32px;
    transition: background 0.15s ease, border-color 0s, box-shadow 0s;
}

.pillar-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow:
        0 0 30px rgba(0, 212, 255, 0.12),
        0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Problem card with tilt — frosted glass */
.problem-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 36px;
    transition: transform 0.1s ease, background 0.15s ease, border-color 0s, box-shadow 0s;
    transform-style: preserve-3d;
}

.problem-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 107, 53, 0.25);
    box-shadow:
        0 0 30px rgba(255, 107, 53, 0.1),
        0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Stat cards */
.stat-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 28px 16px;
    text-align: center;
    transition: border-color 0s, box-shadow 0s, background 0.15s ease;
}
.stat-card:hover {
    border-color: rgba(123, 47, 247, 0.3);
    box-shadow: 0 0 30px rgba(123, 47, 247, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.stat-value {
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #00d4ff 0%, #7b2ff7 50%, #ff6b35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    color: #9ca3af;
    font-size: 0.8rem;
}

/* Stack flow diagram */
.stack-flow {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
}

.stack-node {
    flex: 1;
    max-width: 240px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
    transition: border-color 0s, box-shadow 0s, background 0.15s ease, transform 0.15s ease;
}
.stack-node:hover {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-4px);
}

.stack-node-icon {
    width: 2.75rem;
    height: 2.75rem;
    margin: 0 auto 1rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.1);
    box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.25), 0 0 20px rgba(0, 212, 255, 0.15);
    color: #00d4ff;
}

.stack-node-title {
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.stack-node-text {
    color: #9ca3af;
    font-size: 0.8rem;
    line-height: 1.6;
}

.stack-connector {
    align-self: center;
    width: 44px;
    height: 1px;
    position: relative;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.stack-pulse {
    position: absolute;
    top: -1.5px;
    left: 0;
    width: 6px;
    height: 4px;
    border-radius: 999px;
    background: #00d4ff;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.9);
    animation: stackPulse 2.4s ease-in-out infinite;
}

.stack-connector:nth-of-type(2) .stack-pulse { animation-delay: 0.4s; }
.stack-connector:nth-of-type(4) .stack-pulse { animation-delay: 0.8s; }

@keyframes stackPulse {
    0%   { left: 0; opacity: 0; }
    15%  { opacity: 1; }
    85%  { opacity: 1; }
    100% { left: calc(100% - 6px); opacity: 0; }
}

/* Terminal mock */
.terminal {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(123, 47, 247, 0.08);
    text-align: left;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(5, 0, 16, 0.4);
}

.t-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.terminal-title {
    margin-left: 8px;
}

.terminal-body {
    min-height: 92px;
}

.t-line {
    white-space: nowrap;
    overflow: hidden;
}

.term-caret {
    display: inline-block;
    margin-left: 2px;
    animation: caretBlink 1s steps(1) infinite;
    color: #34d399;
}

.cursor-blink {
    display: inline-block;
    width: 7px;
    height: 14px;
    background: #34d399;
    vertical-align: text-bottom;
    margin-left: 4px;
    animation: caretBlink 1s steps(1) infinite;
}

@keyframes caretBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Text gradient — cyan → violet only (coherent "infrastructure" palette) */
.text-gradient {
    background: linear-gradient(135deg, #00d4ff 0%, #7b2ff7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Section reveal animation — JS staggers via transition-delay */
.reveal {
    opacity: 0;
    transform: translateY(28px);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.17, 0.55, 0.55, 1),
                transform 0.7s cubic-bezier(0.17, 0.55, 0.55, 1);
}

/* Hero reveals immediately with stagger (handled via .revealed + delays in JS) */
#hero .reveal {
    opacity: 0;
    transform: translateY(24px);
}
#hero .reveal.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.9s cubic-bezier(0.17, 0.55, 0.55, 1),
                transform 0.9s cubic-bezier(0.17, 0.55, 0.55, 1);
}

/* Floating animation */
@keyframes float {
    0%, 100% { transform: translate(-50%, 0px); }
    50% { transform: translate(-50%, -10px); }
}

.float {
    animation: float 6s ease-in-out infinite;
}

/* Pulse glow */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(123, 47, 247, 0.2); }
    50% { box-shadow: 0 0 45px rgba(123, 47, 247, 0.5); }
}

.pulse-glow {
    animation: pulseGlow 3s ease-in-out infinite;
}

/* Counter animation */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Nebula canvases */
#nebula-wrapper {
    min-height: 100vh;
}

#nebula-wrapper > div > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Nebula bg — slow drift (60s) */
#nebula-drift {
    animation: driftNebula 60s ease-in-out infinite;
}
@keyframes driftNebula {
    0%, 100% { transform: translate(0, 0); }
    25%  { transform: translate(15px, -10px); }
    50%  { transform: translate(-10px, 15px); }
    75%  { transform: translate(-20px, -5px); }
}

/* Star layers — drift at different speeds (parallax depth) */
#far-drift {
    animation: driftFar 45s ease-in-out infinite;
}
@keyframes driftFar {
    0%, 100% { transform: translate(0, 0); }
    25%  { transform: translate(22px, -14px); }
    50%  { transform: translate(-14px, 22px); }
    75%  { transform: translate(-28px, -8px); }
}

#mid-drift {
    animation: driftMid 30s ease-in-out infinite;
}
@keyframes driftMid {
    0%, 100% { transform: translate(0, 0); }
    25%  { transform: translate(38px, -24px); }
    50%  { transform: translate(-24px, 38px); }
    75%  { transform: translate(-48px, -12px); }
}

#near-drift {
    animation: driftNear 18s ease-in-out infinite;
}
@keyframes driftNear {
    0%, 100% { transform: translate(0, 0); }
    25%  { transform: translate(60px, -45px); }
    50%  { transform: translate(-45px, 60px); }
    75%  { transform: translate(-90px, -18px); }
}

/* Section padding helper */
.section-pad {
    position: relative;
}

/* High-tech blueprint grid overlay (sits inside the nebula wrapper, above stars) */
#tech-grid {
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.045) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 85% 70% at 50% 32%, #000 0%, transparent 78%);
    mask-image: radial-gradient(ellipse 85% 70% at 50% 32%, #000 0%, transparent 78%);
    opacity: 0.55;
}

/* Gradient section divider */
.section-divider {
    height: 1px;
    max-width: 60rem;
    margin: 0 auto;
    background: linear-gradient(90deg, transparent, rgba(123, 47, 247, 0.45) 20%, rgba(0, 212, 255, 0.45) 80%, transparent);
    position: relative;
    z-index: 10;
}

/* Capabilities ticker */
#ticker {
    padding: 14px 0;
}
.ticker-track {
    display: flex;
    width: max-content;
    animation: tickerScroll 42s linear infinite;
}
.ticker-seq {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding-right: 2.5rem;
}
.ticker-item {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
}
.ticker-sep {
    color: rgba(123, 47, 247, 0.55);
    font-size: 0.7rem;
}
@keyframes tickerScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ===== Service Explorer (rail + detail panel) ===== */
.service-explorer {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

/* Rail / selector */
.service-rail {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 92px;
}
.svc-rail-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    padding: 15px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    font-family: inherit;
}
.svc-rail-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateX(3px);
}
.svc-rail-btn.is-active {
    background: rgba(123, 47, 247, 0.10);
    border-color: rgba(123, 47, 247, 0.45);
}
.svc-rail-btn.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #00d4ff, #7b2ff7);
    box-shadow: 0 0 12px rgba(123, 47, 247, 0.8);
}
.svc-rail-index {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    width: 1.4rem;
    flex-shrink: 0;
}
.svc-rail-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.svc-rail-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.svc-rail-title {
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
}
.svc-rail-sub {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.svc-rail-arrow {
    width: 0.9rem;
    height: 0.9rem;
    color: rgba(255, 255, 255, 0.3);
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.18s ease, color 0.18s ease;
}
.svc-rail-btn:hover .svc-rail-arrow,
.svc-rail-btn.is-active .svc-rail-arrow {
    transform: translateX(3px);
    color: rgba(255, 255, 255, 0.75);
}
.svc-rail-live .svc-rail-title { display: inline-flex; align-items: center; }

/* Detail panel */
.service-panel-wrap { min-width: 0; }
.service-panel {
    padding: 40px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.service-detail {
    position: relative;
    animation: svcIn 0.45s cubic-bezier(0.17, 0.55, 0.55, 1);
}
/* Per-service accent so switching feels alive */
.service-detail[data-service="ai-employee"] { --accent:#7b2ff7; --accent-rgb:123,47,247; }
.service-detail[data-service="extraction"]  { --accent:#00d4ff; --accent-rgb:0,212,255; }
.service-detail[data-service="ocr"]         { --accent:#ff6b35; --accent-rgb:255,107,53; }
.service-detail[data-service="chat"]        { --accent:#34d399; --accent-rgb:52,211,153; }
.service-detail[data-service="coder"]       { --accent:#ec4899; --accent-rgb:236,72,153; }
.service-detail[data-service="library"]     { --accent:#2dd4bf; --accent-rgb:45,212,191; }
.service-detail[data-service="hermes"]      { --accent:#22d3ee; --accent-rgb:34,211,238; }
/* Accent glow wash from the top-left of the panel */
.service-detail::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 160px;
    border-radius: inherit;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(var(--accent-rgb), 0.16), transparent 62%),
        linear-gradient(90deg, rgba(var(--accent-rgb), 0.10), transparent 30%);
    pointer-events: none;
    opacity: 0.9;
}
@keyframes svcIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.svc-detail-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 26px;
}
.svc-index {
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--accent, rgba(255,255,255,0.35));
    opacity: 0.55;
    flex-shrink: 0;
    text-shadow: 0 0 22px rgba(var(--accent-rgb, 123,47,247), 0.25);
}
.svc-tagline { letter-spacing: 0.02em; }
.svc-lead {
    font-size: 1.05rem;
    line-height: 1.75;
    color: rgba(229, 231, 235, 0.95);
    margin-bottom: 32px;
}
.svc-subhead {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin: 0 0 12px;
}
.svc-body {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #9ca3af;
}
.svc-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.svc-features li {
    position: relative;
    padding-left: 22px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #d1d5db;
}
.svc-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--accent, #00d4ff);
    box-shadow: 0 0 8px rgba(var(--accent-rgb, 0,212,255), 0.5);
    transform: rotate(45deg);
}
.svc-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.svc-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #d1d5db;
}
.svc-steps li > span {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    background: rgba(var(--accent-rgb, 123,47,247), 0.14);
    border: 1px solid rgba(var(--accent-rgb, 123,47,247), 0.45);
    color: #fff;
}
.svc-underhood { margin-top: 0; border-color: rgba(var(--accent-rgb, 123,47,247), 0.28); }
.svc-underhood-label {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent, #00d4ff);
    display: block;
    margin-bottom: 8px;
}
.svc-underhood p {
    font-size: 0.82rem;
    line-height: 1.6;
    color: #9ca3af;
}
.svc-cta-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    align-items: flex-start;
}

/* Service explorer — collapses to a single column under lg */
@media (max-width: 1023px) {
    .service-explorer {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .service-rail {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }
    .svc-rail-btn {
        flex: 0 0 auto;
        min-width: 210px;
        scroll-snap-align: start;
    }
    .svc-rail-btn:hover { transform: none; }
    .svc-rail-sub,
    .svc-rail-arrow { display: none; }
    .service-panel { padding: 28px 22px; }
}

/* Reduced motion — respect user preference */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    #nebula-drift, #far-drift, #mid-drift, #near-drift,
    .float, .pulse-glow, .stack-pulse, .live-dot,
    .term-caret, .cursor-blink, .ticker-track, .service-detail {
        animation: none !important;
    }
    .reveal, #hero .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .service-card {
        padding: 26px 20px;
    }

    .cta-primary, .cta-secondary {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    .float {
        animation: floatMobile 6s ease-in-out infinite;
    }
    @keyframes floatMobile {
        0%, 100% { transform: translate(-50%, 0px); }
        50% { transform: translate(-50%, -10px); }
    }

    /* Stack flow wraps to two rows */
    .stack-flow {
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;
    }
    .stack-node {
        flex: 1 1 44%;
        max-width: none;
    }
    .stack-connector {
        display: none;
    }
}

/* Contact form */
.form-label {
    display: block;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    background: rgba(5, 0, 16, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    color: #fff;
    font-size: 0.9rem;
    font-family: 'Inter', system-ui, sans-serif;
    transition: border-color 0s, box-shadow 0s, background 0.15s ease;
    outline: none;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.form-input:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.form-input:focus {
    border-color: rgba(0, 212, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12), 0 0 20px rgba(0, 212, 255, 0.08);
    background: rgba(5, 0, 16, 0.7);
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-select option {
    background: #0a0020;
    color: #fff;
}

textarea.form-input {
    line-height: 1.5;
}
