/* ============================================================
   S-Digital Service — Neon Design System
   Futuristic / Cyberpunk / Holographic portfolio
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
    --bg: #050816;
    --bg-2: #09090b;
    --bg-3: #0d1020;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-2: rgba(255, 255, 255, 0.07);
    --surface-3: rgba(255, 255, 255, 0.12);

    --cyan: #00f5ff;
    --electric: #00e5ff;
    --green: #00ff99;
    --purple: #6c63ff;
    --violet: #8b5cf6;
    --white: #f4f7ff;
    --muted: #8a93b5;

    --grad-primary: linear-gradient(135deg, var(--cyan), var(--purple));
    --grad-neon: linear-gradient(90deg, var(--cyan), var(--green), var(--violet));

    --font-display: 'Space Grotesk', 'Sora', sans-serif;
    --font-head: 'Sora', 'Outfit', sans-serif;
    --font-body: 'Outfit', 'Inter', sans-serif;
    --font-code: 'Space Grotesk', monospace;

    --radius: 20px;
    --radius-lg: 28px;
    --glass: rgba(9, 9, 11, 0.55);
    --border: 1px solid rgba(0, 245, 255, 0.14);

    --shadow-neon: 0 0 24px rgba(0, 245, 255, 0.25), 0 0 60px rgba(108, 99, 255, 0.15);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    scroll-behavior: auto;
    -webkit-text-size-adjust: 100%;
}

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--white);
    line-height: 1.7;
    font-size: 1rem;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    cursor: none;
}

@media (pointer: coarse) { body { cursor: auto; } }

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1200px 800px at 85% -10%, rgba(108, 99, 255, 0.12), transparent 60%),
        radial-gradient(900px 700px at 0% 110%, rgba(0, 245, 255, 0.08), transparent 55%),
        radial-gradient(700px 500px at 50% 50%, rgba(139, 92, 246, 0.05), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; }
::selection { background: var(--cyan); color: var(--bg); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--cyan), var(--purple));
    border-radius: 8px;
    border: 2px solid var(--bg-2);
}

.container {
    width: min(1200px, 92%);
    margin-inline: auto;
    position: relative;
    z-index: 2;
}

/* ---------- Utility ---------- */
.text-grad {
    background: var(--grad-neon);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.js .reveal-up, .js .reveal-left, .js .reveal-right {
    opacity: 0;
    will-change: transform, opacity;
}

.js [data-split] .split-char { display: inline-block; will-change: transform; }

.no-scroll { overflow: hidden; }

/* ---------- Noise + Overlays ---------- */
.noise {
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    z-index: 2000;
    pointer-events: none;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: noiseShift 0.6s steps(4) infinite;
}

@keyframes noiseShift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-2%, 1%); }
    50% { transform: translate(1%, -2%); }
    75% { transform: translate(-1%, 2%); }
    100% { transform: translate(2%, -1%); }
}

.spotlight {
    position: fixed;
    width: 550px;
    height: 550px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 245, 255, 0.08) 0%, rgba(108, 99, 255, 0.05) 30%, transparent 70%);
    filter: blur(20px);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.spotlight.is-visible { opacity: 1; }

.matrix-rain {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.09;
}

.matrix-rain canvas { width: 100%; height: 100%; }

/* ---------- Preloader ---------- */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: #04060f;
    display: grid;
    place-items: center;
    transition: opacity 0.8s var(--ease), visibility 0.8s;
}

.preloader.is-done { opacity: 0; visibility: hidden; }

.preloader__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 245, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 255, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at center, black 10%, transparent 70%);
    animation: gridPulse 4s ease-in-out infinite;
}

@keyframes gridPulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

.preloader__scan {
    position: absolute;
    left: 0; right: 0; top: 0; height: 40vh;
    background: linear-gradient(180deg, transparent, rgba(0, 245, 255, 0.06));
    animation: scanLine 2.2s linear infinite;
    pointer-events: none;
}

@keyframes scanLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(250vh); }
}

.preloader__inner {
    position: relative;
    display: grid;
    place-items: center;
    z-index: 2;
}

.preloader__ring {
    position: absolute;
    width: 190px; height: 190px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--cyan);
    border-right-color: var(--purple);
    animation: spin 1.1s linear infinite;
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.35);
}

