/* ═══════════════════════════════════════
   Shahid Hocien — Portfolio Styles
   ═══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Italiana&family=Outfit:wght@300;400;600&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%; margin: 0; padding: 0;
    background-color: #000000;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body {
    min-height: 100vh;
    font-family: 'Outfit', sans-serif;
    color: #ffffff;
    overflow: hidden;
    cursor: none;
    -webkit-overflow-scrolling: auto;
    overscroll-behavior: none;
}

/* Custom cursor override for element interactions */
a, button, .story-item, .nav-link, .contact-btn, .modal-close, .modal-panel a { cursor: none !important; }

/* Allow text selection only where useful */
body.selectable, .modal-scroll { user-select: text; -webkit-user-select: text; }
* { cursor: none !important; }

/* ─── Touch device overrides ─── */
@media (hover: none) and (pointer: coarse) {
    body { cursor: auto; }
    * { cursor: auto !important; }
    a, button, .story-item, .nav-link, .contact-btn, .modal-close, .modal-panel a { cursor: pointer !important; }
    .cursor-inner { display: none !important; }
    .cursor-outer { display: none !important; }
}
::-webkit-scrollbar { display: none; width: 0; }

/* Focus styles for keyboard navigation */
a:focus-visible, button:focus-visible, .story-item:focus-visible {
    outline: 2px solid #7fd8ff;
    outline-offset: 4px;
}

/* ═══ Sci-Fi Modal ═══ */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 100; display: none;
    align-items: center; justify-content: center;
    pointer-events: auto;
}
.modal-overlay.active { display: flex; }
.modal-overlay.active .modal-panel {
    animation: modalIn 0.35s ease-out forwards;
}
.modal-overlay.active .modal-bg {
    animation: fadeIn 0.35s ease-out forwards;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}
.modal-panel {
    position: relative; width: 640px; max-width: 92vw; max-height: 80vh;
    border: 1px solid rgba(120, 200, 255, 0.25);
    padding: 48px 44px 40px;
    background: rgba(5, 8, 16, 0.95);
    box-shadow: 0 0 40px rgba(120, 200, 255, 0.06), inset 0 0 60px rgba(120, 200, 255, 0.03);
    pointer-events: auto;
    display: flex; flex-direction: column;
}
.modal-scroll {
    overflow-y: auto; padding-right: 8px;
    flex: 1; min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(120,200,255,0.3) rgba(255,255,255,0.03);
}
.modal-scroll::-webkit-scrollbar { width: 3px; }
.modal-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
.modal-scroll::-webkit-scrollbar-thumb { background: rgba(120,200,255,0.3); border-radius: 3px; }
.modal-panel::before {
    content: ''; position: absolute; top: -1px; left: 20%; right: 20%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(120, 200, 255, 0.4), transparent);
}
.modal-panel::after {
    content: ''; position: absolute; bottom: -1px; left: 20%; right: 20%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(120, 200, 255, 0.4), transparent);
}
.modal-corner-tl, .modal-corner-tr, .modal-corner-bl, .modal-corner-br {
    position: absolute; width: 16px; height: 16px;
    border-color: rgba(120, 200, 255, 0.5);
    border-style: solid;
}
.modal-corner-tl { top: 8px; left: 8px; border-width: 1px 0 0 1px; }
.modal-corner-tr { top: 8px; right: 8px; border-width: 1px 1px 0 0; }
.modal-corner-bl { bottom: 8px; left: 8px; border-width: 0 0 1px 1px; }
.modal-corner-br { bottom: 8px; right: 8px; border-width: 0 1px 1px 0; }
.modal-close {
    position: absolute; top: 12px; right: 16px;
    color: rgba(255, 255, 255, 0.3); font-size: 20px;
    background: none; border: none; font-family: 'Outfit', sans-serif;
    transition: color 0.3s; pointer-events: auto;
}
.modal-close:hover { color: #7fd8ff; }
.modal-tag {
    font-size: 9px; letter-spacing: 3px; text-transform: uppercase;
    color: rgba(120, 200, 255, 0.5); margin-bottom: 12px;
    font-family: 'Outfit', sans-serif;
}
.modal-title {
    font-family: 'Italiana', serif; font-size: 36px; line-height: 1.1;
    color: #eaf6ff; margin-bottom: 20px; letter-spacing: 1px;
}
.modal-desc {
    font-size: 14px; line-height: 1.8; color: rgba(255, 255, 255, 0.65);
    font-weight: 300; letter-spacing: 0.3px;
}
.modal-divider {
    width: 40px; height: 1px; background: rgba(120, 200, 255, 0.3); margin: 20px 0;
}
.modal-meta {
    font-size: 10px; color: rgba(255, 255, 255, 0.2);
    letter-spacing: 1px; text-transform: uppercase;
}

/* ═══ WebGL Canvas ═══ */
#webgl {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1; outline: none;
}

