/* ============================================
   HEWILLDESIGN - Portfolio CSS
   Inspired by liamfoster.design
   ============================================ */

/* -------------------- CSS Variables -------------------- */
:root {
    /* Colors - Light Mode */
    --color-bg: #fafafa;
    --color-bg-alt: #f5f5f5;
    --color-bg-dark: #0a0a0a;
    --color-bg-card: #ffffff;
    --color-text: #1a1a1a;
    --color-text-light: #666666;
    --color-text-muted: #999999;
    --color-accent: #FF4800;
    --color-accent-hover: #e04000;
    --color-border: #e5e5e5;
    --color-white: #ffffff;
    --color-nav-bg: #fafafa;
    --color-testimonial-bg: #0a0a0a;
    --color-testimonial-text: #ffffff;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 5rem;
    --space-3xl: 8rem;
    
    /* Layout */
    --container-max: 1400px;
    --container-padding: 2rem;
    /* Fixed nav: logo 52px + vertical padding (--space-lg × 2) */
    --nav-offset: calc(52px + var(--space-lg) * 2);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
}

/* Dark Mode - Only color overrides, no spacing changes */
[data-theme="dark"] {
    --color-bg: #0a0a0a;
    --color-bg-alt: #141414;
    --color-bg-dark: #000000;
    --color-bg-card: #1a1a1a;
    --color-text: #f5f5f5;
    --color-text-light: #b0b0b0;
    --color-text-muted: #777777;
    --color-accent: #FF4800;
    --color-accent-hover: #e04000;
    --color-border: #2a2a2a;
    --color-white: #ffffff;
    --color-nav-bg: #0a0a0a;
    --color-testimonial-bg: #141414;
    --color-testimonial-text: #f5f5f5;
}

/* -------------------- Reset & Base -------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

html.project-modal-open {
    scroll-behavior: auto;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

/* -------------------- Typography -------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p {
    color: var(--color-text-light);
}

/* -------------------- Layout -------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

section {
    padding: var(--space-3xl) 0;
}

/* -------------------- Components -------------------- */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 1rem 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.btn-primary {
    background-color: var(--color-accent);
    color: #1a1a1a;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-text);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn .arrow {
    transition: transform var(--transition-fast);
}

.btn:hover .arrow {
    transform: translateX(4px);
}

.btn .plus {
    font-weight: 500;
    font-size: 1.15em;
    line-height: 1;
}

/* Section Headers */
.section-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.section-title {
    margin-bottom: var(--space-lg);
}

.section-title-accent {
    color: #000000;
}

[data-theme="dark"] .section-title-accent {
    color: #ffffff;
}

.section-subtitle {
    max-width: 600px;
    color: var(--color-text-light);
}

.section-header {
    margin-bottom: var(--space-2xl);
}

.section-header-center {
    text-align: center;
}

.section-header-center .section-subtitle {
    margin: 0 auto;
}

/* -------------------- Navigation -------------------- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--space-lg) 0;
    background-color: var(--color-nav-bg);
    transition: background-color var(--transition-base), padding var(--transition-base);
}

.nav.scrolled {
    padding: var(--space-md) 0;
}

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

@media (max-width: 768px) {
    .nav-container {
        padding: 0 var(--space-sm);
    }
    
    .nav-logo {
        margin-left: -8px;
    }
    
    .nav-logo-img {
        height: 48px;
    }
    
    .nav-toggle {
        margin-right: -8px;
    }
}

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

.nav-logo-img {
    height: 48px;
    width: auto;
}

.nav-logo-mobile {
    display: none;
}

.nav-logo-desktop {
    display: block;
    height: 52px;
}

@media (max-width: 768px) {
    .nav-logo-mobile {
        display: block;
    }
    
    .nav-logo-desktop {
        display: none;
    }
}

.nav-logo-text {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

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

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

.nav-theme-item {
    display: flex;
    align-items: center;
}

.theme-toggle-desktop {
    display: flex;
}

.theme-toggle.theme-toggle-mobile {
    display: none;
}

/* Nav Actions (theme toggle + burger) — mobile only */
.nav-actions {
    display: none;
    align-items: center;
    gap: var(--space-sm);
}

@media (max-width: 768px) {
    .nav-actions {
        display: flex;
        margin-right: 0;
    }
    
    .nav-logo {
        margin-left: 0;
    }
}

.nav-menu a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-light);
    transition: color var(--transition-fast);
}

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

@media (min-width: 769px) {
    .nav-menu > li:not(.nav-social-links) > a:not(.nav-cta) {
        color: #ffffff;
    }

    .nav-menu > li:not(.nav-social-links) > a:not(.nav-cta):hover {
        color: var(--color-accent);
    }

    [data-theme="light"] .nav-menu > li:not(.nav-social-links) > a:not(.nav-cta) {
        color: #1a1a1a;
    }

    [data-theme="light"] .nav-menu > li:not(.nav-social-links) > a:not(.nav-cta):hover {
        color: var(--color-accent);
    }
}