.preloader__ring::after {
    content: '';
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-bottom-color: var(--green);
    animation: spinRev 1.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinRev { to { transform: rotate(-360deg); } }

.preloader__core {
    width: 120px; height: 120px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 30% 30%, rgba(108, 99, 255, 0.4), rgba(5, 8, 22, 0.9));
    border: 1px solid rgba(0, 245, 255, 0.35);
    box-shadow: 0 0 40px rgba(108, 99, 255, 0.4), inset 0 0 30px rgba(0, 245, 255, 0.15);
}

.preloader__logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--grad-neon);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: logoGlow 1.6s ease-in-out infinite;
}

@keyframes logoGlow { 0%, 100% { filter: drop-shadow(0 0 6px rgba(0,245,255,0.6)); } 50% { filter: drop-shadow(0 0 18px rgba(139,92,246,0.9)); } }

.preloader__text {
    position: absolute;
    top: 170px;
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: var(--font-code);
    letter-spacing: 0.22em;
    font-size: 0.72rem;
    color: var(--muted);
}

.preloader__word { color: var(--cyan); text-shadow: 0 0 10px rgba(0, 245, 255, 0.6); }

.preloader__bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.preloader__bar i {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--grad-neon);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.8);
    transition: width 0.2s linear;
}

.preloader__pct { color: var(--white); }

/* ---------- Cursor ---------- */
.cursor { position: fixed; inset: 0; z-index: 4000; pointer-events: none; display: none; }
@media (pointer: fine) { .cursor { display: block; } }

.cursor__dot {
    position: fixed;
    top: 0; left: 0;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.9);
    transform: translate(-50%, -50%);
}

.cursor__ring {
    position: fixed;
    top: 0; left: 0;
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 245, 255, 0.6);
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    transition: width 0.3s var(--ease), height 0.3s var(--ease), border-color 0.3s, background 0.3s;
}

.cursor__label {
    font-family: var(--font-code);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    opacity: 0;
    transition: opacity 0.2s;
}

.cursor.is-hover .cursor__ring {
    width: 62px; height: 62px;
    background: rgba(0, 245, 255, 0.08);
    border-color: var(--purple);
    box-shadow: 0 0 24px rgba(0, 245, 255, 0.35);
}

.cursor.is-label .cursor__ring { width: 88px; height: 88px; }
.cursor.is-label .cursor__label { opacity: 1; }

.cursor.is-down .cursor__ring { transform: translate(-50%, -50%) scale(0.7); }
.cursor.is-down .cursor__dot { transform: translate(-50%, -50%) scale(2.4); }

/* ---------- Buttons ---------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.7rem;
    border-radius: 60px;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    overflow: hidden;
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), color 0.3s, border-color 0.3s;
    white-space: nowrap;
    border: 1px solid transparent;
}

.btn i { font-size: 0.9em; position: relative; z-index: 2; }
.btn span { position: relative; z-index: 2; }

.btn--primary {
    background: linear-gradient(120deg, var(--cyan), var(--purple) 90%);
    color: #04121a;
    box-shadow: 0 10px 30px rgba(0, 245, 255, 0.25), 0 6px 40px rgba(108, 99, 255, 0.25);
}

.btn--primary:hover {
    box-shadow: 0 14px 44px rgba(0, 245, 255, 0.45), 0 8px 60px rgba(108, 99, 255, 0.5);
    transform: translateY(-2px);
}

.btn__scan {
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.6s var(--ease);
    z-index: 1;
}

.btn--primary:hover .btn__scan, .btn--send:hover .btn__scan { transform: translateX(120%); }

.btn--outline {
    background: transparent;
    color: var(--white);
    border-color: rgba(0, 245, 255, 0.4);
}

.btn--outline::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(0, 245, 255, 0.16), rgba(139, 92, 246, 0.16));
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 1;
}

.btn--outline:hover { border-color: var(--cyan); box-shadow: 0 0 28px rgba(0, 245, 255, 0.3), inset 0 0 18px rgba(0, 245, 255, 0.08); }
.btn--outline:hover::before { opacity: 1; }

.btn--ghost {
    background: var(--surface-2);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--white);
}

.btn--ghost:hover { border-color: var(--purple); box-shadow: 0 0 22px rgba(139, 92, 246, 0.35); }

.btn--text {
    padding-inline: 0.5rem;
    background: transparent;
    color: var(--muted);
}

.btn--text:hover { color: var(--cyan); }

.btn--sm { padding: 0.65rem 1.25rem; font-size: 0.85rem; }

.btn--send { width: 100%; justify-content: center; padding: 1.1rem 2rem; }

.btn--send.is-sending i { animation: sendPulse 0.8s ease infinite; }
.btn--send.is-sending .btn__send-text::after {
    content: '...';
    animation: dots 1.2s steps(4, end) infinite;
}

@keyframes sendPulse { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ---------- Nav ---------- */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 1.1rem 0;
    transition: padding 0.4s var(--ease), background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
    border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
    padding: 0.6rem 0;
    background: rgba(5, 8, 22, 0.7);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom-color: rgba(0, 245, 255, 0.12);
}

