:root {
    /* Color Palette - Light Theme (Default) */
    --bg-primary: #f8f6f3;
    --bg-secondary: #efece7;
    --bg-tertiary: #e5e1db;
    
    --text-primary: #1a1916;
    --text-secondary: #5c5853;
    --text-muted: #8a857e;
    
    --accent-primary: #b8872e;
    --accent-secondary: #9a7225;
    --accent-glow: rgba(184, 135, 46, 0.25);
    
    /* Typography */
    --font-display: 'Syne', sans-serif;
    --font-body: 'Lora', serif;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;
    --space-2xl: 12rem;
    
    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-circ: cubic-bezier(0.85, 0, 0.15, 1);
}

[data-theme="dark"] {
    --bg-primary: #0f0e0c;
    --bg-secondary: #1a1916;
    --bg-tertiary: #242220;
    
    --text-primary: #f5f0e8;
    --text-secondary: #ccc6c0;
    --text-muted: #d4cfc9;
    
    --accent-primary: #d4a853;
    --accent-secondary: #e8c275;
    --accent-glow: rgba(212, 168, 83, 0.15);
    
    --device-frame-bg: #2a2a2a;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    cursor: default;
}

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

/* ============================================
   Cursor Glow Effect
   ============================================ */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body:hover .cursor-glow {
    opacity: 1;
}

/* ============================================
   Animated Background - Flowing Gradient Waves
   ============================================ */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background-color: var(--bg-primary);
}

.gradient-wave {
    position: absolute;
    width: 200%;
    height: 200%;
    opacity: 0.4;
    filter: blur(100px);
    will-change: transform;
}

.wave-1 {
    background: radial-gradient(ellipse at 30% 40%, rgba(184, 135, 46, 0.35) 0%, transparent 50%);
    top: -50%;
    left: -50%;
    animation: flow1 25s ease-in-out infinite;
}

.wave-2 {
    background: radial-gradient(ellipse at 70% 60%, rgba(184, 135, 46, 0.3) 0%, transparent 50%);
    top: -30%;
    right: -50%;
    animation: flow2 30s ease-in-out infinite;
}

.wave-3 {
    background: radial-gradient(ellipse at 50% 80%, rgba(184, 135, 46, 0.25) 0%, transparent 50%);
    bottom: -50%;
    left: -30%;
    animation: flow3 35s ease-in-out infinite;
}

[data-theme="dark"] .wave-1 {
    background: radial-gradient(ellipse at 30% 40%, rgba(212, 168, 83, 0.3) 0%, transparent 50%);
    opacity: 0.4;
}

[data-theme="dark"] .wave-2 {
    background: radial-gradient(ellipse at 70% 60%, rgba(212, 168, 83, 0.25) 0%, transparent 50%);
    opacity: 0.4;
}

[data-theme="dark"] .wave-3 {
    background: radial-gradient(ellipse at 50% 80%, rgba(212, 168, 83, 0.2) 0%, transparent 50%);
    opacity: 0.4;
}

@keyframes flow1 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    33% {
        transform: translate(20%, 15%) scale(1.2) rotate(120deg);
    }
    66% {
        transform: translate(-15%, 25%) scale(0.9) rotate(240deg);
    }
}

@keyframes flow2 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(-25%, -20%) scale(1.15) rotate(90deg);
    }
    50% {
        transform: translate(15%, -30%) scale(0.85) rotate(180deg);
    }
    75% {
        transform: translate(-10%, 10%) scale(1.1) rotate(270deg);
    }
}

@keyframes flow3 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    20% {
        transform: translate(30%, 20%) scale(1.3) rotate(72deg);
    }
    40% {
        transform: translate(-20%, 30%) scale(0.8) rotate(144deg);
    }
    60% {
        transform: translate(25%, -25%) scale(1.2) rotate(216deg);
    }
    80% {
        transform: translate(-15%, -20%) scale(0.95) rotate(288deg);
    }
}

/* ============================================
   Navigation
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    mix-blend-mode: normal;
}

[data-theme="dark"] .nav {
    mix-blend-mode: difference;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.nav-logo:hover {
    opacity: 0.7;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-links {
    display: flex;
    gap: var(--space-md);
}

/* Theme Toggle Button */
.theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-icon {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
    position: absolute;
    transition: opacity 0.3s ease, transform 0.4s var(--ease-out-expo);
}

