/* ================================================================
   EVERVAULT-STYLE HERO: Card Stream Animation
   Matrix-branded credit cards pass through a glowing line
   and transform into encrypted digits.
   Entire hero wrapped in a rounded container with side padding
   and bottom gradient glow (Evervault container style).
   ================================================================ */

/* --- Outer Wrapper: provides side padding so container is inset --- */
.ev-hero-wrapper {
    padding: 0 20px;
    position: relative;
}

/* --- Hero Container (the big rounded panel, fills viewport) --- */
.ev-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px 60px;
    gap: 0;
    overflow: hidden;
    text-align: center;
    border-radius: 0 0 24px 24px;
    border: none;
    background: #08090a;
    box-shadow: none;
}

/* U-shaped gradient: deeper valley */
.ev-hero-gradient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    border-radius: 0 0 24px 24px;
    background:
        /* Valley: steep concave dip in center, sides stay high */
        radial-gradient(ellipse 45% 45% at 50% 50%,
            rgba(8, 9, 10, 0.98) 0%,
            rgba(8, 9, 10, 0.85) 35%,
            rgba(8, 9, 10, 0.4) 65%,
            transparent 100%),
        /* Bright bottom glow bloom */
        radial-gradient(ellipse 80% 25% at 50% 100%,
            rgba(34, 220, 160, 0.7) 0%,
            rgba(34, 178, 133, 0.4) 40%,
            transparent 70%),
        /* Base gradient: green starts at 35% so sides reach high */
        linear-gradient(180deg,
            transparent 0%,
            transparent 30%,
            rgba(34, 178, 133, 0.10) 38%,
            rgba(34, 178, 133, 0.30) 48%,
            rgba(34, 178, 133, 0.55) 58%,
            rgba(34, 178, 133, 0.80) 68%,
            rgba(34, 178, 133, 0.95) 78%,
            rgb(34, 200, 150) 90%,
            rgb(38, 215, 160) 100%);
}

.ev-hero-content {
    max-width: 720px;
    position: relative;
    z-index: 10;
}

