/* Root Variables */
:root {
    /* Palette (off-black, white, brownish-yellow highlight) */
    --primary-color: #0b0b0b; /* off-black */
    --secondary-color: #ffffff; /* white */
    --accent-color: #caa15a; /* brighter brownish-yellow */
    --accent-foreground: #ffffff;

    --text-dark: #111111;
    --text-light: #ffffff;
    --muted: #9a9a9a;

    --bg-light: #f5f5f5;
    --bg-dark: #070707;

    /* UI tokens */
    --card-bg: #0f0f0f;
    --radius: 8px;
    --shadow: 0 12px 30px rgba(2,2,2,0.6);

    --header-height: 72px;
    --header-height-compact: 56px;

    --transition-fast: 150ms ease;
    --transition: all 0.3s ease;
    --spacing: 2rem;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgb(0, 0, 0);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transform: translateY(0);
    transition: transform 320ms cubic-bezier(.2,.9,.2,1), background 220ms ease, padding 220ms ease;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}
.site-header.header-hidden { transform: translateY(-120%); }
.site-header.shrink { padding: 0.4rem 1.2rem; background: rgba(0,0,0,0.55); }
.site-header.shrink .logo { font-size: 1rem; }
.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-foreground);
    letter-spacing: 0.5px;
}
.top-nav {
    display: flex;
    gap: 1.25rem;
}
.top-nav .nav-link {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: background 0.18s ease, transform 0.18s ease;
}
.top-nav .nav-link:hover {
    background: rgba(255,255,255,0.06);
    transform: translateY(-2px);
}


/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    background: var(--primary-color);
    color: var(--text-light);
    padding: 1rem 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-light);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    margin: 5px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a1a1a 100%);
    color: var(--text-light);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-content {
    max-width: 600px;
    animation: fadeInUp 1s ease;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -1px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

/* Buttons */
.cta-button {
    background: var(--accent-color);
    color: var(--text-light);
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.cta-button:hover {
    background: #b88a52;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(202, 161, 90, 0.2);
}

/* Portfolio Section */
.portfolio {
    padding: 5rem 0;
    /* darker modern background so project tiles stand out */
    background: linear-gradient(180deg, var(--bg-dark) 0%, #0b0b0b 100%);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 700;
    color: var(--text-dark);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.9rem;
    padding: 1.25rem;
    max-width: 1400px;
    margin: var(--header-height) auto 0 auto;
    height: calc(100vh - var(--header-height) - 2.5rem);
    animation: fadeIn 0.6s ease;
    box-sizing: border-box;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    box-shadow: 0 6px 30px rgba(6,6,6,0.15);
    transition: transform 0.4s cubic-bezier(.2,.9,.2,1), box-shadow 0.3s;
}

.portfolio-item:hover {
    transform: scale(1.03);
    box-shadow: 0 18px 40px rgba(10,10,10,0.2);
}

/* Raised variant removed: no vertical nudging for the first tile */
/* (Keeping the class available for future use but no transform applied.) */
.portfolio-item.raised .portfolio-item-media {
    transform: none;
    transition: transform 0.45s ease;
}

/* Hover preview floating box (appears above tile on hover)
   The preview is pointer-events:none so clicks fall through to the tile anchor.
*/
.hover-preview {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) scale(.98);
    width: min(420px, 95%);
    height: calc(min(420px, 95%) * 0.5625); /* 16:9 */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    opacity: 0;
    transition: opacity 180ms ease, transform 180ms ease;
    z-index: 60;
    pointer-events: none;
}
.hover-preview.visible { opacity: 1; transform: translateX(-50%) scale(1); }
.hover-preview iframe,
.hover-preview video { width: 100%; height: 100%; display: block; border: 0; }
.hover-preview iframe { pointer-events: none; }

/* Video preview inside a portfolio tile (project 2) */
.portfolio-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}
.portfolio-video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none; /* allow anchor clicks to pass through */
}

/* Thumbnail wrapper and play button inside a tile */
.portfolio-thumb-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}
.portfolio-thumb-wrapper .portfolio-item-media {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.play-button {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    border: 2px solid rgba(255,255,255,0.08);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 220ms ease;
}
.portfolio-item:hover .play-button {
    opacity: 1;
}
.play-button::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 12px solid #fff;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
}

/* Preview modal styles */
.preview-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.preview-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
}
.preview-modal-content {
    position: relative;
    width: min(1100px, 95%);
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    z-index: 2100;
}
.preview-modal-close {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 2200;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}
.preview-iframe-wrap { width: 100%; padding-bottom: 56.25%; height: 0; position: relative; }
.preview-iframe-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.portfolio-item-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(180deg,#ddd,#eee);
    display: block;
    transition: transform 0.6s ease;
}

.portfolio-item:hover .portfolio-item-media {
    transform: scale(1.06) translateZ(0);
}

.portfolio-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.55) 100%);
    opacity: 0;
    transition: opacity 220ms ease, transform 360ms cubic-bezier(.2,.9,.2,1);
    transform: translateY(8px);
}

.portfolio-item-content {
    padding: 1.5rem;
}

