/* SC-ience Labs — visual effects layer
 * Loaded after main.css. Cursor spotlight, 3D tilt, glass cards,
 * marquees, scroll indicator, refined micro-interactions.
 */

/* ---------- root tweaks ---------- */
:root {
    --shadow-glow: 0 0 60px rgba(0, 212, 255, 0.12);
    --shadow-glow-lg: 0 0 100px rgba(0, 212, 255, 0.18);
    --glass-bg: rgba(13, 17, 25, 0.65);
    --glass-border: rgba(0, 212, 255, 0.18);
}

/* smooth scroll + better default font rendering */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
body {
    font-feature-settings: "kern", "liga", "calt";
    text-wrap: pretty;
}

/* ---------- TOP-OF-PAGE SCROLL PROGRESS ---------- */
.scroll-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    z-index: 1000;
    pointer-events: none;
    background: transparent;
}
.scroll-progress::before {
    content: '';
    display: block;
    height: 100%;
    width: var(--scroll-progress, 0%);
    background: linear-gradient(90deg, var(--accent), #6be6ff, var(--accent));
    background-size: 200% 100%;
    box-shadow: 0 0 12px var(--accent);
    transition: width 0.05s ease-out;
    animation: progress-shimmer 3s linear infinite;
}
@keyframes progress-shimmer {
    0% { background-position: 0 0; }
    100% { background-position: 200% 0; }
}

/* ---------- CURSOR SPOTLIGHT ---------- */
.cursor-spotlight {
    position: fixed;
    top: 0; left: 0;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(circle, rgba(0,212,255,0.10) 0%, rgba(0,212,255,0.04) 30%, transparent 70%);
    transform: translate3d(var(--mx, -1000px), var(--my, -1000px), 0) translate(-50%, -50%);
    transition: opacity 0.3s ease;
    will-change: transform;
    mix-blend-mode: screen;
    opacity: 0;
}
body:hover .cursor-spotlight { opacity: 1; }
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
    .cursor-spotlight { display: none; }
}

/* ---------- LOGO IDLE ORBIT ANIMATION ---------- */
.brand-logo-img {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand:hover .brand-logo-img {
    transform: rotate(8deg) scale(1.06);
    filter: drop-shadow(0 0 12px rgba(0,212,255,0.5));
}

/* ---------- VAPORWAVE ATMOSPHERICS ---------- */

/* sweeping aurora gradient behind hero */
.hero {
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 1200px 600px at 20% 0%, rgba(157, 110, 233, 0.18), transparent 60%),
        radial-gradient(ellipse 1000px 600px at 80% 30%, rgba(255, 94, 168, 0.14), transparent 60%),
        radial-gradient(ellipse 1400px 500px at 50% 100%, rgba(0, 212, 255, 0.15), transparent 60%);
    pointer-events: none;
    z-index: 0;
    animation: aurora-pulse 18s ease-in-out infinite;
}
@keyframes aurora-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.05); }
}

/* perspective grid floor */
.hero::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -40%;
    height: 70%;
    background-image:
        linear-gradient(to right, rgba(0,212,255,0.22) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,94,168,0.18) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: perspective(500px) rotateX(60deg);
    transform-origin: 50% 0%;
    mask-image: linear-gradient(to bottom, transparent, black 30%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 30%, transparent);
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}
@media (prefers-reduced-motion: reduce) {
    .hero::before { animation: none; }
}

/* sun disc behind hero */
.hero-sun {
    position: absolute;
    left: 50%; bottom: 10%;
    transform: translateX(-50%);
    width: 480px;
    height: 240px;
    background: linear-gradient(180deg, #ff5ea8 0%, #ff9a3c 50%, #ffe066 100%);
    border-radius: 480px 480px 0 0;
    filter: blur(0px);
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.hero-sun::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 12px,
        rgba(8, 9, 26, 0.6) 12px,
        rgba(8, 9, 26, 0.6) 14px
    );
    mask-image: linear-gradient(to bottom, transparent 30%, black 80%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 30%, black 80%);
}

/* aurora h1 — soft text-shadow chromatic feel */
.hero h1 {
    text-shadow:
        0 0 32px rgba(0, 212, 255, 0.15),
        0 0 80px rgba(157, 110, 233, 0.08);
}

/* ---------- DISPLAY FONT HIERARCHY ---------- */
h1 { font-size: clamp(2.6rem, 6vw, 5rem) !important; line-height: 1.02 !important; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem) !important; line-height: 1.1 !important; letter-spacing: -0.025em !important; }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.35rem) !important; line-height: 1.25 !important; }

