/* ==========================================================================
   ZOHER.IN — ARCHITECTURAL DAY/NIGHT & INTERACTIVE LOGIC STYLESHEET
   ========================================================================== */

:root[data-theme="dark"] {
    --bg-main: #050a14;
    --bg-elevated: #0b1322;
    --bg-card: rgba(13, 23, 42, 0.84);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.35);
    --accent-btn-text: #04101f;
    --border-subtle: rgba(148, 163, 184, 0.16);
    --orb-1: rgba(56, 189, 248, 0.14);
    --orb-2: rgba(30, 64, 175, 0.18);
    --grid-line: rgba(148, 163, 184, 0.045);
    --card-shadow: 0 22px 45px -15px rgba(0, 0, 0, 0.6);
}

:root[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-elevated: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.92);
    --text-main: #0f172a;
    --text-muted: #475569;
    --accent: #0284c7;
    --accent-glow: rgba(2, 132, 199, 0.25);
    --accent-btn-text: #ffffff;
    --border-subtle: #cbd5e1;
    --orb-1: rgba(2, 132, 199, 0.08);
    --orb-2: rgba(14, 165, 233, 0.06);
    --grid-line: rgba(15, 23, 42, 0.045);
    --card-shadow: 0 14px 34px -8px rgba(15, 23, 42, 0.08);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Disable accidental word selection & Chrome "Tap to search" bar on touch devices */
@media (pointer: coarse) {
    body,
    body * {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }

    input,
    textarea,
    select,
    [contenteditable="true"] {
        -webkit-user-select: text !important;
        user-select: text !important;
        -webkit-touch-callout: default !important;
    }
}

/* Hide default system cursor on Desktop when custom LOGIC cursor is active */
@media (pointer: fine) {
    body.custom-cursor-ready,
    body.custom-cursor-ready a,
    body.custom-cursor-ready button,
    body.custom-cursor-ready input,
    body.custom-cursor-ready textarea,
    body.custom-cursor-ready select {
        cursor: none !important;
    }
}

.font-serif-italic {
    font-family: 'Instrument Serif', Georgia, serif;
    font-style: italic;
    font-weight: 400;
}

.font-mono-code {
    font-family: 'JetBrains Mono', monospace;
}

.display-heading {
    letter-spacing: -0.024em;
    word-spacing: 0.04em;
    line-height: 1.05;
}

.bg-grid-canvas {
    background-size: 48px 48px;
    background-image: 
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
}

/* ==========================================================================
   PC CUSTOM "LOGIC" CURSOR & MOBILE TOUCH RIPPLE
   ========================================================================== */
#logicCursorRoot {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.logic-cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 6px; height: 6px;
    border-radius: 9999px;
    background: var(--accent);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10000;
    transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
}

.logic-cursor-ring {
    position: fixed;
    top: 0; left: 0;
    width: 36px; height: 36px;
    border-radius: 9999px;
    border: 1.5px solid var(--accent);
    background: rgba(56, 189, 248, 0.04);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                border-radius 0.25s ease,
                background-color 0.25s ease,
                border-color 0.25s ease;
}

.logic-cursor-tag {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    white-space: nowrap;
    padding: 3px 7px;
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--accent);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
}

.logic-cursor-ring.is-interactive {
    width: 54px;
    height: 54px;
    background: rgba(56, 189, 248, 0.12);
    box-shadow: 0 0 25px var(--accent-glow);
}

.logic-cursor-ring.is-interactive .logic-cursor-tag {
    background: var(--accent);
    color: var(--accent-btn-text);
    border-color: var(--accent);
    font-weight: 700;
}

/* Mobile & Touch Ripple Burst */
@keyframes touchRingExpand {
    0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0.95; }
    100% { transform: translate(-50%, -50%) scale(2.3); opacity: 0; }
}
@keyframes touchTagFloat {
    0% { transform: translate(-50%, -8px) scale(0.85); opacity: 1; }
    100% { transform: translate(-50%, -38px) scale(1); opacity: 0; }
}
.touch-logic-ring {
    position: fixed;
    width: 44px; height: 44px;
    border-radius: 9999px;
    border: 1.5px solid var(--accent);
    pointer-events: none;
    z-index: 9998;
    animation: touchRingExpand 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.touch-logic-label {
    position: fixed;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--accent);
    color: var(--accent-btn-text);
    pointer-events: none;
    z-index: 9999;
    animation: touchTagFloat 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   THREE.JS STAGE, MARQUEE & HYBRID PROJECT CARDS
   ========================================================================== */
#threeLogicStage {
    position: relative;
    width: 100%;
    height: 420px;
    border: none;
    background: radial-gradient(circle at 50% 50%, var(--orb-1) 0%, transparent 68%);
    box-shadow: none;
    overflow: visible;
    touch-action: pan-y;
}
@media (min-width: 640px) {
    #threeLogicStage { height: 470px; }
}

.marquee-mask {
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
@keyframes marqueeScroll {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}
.marquee-track {
    display: flex;
    width: max-content;
    animation: marqueeScroll 28s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }

.project-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(16px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease;
}
.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: -120%;
    width: 65%; height: 100%;
    background: linear-gradient(115deg, transparent, rgba(255,255,255,0.09), transparent);
    transform: skewX(-20deg);
    transition: left 0.75s ease;
    pointer-events: none;
    z-index: 20;
}
.project-card:hover::before { left: 140%; }
.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
}

.spotlight-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.spotlight-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(320px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), var(--orb-1), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.spotlight-card:hover::after { opacity: 1; }
.spotlight-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

/* Fail-Safe Blur-to-Sharp Scroll Reveal */
.reveal-up {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
    transition: opacity 0.65s ease, filter 0.65s ease, transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}
.js-anim-ready .reveal-up:not(.is-visible) {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(24px);
}

.theme-btn-active {
    background-color: var(--accent) !important;
    color: var(--accent-btn-text) !important;
    border-color: var(--accent) !important;
    font-weight: 700;
}