/* ============================================
   ppuzzle.net - Pop-Art Sunset Stage
   Lichtenstein-inspired, sunset-warm palette
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.85;
    color: #5A3020;
    background-color: #FFF5E8;
    overflow-x: hidden;
    position: relative;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: #2A1010;
    line-height: 1.2;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1em;
}

h3 {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 700;
    margin-bottom: 0.5em;
}

.pop-label {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    color: #D06030;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: inline-block;
}

.pop-label.small {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
}

a {
    color: #D06030;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #F0B040;
}

/* ---------- Grain Overlay (Ben-Day Halftone) ---------- */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background-image: radial-gradient(circle, #2A1010 0.5px, transparent 0.5px);
    background-size: 4px 4px;
    opacity: 0.04;
}

/* ---------- Tropical Fish ---------- */
.fish-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.fish {
    position: absolute;
    opacity: 0.05;
    will-change: transform;
}

.fish-1 {
    width: 80px;
    height: 50px;
    color: #E08060;
    top: 15%;
    left: -100px;
    animation: swimRight 25s linear infinite;
    animation-delay: 0s;
}

.fish-2 {
    width: 60px;
    height: 52px;
    color: #D06030;
    top: 35%;
    right: -100px;
    animation: swimLeft 30s linear infinite;
    animation-delay: 3s;
}

.fish-3 {
    width: 70px;
    height: 44px;
    color: #F0B040;
    top: 55%;
    left: -100px;
    animation: swimRight 22s linear infinite;
    animation-delay: 7s;
}

.fish-4 {
    width: 55px;
    height: 47px;
    color: #E08060;
    top: 72%;
    right: -100px;
    animation: swimLeft 28s linear infinite;
    animation-delay: 12s;
}

.fish-5 {
    width: 65px;
    height: 41px;
    color: #D06030;
    top: 88%;
    left: -100px;
    animation: swimRight 32s linear infinite;
    animation-delay: 5s;
}

.fish-6 {
    width: 50px;
    height: 43px;
    color: #F0B040;
    top: 48%;
    right: -100px;
    animation: swimLeft 26s linear infinite;
    animation-delay: 15s;
}

@keyframes swimRight {
    0% { transform: translateX(-100px) scaleX(1); }
    100% { transform: translateX(calc(100vw + 100px)) scaleX(1); }
}

@keyframes swimLeft {
    0% { transform: translateX(100px) scaleX(-1); }
    100% { transform: translateX(calc(-100vw - 100px)) scaleX(-1); }
}