/* ═══ Custom Cursor ═══ */
.cursor-inner {
    position: fixed; top: 0; left: 0;
    width: 6px; height: 6px;
    border: 2px solid rgba(255, 255, 255, 1);
    border-radius: 50%; transform: translate(-50%, -50%);
    pointer-events: none; z-index: 9999;
    mix-blend-mode: difference;
}
.cursor-outer {
    position: fixed; top: 0; left: 0;
    width: 40px; height: 40px;
    border: 1.5px solid rgba(120, 200, 255, 0.7);
    border-radius: 50%; transform: translate(-50%, -50%);
    pointer-events: none; z-index: 9998;
    transition: width 0.3s, height 0.3s, background 0.3s;
    mix-blend-mode: difference;
}

/* ═══ Cinematic Container ═══ */
.cinematic-container {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%; z-index: 10;
    pointer-events: none;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 0 60px 40px 60px; box-sizing: border-box;
}
.main-header {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; z-index: 20; pointer-events: auto; padding: 20px 0;
}
.brand {
    font-size: 14px; font-weight: 600; letter-spacing: 5px; text-transform: uppercase;
    color: #ffffff;
}
.header-nav { display: flex; align-items: center; gap: 24px; }
.nav-link {
    color: #ffffff; text-decoration: none;
    font-size: 10px; text-transform: uppercase; letter-spacing: 2px;
    font-weight: 500; transition: color 0.3s;
}
.nav-link:hover { color: #7fd8ff; }
.nav-dot { width: 3px; height: 3px; background: rgba(255, 255, 255, 0.2); border-radius: 50%; }
.nav-contact { display: none; }
.header-actions { pointer-events: auto; display: flex; align-items: center; gap: 8px; }
.contact-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 24px; background: #ffffff; color: #000000; text-decoration: none;
    font-size: 10px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
    border-radius: 20px; transition: transform 0.3s, background 0.3s;
}
.contact-btn:hover { transform: scale(1.05); background: #f0f0f0; }
.btn-circle { display: inline-block; width: 6px; height: 6px; border: 1px solid #000000; border-radius: 50%; background: transparent; }

/* ═══ Hamburger ═══ */
.hamburger {
    display: none; flex-direction: column; justify-content: center; align-items: center;
    gap: 5px; width: 36px; height: 36px; padding: 6px; background: none; border: none;
    cursor: none; z-index: 60; pointer-events: auto;
}
.hamburger-line {
    display: block; width: 22px; height: 1.5px;
    background: #ffffff; border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.active .hamburger-line:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.active .hamburger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active .hamburger-line:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ═══ Slides ═══ */
.slide { position: absolute; bottom: 12%; pointer-events: none; }

#slide-1 { left: 0; width: 100%; }
#slide-1 .slide-title { margin-left: 60px; }
#slide-1 .desc-row { position: relative; display: flex; width: 100%; }
#slide-1 .col-1 { margin-left: 60px; width: calc(25vw - 60px); max-width: calc(25vw - 60px); }
#slide-1 .col-2 { position: absolute; left: calc(25vw + 40px); width: calc(25vw - 60px); max-width: calc(25vw - 60px); }

#slide-2 { left: 0; width: 100%; }
#slide-2-img {
    position: fixed; top: 90px; left: 60px;
    width: calc(25vw - 60px); aspect-ratio: 1 / 1; overflow: hidden; z-index: 2;
    pointer-events: none; clip-path: inset(0 0 100% 0);
    transition: clip-path 1.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
    opacity: 0;
}
#slide-2-img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); transition: transform 1.8s cubic-bezier(0.16, 1, 0.3, 1); }
#slide-2-img.active { clip-path: inset(0 0 0 0); opacity: 1; }
#slide-2-img.active img { transform: scale(1); }
#slide-2 .slide-title { margin-left: calc(25vw + 40px); }
#slide-2 .slide-desc { margin-left: calc(50vw + 20px); width: calc(25vw - 60px); max-width: calc(25vw - 60px); }

#slide-3 { left: calc(50vw + 20px); width: calc(25vw - 60px); max-width: calc(25vw - 60px); }
#slide-3 .slide-title { white-space: nowrap; }

#slide-4 { left: calc(25% + 40px); max-width: 600px; }

.slide-title {
    font-family: 'Italiana', serif; font-size: 116px; line-height: 1.0; font-weight: 400;
    letter-spacing: 2px; margin-bottom: 20px; color: #eaf6ff;
}
.slide-desc {
    font-size: 16px; line-height: 1.7; font-weight: 300; color: #cbd5e1; letter-spacing: 0.5px;
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    transition-delay: 0.4s;
}
.slide.active .slide-desc { opacity: 1; transform: translateY(0); }

.slide-title .char {
    display: inline-block; opacity: 0; transform: translateY(50px); filter: blur(12px);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), filter 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}
.slide.active .slide-title .char { opacity: 1; transform: translateY(0); filter: blur(0); }
.slide.active { pointer-events: auto; }

/* ═══ Story Dashes (Sidebar) ═══ */
.story-dashes {
    position: fixed; top: 50%; right: 60px; transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 14px;
    align-items: flex-end;
    z-index: 10;
    pointer-events: auto;
}
.story-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    pointer-events: auto;
}
.story-label {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: color 0.4s ease;
    white-space: nowrap;
}
.story-item:hover .story-label { color: rgba(255, 255, 255, 0.6); }
.story-item.active .story-label { color: #7fd8ff; }
.story-dash { width: 2px; height: 40px; background: rgba(255, 255, 255, 0.15); border-radius: 2px; position: relative; display: block; }
.story-dash-fill { width: 100%; height: 0%; background: #7fd8ff; border-radius: 2px; display: block; }

/* ═══ Grid Lines ═══ */
.grid-horizontal-line {
    position: fixed; top: 70px; left: 0; right: 0; width: 100%; height: 1px;
    background: rgba(255, 255, 255, 0.12); z-index: 5; pointer-events: none;
}
.grid-lines {
    position: fixed; top: 0; left: 40px; right: 40px; width: calc(100% - 80px);
    height: 100vh; display: flex; justify-content: space-between; z-index: 5; pointer-events: none;
}
.grid-line {
    position: relative; width: 1px; height: 100%; background: rgba(255, 255, 255, 0.12);
}
.grid-line:nth-child(3) { margin-top: 70px; height: calc(100vh - 70px); }
.grid-dot {
    position: absolute; left: 50%; transform: translate(-50%, -50%);
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(120, 200, 255, 0.4);
    box-shadow: 0 0 4px rgba(120, 200, 255, 0.2);
}

/* ═══ Loading ═══ */
#loading {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%; background: #000; z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
    color: #7fd8ff; font-family: 'Outfit', sans-serif;
    font-size: 14px; letter-spacing: 2px; text-transform: uppercase;
    transition: opacity 0.6s ease;
}
#loading.fade-out { opacity: 0; }
#loading.error { color: #ff6b6b; }
.load-bar {
    width: 200px; height: 2px;
    background: rgba(127, 216, 255, 0.15);
    border-radius: 1px; overflow: hidden;
}
.load-bar-fill {
    width: 100%; height: 100%;
    background: #7fd8ff;
    border-radius: 1px;
    animation: loadSlide 1.6s ease-in-out infinite;
}
@keyframes loadSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ═══ Model Error State ═══ */
.model-error-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; z-index: 9998;
    display: none; align-items: center; justify-content: center;
    pointer-events: none;
}

