/* Site layer — extends cv-print.css */

.highlight-tag {
    color: var(--cyber-yellow);
    font-weight: 700;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    width: 100%;
    max-width: 100vw;
    margin: 0;
    box-shadow: none;
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

:root {
    --nav-height: 3.5rem;
    --reel-item-height: 320px;
    --site-max: 1200px;
}

/* Ambient FX */
.fx-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.fx-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    transition: transform 0.15s ease-out;
    will-change: transform;
}

.fx-orb--cyan {
    width: 420px;
    height: 420px;
    top: -120px;
    right: 10%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.5), transparent 70%);
    animation: orb-drift 18s ease-in-out infinite;
}

.fx-orb--magenta {
    width: 360px;
    height: 360px;
    bottom: 20%;
    left: -80px;
    background: radial-gradient(circle, rgba(255, 0, 60, 0.4), transparent 70%);
    animation: orb-drift 22s ease-in-out infinite reverse;
}

.fx-orb--yellow {
    width: 280px;
    height: 280px;
    top: 45%;
    right: -60px;
    background: radial-gradient(circle, rgba(252, 238, 10, 0.25), transparent 70%);
    animation: orb-drift 26s ease-in-out infinite;
}

@keyframes orb-drift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -20px); }
}

.scanline-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg width='4' height='4' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='4' height='1' y='1' fill='%2300f0ff' fill-opacity='0.03'/%3E%3C/svg%3E");
    background-size: 4px 4px;
    opacity: 0.6;
}

