/* ===========================
   ROOT & VARIABLES
   =========================== */
:root {
    --text-color: #1a1a1a;
    --light-gray: #f5f5f5;
    --border-gray: #e0e0e0;
}

/* ===========================
   RESET & BASE STYLES
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    background-color: #0a0a0a;
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden;
}


/* ===========================
   CONTAINER
   =========================== */
main {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===========================
   HEADER INTRO ANIMATION
   =========================== */
#header-intro-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.6s ease;
}

#header-intro-canvas.done {
    opacity: 0;
}

/* Header elements start invisible; JS reveals them after scatter resolves */
.header-intro-hidden {
    opacity: 0 !important;
    transition: opacity 0.5s ease !important;
}

.header-intro-visible {
    opacity: 1 !important;
}

/* ===========================
   HEADER
   =========================== */
.header {
    padding: 8vh 0 6vh;
    position: relative;
    will-change: transform;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.profile-pic {
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.header-text {
    display: flex;
    flex-direction: column;
}

.header h1 {
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 200;
    letter-spacing: -0.03em;
    margin-bottom: 0.4rem;
    line-height: 1.0;
    color: #f0ede8;
}

.subtitle {
    font-size: 1rem;
    color: #888;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

/* ===========================
   SOCIAL LINKS
   =========================== */
.social-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #555;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    text-decoration: none;
}

.social-link:hover {
    color: #f0ede8;
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.07);
}

.social-link svg {
    width: 16px;
    height: 16px;
}

/* ===========================
   PROJECT CARDS (inside gallery grid)
   =========================== */
.project-card {
    overflow: visible;
    aspect-ratio: 2 / 1;
    cursor: pointer;
}


.project-card-inner {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(4px);
    position: relative;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.project-card-inner:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.15);
}

.project-card-inner:hover .project-github {
    color: #f0ede8;
}

.project-github {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    display: inline-flex;
    align-items: center;
    color: #555;
    transition: color 0.2s ease;
}

.project-github svg {
    width: 18px;
    height: 18px;
}

.project-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: auto;
}

.project-subtitle {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #555;
    font-weight: 500;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 300;
    color: #f0ede8;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.project-desc {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
}

/* ===========================
   BIO SECTION
   =========================== */
.bio-section {
    padding: 3rem 0 4rem;
    display: flex;
    justify-content: center;
}

.bio-points {
    list-style: none;
    text-align: left;
    display: inline-flex;
    flex-direction: column;
    gap: 0;
    max-width: 520px;
}

.bio-points li {
    font-size: 1rem;
    margin-bottom: 1.2rem;
    color: #aaa;
    line-height: 1.7;
    position: relative;
    padding: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.bio-points li.visible {
    opacity: 1;
    transform: translateY(0);
}

.bio-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: #555;
}

/* ===========================
   GALLERY SECTION
   =========================== */
.gallery-section {
    padding: 2rem 0 12rem;
}

/* Grid layout — left-to-right row order */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 3rem;
}

/* Each wrapper handles the parallax + reveal */
.gallery-item-wrap {
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    aspect-ratio: 2 / 1;

    /* Reveal initial state */
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.5s ease;
}

.gallery-item-wrap.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Size variants — assigned via JS */
.gallery-item-wrap.size-tall {
    /* naturally taller image */
}

.gallery-item-wrap:hover {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    z-index: 2;
}

.gallery-item {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    transform-origin: center center;
}

.gallery-item-wrap:hover .gallery-item {
    transform: scale(1.05);
}


/* ===========================
   LIGHTBOX
   =========================== */
#lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, background 0.35s ease;
}

#lightbox.open {
    opacity: 1;
    pointer-events: all;
    background: rgba(0, 0, 0, 0.92);
}

#lightbox-img {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
}

.lightbox-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f0ede8;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
}

#lightbox.open .lightbox-btn {
    opacity: 1;
    pointer-events: all;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
}

#lightbox-prev { left: 1.5rem; }
#lightbox-next { right: 1.5rem; }

.lightbox-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

#lightbox-close {
    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f0ede8;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
}

#lightbox.open #lightbox-close {
    opacity: 1;
    pointer-events: all;
}

#lightbox-close:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
}

#lightbox-close svg {
    width: 16px;
    height: 16px;
}

#lightbox-counter {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: #555;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

#lightbox.open #lightbox-counter {
    opacity: 1;
}

#lightbox-copyright {
    position: fixed;
    bottom: 3.2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: #444;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    white-space: nowrap;
}

#lightbox.open #lightbox-copyright {
    opacity: 1;
}

/* ===========================
   PROJECT DETAIL MODAL
   =========================== */
#project-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, background 0.35s ease;
}

#project-modal.open {
    opacity: 1;
    pointer-events: all;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.project-modal-inner {
    display: grid;
    grid-template-columns: 1fr 2fr;
    width: min(960px, 100%);
    max-height: 85vh;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    will-change: transform;
}

.project-modal-image {
    position: relative;
    overflow: hidden;
    background: #0d0d0d;
    min-height: 360px;
}

.project-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.85;
}

.project-modal-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    background: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,0.015) 0px,
        rgba(255,255,255,0.015) 1px,
        transparent 1px,
        transparent 24px
    );
}

.project-modal-image-placeholder svg {
    width: 36px;
    height: 36px;
    color: #2a2a2a;
}

.project-modal-content {
    padding: 2.5rem 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
}

.project-modal-tags {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #555;
    font-weight: 500;
}

.project-modal-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 200;
    color: #f0ede8;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.project-modal-desc {
    font-size: 0.95rem;
    color: #888;
    line-height: 1.75;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 1.25rem;
}

.project-modal-longdesc {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.8;
}

.project-modal-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.project-modal-github-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #f0ede8;
    text-decoration: none;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.project-modal-github-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.project-modal-github-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

#project-modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f0ede8;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
}

#project-modal.open #project-modal-close {
    opacity: 1;
    pointer-events: all;
}

#project-modal-close:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
}

#project-modal-close svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 640px) {
    .project-modal-inner {
        grid-template-columns: 1fr;
        max-height: 90vh;
    }
    .project-modal-image {
        min-height: 200px;
        max-height: 220px;
    }
    .project-modal-image-placeholder {
        min-height: 200px;
    }
    .project-modal-content {
        padding: 1.5rem;
    }
}

/* ===========================
   FOOTER
   =========================== */
.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.site-footer p {
    font-size: 0.75rem;
    color: #444;
    letter-spacing: 0.05em;
    line-height: 1.6;
}

/* ===========================
   CUSTOM CURSOR
   =========================== */
body.has-custom-cursor * {
    cursor: none !important;
}

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

#cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(240, 237, 232, 0.45);
    border-radius: 9999px;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: border-color 0.25s ease, opacity 0.3s ease;
    opacity: 0;
}

body.has-custom-cursor.cursor-active #cursor-dot,
body.has-custom-cursor.cursor-active #cursor-ring {
    opacity: 1;
}

/* Ring expands on hoverable elements (size controlled by JS) */
body.has-custom-cursor.cursor-hover #cursor-ring {
    border-color: rgba(240, 237, 232, 0.25);
}

body.has-custom-cursor.cursor-hover #cursor-dot {
    width: 4px;
    height: 4px;
}

/* Ring shrinks on click */
body.has-custom-cursor.cursor-click #cursor-ring {
    width: 24px;
    height: 24px;
    border-color: rgba(240, 237, 232, 0.7);
}

/* ===========================
   DOT GRID CANVAS
   =========================== */
#dot-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