.ev-hero-label {
    font-size: 13px;
    font-weight: var(--ln-weight-medium);
    color: var(--ln-text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 24px;
    opacity: 0;
    animation: ln-fade-up 0.8s var(--ln-ease-spring) 0.3s both;
}

.ev-hero-title {
    font-size: 92px;
    font-weight: var(--ln-weight-book);
    line-height: 1;
    letter-spacing: var(--ln-tracking-tight);
    background: linear-gradient(103.97deg, #FFFFFF 2.99%, rgba(255, 255, 255, 0.38) 91.33%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: ln-hero-enter var(--ln-duration-hero) var(--ln-ease-spring) both;
}

.ev-hero-subtitle {
    font-size: 20px;
    font-weight: var(--ln-weight-book);
    color: var(--ln-text-secondary);
    margin: 24px auto 0;
    line-height: 1.5;
    max-width: 600px;
    opacity: 0;
    animation: ln-fade-up 0.8s var(--ln-ease-spring) 0.3s both;
}

/* --- Hero Buttons (Evervault-style) --- */
.ev-hero-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    opacity: 0;
    animation: ln-fade-up 0.8s var(--ln-ease-spring) 0.5s both;
}
.ev-hero-btn {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 24px;
    border-radius: 9999px;
    font-size: 15px;
    font-weight: var(--ln-weight-medium);
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}
.ev-hero-btn:hover { opacity: 0.85; }
.ev-hero-btn:active { transform: scale(0.97); }
.ev-hero-btn--primary {
    background: #fff;
    color: #08090a;
}
.ev-hero-btn--secondary {
    background: transparent;
    color: var(--ln-text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.ev-hero-btn--secondary:hover {
    border-color: rgba(255, 255, 255, 0.4);
    opacity: 1;
}

/* --- Card Stream Container (now inside the hero panel) --- */
.ev-stream {
    position: relative;
    width: calc(100% + 80px);
    margin-left: -40px;
    margin-right: -40px;
    height: 340px;
    flex-shrink: 0;
    margin-bottom: 0;
    overflow: hidden;
    z-index: 1;
    mask-image: linear-gradient(180deg, transparent 0%, black 15%, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 15%, black 70%, transparent 100%);
}

.ev-particles {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* --- The Horizon Line (div, positioned by JS) --- */
.ev-horizon {
    position: absolute;
    z-index: 30;
    pointer-events: none;
    height: 0;
}

.ev-horizon-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 15%, #fff 40%, #fff 60%, rgba(255,255,255,0.6) 85%, transparent 100%);
    box-shadow: 0 0 8px rgba(34, 178, 133, 0.7),
                0 0 24px rgba(34, 178, 133, 0.3);
}

.ev-horizon-glow {
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 20px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, transparent 0%, rgba(34, 178, 133, 0.25) 20%, rgba(34, 178, 133, 0.35) 50%, rgba(34, 178, 133, 0.25) 80%, transparent 100%);
    filter: blur(10px);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.ev-horizon[data-active="true"] .ev-horizon-glow {
    opacity: 1;
}

/* --- Clip wrappers --- */
.ev-side {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

/* Sharp diagonal: line goes from ~60% top to ~40% bottom */
.ev-side-normal {
    clip-path: polygon(60% 0, 100% 0, 100% 100%, 40% 100%);
    z-index: 11;
}

.ev-side-encrypted {
    clip-path: polygon(0 0, 60% 0, 40% 100%, 0 100%);
    z-index: 12;
}

/* On encrypted side: hide the normal card visuals, only show currency chars */
.ev-side-encrypted .ev-card {
    background: transparent;
    box-shadow: none;
}
.ev-side-encrypted .ev-card::before { display: none; }
.ev-side-encrypted .ev-card-content,
.ev-side-encrypted .ev-card-orb,
.ev-side-encrypted .ev-card-circuits,
.ev-side-encrypted .ev-card-bracket { display: none; }

/* --- Card Row --- */
.ev-card-row {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 200px;
    will-change: transform;
    padding: 0 24px;
}

/* === MATRIX CREDIT CARD === */
.ev-card {
    width: 400px;
    height: 250px;
    border-radius: 20px;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    border: none;
    will-change: transform;
    transform: translate3d(0,0,0);
}

/* --- CARD VARIANT: Dark (default) --- */
.ev-card--dark {
    background: #1e1e28;
    background-image: linear-gradient(160deg, #2a2a36 0%, #222230 35%, #1a1a26 70%, #1e1e2a 100%);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 12px 28px rgba(0, 0, 0, 0.45),
        0 40px 80px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    isolation: isolate;
}

/* --- CARD VARIANT: White --- */
.ev-card--white {
    background: #ebebef;
    background-image: linear-gradient(160deg, #f7f7f9 0%, #ebebef 35%, #e0e0e6 70%, #e5e5ea 100%);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.15),
        0 12px 28px rgba(0, 0, 0, 0.2),
        0 40px 80px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    isolation: isolate;
}

/* --- CARD VARIANT: Navy --- */
.ev-card--navy {
    background: #1a2848;
    background-image: linear-gradient(160deg, #243456 0%, #1e2c4e 35%, #162444 70%, #1a2a48 100%);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 12px 28px rgba(0, 0, 0, 0.45),
        0 40px 80px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    isolation: isolate;
}

/* Card textures: unique per variant */
.ev-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
}

/* Dark: carbon fiber crosshatch */
.ev-card--dark::before {
    background:
        repeating-linear-gradient(
            45deg,
            transparent 0px, transparent 2px,
            rgba(255,255,255,0.03) 2px, rgba(255,255,255,0.03) 4px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent 0px, transparent 2px,
            rgba(255,255,255,0.02) 2px, rgba(255,255,255,0.02) 4px
        );
    opacity: 0.8;
}

/* White: fine linen weave */
.ev-card--white::before {
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px, transparent 3px,
            rgba(0,0,0,0.018) 3px, rgba(0,0,0,0.018) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px, transparent 3px,
            rgba(0,0,0,0.012) 3px, rgba(0,0,0,0.012) 4px
        );
    opacity: 0.9;
}

/* Navy: brushed metal horizontal streaks */
.ev-card--navy::before {
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px, transparent 1px,
            rgba(255,255,255,0.025) 1px, rgba(255,255,255,0.025) 2px
        ),
        repeating-linear-gradient(
            180deg,
            rgba(255,255,255,0.01) 0px,
            transparent 3px,
            rgba(255,255,255,0.015) 5px,
            transparent 8px
        );
    opacity: 0.7;
}

/* Mesh gradient orbs: hidden */
.ev-card-orb { display: none; }

/* Corner brackets: neutral */
.ev-card-bracket {
    position: absolute;
    width: 14px;
    height: 14px;
    z-index: 5;
}
.ev-card-bracket--tl { top: 12px; left: 12px; border-top: 1.5px solid rgba(255, 255, 255, 0.12); border-left: 1.5px solid rgba(255, 255, 255, 0.12); }
.ev-card-bracket--tr { top: 12px; right: 12px; border-top: 1.5px solid rgba(255, 255, 255, 0.12); border-right: 1.5px solid rgba(255, 255, 255, 0.12); }
.ev-card-bracket--bl { bottom: 12px; left: 12px; border-bottom: 1.5px solid rgba(255, 255, 255, 0.12); border-left: 1.5px solid rgba(255, 255, 255, 0.12); }
.ev-card-bracket--br { bottom: 12px; right: 12px; border-bottom: 1.5px solid rgba(255, 255, 255, 0.12); border-right: 1.5px solid rgba(255, 255, 255, 0.12); }
/* White card brackets: dark */
.ev-card--white .ev-card-bracket--tl { border-top-color: rgba(0, 0, 0, 0.1); border-left-color: rgba(0, 0, 0, 0.1); }
.ev-card--white .ev-card-bracket--tr { border-top-color: rgba(0, 0, 0, 0.1); border-right-color: rgba(0, 0, 0, 0.1); }
.ev-card--white .ev-card-bracket--bl { border-bottom-color: rgba(0, 0, 0, 0.1); border-left-color: rgba(0, 0, 0, 0.1); }
.ev-card--white .ev-card-bracket--br { border-bottom-color: rgba(0, 0, 0, 0.1); border-right-color: rgba(0, 0, 0, 0.1); }

/* Card content layer */
.ev-card-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px 28px;
}

/* Top: chip + contactless */
.ev-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ev-card-chip {
    width: 38px;
    height: 28px;
    border-radius: 5px;
    background: linear-gradient(145deg, #3a3a42, #28282e, #3a3a42);
    position: relative;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.1), 0 1px 3px rgba(0,0,0,0.3);
}
.ev-card-chip-inner {
    position: absolute;
    inset: 3px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(145deg, #2e2e36, #222228);
}
/* White card chip */
.ev-card--white .ev-card-chip {
    background: linear-gradient(145deg, #c8c8ce, #b0b0b8, #c8c8ce);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.4), 0 1px 3px rgba(0,0,0,0.15);
}
.ev-card--white .ev-card-chip-inner {
    border-color: rgba(0,0,0,0.06);
    background: linear-gradient(145deg, #bbbbc2, #a8a8b0);
}

.ev-card-nfc {
    color: rgba(255, 255, 255, 0.35);
}
.ev-card--white .ev-card-nfc {
    color: rgba(0, 0, 0, 0.25);
}

/* Center: brand */
.ev-card-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ev-card-logo {
    width: 110px;
    height: 110px;
    object-fit: contain;
    margin-bottom: 8px;
}

.ev-card-brand {
    font-family: var(--ln-font-family);
    font-size: 11px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.ev-card--white .ev-card-brand {
    color: rgba(0, 0, 0, 0.7);
}

.ev-card-tagline-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
}
.ev-card-tagline-line {
    flex: 1;
    height: 1px;
}
.ev-card-tagline-line--left {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15));
}
.ev-card-tagline-line--right {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.15), transparent);
}
.ev-card--white .ev-card-tagline-line--left {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1));
}
.ev-card--white .ev-card-tagline-line--right {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.1), transparent);
}
.ev-card-tagline {
    font-family: var(--ln-font-mono);
    font-size: 7px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
    letter-spacing: 0.1em;
    white-space: nowrap;
}
.ev-card--white .ev-card-tagline {
    color: rgba(0, 0, 0, 0.35);
}

