:root {
    --primary-blue: #0000FF;
    --accent-coral: #F07D58;
    --bg-dark: #0A0A0B;
    --bg-card: #141417;
    --text-main: #FFFFFF;
    --text-muted: #A0A0A5;
    --overlay: rgba(0, 0, 0, 0.6);
    --glass: rgba(255, 255, 255, 0.05);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Typography */
h1, h2, h3 {
    text-transform: uppercase;
    letter-spacing: clamp(1px, 0.3vw, 2px);
    font-weight: 700;
}

/* Layout Utilities - Mobile First */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Sections - Mobile First */
section {
    padding: 60px 0;
}

/* ===== Navigation ===== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 16px 0;
    z-index: 1000;
    transition: var(--transition);
}

nav.scrolled {
    background: rgba(10, 10, 11, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 0;
}

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

.logo a {
    display: inline-block;
    text-decoration: none;
    line-height: 0;
}

.logo img {
    height: 40px;
    width: auto;
    max-width: 100%;
}

/* Hamburger Menu Button */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
    -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: var(--transition);
    transform-origin: center;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Links - Full screen overlay */
.nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    background: rgba(10, 10, 11, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1001;
}

.nav-links.open {
    right: 0;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--transition);
    padding: 8px 16px;
    -webkit-tap-highlight-color: transparent;
}

.nav-links a:hover,
.nav-links a:focus {
    color: var(--accent-coral);
}

/* ===== Hero Section ===== */
.hero {
    height: 100vh;
    height: 100dvh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0.4), rgba(0,0,0,0.7));
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 100%;
    padding: 0 32px;
}

.hero h1 {
    font-size: clamp(2rem, 10vw, 6rem);
    margin-bottom: clamp(12px, 3vw, 20px);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Keep hero title on one line on desktop */
.hero-title {
    white-space: nowrap;
}

/* Mobile break - hidden on desktop, shown on mobile */
.mobile-break {
    display: none;
}

/* Stack hero title on mobile */
@media (max-width: 600px) {
    .hero-title {
        white-space: normal;
    }
    .mobile-break {
        display: block;
    }
}

.hero p {
    font-size: clamp(0.85rem, 2.5vw, 1.2rem);
    color: var(--text-muted);
    letter-spacing: clamp(2px, 1vw, 4px);
    text-transform: uppercase;
}

/* ===== Projects Grid ===== */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.project-card {
    position: relative;
    overflow: hidden;
    background-color: var(--bg-card);
}

/* Modern browsers - use aspect-ratio */
@supports (aspect-ratio: 16/10) {
    .project-card {
        aspect-ratio: 16/10;
    }
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 16/10) {
    .project-card {
        height: 0;
        padding-bottom: 62.5%; /* 10/16 = 0.625 */
    }
    .project-card img {
        position: absolute;
        top: 0;
        left: 0;
    }
    .project-info {
        position: absolute;
    }
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.project-card:hover img {
    transform: scale(1.05);
}

/* Project info - always visible on mobile (no hover) */
.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: clamp(16px, 4vw, 30px);
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    transform: translateY(0);
    opacity: 1;
    transition: var(--transition);
}

.project-info h3 {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    margin-bottom: 4px;
}

.project-info p {
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    color: var(--text-muted);
}

/* ===== Expertise Grid ===== */
.expertise-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.expertise-grid h3 {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
}

.expertise-grid p {
    margin-top: 12px;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ===== About Section ===== */
.about-text {
    max-width: 800px;
    margin-top: clamp(24px, 5vw, 40px);
}

.about-text p {
    margin-bottom: 20px;
}

.about-intro {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
}

.about-sub {
    color: var(--text-muted);
}

/* Section headings */
.section-heading {
    margin-bottom: clamp(32px, 8vw, 60px);
}

/* ===== Reveal Animations ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition);
}

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

/* ===== Footer ===== */
footer {
    padding: clamp(48px, 10vw, 80px) 0;
    border-top: 1px solid var(--glass);
    text-align: center;
}

.footer-logo img {
    height: clamp(40px, 8vw, 60px);
    width: auto;
    max-width: 100%;
    margin-bottom: clamp(24px, 5vw, 40px);
}

.contact-info {
    margin: 32px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(20px, 5vw, 40px);
}

.info-item {
    min-width: 0;
}

.info-item h4 {
    color: var(--accent-coral);
    margin-bottom: 8px;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

.info-item p {
    color: var(--text-muted);
    font-size: clamp(0.85rem, 2vw, 1rem);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: clamp(32px, 8vw, 60px);
}

/* ============================================
   RESPONSIVE BREAKPOINTS - Mobile First
   ============================================ */

/* Small Mobile (360px+) */
@media (min-width: 360px) {
    .container {
        padding: 0 20px;
    }
}

/* Large Mobile (480px+) */
@media (min-width: 480px) {
    .container {
        padding: 0 24px;
    }

    .project-grid {
        gap: 20px;
    }
}

/* ===== Tablet (768px+) ===== */
@media (min-width: 768px) {
    .container {
        padding: 0 32px;
    }

    section {
        padding: 100px 0;
    }

    /* Desktop Navigation */
    .nav-toggle {
        display: none;
    }

    .nav-links {
        position: static;
        width: auto;
        height: auto;
        flex-direction: row;
        gap: 32px;
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .nav-links a {
        font-size: 14px;
        padding: 0;
    }

    .logo img {
        height: 48px;
    }

    nav {
        padding: 24px 0;
    }

    nav.scrolled {
        padding: 16px 0;
    }

    /* Project Grid - 2 columns on tablet */
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    /* Restore hover effect on touch-capable larger screens */
    .project-info {
        transform: translateY(20px);
        opacity: 0;
    }

    .project-card:hover .project-info {
        transform: translateY(0);
        opacity: 1;
    }

    /* Expertise Grid - 2 columns */
    .expertise-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }

    .expertise-grid p {
        margin-top: 16px;
    }

    /* Footer row layout on tablet+ */
    .contact-info {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: clamp(20px, 5vw, 60px);
    }

    /* Hero with fixed background only on non-touch devices (prevents iOS glitch) */
    @media (hover: hover) and (pointer: fine) {
        .hero {
            background-attachment: fixed;
        }
    }
}

/* ===== Small Desktop (1024px+) ===== */
@media (min-width: 1024px) {
    .container {
        padding: 0 40px;
    }

    section {
        padding: 120px 0;
    }

    /* Project Grid - 3 columns on desktop */
    .project-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }

    /* Expertise Grid - 3 columns */
    .expertise-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .nav-links {
        gap: 40px;
    }

    .logo img {
        height: 50px;
    }

    nav {
        padding: 30px 0;
    }

    nav.scrolled {
        padding: 20px 0;
    }
}

/* ===== Large Desktop (1440px+) ===== */
@media (min-width: 1440px) {
    .hero h1 {
        font-size: clamp(4rem, 6vw, 6rem);
    }
}

/* ===== Print & Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .project-card img {
        transition: none;
    }

    .project-info {
        transition: none;
    }
}