.nav-cta {
    padding: 0.75rem 1.5rem;
    background-color: var(--color-accent);
    color: #1a1a1a !important;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.nav-cta:hover {
    background-color: var(--color-accent-hover);
    color: #1a1a1a !important;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle:hover .theme-icon {
    color: var(--color-accent);
}

.theme-icon {
    width: 22px;
    height: 22px;
    color: var(--color-accent);
    transition: all var(--transition-fast);
    position: absolute;
}

.theme-toggle {
    position: relative;
}

.theme-icon.sun {
    opacity: 1;
}

.theme-icon.moon {
    opacity: 0;
}

[data-theme="dark"] .theme-icon.sun {
    opacity: 0;
}

[data-theme="dark"] .theme-icon.moon {
    opacity: 1;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    margin-right: -8px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-accent);
    transition: all var(--transition-fast);
}

/* Scroll Indicator */
.scroll-indicator {
    display: none;
}

.scroll-indicator span {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    color: var(--color-text-muted);
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--color-text-muted), transparent);
    animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.2); }
}

/* -------------------- Hero Image -------------------- */
.hero-image {
    width: 100%;
    margin-top: 100px;
}

@media (max-width: 768px) {
    .hero-image {
        margin-top: 90px;
    }
}

.hero-image picture {
    display: block;
    width: 100%;
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* -------------------- Hero Section -------------------- */
.hero {
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-2xl) 0;
    padding-bottom: var(--space-lg);
}

.hero-content {
    max-width: var(--container-max);
    margin: 0 auto;
    width: 100%;
    padding: 0 var(--container-padding);
}

.hero-title {
    margin-bottom: var(--space-xl);
}

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

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

.hero-intro {
    max-width: 600px;
}