/* ═══ Footer ═══ */
.footer-credit {
    position: fixed; bottom: 40px; right: 60px; z-index: 10;
    font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
    color: rgba(255, 255, 255, 0.25); pointer-events: none;
    font-weight: 300;
}

/* ═══ Responsive ═══ */
@media (max-width: 1024px) {
    .cinematic-container { padding: 0 30px 30px 30px; }
    .slide-title { font-size: 72px; }
    #slide-1 .slide-title { margin-left: 30px; }
    #slide-1 .col-1 { margin-left: 30px; width: calc(35vw - 30px); max-width: calc(35vw - 30px); }
    #slide-1 .col-2 { left: calc(35vw + 30px); width: calc(35vw - 30px); max-width: calc(35vw - 30px); }
    #slide-2 .slide-title { margin-left: calc(25vw + 30px); }
    #slide-2 .slide-desc { margin-left: calc(40vw + 20px); width: calc(35vw - 40px); max-width: calc(35vw - 40px); }
    #slide-2-img { left: 30px; width: calc(25vw - 30px); }
    #slide-3 { left: calc(40vw + 20px); width: calc(35vw - 30px); max-width: calc(35vw - 30px); }
    #slide-4 { left: calc(20% + 30px); max-width: 500px; }
    .grid-lines { left: 30px; right: 30px; width: calc(100% - 60px); }
    .footer-credit { right: 30px; bottom: 30px; font-size: 9px; }
}