/* Bottom: card number + network */
.ev-card-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.ev-card-numbers {
    display: flex;
    align-items: center;
    font-family: var(--ln-font-mono);
    color: rgba(255, 255, 255, 0.35);
    gap: 8px;
    font-size: 13px;
    letter-spacing: 2px;
}
.ev-card--white .ev-card-numbers {
    color: rgba(0, 0, 0, 0.3);
}

.ev-card-num-group {
    padding: 2px 6px;
    border-radius: 3px;
}

.ev-card-network-icon {
    opacity: 0.2;
}
.ev-card--white .ev-card-network-icon circle {
    stroke: rgba(0, 0, 0, 0.25);
}

/* Circuit traces SVG: neutral */
.ev-card-circuits {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
}
.ev-card-circuits path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 1.5;
    opacity: 0.1;
    stroke-dasharray: 12 20;
    animation: ev-circuit-flow 6s linear infinite;
}
.ev-card--white .ev-card-circuits path {
    stroke: rgba(0, 0, 0, 0.08);
}

@keyframes ev-circuit-flow {
    to { stroke-dashoffset: -100; }
}

/* === DISPERSING CHARACTERS === */
.ev-card--dispersing {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible;
}
.ev-card--dispersing::before { display: none; }

.ev-disperse-container {
    position: absolute;
    inset: 0;
    overflow: visible;
    z-index: 15;
}