.hero-subtitle {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

.hero-scroll {
    display: none;
}

/* -------------------- Services Section -------------------- */
.services {
    background-color: var(--color-bg-alt);
}

.services .section-header {
    margin-bottom: var(--space-xl);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.service-card {
    padding: var(--space-xl);
    background-color: var(--color-bg-card);
    border-radius: var(--radius-md);
}

.service-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    color: var(--color-accent);
}

.service-icon svg {
    width: 100%;
    height: 100%;
}

.service-title {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
    font-size: 1.25rem;
    color: var(--color-accent);
}

.service-description {
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* -------------------- Portfolio Section -------------------- */
.portfolio .section-header {
    margin-bottom: var(--space-xl);
}

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

.portfolio-item {
    grid-column: span 4;
    cursor: pointer;
    transition: transform var(--transition-base);
}

.portfolio-item:hover {
    transform: translateY(-8px);
}

.portfolio-item-large {
    grid-column: span 6;
}

.portfolio-image {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.portfolio-image picture {
    display: block;
    width: 100%;
    height: 100%;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    -webkit-filter: grayscale(1);
    transition: filter 0.75s ease, -webkit-filter 0.75s ease;
}

/* Mobile & tablet: exactly one card in color (driven by .in-view) */
@media (max-width: 1024px) {
    .portfolio-item .portfolio-image {
        filter: grayscale(1);
        -webkit-filter: grayscale(1);
        transition: filter 0.75s ease, -webkit-filter 0.75s ease;
    }

    .portfolio-item .portfolio-image img {
        filter: none;
        -webkit-filter: none;
    }

    .portfolio-item.in-view .portfolio-image {
        filter: grayscale(0);
        -webkit-filter: grayscale(0);
    }

    .portfolio-item.in-view .portfolio-placeholder {
        background: #FF4800 !important;
    }
}

/* Desktop: color on hover / keyboard focus only */
@media (min-width: 1025px) {
    .portfolio-item.in-view .portfolio-image img {
        filter: grayscale(1);
        -webkit-filter: grayscale(1);
    }

    .portfolio-item:hover .portfolio-image img,
    .portfolio-item:focus-visible .portfolio-image img,
    .portfolio-item.is-color .portfolio-image img {
        filter: grayscale(0);
        -webkit-filter: grayscale(0);
    }

    .portfolio-item.in-view .portfolio-placeholder {
        background: #333 !important;
    }

    .portfolio-item:hover .portfolio-placeholder,
    .portfolio-item.is-color .portfolio-placeholder {
        background: #FF4800 !important;
    }
}

.portfolio-item-large .portfolio-image {
    aspect-ratio: 16 / 9;
}

/* Monograms: solid black marks (img 1) → full color (img 2) crossfade */
/* Bellhouse: browser gradient (no banding) + transparent logo */
.portfolio-image--bh {
    background: linear-gradient(45deg, #3E823E 0%, #18B718 50%, #96FF00 100%);
}

@media (min-width: 1025px) {
    .portfolio-item .portfolio-image--bh {
        filter: grayscale(1);
        -webkit-filter: grayscale(1);
        transition: filter 0.75s ease, -webkit-filter 0.75s ease;
    }

    .portfolio-item .portfolio-image--bh img {
        filter: none;
        -webkit-filter: none;
    }

    .portfolio-item:hover .portfolio-image--bh,
    .portfolio-item:focus-visible .portfolio-image--bh,
    .portfolio-item.is-color .portfolio-image--bh {
        filter: grayscale(0);
        -webkit-filter: grayscale(0);
    }
}

.portfolio-image--marks {
    background: #fff;
}

.portfolio-image--marks picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.portfolio-image--marks img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none !important;
    -webkit-filter: none !important;
    will-change: opacity;
}

.portfolio-image--marks .marks-bw {
    z-index: 0;
    opacity: 1;
}

.portfolio-image--marks .marks-color {
    z-index: 1;
    opacity: 0;
    transition: opacity 0.8s ease;
}

@media (max-width: 1024px) {
    .portfolio-item.in-view .portfolio-image--marks .marks-color {
        opacity: 1;
    }
}

@media (min-width: 1025px) {
    .portfolio-item:hover .portfolio-image--marks .marks-color,
    .portfolio-item:focus-visible .portfolio-image--marks .marks-color,
    .portfolio-item.is-color .portfolio-image--marks .marks-color {
        opacity: 1;
    }
}

.portfolio-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-slow), background 0.75s ease;
    background: #333 !important;
}

.portfolio-placeholder-text {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.portfolio-info {
    padding: 0 var(--space-xs);
}

.portfolio-category {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.portfolio-title {
    font-size: 1.125rem;
    margin-bottom: var(--space-xs);
    color: var(--color-text);
}

.portfolio-description {
    font-size: 0.875rem;
}

.portfolio-cta {
    text-align: center;
    margin-top: var(--space-2xl);
}

/* -------------------- About Section -------------------- */
.about {
    background-color: var(--color-bg-alt);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-3xl);
    align-items: center;
}

.about-image {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.about-image > picture {
    display: block;
    width: 100%;
}

.about-image > picture.about-photo-orange-wrap {
    position: absolute;
    inset: 0;
}

.about-photo {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    object-position: center top;
    border-radius: var(--radius-lg);
    display: block;
}

.about-photo-orange {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.75s ease;
    pointer-events: none;
    filter: saturate(0.70);
}

@media (max-width: 1024px) {
    .about-photo-orange {
        transition: opacity 1.05s ease;
    }
}

.about-image.is-orange .about-photo-orange {
    opacity: 1;
}

.about-photo-toggle {
    display: flex;
    position: absolute;
    bottom: var(--space-sm);
    right: var(--space-sm);
    top: auto;
    z-index: 3;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: var(--color-accent);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.2s ease, transform 0.2s ease;
}

.about-photo-toggle:hover {
    background: rgba(0, 0, 0, 0.6);
}

.about-photo-toggle:active {
    transform: scale(0.94);
}

.about-photo-toggle-icon {
    width: 22px;
    height: 22px;
    display: block;
}

.about-photo-toggle[hidden] {
    display: none;
}

.about-image-placeholder {
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .about-image-placeholder {
    background: linear-gradient(135deg, #0a0a0a 0%, #222 100%);
}

.about-logo-fallback {
    width: 50%;
    height: auto;
    opacity: 0.3;
    filter: invert(1);
}

.about-text {
    margin-bottom: var(--space-xl);
}

.about-text p {
    margin-bottom: var(--space-md);
    font-size: 1.0625rem;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    gap: var(--space-2xl);
}

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* -------------------- Process Section -------------------- */
.process .section-header {
    margin-bottom: var(--space-xl);
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.process-step {
    padding: var(--space-xl);
    background-color: var(--color-bg-alt);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.process-step:hover {
    background-color: var(--color-accent);
    color: #000;
}

.process-step:hover .process-title,
.process-step:hover .process-description,
.process-step:hover .process-number {
    color: #000;
}

[data-theme="dark"] .process-step:hover {
    background-color: var(--color-accent);
    color: #000;
}

[data-theme="dark"] .process-step:hover .process-title,
[data-theme="dark"] .process-step:hover .process-description,
[data-theme="dark"] .process-step:hover .process-number {
    color: #000;
}

.process-title {
    margin-bottom: var(--space-sm);
    color: var(--color-accent);
}

.process-description {
    font-size: 0.9375rem;
    transition: color var(--transition-base);
}

.process-cta {
    text-align: left;
    margin-top: var(--space-lg);
}

.process-cta .btn {
    width: 185px;
    justify-content: center;
}

/* -------------------- Contact Section -------------------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
}

.contact-description {
    font-size: 1.0625rem;
    margin-bottom: var(--space-sm);
}

.contact-social {
    display: flex;
    gap: var(--space-lg);
}

.contact-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--color-text-light);
    transition: color var(--transition-fast);
}

.contact-social a svg {
    width: 100%;
    height: 100%;
}

.contact-social .social-linkedin:hover {
    color: #0A66C2;
}

.contact-social .social-instagram:hover {
    color: #E4405F;
}

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

/* Nav social links (mobile menu) */
.nav-social-links {
    display: none;
}

@media (max-width: 768px) {
    .nav-social-links {
        display: flex;
        gap: var(--space-lg);
        justify-content: center;
        margin-top: var(--space-lg);
    }
    
    .nav-social-links a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        color: var(--color-text);
        transition: color var(--transition-fast), transform var(--transition-fast);
    }
    
    .nav-social-links a:hover {
        transform: scale(1.1);
    }
    
    .nav-social-links a svg {
        width: 100%;
        height: 100%;
    }
    
    .nav-social-links .social-instagram:hover {
        color: #E4405F;
    }
    
    .nav-social-links .social-linkedin:hover {
        color: #0A66C2;
    }
    
    .nav-social-links .social-email:hover {
        color: var(--color-accent);
    }
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.hero-btn,
.contact-submit {
    width: 185px;
    justify-content: center;
}

.contact-submit {
    align-self: flex-start;
}

.form-row {
    display: flex;
    gap: var(--space-sm);
}

.form-row .form-field {
    flex: 1;
    min-width: 0;
}

.form-field input {
    width: 100%;
    padding: 1rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
}

.form-field input:focus {
    outline: none;
    border-color: var(--color-accent);
    caret-color: var(--color-accent);
}

.field-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-group label .required {
    color: var(--color-accent);
}

.form-group label .optional {
    color: var(--color-text-muted);
    font-weight: 400;
    font-size: 0.75rem;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-text-light);
}

.form-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    border: 1.5px solid var(--color-border);
    border-radius: 3px;
    background-color: var(--color-bg-card);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.form-checkbox input[type="checkbox"]:checked {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

.form-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 9px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

.form-checkbox input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.form-checkbox span {
    line-height: 1.4;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-bg-card);
    transition: border-color var(--transition-fast);
    box-sizing: border-box;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23FF4800' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    caret-color: var(--color-accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* -------------------- Footer -------------------- */
.footer {
    padding: var(--space-lg) 0;
    background-color: var(--color-bg-alt);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.footer-logo {
    display: inline-flex;
    align-items: center;
}

.footer-logo-img {
    height: 32px;
    width: auto;
    margin-bottom: var(--space-sm);
}

.footer-brand p {
    font-size: 0.875rem;
    max-width: 300px;
    color: #1a1a1a;
}

[data-theme="dark"] .footer-brand p {
    color: var(--color-text-light);
}

.footer-social {
    display: flex;
    justify-content: flex-start;
    gap: var(--space-md);
    margin-top: var(--space-sm);
    margin-bottom: var(--space-md);
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #1a1a1a;
    transition: color var(--transition-fast);
}

[data-theme="dark"] .footer-social a {
    color: var(--color-text-light);
}

.footer-social a svg {
    width: 100%;
    height: 100%;
}

.footer-social .social-linkedin:hover {
    color: #0A66C2;
}

.footer-social .social-instagram:hover {
    color: #E4405F;
}

.footer-social .social-email:hover {
    color: var(--color-accent);
}

.footer-bottom {
    padding-top: var(--space-sm);
}

.footer-copyright {
    font-size: 0.8125rem;
    color: var(--color-accent);
    font-weight: 500;
    letter-spacing: 0.05em;
}

.footer-copyright span {
    margin: 0 var(--space-xs);
}

.footer-copyright .amp {
    font-weight: 300;
    margin: 0;
}

.footer-copyright .hewill,
.footer-copyright .design {
    margin: 0;
}

.footer-copyright .hewill {
    font-weight: 700;
}

.footer-copyright .design {
    font-weight: 300;
}

.footer-copyright a {
    color: var(--color-accent);
    font-weight: 700;
}

.footer-copyright a:hover {
    text-decoration: underline;
}

/* -------------------- Responsive Design -------------------- */
@media (max-width: 1200px) {
    .portfolio-item {
        grid-column: span 6;
    }
    
    .portfolio-item-large {
        grid-column: span 6;
    }
}

@media (max-width: 992px) {
    :root {
        --container-padding: 1.5rem;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .about-image {
        max-width: 400px;
    }
    
    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
}

@media (max-width: 768px) {
    :root {
        --space-3xl: 5rem;
        --container-padding: var(--space-sm);
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
    }

    .theme-toggle-desktop {
        display: none;
    }

    .nav-theme-item {
        display: none;
    }

    .theme-toggle.theme-toggle-mobile {
        display: flex;
    }
    
    .hide-on-mobile {
        display: none !important;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        flex-direction: column;
        justify-content: center;
        background-color: var(--color-bg);
        transition: right var(--transition-base);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-toggle {
        display: flex;
        z-index: 1001;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    .scroll-indicator {
        display: none;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-item,
    .portfolio-item-large {
        grid-column: span 12;
    }
    
    .about-stats {
        flex-wrap: wrap;
        gap: var(--space-lg);
    }
    
    .process-steps {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }
}

@media (max-width: 480px) {
    :root {
        --container-padding: var(--space-sm);
        --space-3xl: 4rem;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
    }
    
    .service-card {
        padding: var(--space-lg);
    }
    
    .process-step {
        padding: var(--space-lg);
    }
    
    .about-stats {
        justify-content: space-between;
    }
    
    .stat {
        flex: 1;
        min-width: 100px;
    }
}

/* -------------------- Animations -------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Staggered animations for grid items */
.services-grid .service-card,
.portfolio-grid .portfolio-item,
.process-steps .process-step {
    opacity: 0;
    transform: translateY(30px);
}

.services-grid .service-card.visible,
.portfolio-grid .portfolio-item.visible,
.process-steps .process-step.visible {
    animation: fadeInUp 0.6s ease forwards;
}

/* -------------------- Selection & Focus -------------------- */
::selection {
    background-color: var(--color-accent);
    color: var(--color-white);
}

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* -------------------- Newsletter Popup -------------------- */
.newsletter-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    padding: var(--space-lg);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.newsletter-popup.active {
    display: flex;
    opacity: 1;
}

.newsletter-popup-content {
    background-color: #FF4800 !important;
    border-radius: var(--radius-lg);
    max-width: 420px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.newsletter-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: transparent;
    border: none;
    cursor: pointer;
    color: #000;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-fast);
    z-index: 10;
}

.newsletter-close svg {
    width: 20px;
    height: 20px;
}

.newsletter-close svg line {
    stroke-width: 2.25;
}

.newsletter-close:hover {
    opacity: 0.7;
}

.newsletter-body {
    padding: calc(var(--space-md) + 32px + var(--space-sm)) var(--space-xl) var(--space-md);
    text-align: left;
}

.newsletter-body h2 {
    color: #000;
    margin-bottom: var(--space-sm);
}

.newsletter-body > p {
    color: #000;
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

.newsletter-hewill {
    font-weight: 900;
}

.newsletter-form {
    margin-bottom: var(--space-md);
}

.newsletter-input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
}

.newsletter-input-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #000;
    border-radius: var(--radius-sm);
    background-color: #fff;
    color: #000;
    font-size: 1rem;
    box-sizing: border-box;
    caret-color: #FF4800;
}

.newsletter-input-group input:focus {
    outline: none;
    border-color: #000;
    caret-color: #FF4800;
}

.newsletter-input-group input::placeholder {
    color: #666;
}

.newsletter-input-group .btn {
    width: 100%;
    white-space: nowrap;
    background-color: #000;
    color: var(--color-accent);
    border: 2px solid #000;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
}

.newsletter-input-group .btn:hover {
    background-color: #222;
}

.newsletter-disclaimer {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.7);
    text-align: center;
}

@media (max-width: 480px) {
    .newsletter-body {
        padding: calc(var(--space-md) + 32px + var(--space-sm)) var(--space-xl) var(--space-md);
    }
    
    .newsletter-input-group {
        max-width: 100%;
    }
}

/* -------------------- Modal Styles -------------------- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    overflow-y: auto;
    padding: var(--space-lg);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    opacity: 1;
}

.modal-content {
    background-color: var(--color-bg);
    border-radius: var(--radius-lg);
    max-width: 800px;
    width: 100%;
    margin: var(--space-xl) auto;
    position: relative;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.modal-close {
    position: sticky;
    top: var(--space-md);
    float: right;
    margin-right: var(--space-md);
    margin-top: var(--space-md);
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-fast);
    z-index: 10;
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-close svg line,
.lightbox-close svg line,
.project-modal-close svg line {
    stroke-width: 2.25;
}

.modal-close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: var(--space-xl);
    padding-top: var(--space-md);
}

.modal-body h2 {
    margin-bottom: var(--space-xs);
    color: var(--color-text);
}

.modal-body h2.section-title-accent {
    color: var(--color-text);
}

.modal-body .modal-updated {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.modal-body h3 {
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
    color: var(--color-accent);
}

.modal-body h4 {
    margin-top: var(--space-md);
    margin-bottom: var(--space-xs);
    color: var(--color-text);
}

.modal-body p {
    color: var(--color-text-light);
    line-height: 1.7;
    margin-bottom: var(--space-sm);
}

.modal-body ul {
    list-style: none;
    padding: 0;
    margin-bottom: var(--space-md);
}

.modal-body ul li {
    color: var(--color-text-light);
    line-height: 1.7;
    padding-left: var(--space-md);
    position: relative;
    margin-bottom: var(--space-xs);
}

.modal-body ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 4px;
    height: 4px;
    background-color: var(--color-accent);
    border-radius: 50%;
}

.modal-body ul li strong {
    color: var(--color-text);
}

.modal-email {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.modal-email:hover {
    text-decoration: underline;
}

/* -------------------- Project Modal -------------------- */
/* Flex column + spacer (Safari-safe). Absolute top on a touch-scroll
   pane lets WebKit rubber-band the hero under the fixed nav. */
.modal.project-modal {
    padding: 0 !important;
    background-color: var(--color-bg);
    z-index: 900;
    top: 0 !important;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100% !important;
    height: 100dvh !important;
    max-height: none !important;
    overflow: hidden !important;
    flex-direction: column;
    align-items: stretch;
    pointer-events: none;
}

.modal.project-modal.active {
    display: flex !important;
}

.project-modal-spacer {
    flex: 0 0 var(--nav-offset);
    height: var(--nav-offset);
    min-height: var(--nav-offset);
    max-height: var(--nav-offset);
    width: 100%;
    pointer-events: none;
    background-color: transparent;
}

.project-modal-frame {
    position: relative;
    top: auto !important;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: none;
    background-color: var(--color-bg);
    pointer-events: auto;
}

.project-modal-content {
    max-width: none;
    width: 100%;
    margin: 0;
    border-radius: 0;
    max-height: none;
    overflow: visible;
    background-color: var(--color-bg);
    padding-top: 0 !important;
}

@media (max-width: 768px) {
    :root {
        /* Mobile logo is 48px */
        --nav-offset: calc(48px + var(--space-lg) * 2);
    }
}

/* Keep nav height stable while a project is open (ignore .scrolled shrink).
   transition:none is critical — otherwise padding animates after we measure
   and the bar grows over the hero. */
body.project-modal-open .nav,
body.project-modal-open .nav.scrolled {
    z-index: 4000;
    padding: var(--space-lg) 0 !important;
    transition: none !important;
    pointer-events: auto;
}

/* In-modal close X — white, top-right over the project hero */
.project-modal .modal-close,
.project-modal-close {
    display: flex !important;
    position: fixed;
    top: calc(var(--nav-offset, 5rem) + 0.75rem);
    right: max(0.75rem, var(--container-padding, 2rem));
    float: none;
    margin: 0;
    width: 40px;
    height: 40px;
    color: #fff;
    z-index: 4500;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.project-modal-close svg {
    width: 22px;
    height: 22px;
}

/* Keep burger as burger — never swap to a nav close X */
.nav-project-close {
    display: none !important;
}

/* Shared trailing slot for burger on mobile */
.nav-trailing {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.nav-trailing .nav-toggle {
    position: absolute;
    inset: 0;
    margin: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.nav-trailing .nav-project-close-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    .nav-trailing .nav-toggle {
        display: flex;
        opacity: 1;
        pointer-events: auto;
    }

    body.project-modal-open .nav-trailing .nav-toggle {
        opacity: 1;
        pointer-events: auto;
    }

    .project-modal-close {
        top: calc(var(--nav-offset, 5rem) + 0.5rem);
        right: 0.75rem;
    }
}

@media (min-width: 769px) {
    body.project-modal-open .nav-social-links {
        visibility: visible;
        pointer-events: auto;
    }
}

.project-hero-placeholder {
    width: 100%;
    display: block;
}

.project-modal-hero {
    width: 100%;
    margin: 0;
}

.project-modal-hero picture,
.project-modal-gallery picture,
.hwd-breakdown picture {
    display: block;
    width: 100%;
}

.project-modal-hero img,
.project-modal-hero .hwd-breakdown img {
    width: 100%;
    max-width: none;
    height: auto;
    display: block;
    border-radius: 0;
    background: var(--color-bg-card);
    vertical-align: top;
}

.project-modal-hero .project-visual-embed {
    width: 100%;
    border-radius: 0;
    margin: 0;
}

.project-modal-hero .project-visual-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.project-modal-body {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-xl) var(--container-padding) var(--space-2xl);
}

.project-modal-category {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.project-modal-description {
    color: var(--color-text-light);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
    max-width: 640px;
}

.project-modal-description p {
    color: var(--color-text-light);
    line-height: 1.7;
    margin-bottom: var(--space-sm);
}

.project-modal-description p:last-child {
    margin-bottom: 0;
}

.project-modal-description strong {
    color: var(--color-text);
    font-weight: 600;
}

.project-modal-link {
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.project-modal-link:hover {
    opacity: 0.75;
}

.project-modal-site-link-wrap {
    margin-top: var(--space-sm);
}

.project-modal-site-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.01em;
    line-height: 1.2;
    transition: opacity var(--transition-fast);
}

.project-modal-site-link span {
    display: block;
    line-height: inherit;
}

.project-modal-site-link:hover {
    opacity: 0.82;
}

.project-modal-site-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 2px;
}

.project-modal-site-link-icon {
    width: 0.85em;
    height: 0.85em;
    flex-shrink: 0;
    display: block;
    align-self: center;
    transform: translateY(0.04em);
}

.project-modal-site-link--bellhouse {
    color: #18B718;
}

.project-modal-site-link--lift {
    color: #E30000;
}

.project-modal-subheading {
    margin: var(--space-lg) 0 var(--space-sm);
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #000000;
}

[data-theme="dark"] .project-modal-subheading {
    color: #ffffff;
}

.project-modal-gallery {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.project-modal-gallery > .project-modal-subheading {
    margin-top: var(--space-xl);
    margin-bottom: 0;
}

.project-modal-gallery > .project-modal-subheading:first-child {
    margin-top: 0;
}

.project-visual-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols, 2), minmax(0, 1fr));
    gap: var(--space-md);
    width: 100%;
}

.project-visual-grid-item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    text-align: left;
}

.project-visual-grid-item:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

.project-visual-grid-item picture,
.project-visual-grid picture {
    display: block;
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.project-visual-grid-item img,
.project-visual-grid img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
    transition: transform 0.35s ease, opacity 0.25s ease;
}

.project-visual-grid-item:hover img {
    opacity: 0.92;
}

.project-visual-figure {
    margin: 0;
    width: 100%;
}

.project-visual-figure picture {
    display: block;
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.project-visual-caption {
    margin: 0.65rem 0 0;
    color: var(--color-text-muted);
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-align: center;
    line-height: 1.3;
}

.project-visual-caption--split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    text-align: center;
}

.project-modal-gallery picture {
    display: block;
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.project-modal-gallery img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    display: block;
    background: var(--color-bg-card);
}

.project-modal-downloads {
    margin: 0;
    padding: 0;
}

.project-modal-downloads-title {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.project-modal-downloads-list {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-modal-download {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--color-text);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.3;
    text-decoration: none;
    transition: color var(--transition-fast), opacity var(--transition-fast);
}

.project-modal-download:hover {
    color: var(--color-accent);
}

.project-modal-download-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: currentColor;
}

.project-modal-downloads--guardian {
    background: #FFBE06;
    border-radius: 0;
    width: 100%;
    margin: 0;
    padding: calc(1.15rem + 15px) 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.project-modal-downloads--guardian .project-modal-downloads-title,
.project-modal-downloads--guardian .project-modal-downloads-list {
    max-width: var(--container-max);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
    box-sizing: border-box;
}

.project-modal-downloads--guardian .project-modal-downloads-title {
    margin-bottom: 0.5rem;
}

.project-modal-body:has(+ .project-modal-downloads--guardian:not([hidden])) {
    padding-bottom: var(--space-xl);
}

.project-modal-downloads--guardian .project-modal-downloads-title {
    font-weight: 800;
}

.project-modal-downloads--guardian .project-modal-downloads-title,
.project-modal-downloads--guardian .project-modal-download,
.project-modal-downloads--guardian .project-modal-download-icon {
    color: #000;
}

.project-modal-downloads--guardian .project-modal-download:hover {
    color: #000;
    opacity: 0.72;
}

.project-modal-downloads--guardian .project-modal-download:hover .project-modal-download-icon {
    color: #000;
    opacity: 1;
}

.project-modal-gallery .project-hero-placeholder {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.project-modal-gallery img.project-visual--square {
    border-radius: 0;
    background: transparent;
}

.project-modal-gallery .hwd-breakdown.project-visual--square,
.project-modal-gallery picture:has(img.project-visual--square) {
    border-radius: 0;
    overflow: visible;
}

.project-modal-gallery .project-visual-embed {
    width: 100%;
}

.project-modal-gallery .project-visual-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.hwd-breakdown {
    position: relative;
    width: 100%;
    border-radius: 0;
    overflow: visible;
    margin-bottom: 0;
    /* Label lane under the marks; gallery gap after this matches space above */
    padding-bottom: 1.4rem;
}

.hwd-breakdown img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    background: transparent;
}

.hwd-hotspots {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    /* Keep hit targets on the image only — leave padding-bottom for labels */
    bottom: 1.4rem;
    pointer-events: none;
    overflow: visible;
}

.hwd-hotspot {
    position: absolute;
    width: clamp(44px, 10.5%, 84px);
    height: clamp(44px, 10.5%, 84px);
    transform: translate(-50%, -50%);
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    border-radius: 12px;
    z-index: 2;
    overflow: visible;
}

.hwd-hotspot.is-open {
    z-index: 6;
}

.hwd-hotspot:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}

.hwd-hotspot-bubble {
    position: absolute;
    left: 50%;
    /* Clear air under the mark, ending near the label lane bottom */
    top: 100%;
    bottom: auto;
    transform: translateX(-50%);
    margin-top: 0.8rem;
    background: transparent;
    color: var(--color-accent);
    border: 0;
    font-size: clamp(0.7rem, 1.6vw, 0.85rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    white-space: nowrap;
    padding: 0;
    border-radius: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0s linear 0.22s;
    box-shadow: none;
    z-index: 3;
    line-height: 1.1;
    text-align: center;
}

@media (min-width: 769px) {
    .hwd-breakdown {
        padding-bottom: 1.5rem;
    }

    .hwd-hotspots {
        bottom: 1.5rem;
    }

    .hwd-hotspot {
        width: clamp(52px, 9%, 96px);
        height: clamp(52px, 9%, 96px);
    }

    .hwd-hotspot-bubble {
        margin-top: 0.9rem;
    }
}

.hwd-hotspot:hover .hwd-hotspot-bubble,
.hwd-hotspot:focus-visible .hwd-hotspot-bubble,
.hwd-hotspot.is-open .hwd-hotspot-bubble {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0s;
}

/* Only one label at a time — open mark wins over sibling hover */
.hwd-hotspots:has(.hwd-hotspot.is-open) .hwd-hotspot:not(.is-open):hover .hwd-hotspot-bubble,
.hwd-hotspots:has(.hwd-hotspot.is-open) .hwd-hotspot:not(.is-open):focus-visible .hwd-hotspot-bubble {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0s linear 0.15s;
}

.hwd-hotspot.is-closed .hwd-hotspot-bubble,
.hwd-hotspot.is-closed:hover .hwd-hotspot-bubble,
.hwd-hotspot.is-closed:focus-visible .hwd-hotspot-bubble {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.project-visual-embed {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: #0a0a0a;
}

.project-spin {
    width: min(26rem, 100%);
    margin: 0 auto;
    outline: none;
}

.project-spin--wide {
    width: 100%;
}

.project-spin-stage {
    position: relative;
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #f4f4f4;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

[data-theme="dark"] .project-spin-stage {
    background: #141414;
}

.project-spin.is-dragging .project-spin-stage {
    cursor: grabbing;
}

.project-spin-frame {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.project-spin-toggle {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.72);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.project-spin-toggle:hover {
    opacity: 0.85;
}

.project-spin-toggle:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

.project-spin-icon {
    width: 16px;
    height: 16px;
    display: none;
}

.project-spin.is-playing .project-spin-icon--pause,
.project-spin:not(.is-playing) .project-spin-icon--play {
    display: block;
}

.project-spin-icon--play {
    margin-left: 2px;
}

.project-spin-hint {
    margin: 0.65rem 0 0;
    color: var(--color-text-muted);
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-align: center;
    line-height: 1.3;
}

.project-carousel {
    position: relative;
    width: 100%;
    outline: none;
}

.project-carousel-frame {
    position: relative;
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-bg-card);
}

.project-carousel-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: pan-y;
}

.project-carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.project-carousel-track.is-jumping {
    transition: none;
}

.project-carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    min-width: 0;
}

.project-carousel-slide picture,
.project-carousel-slide img,
.project-carousel-slide .project-carousel-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    background: transparent;
}

.project-carousel-prev,
.project-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--color-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: opacity var(--transition-fast);
}

.project-carousel-prev:hover,
.project-carousel-next:hover {
    opacity: 0.7;
}

.project-carousel-prev {
    left: 0.35rem;
}

.project-carousel-next {
    right: 0.35rem;
}

.project-carousel-prev svg,
.project-carousel-next svg {
    width: 26px;
    height: 26px;
}

.project-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.project-carousel-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--color-border);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.project-carousel-dot.is-active {
    background: var(--color-accent);
    transform: scale(1.15);
}

.project-carousel--bellhouse .project-carousel-dot.is-active {
    background: #18B718;
}

.project-carousel--guardian .project-carousel-dot.is-active {
    background: #FFBE06;
}

.project-carousel--hewill .project-carousel-dot.is-active {
    background: #FF4800;
}

@media (max-width: 768px) {
    .project-carousel-prev,
    .project-carousel-next {
        display: none;
    }
}

.project-visual-embed--square {
    border-radius: 0;
}

.project-visual-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.portfolio-item[data-project],
.portfolio-item[data-lightbox] {
    cursor: pointer;
}

/* -------------------- Marks Lightbox -------------------- */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3500;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.lightbox.lightbox--wide {
    z-index: 5000;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-stage {
    width: min(90vw, calc(80vh * 1080 / 1350), 480px);
    text-align: center;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox--wide .lightbox-stage {
    width: min(92vw, calc(80vh * 16 / 9), 1200px);
}

.lightbox-image {
    width: 100%;
    aspect-ratio: 1080 / 1350;
    max-height: 80vh;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
    display: block;
    margin: 0 auto;
    transition: opacity 0.25s ease;
}

.lightbox--wide .lightbox-image {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
}

.lightbox-caption {
    margin-top: var(--space-md);
    color: #fff;
    font-size: 0.9375rem;
    min-height: 1.4em;
}

.lightbox-caption.is-invisible {
    visibility: hidden;
}

.lightbox-counter {
    margin-top: var(--space-xs);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
}

.lightbox-swipe-hint {
    display: none;
    margin-top: var(--space-sm);
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: transparent;
    border: none;
    color: var(--color-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity var(--transition-fast);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 0.7;
}

.lightbox-close {
    top: var(--space-md);
    right: var(--space-md);
    width: 40px;
    height: 40px;
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
}

.lightbox-prev {
    left: var(--space-sm);
}

.lightbox-next {
    right: var(--space-sm);
}

.lightbox-prev svg,
.lightbox-next svg {
    width: 28px;
    height: 28px;
}

@media (max-width: 1024px) {
    .lightbox-prev,
    .lightbox-next {
        display: none;
    }

    .lightbox-swipe-hint {
        display: block;
    }
}

@media (max-width: 768px) {
    .lightbox {
        padding: var(--space-sm);
    }

    .lightbox-stage {
        width: min(92vw, calc(70vh * 1080 / 1350));
    }

    .lightbox--wide .lightbox-stage {
        width: min(96vw, calc(55vh * 16 / 9));
    }

    .lightbox-image {
        max-height: 70vh;
    }

    .lightbox--wide .lightbox-image {
        max-height: 55vh;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

body.project-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

@media (max-width: 768px) {
    .modal {
        padding: var(--space-sm);
    }

    .modal.project-modal {
        padding: 0 !important;
    }
    
    .modal-content {
        margin: var(--space-md) auto;
    }

    .project-modal-content {
        margin: 0;
    }
    
    .modal-body {
        padding: var(--space-lg);
        padding-top: var(--space-sm);
    }

    .project-modal-body {
        padding: var(--space-lg) var(--container-padding) var(--space-xl);
    }
}