.nav__inner {
    width: min(1240px, 92%);
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nav__brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.nav__brand-mark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--cyan);
    text-shadow: 0 0 14px rgba(0, 245, 255, 0.7);
}

.nav__brand-mark span { color: var(--purple); text-shadow: 0 0 14px rgba(139, 92, 246, 0.7); }

.nav__brand-text { display: flex; flex-direction: column; line-height: 1.15; }

.nav__brand-text strong { font-family: var(--font-head); font-size: 0.95rem; letter-spacing: 0.02em; }
.nav__brand-text strong em { font-style: normal; color: var(--cyan); }
.nav__brand-text small { font-size: 0.65rem; color: var(--muted); letter-spacing: 0.22em; text-transform: uppercase; }

.nav__links { display: flex; gap: 1.6rem; }

.nav__links a {
    position: relative;
    font-family: var(--font-head);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.04em;
    padding: 0.4rem 0;
    transition: color 0.3s;
}

.nav__links a span {
    font-family: var(--font-code);
    font-size: 0.62rem;
    color: var(--cyan);
    opacity: 0;
    transform: translateY(3px);
    display: inline-block;
    transition: opacity 0.3s, transform 0.3s;
    margin-right: 3px;
}

.nav__links a::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 1.5px;
    background: var(--grad-neon);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s var(--ease);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.7);
}

.nav__links a:hover, .nav__links a.active { color: var(--white); }
.nav__links a:hover span, .nav__links a.active span { opacity: 1; transform: translateY(0); }
.nav__links a:hover::after, .nav__links a.active::after { transform: scaleX(1); transform-origin: left; }

.nav__actions { display: flex; align-items: center; gap: 1rem; }

.nav__burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
}

.nav__burger span {
    width: 24px; height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform 0.4s var(--ease), opacity 0.3s, width 0.3s;
}

.nav__burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav__progress {
    position: absolute;
    left: 0; bottom: -1px;
    height: 2px;
    width: 0%;
    background: var(--grad-neon);
    box-shadow: 0 0 14px rgba(0, 245, 255, 0.8);
}

/* ---------- Mobile Menu ---------- */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 990;
    pointer-events: none;
    visibility: hidden;
}

.mobile-menu.is-open { pointer-events: auto; visibility: visible; }

.mobile-menu__bg {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 15, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    clip-path: circle(0% at calc(100% - 50px) 40px);
    transition: clip-path 0.7s var(--ease);
}

.mobile-menu.is-open .mobile-menu__bg { clip-path: circle(150% at calc(100% - 50px) 40px); }

.mobile-menu__links {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 6.5rem 2rem 2rem;
}

.mobile-menu__links a {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 6vw, 2.4rem);
    font-weight: 600;
    color: var(--white);
    display: flex;
    gap: 1rem;
    align-items: baseline;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), color 0.3s;
}

.mobile-menu.is-open .mobile-menu__links a { opacity: 1; transform: translateY(0); }
.mobile-menu.is-open .mobile-menu__links a:nth-child(2) { transition-delay: 0.06s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(3) { transition-delay: 0.12s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(4) { transition-delay: 0.18s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(5) { transition-delay: 0.24s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(6) { transition-delay: 0.3s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(7) { transition-delay: 0.36s; }

.mobile-menu__links a em { font-style: normal; font-family: var(--font-code); font-size: 0.9rem; color: var(--cyan); }
.mobile-menu__links a:hover { color: var(--cyan); }

.mobile-menu__socials {
    position: relative;
    display: flex;
    gap: 1rem;
    padding: 0 2rem;
}

.mobile-menu__socials a {
    width: 44px; height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--muted);
    transition: color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.mobile-menu__socials a:hover { color: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 18px rgba(0, 245, 255, 0.3); }