/* Sticky navigation */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(5, 6, 8, 0.92);
    border-bottom: 1px solid rgba(0, 240, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.site-nav__inner {
    max-width: var(--site-max);
    margin: 0 auto;
    padding: 0 1.25rem;
    min-height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-nav__brand {
    font-family: var(--font-head);
    font-size: 0.75rem;
    color: var(--text-bright);
    text-decoration: none;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.site-nav__brand span {
    color: var(--cyber-cyan);
}

.site-nav__toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--cyber-cyan);
    color: var(--cyber-cyan);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 6px 10px;
    cursor: pointer;
    text-transform: uppercase;
}

.site-nav__panel {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-nav__link {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-dim);
    text-decoration: none;
    padding: 6px 10px;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.site-nav__link:hover,
.site-nav__link.is-active {
    color: var(--cyber-cyan);
    border-color: rgba(0, 240, 255, 0.35);
    background: rgba(0, 240, 255, 0.06);
}

.site-nav__link.is-active {
    color: var(--cyber-yellow);
    border-color: rgba(252, 238, 10, 0.4);
}

/* Main layout */
.schematic-core {
    position: relative;
    z-index: 2;
    max-width: var(--site-max);
    margin: 0 auto;
    padding-top: 1.5rem;
}

.vertical-marquee {
    position: fixed;
}

section[id],
header#top {
    scroll-margin-top: calc(var(--nav-height) + 1rem);
}

/* Portfolio — cyber reel */
.panel-portfolio .panel-inner {
    padding-top: 0;
}

.reel-wrap {
    margin-top: 0.5rem;
    border: 1px dashed rgba(0, 240, 255, 0.25);
    background: rgba(0, 240, 255, 0.02);
    padding: 1rem 0;
}

/* Stack of rows — one horizontal reel per media subfolder. */
.reels {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.reel {
    width: 100%;
    overflow: hidden;
    padding: 20px 0;
    margin: -20px 0;
    cursor: grab;
    touch-action: pan-y;
}

.reel.reel--dragging {
    cursor: grabbing;
}

.reel__track {
    display: flex;
    gap: 1rem;
    padding: 0 1rem;
    width: max-content;
    will-change: transform;
}

.reel__item {
    position: relative;
    flex: 0 0 auto;
    height: var(--reel-item-height);
    aspect-ratio: var(--media-ratio, 16 / 9);
    min-width: 160px;
    max-width: min(88vw, 720px);
    border: 1px solid rgba(0, 240, 255, 0.35);
    background: #000;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
    .reel__item:hover {
        border-color: var(--cyber-yellow);
        box-shadow: 0 0 20px rgba(252, 238, 10, 0.2);
        z-index: 10;
        transform: scale(1.05) translateZ(0);
    }
}

.reel__item img,
.reel__item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Loading placeholder — shown until each file is fetched (aspect ratio kept). */
.reel__loader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 2px solid rgba(0, 240, 255, 0.2);
    border-top-color: var(--cyber-yellow, #fcee0a);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    animation: reel-spin 0.8s linear infinite;
}

.reel__item--loading {
    background:
        repeating-linear-gradient(
            45deg,
            rgba(0, 240, 255, 0.04),
            rgba(0, 240, 255, 0.04) 10px,
            rgba(0, 240, 255, 0.08) 10px,
            rgba(0, 240, 255, 0.08) 20px
        ),
        #000;
}

.reel__item--loading .reel__loader {
    opacity: 1;
}

.reel__item--loading .reel__media {
    visibility: hidden;
}

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

@media (prefers-reduced-motion: reduce) {
    .reel__loader {
        animation-duration: 1.6s;
    }
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(5, 6, 8, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.modal--open {
    display: flex;
}

#modal-img,
#modal-video {
    display: none;
    width: auto;
    height: auto;
    max-width: min(100%, calc(100vw - 6rem));
    max-height: 85vh;
    object-fit: contain;
    object-position: center;
    border: 2px solid var(--cyber-cyan);
    flex-shrink: 0;
}

#modal-img.is-visible,
#modal-video.is-visible {
    display: block;
}

.modal__close,
.modal__nav {
    position: absolute;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid var(--cyber-cyan);
    color: var(--cyber-cyan);
    font-family: var(--font-mono);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    z-index: 10;
}

.modal__close:hover,
.modal__nav:hover {
    background: var(--cyber-cyan);
    color: #000;
}

.modal__close {
    top: 1.25rem;
    right: 1.25rem;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.35rem;
}

.modal__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    font-size: 1.1rem;
}

.modal__nav--prev { left: 1rem; }
.modal__nav--next { right: 1rem; }

.site-footer {
    position: relative;
    z-index: 2;
    max-width: var(--site-max);
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
    padding-left: calc(40px + 1.25rem);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media screen and (max-width: 900px) {
    .vertical-marquee { display: none; }

    .schematic-core {
        padding: 1.25rem;
        padding-left: 1.25rem;
    }

    .node-header {
        padding: 1.25rem;
    }

    .hud-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 16px;
    }

    .contact-array {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .c-node {
        width: 100%;
        flex-wrap: wrap;
        align-items: flex-start;
        line-height: 1.4;
        word-break: break-word;
    }

    .core-skill-banner {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .core-skill-text {
        flex-wrap: wrap;
        line-height: 1.5;
    }

    .site-footer {
        padding-left: 1.25rem;
    }

    .site-nav__toggle {
        display: block;
    }

    .site-nav__panel {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: rgba(5, 6, 8, 0.98);
        border-bottom: 1px solid rgba(0, 240, 255, 0.25);
        padding: 0.75rem 1rem 1rem;
        gap: 0.25rem;
    }

    .site-nav__panel.is-open {
        display: flex;
    }

    .site-nav__link {
        width: 100%;
        text-align: left;
    }

    .skill-blueprint {
        column-count: 1;
    }

    :root {
        --reel-item-height: 260px;
    }
}

@media screen and (max-width: 600px) {
    .cyber-title {
        font-size: clamp(1.35rem, 7.5vw, 2rem);
        letter-spacing: -1px;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .cyber-subtitle {
        font-size: 0.85rem;
        letter-spacing: 1px;
        line-height: 1.4;
    }

    .node-header {
        padding: 1rem;
    }

    .hud-stats {
        grid-template-columns: 1fr 1fr;
    }

    .stat-val {
        font-size: 1.25rem;
    }

    .stat-lbl {
        font-size: 0.6rem;
    }

    .c-node {
        font-size: 0.8rem;
    }

    .c-icon {
        flex-shrink: 0;
    }

    .cyber-panel {
        padding: 1rem;
    }

    :root {
        --reel-item-height: 220px;
    }

    .reel {
        padding: 16px 0;
        margin: -16px 0;
    }

    .modal {
        padding: 1rem;
    }

    .modal__nav--prev { left: 0.25rem; }
    .modal__nav--next { right: 0.25rem; }

    #modal-img,
    #modal-video {
        max-height: 75vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    .fx-orb {
        animation: none;
        transition: none;
    }

    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* Spotlight hover effect */
.cyber-panel {
    transition: transform 0.2s, box-shadow 0.2s;
}

.cyber-panel::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle 350px at var(--mouse-x, 0) var(--mouse-y, 0), rgba(0, 240, 255, 0.06), transparent 80%);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s;
}

.cyber-panel:hover::after {
    opacity: 1;
}

/* Glitch animation for title */
.cyber-title:hover {
    animation: text-glitch 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    cursor: crosshair;
}

@keyframes text-glitch {
    0% { transform: translate(0); text-shadow: 3px 0 var(--cyber-magenta), -3px 0 var(--cyber-cyan); }
    20% { transform: translate(-2px, 1px); text-shadow: -3px 0 var(--cyber-magenta), 3px 0 var(--cyber-cyan); }
    40% { transform: translate(-1px, -1px); text-shadow: 3px 0 var(--cyber-magenta), -3px 0 var(--cyber-cyan); }
    60% { transform: translate(2px, 1px); text-shadow: -3px 0 var(--cyber-magenta), 3px 0 var(--cyber-cyan); }
    80% { transform: translate(1px, -1px); text-shadow: 3px 0 var(--cyber-magenta), -3px 0 var(--cyber-cyan); }
    100% { transform: translate(0); text-shadow: 3px 0 var(--cyber-magenta), -3px 0 var(--cyber-cyan); }
}

/* Hide system cursor when custom cursor is active */
body.has-custom-cursor,
body.has-custom-cursor * {
    cursor: none !important;
}

/* Dynamic crosshair follow */
.custom-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 20px; height: 20px;
    border: 1px solid var(--cyber-cyan);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
    mix-blend-mode: screen;
}
.custom-cursor::before, .custom-cursor::after {
    content: ''; position: absolute; background: var(--cyber-cyan);
}
.custom-cursor::before { top: 50%; left: -5px; right: -5px; height: 1px; transform: translateY(-50%); }
.custom-cursor::after { left: 50%; top: -5px; bottom: -5px; width: 1px; transform: translateX(-50%); }

.custom-cursor.active {
    width: 30px; height: 30px;
    background-color: rgba(0, 240, 255, 0.2);
}

/* Interactive list items */
.crosshair-list li {
    transition: transform 0.2s, color 0.2s;
}
.crosshair-list li:hover {
    transform: translateX(5px);
    color: var(--text-bright);
}
