/* ===== CSS Variables ===== */
:root {
    --color-bg: #fbf3fa;
    --color-text: #000000;
    --color-accent: #1e3a8a;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --gap: 4px;
    --border-radius: 0;
    --header-height: 70px;
    --footer-height: 60px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height);
    scroll-behavior: smooth;
}

/* Page transition overlay */
body.page-transitioning::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    filter: blur(0);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

body.page-transitioning.fade-out::after {
    opacity: 1;
    filter: blur(4px);
}

/* ===== HOVER SYSTEM: Blue highlight - REMOVED from header/footer ===== */
.pill-cta,
.project-link-btn {
    position: relative;
    transition: box-shadow 0.2s ease, color 0.2s ease;
}

.pill-cta:hover,
.pill-cta:focus-visible {
    box-shadow: inset 0 -3em 0 var(--color-accent);
    color: var(--color-bg);
    border-color: var(--color-accent);
}

.project-link-btn:hover,
.project-link-btn:focus-visible {
    box-shadow: inset 0 -3em 0 var(--color-accent);
    color: var(--color-bg);
    border-color: var(--color-accent);
}

/* ===== Header - Simple Transparent ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 1000;
    background-color: transparent;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo a {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.header-logo a:hover {
    opacity: 0.7;
}

.header-social {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.header-social a {
    display: flex;
    align-items: center;
    transition: opacity 0.2s ease;
}

.header-social a .social-icon {
    width: 20px;
    height: 20px;
    display: block;
    /* Blue color overlay via filter - converted brand blue #1e3a8a to filter */
    filter: brightness(0) saturate(100%) invert(14%) sepia(81%) saturate(2556%) hue-rotate(216deg) brightness(94%) contrast(99%);
}

.header-social a:hover {
    opacity: 0.7;
}

/* ===== Footer ===== */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background-color: var(--color-bg);
    border-top: 2px solid var(--color-text);
    z-index: 1000;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left,
.footer-center,
.footer-right {
    flex: 1;
}

.footer-center {
    display: flex;
    justify-content: center;
}

.footer-right {
    display: flex;
    justify-content: flex-end;
}

.online-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--color-text);
    transition: opacity 0.2s ease;
}

.online-indicator:hover {
    opacity: 0.6;
}

.online-indicator span {
    display: none;
}

.online-gif {
    width: auto;
    height: 24px;
    image-rendering: pixelated;
}

/* STANDARDIZED FOOTER BUTTONS - simple opacity hover only */
.newsletter-trigger,
.contact-trigger {
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-text);
    cursor: pointer;
    padding: var(--spacing-xs) var(--spacing-sm);
    position: relative;
    line-height: 1.4;
    height: auto;
    min-height: 36px;
    transition: opacity 0.2s ease;
}

.newsletter-trigger:hover {
    opacity: 0.6;
}

.contact-trigger {
    perspective: 1000px;
}

.contact-trigger:hover {
    opacity: 1;
}

.contact-text,
.contact-feedback {
    display: block;
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.contact-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(90deg);
    opacity: 0;
}

.contact-trigger.copied .contact-text {
    transform: rotateX(-90deg);
    opacity: 0;
}

.contact-trigger.copied .contact-feedback {
    transform: translate(-50%, -50%) rotateX(0deg);
    opacity: 1;
}

/* ===== Homepage Layout ===== */
.homepage-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-lg);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: start;
}

/* ===== Photobooth Grid ===== */
.photobooth-wrapper {
    position: relative;
}

.photobooth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
    width: 100%;
    aspect-ratio: 1;
}

.photo-tile {
    position: relative;
    overflow: hidden;
    background: var(--color-text);
    aspect-ratio: 1;
}

.photo-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.05s ease;
}

.photo-img.active {
    opacity: 1;
}

.dither-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            45deg,
            var(--color-text) 0px,
            var(--color-text) 2px,
            var(--color-bg) 2px,
            var(--color-bg) 4px
        );
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.photo-tile.flashing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 20;
    animation: flashWhite 0.15s ease-out;
    pointer-events: none;
}

@keyframes flashWhite {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 0.9;
    }
}

/* ===== Content Card ===== */
.content-card {
    background: var(--color-bg);
    padding: var(--spacing-lg);
}

