/* ============================================
   GLOBAL RESET & BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg:        #0d0d1f;
    --bg-alt:    #111128;
    --bg-card:   #16162a;
    --border:    rgba(255,255,255,0.08);
    --accent:    #ff6d4a;
    --accent-dark: #e0522e;
    --text:      #f0f0f5;
    --text-muted:#9090a8;
    --font:      'Inter', system-ui, -apple-system, sans-serif;
    --radius:    12px;
    --max-w:     1200px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   NAVIGATION
   ============================================ */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 13, 31, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 2rem;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links a.nav-cta {
    background: var(--accent);
    color: #fff;
    padding: 0.45rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.nav-links a.nav-cta:hover {
    background: var(--accent-dark);
    color: #fff;
    transform: translateY(-1px);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.75rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 109, 74, 0.35);
}

.btn-secondary {
    display: inline-block;
    background: transparent;
    color: var(--text);
    padding: 0.75rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.btn-secondary:hover {
    border-color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.06);
    transform: translateY(-2px);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    position: relative;
    min-height: 88vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 6rem 2rem;
    background: var(--bg);
}

/* Dot grid background texture */
.hero-bg-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

/* Subtle radial glow behind headline */
.hero::before {
    content: '';
    position: absolute;
    top: 10%;
    left: -10%;
    width: 70%;
    height: 80%;
    background: radial-gradient(ellipse at center, rgba(255,109,74,0.08) 0%, transparent 65%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: var(--max-w);
    margin: 0 auto;
    width: 100%;
}

.hero-eyebrow {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.hero-content h1 {
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.hero-highlight {
    color: var(--accent);
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    letter-spacing: 0.02em;
}

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

/* ============================================
   SECTION SHARED STYLES
   ============================================ */
.section {
    padding: 6rem 2rem;
}

.section-alt {
    background: var(--bg-alt);
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
}

.section-label {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(255,109,74,0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255,109,74,0.2);
}

.section h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 2rem;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-body {
    max-width: 760px;
}

.about-body p {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* ============================================
   PROJECTS GRID
   ============================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-card:hover {
    border-color: rgba(255,109,74,0.35);
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

.card-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(255,109,74,0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    width: fit-content;
    border: 1px solid rgba(255,109,74,0.2);
}

.project-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.project-card p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.7;
    flex: 1;
}

.project-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: gap 0.2s, opacity 0.2s;
    margin-top: 0.5rem;
}

.project-link:hover {
    gap: 0.6rem;
    opacity: 0.85;
}

/* ============================================
   PHOTOGRAPHY GRID
   ============================================ */
/* Heading row: title on the left, portfolio button on the right */
.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-heading-row h2 {
    margin-bottom: 0;
}

.portfolio-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s, gap 0.2s;
}

.portfolio-btn:hover {
    gap: 0.7rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-top: 2.5rem;
}

.photo-grid-wide {
    margin-top: 1rem;
}

.photo-item {
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.photo-item-wide {
    aspect-ratio: 3/2;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.photo-item img,
.photo-item-wide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.photo-item:hover img,
.photo-item-wide:hover img {
    transform: scale(1.05);
}

/* ============================================
   PORTFOLIO PAGE
   ============================================ */
.portfolio-header {
    padding-top: 8rem;   /* clear the fixed nav */
    padding-bottom: 1rem;
}

.portfolio-intro {
    max-width: 640px;
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.portfolio-section {
    padding-top: 2rem;
}

/* Masonry layout: columns adapt to screen width automatically.
   Portrait and landscape shots keep their natural ratio and pack
   together with minimal blank space, on both desktop and phone. */
.portfolio-masonry {
    column-width: 320px;
    column-gap: 1rem;
}

.portfolio-item {
    position: relative;
    break-inside: avoid;
    margin: 0 0 1rem;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.portfolio-item img {
    width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
    transition: transform 0.4s ease;
}

.portfolio-item:hover img {
    transform: scale(1.03);
}

/* Per-image download button (native long-press still works on mobile) */
.portfolio-download {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-decoration: none;
    background: rgba(13,13,31,0.6);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s, transform 0.2s, background 0.2s;
}

.portfolio-item:hover .portfolio-download,
.portfolio-download:focus {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-download:hover {
    background: var(--accent);
}

/* On touch devices there's no hover — keep the button visible */
@media (hover: none) {
    .portfolio-download {
        opacity: 1;
        transform: none;
    }
}

.portfolio-empty {
    color: var(--text-muted);
    font-size: 1rem;
    padding: 2rem 0;
}

.portfolio-empty code {
    background: var(--bg-card);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 0.9em;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    padding: 2rem;
    background: rgba(5,5,12,0.92);
    backdrop-filter: blur(6px);
}

.lightbox[hidden] { display: none; }

.lightbox img {
    max-width: 92vw;
    max-height: 78vh;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.lightbox-close {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.4rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-download {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.65rem 1.6rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.lightbox-download:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

/* ============================================
   CV SECTION
   ============================================ */
.cv-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 1rem;
    align-items: start;
}

.cv-group-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.cv-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.cv-item:last-child {
    border-bottom: none;
}

.cv-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}

.cv-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.cv-date {
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
    background: rgba(255,109,74,0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    border: 1px solid rgba(255,109,74,0.2);
}

.cv-org {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.cv-item p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-top: 0.3rem;
}

.cv-download-wrap {
    margin-top: 3rem;
    text-align: center;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-section {
    position: relative;
    text-align: center;
    overflow: hidden;
}

.contact-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(255,109,74,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.contact-inner {
    position: relative;
}

.contact-sub {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 2rem;
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-logo {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .cv-columns {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }

    .nav-links li:not(:last-child) a {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: 5rem 1.5rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .section {
        padding: 4rem 1.5rem;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }
}
