/* ═══════════════════════════════════════════════════════
   RESURRECTION  ·  style.css  v3 — UX Overhaul
   Palette: black + white + glow only. No color.
   Custom cursor · Glitch loader · Scrim · InfoHUD
═══════════════════════════════════════════════════════ */

:root {
    --bg: #000000;
    --white: #ffffff;
    --w90: rgba(255, 255, 255, 0.9);
    --w60: rgba(255, 255, 255, 0.6);
    --w25: rgba(255, 255, 255, 0.25);
    --w15: rgba(255, 255, 255, 0.15);
    --w10: rgba(255, 255, 255, 0.10);
    --w05: rgba(255, 255, 255, 0.05);
    --glow-sm: 0 0 8px rgba(255, 255, 255, 0.6);
    --glow-md: 0 0 20px rgba(255, 255, 255, 0.5), 0 0 60px rgba(255, 255, 255, 0.15);
    --glow-lg: 0 0 40px rgba(255, 255, 255, 0.8), 0 0 100px rgba(255, 255, 255, 0.3);
    --glass: rgba(0, 0, 0, 0.92);
    --border: rgba(255, 255, 255, 0.12);
    --radius: 14px;
    --ft: 'Orbitron', sans-serif;
    --fb: 'Inter', sans-serif;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: none !important;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--white);
    font-family: var(--fb);
}

/* ── CUSTOM CURSOR ───────────────────────────────────── */
#cur-dot {
    position: fixed;
    z-index: 9999;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: var(--glow-sm);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: transform 0.05s, width 0.2s var(--ease), height 0.2s var(--ease), opacity 0.2s;
    will-change: transform;
}

#cur-ring {
    position: fixed;
    z-index: 9998;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--w60);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.35s var(--ease), height 0.35s var(--ease),
        border-color 0.2s, opacity 0.3s;
    will-change: transform;
}

body.cursor-hover #cur-dot {
    width: 10px;
    height: 10px;
    box-shadow: var(--glow-md);
}

body.cursor-hover #cur-ring {
    width: 44px;
    height: 44px;
    border-color: var(--white);
}

/* ── CANVAS ─────────────────────────────────────────── */
#cosmos {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
}

/* ── LOADER ─────────────────────────────────────────── */
#loader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: #000;
    transition: opacity 1s var(--ease), visibility 1s var(--ease);
}

#loader.done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Scanline texture */
#loader::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom,
            transparent 0px,
            transparent 2px,
            rgba(255, 255, 255, 0.015) 2px,
            rgba(255, 255, 255, 0.015) 4px);
    pointer-events: none;
}

.ld-rings {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ld-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid transparent;
}

.r1 {
    width: 110px;
    height: 110px;
    border-top-color: var(--white);
    border-right-color: var(--w25);
    animation: spin 2s linear infinite;
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.4);
}

.r2 {
    width: 78px;
    height: 78px;
    border-top-color: var(--w60);
    border-left-color: var(--w25);
    animation: spin 1.4s linear infinite reverse;
}

.r3 {
    width: 50px;
    height: 50px;
    border-top-color: var(--w25);
    border-right-color: var(--white);
    animation: spin 1s linear infinite;
}

.ld-core {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: var(--glow-lg);
    animation: corePulse 1.2s ease-in-out infinite;
}

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

@keyframes corePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: var(--glow-md);
    }

    50% {
        transform: scale(1.5);
        box-shadow: var(--glow-lg);
    }
}

.ld-label {
    font-family: var(--ft);
    font-size: 0.6rem;
    letter-spacing: 0.45em;
    color: var(--w60);
    text-transform: uppercase;
    position: relative;
}

/* Glitch flicker applied via JS .glitch class */
.ld-label.glitch {
    animation: glitchFlicker 0.15s steps(2, end) infinite;
}