.theme-icon.sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-icon.moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

[data-theme="dark"] .theme-icon.sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

[data-theme="dark"] .theme-icon.moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.nav-links a {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    padding: 0.5rem 0;
}

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

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

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-xl) var(--space-lg);
    position: relative;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(212, 168, 83, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 168, 83, 0.02) 0%, transparent 50%);
}

.hero-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.hero-tag {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: var(--space-md);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s var(--ease-out-expo) 0.2s forwards;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
}

.hero-title .line {
    display: block;
    opacity: 0;
    transform: translateY(60px);
    animation: fadeInUp 1s var(--ease-out-expo) forwards;
}

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

.hero-title em {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 400;
    color: var(--accent-primary);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s var(--ease-out-expo) 0.7s forwards;
}

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

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

/* ============================================
   Section Headers
   ============================================ */
.section-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding: 0 var(--space-lg);
}

.section-number {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--accent-primary);
}

.section-title {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ============================================
   Work Section
   ============================================ */
.work-section {
    padding: var(--space-xl) 0;
    background: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-lg);
    padding: 0 var(--space-lg);
}

.project-card {
    grid-column: span 4;
    position: relative;
    overflow: hidden;
    background: var(--bg-tertiary);
    border-radius: 24px;
    transition: transform 0.6s var(--ease-out-expo);
}

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

.project-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
}

.project-image.headspace-hero {
    border-radius: 24px 24px 0 0;
}

.project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        135deg,
        hsl(var(--hue), 15%, 18%) 0%,
        hsl(var(--hue), 20%, 12%) 100%
    );
    border-radius: 24px 24px 0 0;
    transition: transform 0.8s var(--ease-out-expo);
}

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

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: var(--bg-tertiary);
    transition: transform 0.8s var(--ease-out-expo);
}

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

/* ============================================
   Headspace Hero Grid (Project Card)
   ============================================ */
.headspace-hero {
    background: linear-gradient(135deg, #FDB831 0%, #F5A623 50%, #E8941E 100%);
    padding: var(--space-lg) var(--space-md);
}

.headspace-hero-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    height: 100%;
}

.headspace-hero-grid img {
    height: auto;
    max-height: 100%;
    width: auto;
    max-width: 23%;
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    transition: transform 0.6s var(--ease-out-expo), box-shadow 0.4s ease;
}

