/* ==========================================================================
   1. CSS VARIABLES & THEME CONFIGURATION
   ========================================================================== */
:root {
    /* Color Palette: Deep darks and rich reds. Zero papaya/orange. */
    --bg-base: #070505;
    --bg-surface: #120909;
    --bg-surface-alt: #1a0c0d;

    --accent-primary: #6e0d16;
    --accent-hover: #8f111c;
    --accent-muted: #3d070b;

    --text-main: #f0eaea;
    --text-secondary: #a69a9a;
    --text-dark: #070505;

    --border-subtle: rgba(110, 13, 22, 0.3);
    --border-heavy: #3d070b;

    /* Typography Configuration */
    --font-display: 'Melodrama', serif;
    --font-body: 'General Sans', sans-serif;

    /* Fluid Typography Sizes */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --text-lg: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    --text-2xl: clamp(2rem, 1.6rem + 2vw, 3rem);
    --text-3xl: clamp(2.5rem, 1.8rem + 3.5vw, 4.5rem);
    --text-huge: clamp(3rem, 2rem + 6vw, 7rem);

    /* Naive Design Shapes (Hand-drawn feel via complex border-radii) */
    --shape-blob-1: 60% 40% 30% 70% / 60% 30% 70% 40%;
    --shape-blob-2: 30% 70% 70% 30% / 30% 30% 70% 70%;
    --shape-box-1: 255px 15px 225px 15px/15px 225px 15px 255px;
    --shape-box-2: 15px 225px 15px 255px/255px 15px 225px 15px;
    --shape-button: 12px 24px 10px 30px / 20px 10px 25px 15px;

    /* Z-Index Layers */
    --z-back: -10;
    --z-normal: 1;
    --z-nav: 100;
    --z-cursor: 1001;
    --z-modal: 1000;
}

/* ==========================================================================
   2. RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: none !important;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

::selection {
    background-color: var(--accent-primary);
    color: var(--text-main);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.1;
    color: var(--text-main);
}

a {
    color: inherit;
    text-decoration: none;
}

img, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

ul {
    list-style: none;
}

.wrapper {
    width: 92%;
    max-width: 1600px;
    margin: 0 auto;
}

/* ==========================================================================
   3. CUSTOM CURSOR
   ========================================================================== */
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-primary);
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-cursor);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background-color 0.3s;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent-primary);
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-cursor);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, border-color 0.3s;
}

body.hovering .cursor-dot {
    width: 50px;
    height: 50px;
    background-color: var(--text-main);
    mix-blend-mode: difference;
}
body.hovering .cursor-outline {
    width: 60px;
    height: 60px;
    border-color: transparent;
}

/* ==========================================================================
   4. NAVIGATION
   ========================================================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: var(--z-nav);
    transition: all 0.4s ease;
    background: linear-gradient(to bottom, var(--bg-base) 60%, transparent 100%);
}

header.scrolled {
    padding: 1rem 0;
    background-color: rgba(7, 5, 5, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-heavy);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-main);
    position: relative;
    z-index: 2;
}

.brand-logo span {
    color: var(--accent-primary);
    font-style: italic;
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    font-size: var(--text-base);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    overflow: hidden;
    display: inline-block;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent-primary);
    transform: translateX(-101%);
    transition: transform 0.4s cubic-bezier(0.86, 0, 0.07, 1);
}

.nav-link:hover::before {
    transform: translateX(0);
}

/* ==========================================================================
   5. HERO SECTION & PARALLAX DECORATIONS
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    overflow: hidden;
}

.bg-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-back);
    pointer-events: none;
}

.blob-1 {
    position: absolute;
    top: 15%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-muted) 0%, transparent 70%);
    opacity: 0.4;
    border-radius: var(--shape-blob-1);
    animation: float 20s ease-in-out infinite alternate;
}

.blob-2 {
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, #1f080a 0%, transparent 70%);
    opacity: 0.5;
    border-radius: var(--shape-blob-2);
    animation: float 25s ease-in-out infinite alternate-reverse;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
    z-index: var(--z-normal);
}

.hero-content h1 {
    font-size: var(--text-huge);
    line-height: 0.9;
    margin-bottom: 2rem;
    position: relative;
}

.hero-content h1 em {
    color: var(--accent-primary);
    font-style: italic;
    display: inline-block;
    transform: rotate(-3deg);
}

.hero-description {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--bg-surface);
    color: var(--text-main);
    border: 2px solid var(--border-heavy);
    border-radius: var(--shape-button);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--accent-primary);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.86, 0, 0.07, 1);
}

.btn:hover {
    color: #fff;
    border-color: var(--accent-primary);
    transform: translateY(-4px) rotate(1deg);
}

.btn:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.hero-art-placeholder {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    background-color: var(--bg-surface);
    border-radius: var(--shape-box-1);
    border: 2px solid var(--border-heavy);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.hero-art-placeholder svg {
    width: 60%;
    height: 60%;
    stroke: var(--accent-primary);
    stroke-width: 1;
    fill: none;
    opacity: 0.5;
}

/* ==========================================================================
   6. SCROLLING MARQUEE
   ========================================================================== */