/* eyebrow lift */
.eyebrow {
    color: var(--accent-2) !important;
}
.eyebrow::before {
    background: linear-gradient(90deg, var(--accent-2), var(--accent)) !important;
}

/* card gradient border on hover */
.card {
    position: relative;
}
.card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: var(--gradient-aurora);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}
.card:hover::before { opacity: 0.6; }

/* accent dot */
.dot {
    background: var(--accent-2) !important;
    box-shadow: 0 0 8px var(--accent-2) !important;
}

/* tag pills */
.tag {
    background: linear-gradient(135deg, rgba(0,212,255,0.06), rgba(255,94,168,0.06)) !important;
    border-color: rgba(157,110,233,0.25) !important;
    color: #b6c4ff !important;
}

/* primary button — aurora */
.btn-primary {
    background: var(--gradient-aurora) !important;
    background-size: 200% 100% !important;
    color: #fff !important;
    animation: btn-aurora 6s ease-in-out infinite;
    box-shadow: 0 4px 24px rgba(157,110,233,0.4), 0 0 40px rgba(255,94,168,0.2) !important;
}
.btn-primary:hover {
    color: #fff !important;
    box-shadow: 0 10px 40px rgba(157,110,233,0.55), 0 0 60px rgba(255,94,168,0.3) !important;
}
@keyframes btn-aurora {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 0%; }
}

/* badges */
.work-card .badge {
    background: linear-gradient(135deg, rgba(255,94,168,0.12), rgba(157,110,233,0.12)) !important;
    border: 1px solid rgba(255,94,168,0.3) !important;
    color: var(--accent-2) !important;
}

/* nav twitter handle slightly accented */
.nav-twitter:hover {
    color: var(--accent-2) !important;
    background: rgba(255,94,168,0.06) !important;
}

/* scroll progress with full aurora */
.scroll-progress::before {
    background: var(--gradient-aurora) !important;
    background-size: 200% 100% !important;
}

/* cursor spotlight now has magenta blend */
.cursor-spotlight {
    background: radial-gradient(circle,
        rgba(0,212,255,0.10) 0%,
        rgba(157,110,233,0.06) 30%,
        transparent 70%) !important;
}

/* ---------- ANIMATED TOPO CONTOUR HERO BG ---------- */
.topo-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    opacity: 0.35;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 80%);
}
.topo-bg svg {
    width: 100%;
    height: 100%;
}
.topo-bg path {
    fill: none;
    stroke: var(--accent);
    stroke-width: 0.6;
    stroke-opacity: 0.5;
    stroke-dasharray: 2200;
    stroke-dashoffset: 2200;
    animation: topo-draw 6s ease-out forwards;
}
.topo-bg path:nth-child(2) { animation-delay: 0.3s; stroke-opacity: 0.35; }
.topo-bg path:nth-child(3) { animation-delay: 0.6s; stroke-opacity: 0.25; }
.topo-bg path:nth-child(4) { animation-delay: 0.9s; stroke-opacity: 0.4; }
.topo-bg path:nth-child(5) { animation-delay: 1.2s; stroke-opacity: 0.3; }
.topo-bg path:nth-child(6) { animation-delay: 1.5s; stroke-opacity: 0.45; }
.topo-bg path:nth-child(7) { animation-delay: 1.8s; stroke-opacity: 0.25; }
.topo-bg path:nth-child(8) { animation-delay: 2.1s; stroke-opacity: 0.35; }
@keyframes topo-draw {
    to { stroke-dashoffset: 0; }
}

/* ---------- FLAGSHIP SPOTLIGHT REFINEMENTS ---------- */
.flagship {
    position: relative;
    overflow: hidden;
}
.flagship-visual {
    position: relative;
}
.flagship-visual::before {
    content: '';
    position: absolute;
    inset: -10%;
    background: radial-gradient(circle, rgba(0,212,255,0.18), transparent 60%);
    filter: blur(40px);
    z-index: -1;
}

/* phone screen overlay text */
.flagship-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(0,212,255,0.1);
    border: 1px solid rgba(0,212,255,0.3);
    color: var(--accent);
    border-radius: 100px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.flagship-badge::before {
    content: '●';
    color: #4ade80;
    animation: pulse 2s ease-in-out infinite;
}