.portfolio-item-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.portfolio-overlay-title {
    color: var(--text-light);
    font-size: 1.6rem;
    font-weight: 800;
    text-align: center;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(90deg, rgba(0,0,0,0.45), rgba(10,10,10,0.25));
    border-radius: 999px;
    letter-spacing: 0.6px;
    transform: translateY(8px);
    transition: transform 320ms cubic-bezier(.2,.9,.2,1), opacity 220ms ease;
    opacity: 0;
}

.portfolio-overlay-meta {
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
    text-align: center;
    padding: 0.3rem 1rem;
    margin-top: 0.5rem;
    letter-spacing: 0.3px;
    transform: translateY(8px);
    transition: transform 320ms cubic-bezier(.2,.9,.2,1), opacity 220ms ease;
    opacity: 0;
    font-weight: 500;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
    transform: translateY(0);
}
.portfolio-item:hover .portfolio-overlay-title {
    transform: translateY(0);
    opacity: 1;
}
.portfolio-item:hover .portfolio-overlay-meta {
    transform: translateY(0);
    opacity: 1;
}

/* Modal styles */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    z-index: 1500;
}
.modal[aria-hidden="false"] {
    display: flex;
}
.modal-content {
    background: var(--bg-dark);
    color: var(--text-light);
    max-width: 720px;
    width: 94%;
    padding: 2rem;
    border-radius: 10px;
    position: relative;
    border: 1px solid rgba(255,255,255,0.08);
}
.modal-close {
    position: absolute;
    right: 12px;
    top: 12px;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
}
/* accessibility focus styles */
.modal:focus { outline: none; }
.modal-content :focus { outline: 3px solid var(--accent-color); outline-offset: 4px; }

/* About section below grid */
.about-section {
    background: linear-gradient(180deg, var(--bg-dark) 0%, #0a0a0a 100%);
    color: var(--text-light);
    padding: 4rem 1.5rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-photo {
    width: 100%;
    max-width: 450px;
    border-radius: 16px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.8);
    object-fit: cover;
    aspect-ratio: 3/4;
    transition: transform 0.6s cubic-bezier(.2,.9,.2,1);
}

.about-photo:hover {
    /* hover animation intentionally removed to keep layout stable */
    transform: none;
}

.about-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-light) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-content p {
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2rem;
}

.skills h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.skill-item {
    background: rgba(202, 161, 90, 0.1);
    border: 1px solid rgba(202, 161, 90, 0.28);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
    color: var(--text-light);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.skill-item:hover {
    /* no translate on hover to avoid movement; subtle color change only */
    background: rgba(202, 161, 90, 0.16);
    border-color: var(--accent-color);
}

/* Responsive */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        height: calc(100vh - var(--header-height-compact) - 2.5rem);
        margin-top: var(--header-height-compact);
    }
    .header-inner { padding: 0.7rem 1rem; }
    .site-header { display: flex; flex-direction: column; }
    
    .about-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-content h2 { font-size: 1.75rem; }
    .skills-grid { grid-template-columns: 1fr; }
}
/* Project detail page styles */
.project-detail {
    min-height: calc(100vh - var(--header-height));
    padding-top: calc(var(--header-height) + 1rem);
    color: var(--text-light);
    background: linear-gradient(180deg, var(--bg-dark), #0b0b0b);
}
.project-detail .content {
    max-width: 1100px;
    margin: 2rem auto 4rem auto;
    padding: 1.5rem;
}
.project-detail h1 { font-size: 2rem; margin-bottom: 0.75rem; }
.project-detail img {
    display: block;
    width: calc(100% - 4rem);
    max-width: 1200px;
    margin: 1.25rem auto;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.back-link {
    display: inline-block;
    color: var(--accent-foreground);
    background: rgba(255,255,255,0.04);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    margin: 1rem;
}
/* legacy vertical styles removed */



.contact .section-title {
    color: var(--text-light);
}

.contact-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-color);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Contact info link styling (matches project page link style) */
.contact-info a {
    color: var(--accent-foreground);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-foreground);
    transition: opacity 0.2s ease;
}
.contact-info a:hover { opacity: 0.8; }

/* Footer */
.portfolio-item {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.4s cubic-bezier(.2,.9,.2,1), box-shadow 0.3s;
    opacity: 0;
    transform: translateY(12px) scale(.995);
    animation: popIn 600ms cubic-bezier(.2,.9,.2,1) forwards;
    animation-delay: calc(var(--i, 0) * 90ms);
}
.portfolio-item:hover {
    transform: scale(1.03);
    box-shadow: 0 28px 60px rgba(2,2,2,0.6);
}

.portfolio-item-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(180deg,#0f0f0f,#141414);
    display: block;
    transition: transform 0.6s ease;
}

.portfolio-item:hover .portfolio-item-media {
    transform: scale(1.06) translateZ(0);
}

@keyframes popIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
}


/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--primary-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        padding: 1rem 0;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .about-content {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .cta-button {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }

    .container {
        padding: 0 1rem;
    }
}

/* Global footer */
.site-footer {
    text-align: center;
    color: rgba(255,255,255,0.65);
    padding: 1rem 1rem;
    font-size: 0.95rem;
    border-top: 1px solid rgba(255,255,255,0.04);
    margin-top: 2rem;
    background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.02));
}
.site-footer a {
    color: var(--accent-foreground);
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.site-footer a:hover { opacity: 0.9; }