@media (max-width: 768px) {
    .cinematic-container { padding: 0 20px 24px 20px; }
    .slide-title { font-size: 48px; }
    .slide-desc { font-size: 14px; }
    #slide-1 .slide-title { margin-left: 0; }
    #slide-1 .desc-row { flex-direction: column; }
    #slide-1 .col-1 { margin-left: 0; width: calc(100% - 60px); max-width: calc(100% - 60px); margin-bottom: 12px; }
    #slide-1 .col-2 { position: relative; left: 0; width: calc(100% - 60px); max-width: calc(100% - 60px); }
    #slide-2 .slide-title { margin-left: 0; padding-right: 60px; }
    #slide-2 .slide-desc { margin-left: 0; width: calc(100% - 60px); max-width: calc(100% - 60px); margin-top: 12px; }
    #slide-2-img { display: none; }
    #slide-3 { left: 0; width: calc(100% - 60px); max-width: 100%; bottom: 8%; }
    #slide-3 .slide-title { white-space: normal; }
    #slide-4 { left: 0; max-width: calc(100% - 60px); bottom: 8%; }
    .slide { bottom: 6%; }
    .main-header { flex-wrap: nowrap; gap: 8px; align-items: center; }
    .hamburger { display: flex; }
    .header-nav {
        position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column; align-items: center; justify-content: center;
        gap: 28px; z-index: 50;
        opacity: 0; visibility: hidden; pointer-events: none;
        transition: opacity 0.35s ease, visibility 0.35s ease;
    }
    .header-nav.active { opacity: 1; visibility: visible; pointer-events: auto; }
    .nav-link { font-size: 18px; letter-spacing: 3px; }
    .nav-dot { display: none; }
    .contact-btn { padding: 8px 16px; font-size: 9px; white-space: nowrap; }
    .grid-lines { left: 20px; right: 20px; width: calc(100% - 40px); }
    .grid-line:nth-child(4),
    .grid-line:nth-child(5) { display: none; }
    .footer-credit { right: 20px; bottom: 20px; font-size: 8px; max-width: calc(100% - 100px); text-align: right; }
    .story-dashes { right: 16px; gap: 12px; }
    .story-label { font-size: 11px; letter-spacing: 1px; }
    .story-dash { height: 32px; }
    .modal-panel { padding: 32px 24px 28px; max-width: 94vw; max-height: 85vh; }
    .modal-title { font-size: 26px; }
    .modal-scroll { padding-right: 4px; }
}

@media (max-width: 480px) {
    .slide-title { font-size: 38px; margin-bottom: 14px; }
    .slide-desc { font-size: 13px; line-height: 1.6; }
    .brand { font-size: 11px; letter-spacing: 3px; }
    .header-nav { gap: 24px; }
    .nav-link { font-size: 16px; letter-spacing: 2px; }
    .cinematic-container { padding: 0 16px 20px 16px; }
    .grid-lines { left: 16px; right: 16px; width: calc(100% - 32px); }
    .grid-line:nth-child(2),
    .grid-line:nth-child(3),
    .grid-line:nth-child(4),
    .grid-line:nth-child(5) { display: none; }
    .grid-line:first-child { left: 0; }
    .story-dashes { right: 10px; gap: 10px; }
    .story-dash { height: 28px; }
    .story-label { font-size: 10px; letter-spacing: 1px; }
    .modal-panel { padding: 28px 18px 24px; max-width: 96vw; max-height: 88vh; border-radius: 0; }
    .modal-title { font-size: 22px; }
    .modal-desc { font-size: 13px; line-height: 1.6; }
    .modal-corner-tl, .modal-corner-tr, .modal-corner-bl, .modal-corner-br { width: 12px; height: 12px; }
    .footer-credit { right: 12px; bottom: 16px; font-size: 7px; letter-spacing: 1px; max-width: calc(100% - 80px); }
    #slide-1 .col-1, #slide-1 .col-2 { width: calc(100% - 50px); max-width: calc(100% - 50px); }
    #slide-2 .slide-title, #slide-2 .slide-desc { padding-right: 50px; width: calc(100% - 50px); max-width: calc(100% - 50px); }
    #slide-3, #slide-4 { width: calc(100% - 50px); max-width: calc(100% - 50px); }
    .slide { bottom: 7%; }
    .header-actions { gap: 4px; }
}