@keyframes glitchFlicker {
    0% {
        opacity: 1;
        clip-path: inset(0 0 80% 0);
        transform: translateX(-2px);
    }

    25% {
        opacity: 0.8;
        clip-path: inset(20% 0 40% 0);
        transform: translateX(2px);
    }

    50% {
        opacity: 1;
        clip-path: inset(60% 0 10% 0);
        transform: translateX(-1px);
    }

    75% {
        opacity: 0.6;
        clip-path: inset(40% 0 30% 0);
        transform: translateX(1px);
    }

    100% {
        opacity: 1;
        clip-path: inset(0 0 0 0);
        transform: translateX(0);
    }
}

.ld-bar-wrap {
    width: 220px;
    height: 1px;
    background: var(--w10);
}

#ld-bar {
    height: 100%;
    width: 0%;
    background: var(--white);
    box-shadow: var(--glow-sm);
    transition: width 0.12s linear;
}

#ld-pct {
    font-family: var(--ft);
    font-size: 0.58rem;
    letter-spacing: 0.3em;
    color: var(--w25);
}

/* ── SCRIM ───────────────────────────────────────────── */
#scrim {
    position: fixed;
    inset: 0;
    z-index: 350;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease);
}

#scrim.on {
    opacity: 1;
    pointer-events: auto;
}

/* ── HUD NAV ─────────────────────────────────────────── */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 36px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
}

.hud-logo {
    font-family: var(--ft);
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: var(--white);
    text-shadow: var(--glow-md);
    animation: fadeUp 1.2s 0.5s both;
}

.hud-nav {
    display: flex;
    gap: 5px;
    animation: fadeUp 1.2s 0.7s both;
}

.hb {
    font-family: var(--ft);
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    border: 1px solid var(--w15);
    background: transparent;
    color: var(--w60);
    padding: 7px 15px;
    border-radius: 99px;
    transition: all 0.22s var(--ease);
}

.hb:hover,
.hb.active {
    border-color: var(--white);
    color: var(--white);
    background: var(--w10);
    box-shadow: var(--glow-sm);
}

.hud-lang {
    display: flex;
    gap: 5px;
    animation: fadeUp 1.2s 0.9s both;
}

.lb {
    font-family: var(--ft);
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--w25);
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.22s var(--ease);
}

.lb.active,
.lb:hover {
    border-color: var(--white);
    color: var(--white);
    box-shadow: var(--glow-sm);
    background: var(--w05);
}

/* ── HERO ────────────────────────────────────────────── */
#hero {
    position: fixed;
    bottom: 10vh;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.hero-sub {
    font-family: var(--ft);
    font-size: 0.52rem;
    letter-spacing: 0.55em;
    color: var(--w60);
    margin-bottom: 14px;
    text-shadow: var(--glow-sm);
    animation: fadeUp 1.4s 1.6s both;
}

.hero-name {
    font-family: var(--ft);
    font-size: clamp(2.4rem, 6vw, 5rem);
    font-weight: 900;
    letter-spacing: 0.15em;
    line-height: 1.05;
    color: var(--white);
    text-shadow: var(--glow-lg);
    margin-bottom: 16px;
}

.hn-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px) skewX(4deg);
    animation: wordReveal 0.9s var(--spring) forwards;
}

.hn-word:first-child {
    animation-delay: 1.8s;
}

.hn-word:last-child {
    animation-delay: 2.0s;
}

@keyframes wordReveal {
    to {
        opacity: 1;
        transform: translateY(0) skewX(0deg);
    }
}

.hero-role {
    font-size: clamp(0.66rem, 1.2vw, 0.85rem);
    font-weight: 300;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--w60);
    margin-bottom: 18px;
    animation: fadeUp 1.2s 2.3s both;
}

.hero-hint {
    font-family: var(--ft);
    font-size: 0.52rem;
    letter-spacing: 0.32em;
    color: var(--w25);
    animation: bob 2.8s ease-in-out infinite, fadeUp 1.2s 2.6s both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Override for elements not using translateX */
.hud-logo,
.hb,
.lb,
.hero-sub,
.hero-role,
.hero-hint,
.hn-word {
    animation-fill-mode: both;
}

/* Simplified fadeUp for non-centered elements */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-name .hn-word:first-child {
    animation-delay: 1.8s;
}

.hero-name .hn-word:last-child {
    animation-delay: 2.05s;
}

@keyframes bob {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.3;
    }

    50% {
        transform: translateY(-6px);
        opacity: 0.7;
    }
}