.project-card:hover .headspace-hero-grid img {
    transform: translateY(-6px);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Room & Rest Hero Grid (Project Card)
   ============================================ */
.roomrest-hero {
    background: linear-gradient(135deg, #1B4965 0%, #2D6A8F 50%, #5FA8D3 100%);
    padding: var(--space-lg) var(--space-md);
    border-radius: 24px 24px 0 0;
}

.roomrest-hero-grid {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: var(--space-sm);
    height: 100%;
}

.roomrest-hero-grid img {
    height: auto;
    max-height: 100%;
    width: auto;
    max-width: 23%;
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    transition: transform 0.6s var(--ease-out-expo), box-shadow 0.4s ease;
}

.roomrest-hero-grid img:nth-child(2) {
    transform: translateY(-10px);
}

.roomrest-hero-grid img:nth-child(3) {
    transform: translateY(-5px);
}

.project-card:hover .roomrest-hero-grid img {
    transform: translateY(-6px);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3);
}

.project-card:hover .roomrest-hero-grid img:nth-child(2) {
    transform: translateY(-16px);
}

.project-card:hover .roomrest-hero-grid img:nth-child(3) {
    transform: translateY(-11px);
}

/* ============================================
   Creative Process Hero (Project Card)
   ============================================ */
.creative-hero {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
    background: linear-gradient(135deg, #5B4B8A 0%, #7B68A6 50%, #9F8FBF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.creative-hero img {
    width: 85%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    transition: transform 0.8s var(--ease-out-expo);
}

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

/* ============================================
   Emerald Rejuvenation Hero (Project Card)
   ============================================ */
.emerald-hero {
    overflow: hidden;
    border-radius: 24px 24px 0 0;
    background: linear-gradient(135deg, #2D2B55 0%, #3E3A6E 50%, #4A4580 100%);
    padding: var(--space-lg) var(--space-md);
}

.emerald-hero-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    height: 100%;
}

.emerald-hero-grid img {
    height: auto;
    max-height: 100%;
    width: auto;
    max-width: 23%;
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    transition: transform 0.6s var(--ease-out-expo), box-shadow 0.4s ease;
}

.project-card:hover .emerald-hero-grid img {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* ============================================
   Workout Log Hero (Project Card)
   ============================================ */
.workout-hero {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
    background: linear-gradient(135deg, #0A1A1F 0%, #0F2A2E 50%, #163A3E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.workout-hero img {
    width: 60%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.8s var(--ease-out-expo);
}

.project-card:hover .workout-hero img {
    transform: scale(1.03);
}

/* ============================================
   Freecycle Hero (Project Card)
   ============================================ */
.freecycle-hero {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
    background: linear-gradient(135deg, #D4EDDA 0%, #C1E1C5 50%, #A8D5B0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.freecycle-hero img {
    width: 45%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.8s var(--ease-out-expo);
}

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

.project-placeholder span {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.5;
}

.project-info {
    padding: var(--space-lg);
    border-radius: 0 0 24px 24px;
}

.project-category {
    font-family: var(--font-display);
    font-size: 0.625rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-primary);
}

.project-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    margin: var(--space-xs) 0;
    transition: color 0.3s ease;
}

.project-card:hover .project-title {
    color: var(--accent-primary);
}

.project-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.project-year {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   About Section
   ============================================ */
.about-section {
    padding: var(--space-xl) 0;
    background: 
        linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.about-content {
    display: grid;
    grid-template-columns: 60% repeat(3, 1fr);
    gap: var(--space-lg);
    padding: 0 var(--space-lg);
}

.about-lead {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--space-md);
}

.about-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.about-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.detail-block h4 {
    font-family: var(--font-display);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: var(--space-sm);
}

.detail-block ul {
    list-style: none;
}

.detail-block li {
    font-size: 1rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
    transition: color 0.3s ease;
}

.detail-block li:hover {
    color: var(--text-primary);
}

/* ============================================
   Contact Section
   ============================================ */
.contact-section {
    padding: var(--space-xl) 0;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: 
        radial-gradient(ellipse at 50% 100%, rgba(212, 168, 83, 0.05) 0%, transparent 60%);
}

.contact-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xl);
    padding: 0 var(--space-lg);
    align-items: start;
}

.contact-lead {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.contact-email {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    display: inline-block;
    transition: color 0.3s ease;
}

.contact-email::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s var(--ease-out-expo);
}

.contact-email:hover {
    color: var(--accent-primary);
}

.contact-email:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.contact-block h4 {
    font-family: var(--font-display);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: var(--space-sm);
}

.contact-block p {
    font-size: 1rem;
    color: var(--text-secondary);
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.social-links a {
    font-size: 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.social-links a:hover {
    color: var(--text-primary);
    transform: translateX(8px);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--bg-tertiary);
}

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

.footer-copyright {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-tagline {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-style: italic;
    color: var(--text-muted);
}

/* ============================================
   Scroll Reveal Animations
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

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

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .project-card {
        grid-column: span 2;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

@media (max-width: 768px) {
    :root {
        --space-lg: 2rem;
        --space-xl: 4rem;
    }
    
    .nav {
        padding: var(--space-sm) var(--space-md);
    }
    
    .nav-links {
        display: none;
    }
    
    .hero {
        padding: var(--space-xl) var(--space-md);
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        padding: 0 var(--space-md);
    }
    
    .project-card {
        grid-column: span 1;
    }
    
    .section-header {
        padding: 0 var(--space-md);
    }
    
    .about-content {
        grid-template-columns: 1fr 1fr;
        padding: 0 var(--space-md);
    }
    
    .contact-content {
        padding: 0 var(--space-md);
    }
    
    .footer-content {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }
    
    .cursor-glow {
        display: none;
    }
    
    .modal-overlay {
        padding: var(--space-sm);
    }
    
    .modal {
        margin: var(--space-md) auto;
    }
    
    .modal-content {
        padding: var(--space-md);
    }
    
    .modal-close {
        top: var(--space-sm);
        right: var(--space-sm);
        width: 40px;
        height: 40px;
    }
    
    .modal-details {
        grid-template-columns: 1fr;
    }
    
    .modal-gallery {
        flex-direction: column;
        padding: var(--space-sm);
    }
    
    .modal-gallery img.gallery-item,
    .modal-gallery:not(.single) img.gallery-item {
        max-width: 100%;
        max-height: 40vh;
    }
    
    .modal-hero {
        padding: var(--space-sm);
    }
    
    .modal-hero-img {
        max-height: 50vh;
    }
    
    .device-showcase {
        gap: var(--space-md);
    }
    
    .device-frame {
        max-width: 200px;
        border-radius: 28px;
        padding: 8px;
    }
    
    .device-notch {
        width: 70px;
        height: 20px;
        top: 8px;
        border-radius: 0 0 12px 12px;
    }
    
    .device-frame img {
        border-radius: 20px;
    }
    
    .scroll-container {
        max-height: 400px;
    }
    
    .project-card::after {
        display: none;
    }
    
    .headspace-hero-grid img {
        max-width: 50%;
        border-radius: 12px;
    }
    
    .roomrest-hero {
        padding: var(--space-md) var(--space-sm);
    }
    
    .roomrest-hero-grid {
        gap: var(--space-xs);
    }
    
    .roomrest-hero-grid img {
        max-height: 250px;
        max-width: 23%;
        border-radius: 12px;
    }
    
    .emerald-hero {
        padding: var(--space-md) var(--space-sm);
    }
    
    .emerald-hero-grid {
        gap: var(--space-xs);
    }
    
    .emerald-hero-grid img {
        max-width: 28%;
        border-radius: 10px;
    }
    
    .headspace-screen {
        width: 140px;
    }
    
    .headspace-screen-frame {
        border-radius: 24px;
        padding: 6px;
    }
    
    .headspace-screen-frame img {
        border-radius: 18px;
    }
    
    .headspace-scroll-screen {
        width: 140px;
    }
    
    .headspace-scroll-frame {
        border-radius: 24px;
        padding: 6px;
    }
    
    .headspace-scroll-container {
        max-height: 260px;
        border-radius: 18px;
    }
}

/* ============================================
   Project Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    overflow-y: auto;
    padding: var(--space-md);
}

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

.modal {
    position: relative;
    max-width: 1000px;
    margin: var(--space-lg) auto;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    transform: translateY(40px) scale(0.95);
    opacity: 0;
    transition: transform 0.5s var(--ease-out-expo), opacity 0.4s ease;
}

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

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 48px;
    height: 48px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.3s ease, transform 0.3s ease;
}

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

.modal-close svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

.modal-content {
    padding: var(--space-lg);
}

.modal-header {
    margin-bottom: var(--space-lg);
}

.modal-category {
    font-family: var(--font-display);
    font-size: 0.625rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent-primary);
    display: block;
    margin-bottom: var(--space-xs);
}

.modal-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--space-xs);
}

.modal-year {
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.modal-hero {
    margin-bottom: var(--space-lg);
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.modal-hero:has(.headspace-modal-showcase),
.modal-hero:has(.roomrest-modal-showcase),
.modal-hero:has(.creative-modal-showcase),
.modal-hero:has(.emerald-modal-showcase),
.modal-hero:has(.workout-modal-showcase),
.modal-hero:has(.freecycle-modal-showcase) {
    padding: 0;
    background: transparent;
}

.modal-placeholder {
    aspect-ratio: 16 / 9;
    width: 100%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.modal-placeholder span {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.5;
}

.modal-hero-img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Mobile App Device Showcase
   ============================================ */
.device-showcase {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.device-frame {
    position: relative;
    background: #1a1a1a;
    border-radius: 36px;
    padding: 12px;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    max-width: 280px;
}

.device-notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 28px;
    background: #1a1a1a;
    border-radius: 0 0 16px 16px;
    z-index: 2;
}

.device-frame img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 24px;
}

.device-label {
    display: block;
    text-align: center;
    margin-top: var(--space-sm);
    font-family: var(--font-display);
    font-size: 0.625rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ============================================
   Scrollable Screen Showcase
   ============================================ */
.scroll-showcase {
    width: 100%;
}

.scroll-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    padding: 0 var(--space-xs);
}

.scroll-label span:first-child {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.scroll-hint {
    font-family: var(--font-display);
    font-size: 0.625rem;
    letter-spacing: 0.1em;
    color: var(--accent-primary);
    animation: scrollHintPulse 2s ease-in-out infinite;
}

@keyframes scrollHintPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.scroll-container {
    position: relative;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 8px;
    background: #1a1a1a;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.scroll-container::-webkit-scrollbar {
    width: 6px;
}

.scroll-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.scroll-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

.scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

.scroll-container img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-gallery.full-width {
    display: flex;
    flex-direction: column;
    padding: var(--space-md);
}

/* ============================================
   Headspace Modal Layout
   ============================================ */
.headspace-modal-showcase {
    display: flex;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: linear-gradient(135deg, #FDB831 0%, #F5A623 50%, #E8941E 100%);
    border-radius: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: center;
}

.headspace-screen-group {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
}

.headspace-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    width: 200px;
}

.headspace-screen-label {
    font-family: var(--font-display);
    font-size: 0.625rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 600;
}

.headspace-screen-frame {
    background: #1a1a1a;
    border-radius: 32px;
    padding: 10px;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 20px 50px rgba(0, 0, 0, 0.4);
    width: 100%;
}

.headspace-screen-frame img {
    display: block;
    border-radius: 22px;
    width: 100%;
    height: auto;
}

.headspace-scroll-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    width: 200px;
}

.headspace-scroll-frame {
    background: #1a1a1a;
    border-radius: 32px;
    padding: 10px;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 20px 50px rgba(0, 0, 0, 0.4);
    width: 100%;
}

.headspace-scroll-container {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 22px;
    background: #fff;
}

.headspace-scroll-container img {
    display: block;
    width: 100%;
    height: auto;
}

.headspace-scroll-container::-webkit-scrollbar {
    width: 4px;
}

.headspace-scroll-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.headspace-scroll-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 2px;
}

.headspace-scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
    font-family: var(--font-display);
    font-size: 0.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.5);
}