/* ---------- Spring Bounce Animation ---------- */
@keyframes springIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.92);
    }
    60% {
        opacity: 1;
        transform: translateY(-8px) scale(1.02);
    }
    80% {
        transform: translateY(3px) scale(0.99);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.spring-in {
    animation: springIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.spring-in:nth-child(1) { animation-delay: 0.1s; }
.spring-in:nth-child(2) { animation-delay: 0.25s; }
.spring-in:nth-child(3) { animation-delay: 0.4s; }
.spring-in:nth-child(4) { animation-delay: 0.55s; }

/* Observe-triggered spring animation */
.observe-spring {
    opacity: 0;
    transform: translateY(40px) scale(0.92);
}

.observe-spring.sprung {
    animation: springIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Stagger delays for observed elements */
.observe-spring.sprung:nth-child(1) { animation-delay: 0s; }
.observe-spring.sprung:nth-child(2) { animation-delay: 0.1s; }
.observe-spring.sprung:nth-child(3) { animation-delay: 0.2s; }
.observe-spring.sprung:nth-child(4) { animation-delay: 0.3s; }
.observe-spring.sprung:nth-child(5) { animation-delay: 0.4s; }
.observe-spring.sprung:nth-child(6) { animation-delay: 0.5s; }
.observe-spring.sprung:nth-child(7) { animation-delay: 0.6s; }
.observe-spring.sprung:nth-child(8) { animation-delay: 0.7s; }

/* ---------- Hero Section ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #FFF5E8 0%, #FFE8D0 100%);
    position: relative;
    text-align: center;
    padding: clamp(24px, 5vw, 80px);
}

.hero-content {
    max-width: 900px;
    position: relative;
    z-index: 5;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.4rem, 5.5vw, 4.2rem);
    font-weight: 700;
    color: #2A1010;
    margin: 0.3em 0 0.4em;
    letter-spacing: 0.04em;
    position: relative;
}

.hero-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: #D06030;
    margin: 0.5em auto 0;
    border-radius: 2px;
}

.hero-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    color: #5A3020;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

.hero-decoration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
}

.hero-burst {
    width: clamp(250px, 40vw, 500px);
    height: clamp(250px, 40vw, 500px);
    animation: rotateSlow 40s linear infinite;
}

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

.hero-scroll-hint {
    position: absolute;
    bottom: clamp(24px, 4vh, 48px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.scroll-arrow {
    animation: bobDown 2s ease-in-out infinite;
}

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

/* ---------- Sections ---------- */
.section {
    position: relative;
    padding: clamp(40px, 8vh, 80px) clamp(24px, 5vw, 80px);
}

.section-inner {
    max-width: 900px;
    margin: 0 auto;
}

.section-title {
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: #F0B040;
    margin-top: 0.3em;
    border-radius: 2px;
}

/* Section fish border decoration */
.section-fish-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #E08060 20%, #F0B040 50%, #E08060 80%, transparent);
    opacity: 0.2;
}

/* ---------- About Section ---------- */
.section-about {
    background: #FFF5E8;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: clamp(20px, 3vw, 40px);
    margin-top: 2em;
}

.about-card {
    background: linear-gradient(135deg, #FFE8D0 0%, #FFF5E8 100%);
    border-radius: 12px;
    padding: clamp(24px, 3vw, 36px);
    border: 2px solid rgba(208, 96, 48, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(42, 16, 16, 0.08);
}

.card-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1em;
}

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

/* ---------- Featured Section ---------- */
.section-featured {
    background: linear-gradient(180deg, #FFE8D0 0%, #FFF5E8 100%);
}

.featured-grid {
    display: grid;
    gap: 0;
    margin-top: 2em;
}

.featured-item {
    display: flex;
    align-items: flex-start;
    gap: clamp(16px, 3vw, 32px);
    padding: clamp(20px, 3vw, 32px) 0;
    border-bottom: 1px solid rgba(208, 96, 48, 0.15);
    transition: background 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}

.featured-item:last-child {
    border-bottom: none;
}

.featured-item:hover {
    background: rgba(240, 176, 64, 0.06);
    padding-left: 12px;
    margin-left: -12px;
    padding-right: 12px;
    margin-right: -12px;
    border-radius: 8px;
}

.featured-number {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: #F0B040;
    line-height: 1;
    opacity: 0.4;
    min-width: 70px;
}

.featured-content h3 {
    color: #2A1010;
    margin-bottom: 0.3em;
}

.featured-content p {
    margin-bottom: 0.8em;
    color: #5A3020;
}

/* ---------- Gallery Section ---------- */
.section-gallery {
    background: #FFF5E8;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: clamp(12px, 2vw, 20px);
    margin-top: 2em;
}

.gallery-tile {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.gallery-tile:hover {
    transform: scale(1.05) rotate(-1deg);
    box-shadow: 0 16px 40px rgba(42, 16, 16, 0.12);
}

.tile-inner {
    width: 100%;
    height: 100%;
    background: var(--tile-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tile-pattern {
    width: 70%;
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile-pattern svg {
    width: 100%;
    height: 100%;
}

.tile-label {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.7rem;
    color: #FFF5E8;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    position: absolute;
    bottom: 12px;
    opacity: 0.7;
}

/* ---------- Community Section ---------- */
.section-community {
    background: linear-gradient(180deg, #FFF5E8 0%, #FFE8D0 100%);
}

.community-content {
    margin-top: 2em;
}

.community-stats {
    display: flex;
    justify-content: center;
    gap: clamp(24px, 5vw, 60px);
    flex-wrap: wrap;
    margin-bottom: 3em;
}

.stat-bubble {
    text-align: center;
    padding: clamp(16px, 3vw, 28px);
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    width: clamp(110px, 18vw, 160px);
    height: clamp(110px, 18vw, 160px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(208, 96, 48, 0.15);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-bubble:hover {
    transform: scale(1.08);
}

.stat-number {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 700;
    color: #D06030;
    line-height: 1.1;
    display: block;
}

.stat-label {
    display: block;
    margin-top: 4px;
}

.community-message {
    max-width: 600px;
    margin: 0 auto;
}

.speech-bubble {
    position: relative;
    background: #FFF5E8;
    border: 3px solid #D06030;
    border-radius: 20px;
    padding: clamp(20px, 3vw, 32px);
    text-align: center;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 16px solid #D06030;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 14px solid #FFF5E8;
    z-index: 1;
}

.speech-bubble p {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    color: #5A3020;
    line-height: 1.8;
}

/* ---------- Footer ---------- */
.site-footer {
    background: #2A1010;
    color: #FFE8D0;
    padding: clamp(32px, 6vh, 60px) clamp(24px, 5vw, 80px);
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-logo {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #F0B040;
    letter-spacing: 0.05em;
}

.footer-tagline {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: #E08060;
    opacity: 0.7;
}

.footer-links {
    text-align: center;
}

.footer-links .pop-label {
    color: #F0B040;
    margin-bottom: 12px;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.footer-nav a {
    color: #FFE8D0;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: #F0B040;
}

.footer-copy {
    text-align: right;
    align-self: end;
}

.footer-copy p {
    font-size: 0.8rem;
    color: #E08060;
    opacity: 0.5;
}

/* ---------- Speech Pop Keyframes ---------- */
@keyframes speechPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    60% {
        transform: scale(1.04);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 24px;
    }

    .footer-copy {
        text-align: center;
    }

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

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .featured-number {
        min-width: 50px;
    }

    .community-stats {
        gap: 16px;
    }

    .stat-bubble {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .fish {
        opacity: 0.03;
    }
}