.intro-block {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.intro-text p {
    font-size: 1.1rem;
    line-height: 1.4;
    margin: 0;
}

.pianoman-stamp {
    width: 120px;
    height: auto;
    flex-shrink: 0;
    image-rendering: pixelated;
    display: none;
}

/* Show pianoman on desktop inline */
@media (min-width: 769px) {
    .intro-block {
        display: flex;
    }
    
    .pianoman-stamp {
        display: none !important;
    }
    
    .intro-block::after {
        content: '';
        width: 120px;
        height: 120px;
        background: url('/images/pianoman.gif') no-repeat center;
        background-size: contain;
        flex-shrink: 0;
        image-rendering: pixelated;
    }
}

.pill-cta {
    display: block;
    padding: 10px 24px;
    background: transparent;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 2px solid var(--color-accent);
    margin-bottom: var(--spacing-md);
    text-align: center;
    width: fit-content;
    /* Desktop: left-aligned */
    margin-left: 0;
    margin-right: auto;
}

.divider {
    height: 1px;
    background: var(--color-text);
    margin: var(--spacing-md) 0;
    opacity: 0.3;
}

.projects-section {
    margin-bottom: var(--spacing-md);
}

.projects-heading {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    text-transform: lowercase;
}

.projects-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.projects-list li {
    margin-bottom: var(--spacing-xs);
    width: fit-content;
}

.project-link {
    display: block;
    cursor: pointer;
}

.project-button-img {
    display: block;
    height: auto;
    max-width: 100%;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.project-button-img:hover {
    opacity: 0.8;
    transform: translateX(4px);
}

.thank-you {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-top: var(--spacing-md);
}

/* ===== Modals ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.modal-content {
    position: relative;
    background: var(--color-bg);
    border: 2px solid var(--color-text);
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.newsletter-modal-content {
    width: 500px;
    padding: var(--spacing-lg);
    animation: spinIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center center;
}

@keyframes spinIn {
    0% {
        transform: rotate(-12deg) scale(0.96);
        opacity: 0;
    }
    60% {
        transform: rotate(3deg) scale(1.02);
    }
    100% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    z-index: 10;
}

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

/* Project Modals */
.project-modal-content {
    width: 600px;
    padding: var(--spacing-xl);
    background: rgba(251, 243, 250, 0.95);
}

.project-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
    text-align: center;
}

.project-preview-img {
    max-width: 100%;
    height: auto;
    border: none;
}

.project-preview-img.floating {
    animation: float 3s ease-in-out infinite;
    max-width: 80%;
}

.project-preview-img.spinning {
    animation: spin 4s linear infinite;
    border: none;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.project-description {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.project-link-btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--color-text);
    color: var(--color-bg);
    text-decoration: none;
    font-size: 1rem;
    border: 2px solid var(--color-text);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
    }

    .header-content {
        padding: 0 var(--spacing-sm);
    }

    .header-logo a {
        font-size: 1.2rem;
    }

    .header-social {
        gap: var(--spacing-sm);
    }

    .header-social a .social-icon {
        width: 18px;
        height: 18px;
    }

    .footer-content {
        padding: 0 var(--spacing-sm);
        font-size: 0.8rem;
    }

    .online-indicator span {
        display: none;
    }

    .newsletter-trigger,
    .contact-trigger {
        font-size: 0.8rem;
        padding: var(--spacing-xs);
    }

    .homepage-container {
        grid-template-columns: 1fr;
        padding: var(--spacing-md) var(--spacing-sm);
        gap: var(--spacing-md);
    }

    /* Photobooth HALF SIZE on mobile */
    .photobooth-wrapper {
        display: block;
        margin-bottom: var(--spacing-sm);
        max-width: 57.5%;
        width: 57.5%;
        margin-left: auto;
        margin-right: auto;
    }

    .photobooth-grid {
        display: grid;
    }

    .content-card {
        padding: var(--spacing-md);
        text-align: center;
    }

    .intro-block {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }

    .intro-block::after {
        display: none !important;
    }

    .intro-text {
        text-align: center;
    }

    /* Pianoman sits above divider on mobile */
    .pianoman-stamp {
        width: 80px;
        display: block !important;
        margin: var(--spacing-sm) auto;
    }

    .pill-cta {
        display: inline-block;
        text-align: center;
        /* Mobile: centered */
        margin-left: auto;
        margin-right: auto;
    }

    .projects-section {
        text-align: center;
    }
    
    .projects-list {
        align-items: center;
    }

    .divider {
        order: 0;
    }

    .newsletter-modal-content,
    .project-modal-content {
        width: 95%;
        max-width: 400px;
        padding: var(--spacing-md);
    }

    .modal-close {
        top: var(--spacing-xs);
        right: var(--spacing-xs);
    }
}

/* ===== Accessibility ===== */
.modal-close:focus-visible,
.newsletter-trigger:focus-visible,
.pill-cta:focus-visible,
.header-logo a:focus-visible,
.header-social a:focus-visible,
.project-link-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