.marquee-section {
    padding: 3rem 0;
    border-top: 1px solid var(--border-heavy);
    border-bottom: 1px solid var(--border-heavy);
    background-color: var(--bg-surface-alt);
    overflow: hidden;
    display: flex;
    white-space: nowrap;
    transform: rotate(-1deg) scale(1.02);
    margin: 4rem 0;
}

.marquee-content {
    display: flex;
    animation: scrollText 30s linear infinite;
}

.marquee-item {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    margin: 0 2rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 2rem;
}

.marquee-item span {
    color: var(--accent-primary);
    font-size: 1.5rem;
}

/* ==========================================================================
   7. PORTFOLIO GRID (Asymmetrical Masonry)
   ========================================================================== */
.portfolio-section {
    padding: 8rem 0;
    position: relative;
}

.section-header {
    margin-bottom: 6rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.section-header h2 {
    font-size: var(--text-3xl);
    position: relative;
}

.section-header h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1rem;
    width: 60px;
    height: 4px;
    background-color: var(--accent-primary);
    border-radius: 4px;
}

.section-header p {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 400px;
    text-align: right;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 3rem;
}

.art-card {
    position: relative;
    border-radius: var(--shape-box-2);
    overflow: hidden;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-heavy);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateZ(0);
}

.art-card:nth-child(even) { border-radius: var(--shape-box-1); }
.art-card:nth-child(3n) { border-radius: 10px 40px 10px 40px / 40px 10px 40px 10px; }

/* Row 1: 5 + 7 */
.art-card:nth-child(1)  { grid-column: span 5; aspect-ratio: 3/4; }
.art-card:nth-child(2)  { grid-column: span 7; aspect-ratio: 3/4; margin-top: 3rem; }
/* Row 2: 4 + 4 + 4 */
.art-card:nth-child(3)  { grid-column: span 4; aspect-ratio: 1/1; }
.art-card:nth-child(4)  { grid-column: span 4; aspect-ratio: 1/1; }
.art-card:nth-child(5)  { grid-column: span 4; aspect-ratio: 1/1; }
/* Row 3: 6 + 6 */
.art-card:nth-child(6)  { grid-column: span 6; aspect-ratio: 3/4; }
.art-card:nth-child(7)  { grid-column: span 6; aspect-ratio: 3/4; }
/* Row 4: 7 + 5 */
.art-card:nth-child(8)  { grid-column: span 7; aspect-ratio: 3/4; margin-top: 3rem; }
.art-card:nth-child(9)  { grid-column: span 5; aspect-ratio: 3/4; }
/* Row 5: 4 + 4 + 4 */
.art-card:nth-child(10) { grid-column: span 4; aspect-ratio: 1/1; }
.art-card:nth-child(11) { grid-column: span 4; aspect-ratio: 1/1; }
.art-card:nth-child(12) { grid-column: span 4; aspect-ratio: 1/1; }
/* Row 6: 5 + 7 */
.art-card:nth-child(13) { grid-column: span 5; aspect-ratio: 3/4; }
.art-card:nth-child(14) { grid-column: span 7; aspect-ratio: 3/4; margin-top: 3rem; }
/* Row 7: 6 + 6 */
.art-card:nth-child(15) { grid-column: span 6; aspect-ratio: 3/4; }
.art-card:nth-child(16) { grid-column: span 6; aspect-ratio: 3/4; }