/* ── TOOLTIP ─────────────────────────────────────────── */
#tip {
    position: fixed;
    z-index: 500;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--w25);
    backdrop-filter: blur(24px);
    padding: 7px 14px;
    border-radius: 8px;
    font-family: var(--ft);
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    color: var(--white);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.18s, transform 0.18s;
    box-shadow: var(--glow-sm);
}

#tip.on {
    opacity: 1;
    transform: translateY(0);
}

/* ── PANEL ───────────────────────────────────────────── */
#panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 450;
    width: min(500px, 100vw);
    background: rgba(0, 0, 0, 0.97);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    padding: 44px 36px;
    transform: translateX(100%);
    transition: transform 0.45s var(--ease);
    scrollbar-width: thin;
    scrollbar-color: var(--w25) transparent;
}

#panel.open {
    transform: translateX(0);
}

#pc {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--w05);
    border: 1px solid var(--border);
    color: var(--w60);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
}

#pc:hover {
    border-color: var(--white);
    color: var(--white);
    box-shadow: var(--glow-sm);
}

/* Panel content typography */
.pt {
    font-family: var(--ft);
    font-size: 0.5rem;
    letter-spacing: 0.42em;
    color: var(--w25);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.ph {
    font-family: var(--ft);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--white);
    text-shadow: var(--glow-sm);
    margin-bottom: 22px;
}

.pp {
    font-size: 0.86rem;
    line-height: 1.8;
    color: var(--w60);
    margin-bottom: 14px;
}

.pp strong {
    color: var(--white);
    font-weight: 500;
}

.pd {
    border: none;
    border-top: 1px solid var(--w10);
    margin: 22px 0;
}

.ptags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 18px;
}

.ptag {
    font-family: var(--ft);
    font-size: 0.52rem;
    letter-spacing: 0.1em;
    padding: 4px 11px;
    border-radius: 99px;
    border: 1px solid var(--w25);
    color: var(--w60);
    background: var(--w05);
    transition: all 0.2s;
}

.ptag:hover {
    border-color: var(--white);
    color: var(--white);
}

.pcard {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 12px;
    background: var(--w05);
    transition: border-color 0.25s, box-shadow 0.25s;
}

.pcard:hover {
    border-color: var(--w60);
    box-shadow: var(--glow-sm);
}

.pcard-cat {
    font-family: var(--ft);
    font-size: 0.5rem;
    letter-spacing: 0.2em;
    color: var(--w25);
    margin-bottom: 6px;
}

.pcard h3 {
    font-family: var(--ft);
    font-size: 0.88rem;
    color: var(--white);
    margin-bottom: 8px;
}

.plinks {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.pl {
    font-family: var(--ft);
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    padding: 7px 16px;
    border-radius: 99px;
    text-decoration: none;
    transition: all 0.22s var(--ease);
}

.pl.pri {
    background: var(--white);
    color: #000;
}

.pl.pri:hover {
    box-shadow: var(--glow-md);
    transform: scale(1.03);
}

.pl.sec {
    border: 1px solid var(--w25);
    color: var(--w60);
}

.pl.sec:hover {
    border-color: var(--white);
    color: var(--white);
}

/* Timeline */
.ptl {
    position: relative;
    padding-left: 22px;
}

.ptl::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, var(--white), transparent);
}

.ptli {
    position: relative;
    margin-bottom: 28px;
}

.ptli::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: var(--glow-sm);
}

.ptli-t {
    font-family: var(--ft);
    font-size: 0.72rem;
    color: var(--white);
    margin-bottom: 3px;
}

.ptli-d {
    font-size: 0.65rem;
    color: var(--w25);
    margin-bottom: 6px;
    letter-spacing: 0.08em;
}