.ev-disperse-char {
    position: absolute;
    font-family: var(--ln-font-mono);
    font-size: 24px;
    font-weight: 600;
    color: rgba(34, 178, 133, 0.55);
    text-shadow: 0 0 12px rgba(34, 178, 133, 0.4);
    pointer-events: none;
    will-change: transform, opacity;
}

.ev-disperse-bright {
    color: rgba(34, 178, 133, 1);
    text-shadow: 0 0 18px rgba(34, 178, 133, 0.8), 0 0 40px rgba(34, 178, 133, 0.4);
}

/* --- Edge fade on card stream (transparent to let gradient through) --- */
.ev-stream::before,
.ev-stream::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 120px;
    z-index: 20;
    pointer-events: none;
}
.ev-stream::before {
    left: 0;
    background: linear-gradient(to right, rgba(8, 9, 10, 0.3) 0%, transparent 100%);
}
.ev-stream::after {
    right: 0;
    background: linear-gradient(to left, rgba(8, 9, 10, 0.3) 0%, transparent 100%);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .ev-hero-title { font-size: 72px; }
    .ev-hero { padding: 80px 32px 48px; }
    .ev-stream {
        height: 320px;
        width: calc(100% + 64px);
        margin-left: -32px;
        margin-right: -32px;
    }
    .ev-card { width: 360px; height: 225px; }
}

@media (max-width: 768px) {
    .ev-hero-wrapper { padding: 0 12px; }
    .ev-hero {
        min-height: calc(100svh - 60px);
        padding: 80px 20px 40px;
        border-radius: 20px;
    }
    .ev-hero-title { font-size: 48px; }
    .ev-hero-subtitle { font-size: 16px; }
    .ev-hero-buttons { flex-direction: column; gap: 12px; }
    .ev-hero-btn { width: 100%; justify-content: center; }
    .ev-stream {
        height: 260px;
        width: calc(100% + 40px);
        margin-left: -20px;
        margin-right: -20px;
        margin-bottom: 32px;
    }
    .ev-card { width: 300px; height: 188px; }
    .ev-card-content { padding: 18px 20px; }
    .ev-card-logo { width: 56px; height: 56px; }
    .ev-card-brand { font-size: 9px; }
    .ev-card-numbers { font-size: 11px; gap: 6px; }
    .ev-hero-gradient { height: 45%; }
}

@media (max-width: 480px) {
    .ev-hero-wrapper { padding: 0 8px; }
    .ev-hero {
        padding: 72px 16px 0;
        border-radius: 16px;
    }
    .ev-hero-title { font-size: 40px; }
    .ev-stream {
        height: 220px;
        width: calc(100% + 32px);
        margin-left: -16px;
        margin-right: -16px;
    }
    .ev-card { width: 260px; height: 163px; }
    .ev-card-content { padding: 14px 16px; }
    .ev-hero-gradient { height: 40%; }
}

@media (prefers-reduced-motion: reduce) {
    .ev-hero-label,
    .ev-hero-subtitle { opacity: 1; animation: none; }
    .ev-hero-title { animation: none; -webkit-text-fill-color: #fff; }
    .ev-card-orb { animation: none !important; }
    .ev-card-circuits path { animation: none !important; }
}
