/* styles.css */
:root {
    --bg-primary: #0a0a0b;
    --bg-secondary: #111113;
    --text-primary: #f5f5f4;
    --text-muted: #737373;
    --accent: #c4f54a;
    --accent-glow: rgba(196, 245, 74, 0.15);
    --gradient-1: #c4f54a;
    --gradient-2: #54f5c4;
    --border: rgba(255, 255, 255, 0.08);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    background-color: #0a0a0b;
    /* Prevent iOS Safari overscroll bounce showing white */
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
    /* Ensure background covers iOS Safari safe area */
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
}

/* iOS Safari safe area cover - solid bar at top */
.safe-area-cover {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top, 0px);
    background-color: #0a0a0b;
    z-index: 9999;
    pointer-events: none;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

body {
    font-family: 'Syne', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    /* Ensure body background extends to cover safe area */
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
}

/* Noise texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 1000;
}

/* Custom selection */
::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.5rem 3rem;
    padding-top: calc(1.5rem + env(safe-area-inset-top, 0px));
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(20px);
    background: rgba(10, 10, 11, 0.95);
    border-bottom: 1px solid var(--border);
}

nav::before {
    content: '';
    position: absolute;
    top: calc(-1 * env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    height: env(safe-area-inset-top, 0px);
    background: #0a0a0b;
    z-index: -1;
}

/* Additional fixed background for iOS Safari top area */
nav::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top, 0px);
    background: #0a0a0b;
    z-index: 99;
    pointer-events: none;
}

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s ease;
}

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

.nav-links a:hover::after {
    width: 100%;
}

.nav-cta {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Syne', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-cta:hover {
    background: var(--accent);
    color: var(--bg-primary);
    box-shadow: 0 0 30px var(--accent-glow);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8rem 3rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    max-width: 900px;
}

.hero-bg {
    position: absolute;
    top: 0;
    right: -20%;
    width: 70%;
    height: 100%;
    background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.5;
    animation: pulse 8s ease-in-out infinite;
}

.cursor-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle at center, var(--accent-glow) 0%, rgba(196, 245, 74, 0.08) 40%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    z-index: 1;
    mix-blend-mode: screen;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.hero-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.hero-title {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(3.5rem, 12vw, 10rem);
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
    max-width: 900px;
}

.hero-title .line {
    display: block;
    overflow: hidden;
}

.hero-title .line span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-title .line:nth-child(1) span { animation-delay: 0.3s; }
.hero-title .line:nth-child(2) span { animation-delay: 0.4s; }
.hero-title .line:nth-child(3) span { animation-delay: 0.5s; }

.hero-title em {
    font-style: italic;
    color: var(--accent);
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    to {
        opacity: 1;
    }
}

.hero-description {
    max-width: 500px;
    font-size: 1.125rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.7s;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.9s;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 2.5rem;
    background: var(--accent);
    color: var(--bg-primary);
    font-family: 'Syne', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px var(--accent-glow);
}

.btn-primary svg {
    transition: transform 0.3s ease;
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.btn-secondary:hover {
    color: var(--accent);
}

/* iPhone Mockup */
.iphone-mockup {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    margin-left: 4rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 1.1s;
}

.iphone-frame {
    width: 280px;
    height: 580px;
    background: #1a1a1d;
    border-radius: 50px;
    padding: 12px;
    position: relative;
    box-shadow:
        0 0 0 2px #2a2a2d,
        0 0 0 4px #0a0a0b,
        0 40px 80px rgba(0, 0, 0, 0.5),
        0 0 60px var(--accent-glow);
}

.iphone-notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 32px;
    background: #0a0a0b;
    border-radius: 0 0 20px 20px;
    z-index: 2;
}

.iphone-notch::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #2a2a2d;
    border-radius: 50%;
}

.iphone-screen {
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    border-radius: 40px;
    overflow: hidden;
    position: relative;
}

.iphone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Marquee */
.marquee-section {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

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

.marquee-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    padding-right: 3rem;
    white-space: nowrap;
}