.headspace-scroll-hint svg {
    width: 12px;
    height: 12px;
    animation: scrollBounce 1.5s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

@media (max-width: 900px) {
    .headspace-modal-showcase {
        flex-direction: column;
        align-items: center;
    }
    
    .headspace-screen-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .headspace-screen {
        width: 160px;
    }
    
    .headspace-scroll-screen {
        width: 160px;
    }
    
    .headspace-scroll-container {
        max-height: 320px;
    }
}

/* ============================================
   Room & Rest Modal Layout
   ============================================ */
.roomrest-modal-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: linear-gradient(135deg, #1B4965 0%, #2D6A8F 50%, #5FA8D3 100%);
    border-radius: 8px;
    justify-items: center;
}

.roomrest-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    width: 200px;
}

.roomrest-screen-label {
    font-family: var(--font-display);
    font-size: 0.625rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.roomrest-screen-frame {
    background: #1a1a1a;
    border-radius: 32px;
    padding: 10px;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 20px 50px rgba(0, 0, 0, 0.4);
    width: 100%;
}

.roomrest-screen-frame img {
    display: block;
    border-radius: 22px;
    width: 100%;
    height: auto;
}

@media (max-width: 900px) {
    .roomrest-modal-showcase {
        gap: var(--space-sm);
    }
    
    .roomrest-screen {
        width: 140px;
    }
    
    .roomrest-screen-frame {
        border-radius: 24px;
        padding: 6px;
    }
    
    .roomrest-screen-frame img {
        border-radius: 18px;
    }
}

@media (max-width: 600px) {
    .roomrest-modal-showcase {
        grid-template-columns: 1fr;
    }
    
    .roomrest-screen {
        width: 180px;
    }
}

/* ============================================
   Creative Process Modal Layout
   ============================================ */
.creative-modal-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: linear-gradient(135deg, #5B4B8A 0%, #7B68A6 50%, #9F8FBF 100%);
    border-radius: 8px;
}

.creative-modal-img {
    width: 100%;
    max-width: 900px;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.creative-modal-showcase .click-to-expand-hint {
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   Emerald Rejuvenation Modal Layout
   ============================================ */
.emerald-modal-showcase {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: linear-gradient(135deg, #2D2B55 0%, #3E3A6E 50%, #4A4580 100%);
    border-radius: 8px;
}

.emerald-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    max-width: 200px;
}

.emerald-screen-label {
    font-family: var(--font-display);
    font-size: 0.625rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.emerald-screen-frame {
    background: #1a1a2e;
    border-radius: 32px;
    padding: 10px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 20px 50px rgba(0, 0, 0, 0.4);
    width: 100%;
}

.emerald-screen-frame img {
    display: block;
    border-radius: 22px;
    width: 100%;
    height: auto;
}

.emerald-single-screen-frame {
    background: #1a1a2e;
    border-radius: 32px;
    padding: 10px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 20px 50px rgba(0, 0, 0, 0.4);
    max-width: 240px;
}

.emerald-single-screen-frame img {
    display: block;
    border-radius: 22px;
    width: 100%;
    height: auto;
}

@media (max-width: 700px) {
    .emerald-screen {
        max-width: 140px;
        width: calc(50% - var(--space-sm));
    }
    
    .emerald-screen-frame {
        border-radius: 24px;
        padding: 6px;
    }
    
    .emerald-screen-frame img {
        border-radius: 18px;
    }
}

/* Emerald Style Guide Grid */
.styleguide-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
    width: 100%;
}

.styleguide-item {
    flex: 0 1 200px;
    max-width: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.styleguide-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    cursor: zoom-in;
    transition: opacity 0.3s ease;
}

.styleguide-item img:hover {
    opacity: 0.85;
}

.styleguide-item-label {
    font-family: var(--font-display);
    font-size: 0.5rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ============================================
   Workout Log Modal Layout
   ============================================ */
.workout-modal-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: linear-gradient(135deg, #0A1A1F 0%, #0F2A2E 50%, #163A3E 100%);
    border-radius: 8px;
}

.workout-modal-img {
    width: 100%;
    max-width: 900px;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.workout-modal-showcase .click-to-expand-hint {
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   Freecycle Modal Layout
   ============================================ */
.freecycle-modal-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: linear-gradient(135deg, #D4EDDA 0%, #C1E1C5 50%, #A8D5B0 100%);
    border-radius: 8px;
}

.freecycle-modal-img {
    max-width: 360px;
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.freecycle-modal-showcase .click-to-expand-hint {
    color: rgba(0, 0, 0, 0.4);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.modal-section h3 {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: var(--space-sm);
}

.modal-section p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.modal-overview {
    font-size: 1.25rem !important;
    color: var(--text-primary) !important;
}

.modal-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: 2px;
}

.modal-detail h4 {
    font-family: var(--font-display);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.modal-detail p {
    font-size: 1rem;
    color: var(--text-primary);
}

.modal-gallery {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    background: var(--bg-secondary);
    padding: var(--space-md);
    border-radius: 4px;
}

.modal-gallery.single {
    flex-direction: column;
}

.gallery-item {
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-gallery img.gallery-item {
    max-width: 100%;
    max-height: 50vh;
    width: auto;
    height: auto;
    display: block;
    flex: 0 1 auto;
}

.modal-gallery:not(.single) img.gallery-item {
    max-width: calc(50% - var(--space-sm));
}

.modal-placeholder.gallery-item {
    aspect-ratio: 4 / 3;
    flex: 1;
    min-width: 200px;
}

/* ============================================
   Artifact / Diagram Display
   ============================================ */
.artifact-display {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.artifact-label {
    font-family: var(--font-display);
    font-size: 0.625rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.artifact-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.userflow-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.userflow-legend-img {
    width: 140px;
    height: 180px;
    object-fit: cover;
    object-position: center 55%;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.userflow-display .artifact-img {
    width: 100%;
}

.lightbox-trigger {
    cursor: zoom-in;
    transition: opacity 0.3s ease;
}

.lightbox-trigger:hover {
    opacity: 0.85;
}

.click-to-expand-hint {
    font-family: var(--font-display);
    font-size: 0.5rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: calc(-1 * var(--space-xs));
}

/* ============================================
   Image Lightbox
   ============================================ */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-img {
    max-width: 95vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 8px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.4s var(--ease-out-expo);
}

.lightbox-overlay.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.3s ease, transform 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-close svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

/* Body scroll lock when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Project card cursor indicator */
.project-card {
    cursor: pointer;
}

.project-card::after {
    content: 'View Case Study';
    position: absolute;
    bottom: var(--space-md);
    right: var(--space-md);
    font-family: var(--font-display);
    font-size: 0.625rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-primary);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

/* ============================================
   Utility Classes
   ============================================ */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
