/* ==========================================================================
   courts.studio — Styles
   Palette: Hardwood Amber #D4A574, Clay Court Orange #C67B4B, Regulation Green #4A7C59,
            Court Line Cream #FFF8E7, Gymnasium Shadow #2B1810, Clerestory Blue #7BA3BF,
            Acrylic Surface #B8C4A8, Net Post Silver #A8A8A0
   Fonts: Anybody (display), Nunito (body), Azeret Mono (labels)
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: #2B1810;
    color: #FFF8E7;
    font-family: 'Nunito', sans-serif;
    font-size: 17px;
    line-height: 1.75;
    overflow-x: hidden;
    cursor: none;
}

::selection {
    background: #C67B4B;
    color: #FFF8E7;
}

a {
    color: #7BA3BF;
    text-decoration: none;
}

/* --- Custom Cursor --- */
#cursor-ball {
    position: fixed;
    width: 12px;
    height: 12px;
    background: #C67B4B;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    will-change: transform;
    display: none;
}

.cursor-trail {
    position: fixed;
    width: 12px;
    height: 12px;
    background: #C67B4B;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    will-change: transform;
    display: none;
}

#trail-1 { opacity: 0.4; width: 10px; height: 10px; }
#trail-2 { opacity: 0.25; width: 8px; height: 8px; }
#trail-3 { opacity: 0.12; width: 6px; height: 6px; }

/* --- Navigation Pill --- */
#nav-pill {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: #4A7C59;
    border-radius: 40px;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(43, 24, 16, 0.3);
    transition: background 0.4s ease, opacity 0.4s ease, transform 0.4s ease;
}

#nav-pill.scrolled {
    background: rgba(74, 124, 89, 0.92);
    box-shadow: 0 4px 30px rgba(43, 24, 16, 0.5);
}

.nav-logo {
    font-family: 'Anybody', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: #FFF8E7;
    letter-spacing: -0.03em;
}

#nav-hamburger {
    background: none;
    border: none;
    cursor: none;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: #FFF8E7;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* --- Overlay Menu --- */
#overlay-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #2B1810;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#overlay-menu.active {
    opacity: 1;
    pointer-events: all;
}

#overlay-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    cursor: none;
    width: 40px;
    height: 40px;
}

#overlay-close span {
    display: block;
    width: 30px;
    height: 2px;
    background: #FFF8E7;
    position: absolute;
    top: 50%;
    left: 50%;
}

#overlay-close span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
}

#overlay-close span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.overlay-link {
    font-family: 'Anybody', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #FFF8E7;
    letter-spacing: -0.03em;
    transition: color 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

#overlay-menu.active .overlay-link {
    opacity: 1;
    transform: translateY(0);
}

.overlay-link:hover {
    color: #C67B4B;
    transform: translateX(8px);
}

/* Stagger overlay link animations */
#overlay-menu.active .overlay-link[data-index="0"] { transition-delay: 0.05s; }
#overlay-menu.active .overlay-link[data-index="1"] { transition-delay: 0.1s; }
#overlay-menu.active .overlay-link[data-index="2"] { transition-delay: 0.15s; }
#overlay-menu.active .overlay-link[data-index="3"] { transition-delay: 0.2s; }
#overlay-menu.active .overlay-link[data-index="4"] { transition-delay: 0.25s; }
#overlay-menu.active .overlay-link[data-index="5"] { transition-delay: 0.3s; }
#overlay-menu.active .overlay-link[data-index="6"] { transition-delay: 0.35s; }