.art-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
}

.art-card .img-bg {
    width: 100%;
    height: 100%;
    background-color: #160a0a;
    background-image: radial-gradient(circle at center, #260f12 0%, #0d0404 100%);
    background-size: cover;
    background-position: center;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.art-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(7,5,5,0.9) 0%, transparent 60%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.art-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    transform: scale(1.02) rotate(-0.5deg);
}

.art-card:hover .img-bg {
    transform: scale(1.08);
}

.art-card:hover .art-overlay {
    opacity: 1;
    transform: translateY(0);
}

.art-title {
    font-size: var(--text-2xl);
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.art-category {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.85;
}

/* ==========================================================================
   8. ABOUT / BIOGRAPHY SECTION
   ========================================================================== */
.about-section {
    padding: 10rem 0;
    position: relative;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
}

.about-visual {
    position: relative;
}

.portrait-box {
    width: 100%;
    aspect-ratio: 3/4;
    background-color: var(--accent-muted);
    border-radius: var(--shape-box-2);
    border: 1px solid var(--border-heavy);
    position: relative;
    z-index: 2;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}


.about-copy h2 {
    font-size: var(--text-3xl);
    margin-bottom: 2rem;
}

.about-copy p {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.about-copy p strong {
    color: var(--text-main);
    font-weight: 500;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.social-btn {
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* ==========================================================================
   9. FOOTER
   ========================================================================== */
footer {
    background-color: var(--bg-surface-alt);
    padding: 6rem 0 2rem;
    border-top: 1px solid var(--border-heavy);
    border-radius: 60px 60px 0 0 / 20px 20px 0 0;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand h3 {
    font-size: var(--text-2xl);
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.footer-links h4 {
    font-size: var(--text-lg);
    margin-bottom: 1.5rem;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-heavy);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* ==========================================================================
   10. LIGHTBOX MODAL
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(7, 5, 5, 0.98);
    z-index: var(--z-modal);
    display: flex;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    backdrop-filter: blur(10px);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    width: 95%;
    max-width: 1400px;
    margin: auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-heavy);
    border-radius: var(--shape-box-1);
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-visual {
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 400px;
}

.modal-img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.modal-content {
    padding: 4rem 3rem 4rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-title {
    font-size: var(--text-3xl);
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.modal-desc {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.8;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    color: var(--text-main);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: rotate(90deg);
}

.modal-nav {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-heavy);
}

.modal-nav button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
}

.modal-nav button:hover {
    color: var(--accent-primary);
}

/* ==========================================================================
   11. ANIMATIONS & MEDIA QUERIES
   ========================================================================== */
@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    100% { transform: translate(30px, 50px) rotate(10deg) scale(1.05); }
}

@keyframes scrollText {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   12. HAMBURGER NAV
   ========================================================================== */

/* Hamburger button — hidden on desktop */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 0.5rem;
    position: relative;
    z-index: 2;
}

.nav-toggle span {
    display: block;
    width: 28px;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Bars animate to X when open */
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; transform: scaleX(0); }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile overlay — sits OUTSIDE the header in the DOM so z-index 99 is below header's 100 */
.nav-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    background-color: var(--bg-base);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.nav-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nav-link--large {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
}

@media (max-width: 1024px) {
    /* Hide desktop inline nav, show hamburger */
    .nav-menu { display: none; }
    .nav-toggle { display: flex; }

    /* Always show card title/category on mobile — no cursor to hover */
    .art-overlay {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .grid-container { display: flex; flex-direction: column; gap: 2rem; }
    .art-card { aspect-ratio: 4/3 !important; margin: 0 !important; }
    .hero-grid, .about-grid, .modal-container, .footer-grid { grid-template-columns: 1fr; }
    .modal-content { padding: 1.25rem 1.25rem 1.5rem; }
    .modal-container { max-height: 90vh; overflow-y: auto; gap: 0; }
    .modal-img { max-height: 45vh; }
    .modal-visual { min-height: unset; }
    .modal-title { margin-bottom: 0.5rem; }
    .modal-desc { margin-bottom: 1.25rem; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .section-header p { text-align: left; }

    /* Hide custom cursor on touch devices */
    .cursor-dot, .cursor-outline { display: none; }
    * { cursor: auto !important; }
}