.marquee-item {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.marquee-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

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

/* Services Section */
.services {
    padding: 8rem 3rem;
}

.section-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 5rem;
    align-items: end;
}

.section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 1rem;
}

.section-title {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.section-description {
    color: var(--text-muted);
    font-size: 1.125rem;
    line-height: 1.7;
    max-width: 400px;
    justify-self: end;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
}

.service-card {
    background: var(--bg-primary);
    padding: 3rem;
    position: relative;
    transition: all 0.4s ease;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-4px);
}

.service-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    position: relative;
}

.service-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1.5rem;
    color: var(--accent);
    position: relative;
}

.service-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
}

.service-desc {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.7;
    position: relative;
}

/* Work Section */
.work {
    padding: 8rem 3rem;
    background: var(--bg-secondary);
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.work-card {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border);
}

.work-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1d 0%, #0a0a0b 100%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-card:hover .work-card-bg,
.work-card:hover .work-card-img {
    transform: scale(1.05);
}

.work-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(10, 10, 11, 0.9) 0%, rgba(10, 10, 11, 0.3) 50%, rgba(10, 10, 11, 0.1) 100%);
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.work-card:hover::after {
    background: linear-gradient(to top, rgba(10, 10, 11, 0.95) 0%, rgba(10, 10, 11, 0.4) 50%, rgba(10, 10, 11, 0.2) 100%);
}

.work-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    z-index: 2;
}

.work-card-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.625rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}