/* ═══ Small screens: contact button into burger menu ═══ */
@media (max-width: 500px) {
    .contact-btn { display: none !important; }
    .header-nav .nav-contact { display: block; }
    .nav-contact {
        margin-top: 6px;
        padding: 10px 28px;
        border: 1px solid rgba(120, 200, 255, 0.35);
        border-radius: 20px;
        color: #7fd8ff !important;
        letter-spacing: 2px;
        font-weight: 400;
        transition: background 0.3s, color 0.3s;
    }
    .nav-contact:hover { background: rgba(120, 200, 255, 0.1); color: #eaf6ff !important; }
    .story-label { display: none; }
    .slide { padding-left: 15px; padding-bottom: 15px; }
}

/* ═══ Reduced Motion ═══ */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .slide-title .char { opacity: 1; transform: none; filter: none; }
    .slide-desc { opacity: 1; transform: none; }
}

/* ═══ Landscape orientation for mobile ═══ */
@media (max-width: 900px) and (orientation: landscape) {
    .slide-title { font-size: 42px; }
    .slide-desc { font-size: 12px; line-height: 1.5; }
    .cinematic-container { padding: 0 24px 12px 24px; }
    .slide { bottom: 4%; }
    #slide-1 .desc-row { flex-direction: row; gap: 16px; }
    #slide-1 .col-1, #slide-1 .col-2 { width: calc(45% - 30px); max-width: calc(45% - 30px); margin-bottom: 0; }
    #slide-1 .col-2 { position: relative; left: 0; }
    .story-dashes { right: 16px; gap: 6px; }
    .story-dash { height: 22px; }
    .story-label { font-size: 9px; }
    .footer-credit { bottom: 10px; right: 16px; font-size: 7px; }
    .modal-panel { max-height: 92vh; padding: 24px 20px 20px; }
    .modal-title { font-size: 22px; margin-bottom: 10px; }
    .modal-divider { margin: 12px 0; }
    #slide-2-img { display: none; }
    .grid-horizontal-line { top: 60px; }
    .grid-line:nth-child(2),
    .grid-line:nth-child(3),
    .grid-line:nth-child(4) { display: none; }
}

/* ═══ Very small screens ═══ */
@media (max-width: 360px) {
    .slide-title { font-size: 32px; margin-bottom: 10px; }
    .slide-desc { font-size: 12px; line-height: 1.5; }
    .cinematic-container { padding: 0 12px 16px 12px; }
    .grid-lines { left: 12px; right: 12px; width: calc(100% - 24px); }
    .story-dashes { right: 6px; gap: 8px; }
    .story-dash { height: 24px; }
    .story-label { font-size: 9px; letter-spacing: 0.5px; }
    .modal-panel { padding: 22px 14px 20px; }
    .modal-title { font-size: 20px; }
    .modal-desc { font-size: 12px; }
    .footer-credit { right: 8px; bottom: 12px; font-size: 6px; letter-spacing: 0.5px; max-width: calc(100% - 60px); }
    .brand { font-size: 10px; letter-spacing: 2px; }
    .contact-btn { padding: 6px 12px; font-size: 8px; }
    #slide-1 .col-1, #slide-1 .col-2 { width: calc(100% - 36px); max-width: calc(100% - 36px); }
    #slide-2 .slide-title, #slide-2 .slide-desc { padding-right: 36px; width: calc(100% - 36px); max-width: calc(100% - 36px); }
    #slide-3, #slide-4 { width: calc(100% - 36px); max-width: calc(100% - 36px); }
}