.ptli-p {
    font-size: 0.82rem;
    color: var(--w60);
    line-height: 1.7;
}

/* Skills grid */
.psgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.psc {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    background: var(--w05);
    transition: all 0.25s var(--ease);
}

.psc:hover {
    border-color: var(--white);
    box-shadow: var(--glow-sm);
}

.psc-n {
    font-family: var(--ft);
    font-size: 0.68rem;
    color: var(--white);
    margin-bottom: 6px;
}

.psc-d {
    font-size: 0.72rem;
    color: var(--w60);
    line-height: 1.55;
}

/* ── AI CHAT ─────────────────────────────────────────── */
#aic {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    width: min(580px, calc(100vw - 40px));
    background: rgba(0, 0, 0, 0.98);
    border: 1px solid var(--w15);
    border-radius: 18px;
    z-index: 600;
    box-shadow: var(--glow-sm), 0 30px 80px rgba(0, 0, 0, 0.9);
    transition: transform 0.45s var(--spring), opacity 0.4s;
    opacity: 0;
    overflow: hidden;
}

#aic.open {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

#aih {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--w10);
    background: var(--w05);
}

.ai-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: var(--glow-md);
    flex-shrink: 0;
    animation: corePulse 1.6s ease-in-out infinite;
}

#ai-lbl {
    flex: 1;
    font-family: var(--ft);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    color: var(--w60);
}

#aix {
    background: transparent;
    border: none;
    color: var(--w25);
    font-size: 1rem;
    transition: color 0.2s;
}

#aix:hover {
    color: var(--white);
}

#aim {
    height: 240px;
    overflow-y: auto;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--w25) transparent;
}

.am {
    max-width: 86%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.82rem;
    line-height: 1.68;
    animation: msgIn 0.28s ease;
}

.am.user {
    align-self: flex-end;
    background: var(--w10);
    border: 1px solid var(--w25);
    color: var(--white);
    border-bottom-right-radius: 3px;
}

.am.bot {
    align-self: flex-start;
    background: var(--w05);
    border: 1px solid var(--border);
    color: var(--w60);
    border-bottom-left-radius: 3px;
}

.am.typing {
    font-style: italic;
    opacity: 0.5;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing dots */
.typing-dots span {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--w60);
    margin: 0 2px;
    animation: dotBounce 1.2s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    40% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

#ais {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 18px;
    border-top: 1px solid var(--w05);
}

.ac {
    font-family: var(--ft);
    font-size: 0.52rem;
    letter-spacing: 0.1em;
    padding: 5px 12px;
    border-radius: 99px;
    background: var(--w05);
    border: 1px solid var(--w15);
    color: var(--w60);
    transition: all 0.22s var(--ease);
}

.ac:hover {
    border-color: var(--white);
    color: var(--white);
    background: var(--w10);
    box-shadow: var(--glow-sm);
}

#ai-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--w10);
}

#ai-in {
    flex: 1;
    background: var(--w05);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--white);
    padding: 9px 14px;
    font-size: 0.83rem;
    font-family: var(--fb);
    outline: none;
    transition: border-color 0.2s;
}

#ai-in:focus {
    border-color: var(--w60);
}

#ai-in::placeholder {
    color: var(--w25);
}

#ai-send {
    font-family: var(--ft);
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    background: var(--white);
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    transition: all 0.22s var(--ease);
    white-space: nowrap;
}

#ai-send:hover {
    box-shadow: var(--glow-md);
    transform: scale(1.04);
}

/* ── INFO HUD ────────────────────────────────────────── */
#infohud {
    position: fixed;
    bottom: 20px;
    right: 28px;
    z-index: 200;
    font-family: var(--ft);
    font-size: 0.5rem;
    letter-spacing: 0.22em;
    color: var(--w25);
    display: flex;
    gap: 10px;
    align-items: center;
    pointer-events: none;
    animation: fadeUp 1s 3s both;
    transition: color 0.3s;
}

#infohud.active {
    color: var(--w60);
}

#ih-sep {
    opacity: 0.3;
}