.work-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.work-card-year {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.work-card-arrow {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.3s ease;
    z-index: 2;
}

.work-card:hover .work-card-arrow {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
}

/* About Section */
.about {
    padding: 8rem 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
}

/* About iPhone Mockup */
.about-mockup {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.about-mockup-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
}

.about-iphone-frame {
    position: relative;
    z-index: 1;
    width: 320px;
    height: 660px;
    background: linear-gradient(145deg, #1f1f23 0%, #0a0a0b 100%);
    border-radius: 55px;
    padding: 14px;
    box-shadow:
        0 0 0 2px #2a2a2d,
        0 0 0 5px #0a0a0b,
        0 50px 100px rgba(0, 0, 0, 0.5),
        0 0 80px var(--accent-glow),
        inset 0 0 20px rgba(255, 255, 255, 0.02);
}

.about-iphone-notch {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    height: 35px;
    background: #0a0a0b;
    border-radius: 0 0 22px 22px;
    z-index: 2;
}

.about-iphone-notch::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: linear-gradient(145deg, #1a1a1d, #0a0a0b);
    border-radius: 50%;
    box-shadow: inset 0 0 3px rgba(196, 245, 74, 0.3);
}

.about-iphone-screen {
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    border-radius: 44px;
    overflow: hidden;
    position: relative;
}

.about-iphone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-iphone-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.about-content {
    padding: 2rem 0;
}

.about-title {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 2rem;
}

.about-title em {
    font-style: italic;
    color: var(--accent);
}

.about-text {
    color: var(--text-muted);
    font-size: 1.0625rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding-top: 2.5rem;
    margin-top: 0.5rem;
}

.stat-card {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(196, 245, 74, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(196, 245, 74, 0.1);
    border-radius: 50%;
    margin-bottom: 1.25rem;
    color: var(--accent);
    transition: all 0.4s ease;
}

.stat-card:hover .stat-icon {
    background: rgba(196, 245, 74, 0.2);
    transform: scale(1.1);
}

.stat-number {
    display: block;
    font-family: 'Instrument Serif', serif;
    font-size: 3rem;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* Tech Stack */
.tech-stack {
    padding: 6rem 3rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.tech-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: center;
}

.tech-item {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 1rem 2rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.tech-item:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Contact Section */
.contact {
    padding: 10rem 3rem;
    text-align: center;
    position: relative;
}

.contact::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.3;
}

.contact-title {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
    position: relative;
}

.contact-title em {
    font-style: italic;
    background: linear-gradient(135deg, var(--gradient-1) 0%, var(--gradient-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-subtitle {
    color: var(--text-muted);
    font-size: 1.25rem;
    margin-bottom: 3rem;
    position: relative;
}

.contact-email {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--text-primary);
    text-decoration: none;
    padding: 1.5rem 3rem;
    border: 1px solid var(--border);
    display: inline-block;
    transition: all 0.4s ease;
    position: relative;
}

.contact-email:hover {
    border-color: var(--accent);
    box-shadow: 0 0 60px var(--accent-glow);
}

/* Page Header (for subpages) */
.page-header {
    padding: 12rem 3rem 6rem;
    text-align: center;
    position: relative;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.3;
    pointer-events: none;
}

.page-title {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    position: relative;
}

.page-title em {
    font-style: italic;
    color: var(--accent);
}

.page-description {
    color: var(--text-muted);
    font-size: 1.125rem;
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

/* Projects Section */
.projects-section {
    padding: 0 3rem 8rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.project-download-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.4s ease;
}

.project-download-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

.project-download-image {
    aspect-ratio: 16/9;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.project-download-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.project-download-content {
    padding: 2rem;
}

.project-download-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.625rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.project-download-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.75rem 0 1rem;
}

.project-download-desc {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.project-download-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.project-tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tech-tags span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.625rem;
    color: var(--text-muted);
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-file-size {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.project-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    justify-content: center;
    padding: 1rem 2rem;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Syne', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.project-download-btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
    box-shadow: 0 0 30px var(--accent-glow);
}

.project-download-btn svg {
    transition: transform 0.3s ease;
}

.project-download-btn:hover svg {
    transform: translateY(2px);
}

/* Nav active state */
.nav-links a.active {
    color: var(--accent);
}

.nav-links a.active::after {
    width: 100%;
}

@media (max-width: 1024px) {
    .page-header {
        padding: 10rem 1.5rem 4rem;
    }

    .projects-section {
        padding: 0 1.5rem 6rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 8rem 1rem 3rem;
    }

    .page-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .page-description {
        font-size: 1rem;
    }

    .projects-section {
        padding: 0 1rem 4rem;
    }
}

@media (max-width: 640px) {
    .project-download-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .project-download-content {
        padding: 1.5rem;
    }

    .project-download-title {
        font-size: 1.25rem;
    }

    .project-download-desc {
        font-size: 0.875rem;
    }

    .project-download-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.8125rem;
    }
}

/* Project Modal */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 11, 0.9);
    backdrop-filter: blur(20px);
}

.modal-content {
    position: relative;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    max-width: 1100px;
    max-height: 90vh;
    width: 90%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 2.5rem;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
}

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

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gallery-main {
    aspect-ratio: 4/3;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    overflow: hidden;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-thumbs {
    display: flex;
    gap: 0.75rem;
}

.gallery-thumb {
    width: 80px;
    height: 60px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-thumb:hover {
    border-color: var(--text-muted);
}

.gallery-thumb.active {
    border-color: var(--accent);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.modal-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.625rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
}

.modal-title {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.modal-description {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.modal-tech {
    margin-bottom: 2rem;
}

.modal-tech-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    display: block;
    margin-bottom: 0.75rem;
}

.modal-tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-tech-item {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.modal-tech-item:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.modal-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--accent);
    color: var(--bg-primary);
    font-family: 'Syne', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    align-self: flex-start;
}

.modal-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px var(--accent-glow);
}

.modal-link svg {
    transition: transform 0.3s ease;
}

.modal-link:hover svg {
    transform: translate(3px, -3px);
}

@media (max-width: 1024px) {
    .modal-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem;
        max-height: 95vh;
    }

    .gallery-main {
        aspect-ratio: 16/9;
    }

    .gallery-thumb {
        width: 60px;
        height: 45px;
    }
}

/* Footer */
footer {
    padding: 3rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
}

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

/* Responsive */
@media (max-width: 1024px) {
    nav {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        display: none;
    }

    .hero {
        flex-direction: column;
    }

    .hero-content {
        max-width: 100%;
    }

    .iphone-mockup {
        display: none;
    }

    .hero,
    .services,
    .work,
    .about,
    .contact {
        padding: 6rem 1.5rem;
    }

    .section-header {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .section-description {
        justify-self: start;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .work-grid {
        grid-template-columns: 1fr;
    }

    .about {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-mockup {
        padding: 1rem;
    }

    .about-iphone-frame {
        width: 260px;
        height: 540px;
        border-radius: 45px;
        padding: 12px;
    }

    .about-iphone-notch {
        width: 110px;
        height: 30px;
        top: 12px;
        border-radius: 0 0 18px 18px;
    }

    .about-iphone-screen {
        border-radius: 36px;
    }

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

    .stat-card {
        padding: 1.5rem 1rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 1rem;
    }

    .stat-icon svg {
        width: 20px;
        height: 20px;
    }

    .stat-number {
        font-size: 2.25rem;
    }

    .stat-label {
        font-size: 0.5625rem;
    }

    footer {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        display: flex;
        align-items: center;
        gap: 1.25rem;
        text-align: left;
        padding: 1.25rem 1.5rem;
    }

    .stat-icon {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .stat-content {
        flex: 1;
    }

    .stat-number {
        font-size: 2rem;
        margin-bottom: 0.25rem;
    }

    .stat-label {
        font-size: 0.625rem;
    }

    .about-iphone-frame {
        width: 220px;
        height: 460px;
        border-radius: 40px;
        padding: 10px;
    }

    .about-iphone-notch {
        width: 90px;
        height: 26px;
        top: 10px;
        border-radius: 0 0 15px 15px;
    }

    .about-iphone-notch::before {
        width: 10px;
        height: 10px;
        top: 10px;
    }

    .about-iphone-screen {
        border-radius: 32px;
    }

    .about-mockup-glow {
        opacity: 0.4;
    }
}

/* Password Modal */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.password-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 11, 0.92);
    backdrop-filter: blur(20px);
}

.password-modal-content {
    position: relative;
    width: 90%;
    max-width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 3rem 2.5rem;
    text-align: center;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.password-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.password-modal-close:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.password-modal-icon {
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.password-modal-title {
    font-family: 'Instrument Serif', serif;
    font-size: 1.75rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.password-modal-desc {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.password-input-wrapper {
    position: relative;
    margin-bottom: 0.5rem;
}

.password-input-wrapper input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.password-input-wrapper input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.password-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--text-primary);
}

.password-error {
    color: #ef4444;
    font-size: 0.8125rem;
    text-align: left;
    margin-bottom: 1rem;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, height 0.3s ease, margin 0.3s ease;
}

.password-error.visible {
    opacity: 1;
    height: auto;
    margin-bottom: 1rem;
}

.password-submit-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--accent);
    border: none;
    color: var(--bg-primary);
    font-family: 'Syne', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.password-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px var(--accent-glow);
}

.password-modal-contact {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.password-modal-contact p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.password-modal-contact a {
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.password-modal-contact a:hover {
    opacity: 0.8;
}

/* Shake animation for wrong password */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.password-input-wrapper input.shake {
    animation: shake 0.5s ease;
    border-color: #ef4444;
}

@media (max-width: 640px) {
    .password-modal-content {
        width: 94%;
        padding: 2rem 1.25rem;
        margin: 1rem;
    }

    .password-modal-close {
        width: 44px;
        height: 44px;
        top: 0.75rem;
        right: 0.75rem;
    }

    .password-modal-icon svg {
        width: 40px;
        height: 40px;
    }

    .password-modal-title {
        font-size: 1.5rem;
    }

    .password-modal-desc {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }

    .password-input-wrapper input {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 0.875rem 3rem 0.875rem 1rem;
    }

    .password-toggle {
        width: 44px;
        height: 44px;
        right: 0;
    }

    .password-submit-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.8125rem;
    }

    .password-modal-contact {
        margin-top: 1.5rem;
        padding-top: 1.25rem;
    }

    .password-modal-contact p,
    .password-modal-contact a {
        font-size: 0.8125rem;
    }
}