/* Reset transition delay when closing */
.overlay-link {
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

/* --- Section Base --- */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.section--hero {
    opacity: 1;
    transform: none;
}

.section.in-view {
    opacity: 1;
    transform: translateY(0);
}

.section-inner {
    position: relative;
    width: 100%;
    max-width: 1100px;
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

/* --- Typography --- */
.section-title {
    font-family: 'Anybody', sans-serif;
    font-weight: 800;
    font-size: clamp(2.8rem, 6vw, 6rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 24px;
    color: #FFF8E7;
}

.section-body {
    font-family: 'Nunito', sans-serif;
    font-size: 17px;
    line-height: 1.75;
    max-width: 38em;
    margin-bottom: 16px;
    color: #FFF8E7;
}

.court-label {
    font-family: 'Azeret Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #FFF8E7;
    display: inline-block;
    margin-top: 8px;
}

/* --- Court SVG Diagrams --- */
.court-svg {
    width: 80%;
    max-width: 700px;
    height: auto;
}

.court-diagram {
    width: 100%;
    max-width: 500px;
    height: auto;
    flex-shrink: 0;
}

.court-line {
    stroke: #FFF8E7;
    stroke-width: 1.5;
    fill: none;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

/* --- Hero Section --- */
.section--hero {
    background: #2B1810;
    position: relative;
    transition: background 1.2s ease;
}

.section--hero.lit {
    background: linear-gradient(180deg, #D4A574 0%, #2B1810 100%);
}

#hero-court {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    max-width: 800px;
    opacity: 0.85;
}

.hero-title {
    position: relative;
    z-index: 2;
    font-family: 'Anybody', sans-serif;
    font-weight: 800;
    font-size: clamp(2.8rem, 8vw, 7rem);
    letter-spacing: -0.03em;
    color: #FFF8E7;
    text-align: center;
    opacity: 0;
}

.hero-title.visible {
    opacity: 1;
}

.hero-title span {
    display: inline-block;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-title span.show {
    opacity: 1;
    transform: scale(1);
}

.scroll-cue {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.scroll-cue.visible {
    opacity: 1;
}

.scroll-ball {
    width: 10px;
    height: 10px;
    background: #C67B4B;
    border-radius: 50%;
    animation: bounce-ball 1.5s ease-in-out infinite;
}

@keyframes bounce-ball {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* --- Tennis Section --- */
.section--tennis {
    background: #2B1810;
    /* Clay texture: tiny dot pattern */
    background-image: radial-gradient(circle, #B8C4A8 0.5px, transparent 0.5px);
    background-size: 8px 8px;
}

.section--tennis .court-diagram {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section--tennis.in-view .court-diagram {
    opacity: 1;
    transform: translateY(0);
}

.tennis-content {
    flex: 1;
    min-width: 300px;
}

/* --- Basketball Section --- */
.section--basketball {
    background: #2B1810;
    /* Hardwood: fine parallel lines */
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(184, 196, 168, 0.04) 2px,
        rgba(184, 196, 168, 0.04) 3px
    );
}

.section--basketball .court-diagram {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section--basketball.in-view .court-diagram {
    opacity: 1;
    transform: translateY(0);
}

.basketball-content {
    flex: 1;
    min-width: 300px;
}

/* --- Golden Hour Section --- */
.section--golden-hour {
    background: linear-gradient(180deg, #D4A574 0%, #C67B4B 40%, #2B1810 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.golden-hour-inner {
    position: relative;
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.golden-court {
    opacity: 0.6;
    max-width: 700px;
}

.golden-text {
    text-align: center;
    position: relative;
    z-index: 2;
    margin-top: -80px;
}

.golden-title {
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    margin-bottom: 24px;
    text-shadow: 0 2px 20px rgba(43, 24, 16, 0.4);
}

.golden-body {
    max-width: 32em;
    margin: 0 auto;
    font-size: 18px;
    text-shadow: 0 1px 10px rgba(43, 24, 16, 0.3);
}

/* --- Badminton Section --- */
.section--badminton {
    background: #FFF8E7;
    color: #2B1810;
    /* Grass texture: fine parallel lines */
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(74, 124, 89, 0.04) 2px,
        rgba(74, 124, 89, 0.04) 3px
    );
}

.section--badminton .section-title,
.section--badminton .section-body {
    color: #2B1810;
}

.section--badminton .court-label {
    color: #4A7C59;
}

.section--badminton .court-diagram {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section--badminton.in-view .court-diagram {
    opacity: 1;
    transform: translateY(0);
}

.badminton-content {
    flex: 1;
    min-width: 300px;
}

/* --- Blobitecture Containers --- */
.blob-container {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    padding: 40px;
    border: 1px solid #A8A8A0;
    box-shadow: inset 0 2px 8px rgba(43, 24, 16, 0.06);
    transition: border-radius 0.4s ease;
    animation: blob-morph 16s ease-in-out infinite;
    margin-bottom: 24px;
    background: rgba(43, 24, 16, 0.2);
}

.section--badminton .blob-container {
    background: rgba(255, 248, 231, 0.5);
    border-color: #B8C4A8;
}

.blob-container:hover {
    border-radius: 24px;
    animation-play-state: paused;
}

@keyframes blob-morph {
    0%   { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    25%  { border-radius: 58% 42% 55% 45% / 45% 60% 40% 55%; }
    50%  { border-radius: 45% 55% 35% 65% / 60% 35% 65% 40%; }
    75%  { border-radius: 65% 35% 60% 40% / 35% 55% 45% 65%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

.blob-1 { animation-delay: 0s; }
.blob-2 { animation-delay: -4s; animation-duration: 18s; }
.blob-3 { animation-delay: -2s; animation-duration: 14s; }
.blob-4 { animation-delay: -6s; animation-duration: 20s; }
.blob-5 { animation-delay: -3s; animation-duration: 15s; }
.blob-6 { animation-delay: -8s; animation-duration: 17s; }
.blob-7 { animation-delay: -1s; animation-duration: 19s; }
.blob-8 { animation-delay: -5s; animation-duration: 13s; }

/* --- Net Divider --- */
.net-divider {
    width: 100%;
    height: 24px;
    background-image:
        repeating-linear-gradient(
            90deg,
            #A8A8A0 0px,
            #A8A8A0 4px,
            transparent 4px,
            transparent 5px
        ),
        repeating-linear-gradient(
            0deg,
            #A8A8A0 0px,
            #A8A8A0 4px,
            transparent 4px,
            transparent 5px
        );
    background-size: 5px 5px;
    opacity: 0.2;
    margin: 0;
}

/* --- Explorer Section --- */
.section--explorer {
    background: #2B1810;
    padding: 80px 20px;
    /* Acrylic surface texture: tight dots */
    background-image: radial-gradient(circle, rgba(184, 196, 168, 0.06) 0.5px, transparent 0.5px);
    background-size: 5px 5px;
}

.explorer-title {
    text-align: center;
    margin-bottom: 12px;
}

.explorer-intro {
    text-align: center;
    margin-bottom: 40px;
    color: #B8C4A8;
}

.explorer-container {
    position: relative;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
}

.explorer-court-svg {
    width: 100%;
    max-width: 780px;
    cursor: none;
}

.explorer-zone {
    transition: fill 0.3s ease;
}

.explorer-zone.highlight {
    fill: rgba(198, 123, 75, 0.12);
}

.explorer-tooltip {
    position: absolute;
    background: rgba(43, 24, 16, 0.95);
    border: 1px solid #A8A8A0;
    border-radius: 8px;
    padding: 8px 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.explorer-tooltip.visible {
    opacity: 1;
}

.tooltip-label {
    font-family: 'Azeret Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #FFF8E7;
}

.tooltip-dim {
    font-family: 'Azeret Mono', monospace;
    font-size: 10px;
    color: #C67B4B;
    letter-spacing: 0.1em;
}

/* --- Philosophy Section --- */
.section--philosophy {
    background: #2B1810;
    position: relative;
    padding: 100px 40px;
}

.philosophy-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* --- Floating Court Fragments --- */
.floating-fragment {
    position: absolute;
    opacity: 0.4;
    animation: float-drift 8s ease-in-out infinite;
}

.frag-1 {
    top: 15%;
    right: 5%;
    animation-delay: 0s;
}

.frag-2 {
    bottom: 20%;
    left: 4%;
    animation-delay: -3s;
    animation-duration: 10s;
}

.frag-3 {
    top: 60%;
    right: 8%;
    animation-delay: -5s;
    animation-duration: 9s;
}

@keyframes float-drift {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-18px) rotate(2deg); }
}

/* --- Golden Hour Light Sweep --- */
.light-sweep {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(165deg, rgba(212, 165, 116, 0.15) 0%, transparent 60%);
    pointer-events: none;
    opacity: 0;
    transform: translateX(-100%);
    transition: opacity 1.2s ease-out, transform 1.5s ease-out;
}

.in-view .light-sweep {
    opacity: 1;
    transform: translateX(0);
}

.light-sweep--light {
    background: linear-gradient(165deg, rgba(74, 124, 89, 0.08) 0%, transparent 60%);
}

/* --- Footer --- */
.site-footer {
    background: #2B1810;
    padding: 60px 40px;
    text-align: center;
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-logo {
    font-family: 'Anybody', sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.03em;
    color: #FFF8E7;
}

.footer-tagline {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    color: #B8C4A8;
}

.net-divider--footer {
    width: 200px;
    height: 12px;
}

.footer-copy {
    font-family: 'Azeret Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: #A8A8A0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section {
        padding: 60px 20px;
    }

    .section-inner {
        flex-direction: column;
        gap: 24px;
    }

    .court-diagram {
        max-width: 100%;
    }

    .blob-container {
        padding: 24px;
    }

    #hero-court {
        width: 95%;
    }

    .golden-text {
        margin-top: -40px;
    }

    body {
        cursor: auto;
    }

    #cursor-ball,
    .cursor-trail {
        display: none !important;
    }

    .explorer-container {
        overflow-x: auto;
    }

    .floating-fragment {
        display: none;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    #nav-pill {
        padding: 8px 16px;
    }

    .overlay-link {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }
}