/* HERO REFINEMENTS */
.hero h1 {
    letter-spacing: -0.035em;
    text-wrap: balance;
}
.hero h1 .accent {
    background: linear-gradient(120deg, var(--accent) 0%, #6be6ff 50%, var(--accent) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: gradient-flow 6s ease-in-out infinite;
}
@keyframes gradient-flow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* refined orb motion */
.hero-orbs .orb {
    animation-duration: 22s !important;
    filter: blur(80px);
}

/* ---------- 3D TILT CARDS ---------- */
.card, .work-card, .mt-feature {
    transform-style: preserve-3d;
    will-change: transform;
}
.tilt {
    transition: transform 0.15s ease-out;
}
.tilt.is-tilting { transition: none; }
.tilt:not(.is-tilting) {
    transform: perspective(900px) rotateX(0) rotateY(0) translateZ(0);
}

/* shine sweep on cards */
.card, .work-card {
    position: relative;
    overflow: hidden;
}
.card::after, .work-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle 350px at var(--mx, 50%) var(--my, 50%),
                                rgba(0,212,255,0.10),
                                transparent 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}
.card:hover::after, .work-card:hover::after { opacity: 1; }

/* ---------- MAGNETIC BUTTONS ---------- */
.btn-primary, .mt-btn-primary {
    will-change: transform;
}

/* ---------- GLASS PANELS ---------- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
}

/* ---------- MARQUEE TECH STRIP ---------- */
.marquee-wrap {
    background: var(--bg-elev);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 32px 0;
    overflow: hidden;
    position: relative;
}
.marquee-wrap::before, .marquee-wrap::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 120px;
    z-index: 2;
    pointer-events: none;
}
.marquee-wrap::before {
    left: 0;
    background: linear-gradient(90deg, var(--bg-elev), transparent);
}
.marquee-wrap::after {
    right: 0;
    background: linear-gradient(270deg, var(--bg-elev), transparent);
}
.marquee-label {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 18px;
}
.marquee-track {
    display: flex;
    gap: 48px;
    width: max-content;
    animation: marquee 40s linear infinite;
    align-items: center;
}
.marquee-track:hover { animation-play-state: paused; }
.marquee-item {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 18px;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.marquee-item:hover { color: var(--accent); }
.marquee-item .dot {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ---------- STAT COUNTER PULSE-IN ---------- */
.stat-num.counting { color: #6be6ff; }
.stat-num {
    background: linear-gradient(180deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-feature-settings: "tnum";
}

/* ---------- SECTION STAGGER ENTRANCE ---------- */
.stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.stagger.in > * { opacity: 1; transform: translateY(0); }
.stagger.in > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.in > *:nth-child(2) { transition-delay: 0.12s; }
.stagger.in > *:nth-child(3) { transition-delay: 0.19s; }
.stagger.in > *:nth-child(4) { transition-delay: 0.26s; }
.stagger.in > *:nth-child(5) { transition-delay: 0.33s; }
.stagger.in > *:nth-child(6) { transition-delay: 0.40s; }
.stagger.in > *:nth-child(7) { transition-delay: 0.47s; }
.stagger.in > *:nth-child(8) { transition-delay: 0.54s; }

/* ---------- TYPEWRITER CARET ---------- */
.typewriter-caret {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--accent);
    margin-left: 4px;
    vertical-align: text-bottom;
    animation: blink 1s steps(2) infinite;
}
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ---------- ELEVATED BTN OUTLINE ---------- */
.btn-ghost {
    position: relative;
    overflow: hidden;
}
.btn-ghost::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(120deg, var(--border-strong), var(--accent), var(--border-strong));
    background-size: 200% 100%;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: gradient-flow 4s linear infinite;
}
.btn-ghost:hover::after { opacity: 1; }

/* ---------- IMAGE REVEAL CLIP ---------- */
.img-reveal {
    clip-path: inset(100% 0 0 0);
    transition: clip-path 1s cubic-bezier(0.7, 0, 0.3, 1);
}
.img-reveal.in { clip-path: inset(0 0 0 0); }

/* ---------- SUBTLE NAV MENU UNDERLINE FADE ---------- */
.nav-cta {
    position: relative;
    overflow: hidden;
}
.nav-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}
.nav-cta:hover::before { transform: translateX(100%); }

/* ---------- MOBILE NAV TOGGLE ---------- */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text);
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}
@media (max-width: 880px) {
    .nav-toggle { display: inline-block; }
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: var(--bg-elev);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    .nav-links li { border-bottom: 1px solid var(--border); }
    .nav-links li:last-child { border-bottom: none; }
    .nav-links a { display: block; padding: 14px 24px !important; }
    .nav-links a::after { display: none; }
    .nav.open .nav-links {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .hero h1 .accent { animation: none; -webkit-text-fill-color: var(--accent); color: var(--accent); }
}

/* ---------- PRINT ---------- */
@media print {
    .scroll-progress, .cursor-spotlight, .hero-orbs, .marquee-wrap { display: none !important; }
}
