/* ============================================================
   xity.quest — Styles
   Palette: #c4724e #f5efe6 #2a9d8f #8b4513 #9b7cb8 #3d3028 #d4a843
   Fonts: Playfair Display, Lora, Permanent Marker
   ============================================================ */

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

:root {
    --terracotta: #c4724e;
    --cream: #f5efe6;
    --teal: #2a9d8f;
    --sienna: #8b4513;
    --lavender: #9b7cb8;
    --charcoal: #3d3028;
    --gold: #d4a843;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Lora', Georgia, serif;
    --font-graffiti: 'Permanent Marker', cursive;

    --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--cream);
    color: var(--charcoal);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ============================================================
   HERO — The City Gate
   ============================================================ */
.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-color: var(--terracotta);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-hex-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.9;
}

.hex-grid-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

/* Graffiti splashes */
.graffiti-splash {
    position: absolute;
    z-index: 1;
}

.splash-teal {
    width: 520px;
    height: 380px;
    background-color: var(--teal);
    opacity: 0.55;
    clip-path: polygon(
        18% 5%, 45% 0%, 72% 8%, 92% 22%,
        100% 48%, 88% 72%, 70% 88%,
        42% 100%, 15% 90%, 0% 65%,
        5% 35%, 10% 15%
    );
    top: 50%;
    left: 50%;
    transform: translate(-60%, -52%);
}

.splash-gold {
    width: 300px;
    height: 220px;
    background-color: var(--gold);
    opacity: 0.35;
    clip-path: polygon(
        25% 0%, 60% 5%, 85% 20%,
        100% 50%, 80% 80%,
        50% 100%, 10% 85%, 0% 50%,
        8% 20%
    );
    bottom: 15%;
    right: 8%;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    max-width: 700px;
}

.hero-tag {
    font-family: var(--font-graffiti);
    color: var(--gold);
    font-size: clamp(0.85rem, 2vw, 1rem);
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    opacity: 0.9;
    text-transform: uppercase;
}

.hero-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: clamp(3.5rem, 10vw, 7rem);
    color: var(--cream);
    line-height: 1;
    letter-spacing: -0.02em;
    text-shadow: 4px 4px 0px var(--sienna), 8px 8px 20px rgba(0,0,0,0.3);
    margin-bottom: 1.5rem;
}

.hero-dot {
    color: var(--gold);
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--cream);
    opacity: 0.88;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-cta {
    display: inline-block;
    padding: 0.85rem 2.5rem;
    background-color: var(--cream);
    color: var(--terracotta);
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    border-radius: 2px;
    border: 2px solid var(--cream);
    transition: transform 0.5s var(--spring), background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 4px 4px 0 var(--sienna);
}

.hero-cta:hover {
    transform: scale(1.04) translateY(-3px);
    background-color: var(--gold);
    color: var(--charcoal);
    border-color: var(--gold);
    box-shadow: 6px 6px 0 var(--sienna);
}

.hero-cta:active {
    transform: scale(0.98);
    box-shadow: 2px 2px 0 var(--sienna);
}

/* Hero floating bubbles */
.bubble {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: bubbleFloat 8s ease-in-out infinite;
    z-index: 1;
}

.b1 {
    width: 80px; height: 80px;
    background-color: var(--teal);
    opacity: 0.3;
    top: 15%; left: 8%;
    animation-delay: 0s;
    animation-duration: 7s;
}

.b2 {
    width: 50px; height: 50px;
    background-color: var(--gold);
    opacity: 0.35;
    top: 70%; left: 12%;
    animation-delay: 1.5s;
    animation-duration: 9s;
}

.b3 {
    width: 65px; height: 65px;
    background-color: var(--lavender);
    opacity: 0.3;
    top: 20%; right: 10%;
    animation-delay: 0.8s;
    animation-duration: 11s;
}

.b4 {
    width: 35px; height: 35px;
    background-color: var(--cream);
    opacity: 0.25;
    top: 55%; right: 15%;
    animation-delay: 2s;
    animation-duration: 8.5s;
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateY(0px) scale(1); opacity: 0.3; }
    33% { transform: translateY(-18px) scale(1.05); opacity: 0.45; }
    66% { transform: translateY(-8px) scale(0.97); opacity: 0.35; }
}

/* ============================================================
   NEIGHBORHOODS — Honeycomb Section
   ============================================================ */
.neighborhoods {
    background-color: var(--cream);
    padding: 6rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4.5rem);
    color: var(--charcoal);
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.section-sub {
    font-family: var(--font-graffiti);
    color: var(--terracotta);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    opacity: 0.8;
}

/* City Map Data-Viz */
.city-map-viz {
    display: flex;
    justify-content: center;
    margin: 0 auto 2rem;
    max-width: 420px;
    opacity: 0.7;
}

.city-svg {
    width: 100%;
    height: auto;
}

/* Honeycomb Grid */
.honeycomb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 960px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
}

.hex-cell {
    aspect-ratio: 1 / 1.154;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background-color: var(--terracotta);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.5s var(--spring), box-shadow 0.3s ease;
    position: relative;
    will-change: transform;
    opacity: 0;
    transform: scale(0.8);
}

.hex-cell.hex-row-1 {
    background-color: var(--terracotta);
}

.hex-cell.hex-row-2 {
    background-color: var(--charcoal);
    margin-top: -1.5rem;
}

/* Alternating colors */
.hex-cell:nth-child(2) { background-color: var(--teal); }
.hex-cell:nth-child(3) { background-color: var(--lavender); }
.hex-cell:nth-child(5) { background-color: var(--teal); }

.hex-cell:hover {
    transform: scale(1.06) translateY(-5px);
    z-index: 2;
}

.hex-cell:active {
    transform: scale(0.97);
}

.hex-cell.visible {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.6s ease, transform 0.7s var(--spring);
}

.hex-inner {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--cream);
}

.hex-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.hex-inner h3 {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: clamp(0.85rem, 1.8vw, 1.15rem);
    margin-bottom: 0.4rem;
    line-height: 1.2;
}

.hex-inner p {
    font-family: var(--font-body);
    font-size: clamp(0.7rem, 1.2vw, 0.82rem);
    line-height: 1.5;
    opacity: 0.85;
}

/* Bubble decorations */
.bubble-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 2rem 0;
}

.deco-bubble {
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: transform 0.6s var(--spring), opacity 0.4s ease;
}

.deco-bubble.visible {
    opacity: 0.55;
    transform: scale(1);
}

.db1 { width: 28px; height: 28px; background-color: var(--teal); }
.db2 { width: 18px; height: 18px; background-color: var(--gold); }
.db3 { width: 40px; height: 40px; background-color: var(--lavender); }
.db4 { width: 22px; height: 22px; background-color: var(--terracotta); }
.db5 { width: 32px; height: 32px; background-color: var(--sienna); }
.db6 { width: 16px; height: 16px; background-color: var(--teal); }
.db7 { width: 26px; height: 26px; background-color: var(--gold); }
.db8 { width: 20px; height: 20px; background-color: var(--lavender); }

.db1 { transition-delay: 0s; }
.db2 { transition-delay: 0.1s; }
.db3 { transition-delay: 0.2s; }
.db4 { transition-delay: 0.05s; }
.db5 { transition-delay: 0.15s; }
.db6 { transition-delay: 0.25s; }
.db7 { transition-delay: 0.08s; }
.db8 { transition-delay: 0.18s; }

/* ============================================================
   GRAFFITI WALL
   ============================================================ */
.graffiti-wall {
    background-color: var(--charcoal);
    padding: 4rem 0 3rem;
    overflow: hidden;
}

.wall-header {
    text-align: center;
    padding: 0 2rem;
    margin-bottom: 2rem;
}

.wall-title {
    color: var(--cream);
}

.wall-header .section-sub {
    color: var(--gold);
}

.wall-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--terracotta) var(--charcoal);
}

.wall-scroll-container::-webkit-scrollbar {
    height: 4px;
}

.wall-scroll-container::-webkit-scrollbar-track {
    background: var(--charcoal);
}

.wall-scroll-container::-webkit-scrollbar-thumb {
    background-color: var(--terracotta);
    border-radius: 2px;
}

.wall-scroll-container:active {
    cursor: grabbing;
}

.wall-canvas {
    position: relative;
    width: 2400px;
    height: 380px;
    background: linear-gradient(
        135deg,
        #2c1f18 0%,
        #3d3028 30%,
        #2c1f18 60%,
        #3d3028 100%
    );
    white-space: nowrap;
    overflow: hidden;
}

/* Background wall texture lines */
.wall-canvas::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 60px,
        rgba(255,255,255,0.015) 60px,
        rgba(255,255,255,0.015) 62px
    );
}

/* Wall color splashes */
.wall-splash {
    position: absolute;
    opacity: 0.35;
    border-radius: 0;
}

.ws1 {
    width: 600px; height: 300px;
    background-color: var(--teal);
    clip-path: polygon(10% 20%, 40% 5%, 70% 15%, 90% 40%, 80% 70%, 50% 90%, 20% 80%, 5% 55%);
    top: 20px; left: 80px;
    opacity: 0.3;
}

.ws2 {
    width: 400px; height: 280px;
    background-color: var(--terracotta);
    clip-path: polygon(20% 0%, 60% 10%, 100% 30%, 90% 70%, 60% 100%, 10% 85%, 0% 45%);
    top: 30px; left: 650px;
    opacity: 0.4;
}

.ws3 {
    width: 500px; height: 320px;
    background-color: var(--lavender);
    clip-path: polygon(5% 30%, 35% 5%, 70% 0%, 100% 25%, 95% 65%, 65% 95%, 25% 100%, 0% 70%);
    top: -10px; left: 1100px;
    opacity: 0.28;
}

.ws4 {
    width: 350px; height: 250px;
    background-color: var(--gold);
    clip-path: polygon(30% 5%, 75% 0%, 100% 40%, 85% 90%, 40% 100%, 0% 75%, 5% 30%);
    top: 50px; left: 1600px;
    opacity: 0.3;
}

.ws5 {
    width: 450px; height: 300px;
    background-color: var(--teal);
    clip-path: polygon(15% 0%, 60% 5%, 100% 20%, 90% 60%, 70% 90%, 20% 100%, 0% 65%, 5% 25%);
    top: 20px; left: 1950px;
    opacity: 0.28;
}

/* Graffiti text pieces */
.graffiti-text {
    position: absolute;
    font-family: var(--font-graffiti);
    white-space: pre;
}

.gt1 {
    font-size: clamp(3rem, 5vw, 5.5rem);
    color: var(--cream);
    top: 40px; left: 60px;
    transform: rotate(-4deg);
    opacity: 0.9;
    text-shadow: 3px 3px 0 var(--teal);
}

.gt2 {
    font-size: clamp(2rem, 4vw, 4rem);
    color: var(--gold);
    top: 160px; left: 280px;
    transform: rotate(3deg);
    opacity: 0.85;
}

.gt3 {
    font-size: clamp(1.5rem, 3vw, 3rem);
    color: var(--lavender);
    top: 60px; left: 500px;
    transform: rotate(-2deg);
    opacity: 0.8;
}

.gt4 {
    font-size: clamp(4rem, 7vw, 8rem);
    color: var(--terracotta);
    top: 100px; left: 720px;
    transform: rotate(5deg);
    opacity: 0.75;
    text-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

.gt5 {
    font-size: clamp(1.2rem, 2.5vw, 2.2rem);
    color: var(--cream);
    top: 250px; left: 820px;
    transform: rotate(-5deg);
    opacity: 0.7;
}

.gt6 {
    font-size: clamp(1.8rem, 3vw, 3rem);
    color: var(--teal);
    top: 50px; left: 1200px;
    transform: rotate(4deg);
    opacity: 0.85;
    line-height: 1.1;
    white-space: normal;
    width: 160px;
}

.gt7 {
    font-size: clamp(4.5rem, 8vw, 9rem);
    color: var(--lavender);
    top: 80px; left: 1480px;
    transform: rotate(-3deg);
    opacity: 0.65;
    text-shadow: 5px 5px 0 rgba(0,0,0,0.2);
}

.gt8 {
    font-size: clamp(1rem, 2vw, 1.8rem);
    color: var(--gold);
    top: 280px; left: 1700px;
    transform: rotate(2deg);
    opacity: 0.8;
}

/* Wall SVG elements */
.wall-svg {
    position: absolute;
}

.ws-svg1 {
    width: 120px; height: 120px;
    top: 100px; left: 340px;
}

.ws-svg2 {
    width: 80px; height: 80px;
    top: 60px; left: 1020px;
}

.ws-svg3 {
    width: 220px; height: 120px;
    top: 180px; left: 1950px;
}

.wall-scroll-hint {
    text-align: center;
    padding: 0.75rem;
    font-family: var(--font-graffiti);
    color: var(--gold);
    opacity: 0.6;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

/* ============================================================
   CITY EXPLORER
   ============================================================ */
.city-explorer {
    background-color: var(--cream);
    padding: 6rem 2rem;
    position: relative;
}

.explorer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

.map-panel {
    background-color: var(--charcoal);
    border-radius: 4px;
    padding: 1.5rem;
    box-shadow: 8px 8px 0 var(--terracotta);
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s ease, transform 0.8s var(--spring);
}

.map-panel.visible {
    opacity: 1;
    transform: translateX(0);
}

.full-city-map {
    width: 100%;
    height: auto;
}

.explorer-text {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s ease 0.2s, transform 0.8s var(--spring) 0.2s;
}

.explorer-text.visible {
    opacity: 1;
    transform: translateX(0);
}

.explorer-heading {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--terracotta);
    margin-bottom: 1.25rem;
    line-height: 1.2;
}

.explorer-text p {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--charcoal);
    line-height: 1.75;
    margin-bottom: 1rem;
}

.explorer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.tag {
    font-family: var(--font-graffiti);
    font-size: 0.85rem;
    padding: 0.3rem 0.9rem;
    background-color: transparent;
    border: 2px solid var(--terracotta);
    color: var(--terracotta);
    border-radius: 2px;
    transition: transform 0.4s var(--spring), background-color 0.25s ease, color 0.25s ease;
    cursor: default;
}

.tag:hover {
    background-color: var(--terracotta);
    color: var(--cream);
    transform: scale(1.08) rotate(-1deg);
}

/* ============================================================
   GARDEN GATE FOOTER
   ============================================================ */
.garden-gate {
    background-color: var(--terracotta);
    padding: 5rem 2rem 3rem;
    position: relative;
    overflow: hidden;
    text-align: center;
}

/* Vanishing-point hex row */
.garden-hex-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.garden-hex {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background-color: var(--sienna);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.5s var(--spring);
    opacity: 0;
    transform: scale(0.6);
}

.garden-hex.visible {
    opacity: 1;
    transform: scale(1);
}

.gh-large { width: 180px; height: 207px; background-color: var(--sienna); transition-delay: 0s; }
.gh-medium { width: 130px; height: 150px; background-color: var(--charcoal); transition-delay: 0.1s; }
.gh-small { width: 90px; height: 104px; background-color: var(--teal); transition-delay: 0.2s; }
.gh-tiny { width: 55px; height: 63px; background-color: var(--gold); transition-delay: 0.3s; }

.hex-inner-garden {
    padding: 1rem;
    text-align: center;
    color: var(--cream);
}

.botanical-svg {
    width: 70px;
    height: 70px;
}

.farewell-text {
    font-family: var(--font-graffiti);
    color: var(--cream);
    font-size: clamp(0.75rem, 2vw, 1.1rem);
    text-align: center;
    line-height: 1.2;
}

.footer-content {
    position: relative;
    z-index: 2;
}

.footer-domain {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--cream);
    margin-bottom: 0.5rem;
    text-shadow: 3px 3px 0 var(--sienna);
}

.footer-tagline {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--cream);
    opacity: 0.8;
    margin-bottom: 1rem;
}

.footer-graffiti-line {
    font-family: var(--font-graffiti);
    color: var(--gold);
    opacity: 0.5;
    font-size: 2rem;
    letter-spacing: 0.5rem;
}

/* Footer bubbles */
.footer-bubbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.foot-bubble {
    position: absolute;
    border-radius: 50%;
    opacity: 0.25;
    animation: footBubble 12s ease-in-out infinite;
}

.fb1 { width: 100px; height: 100px; background: var(--teal); top: 10%; left: 5%; animation-delay: 0s; }
.fb2 { width: 60px; height: 60px; background: var(--gold); top: 60%; left: 3%; animation-delay: 2s; }
.fb3 { width: 80px; height: 80px; background: var(--lavender); bottom: 15%; right: 5%; animation-delay: 1s; }
.fb4 { width: 45px; height: 45px; background: var(--cream); top: 20%; right: 8%; animation-delay: 3s; }
.fb5 { width: 120px; height: 120px; background: var(--sienna); bottom: 5%; left: 40%; animation-delay: 1.5s; }

@keyframes footBubble {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.06); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .honeycomb-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hex-cell.hex-row-2 {
        margin-top: 0;
    }

    .explorer-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .map-panel {
        transform: translateY(-30px);
    }

    .map-panel.visible {
        transform: translateY(0);
    }

    .explorer-text {
        transform: translateY(30px);
    }

    .explorer-text.visible {
        transform: translateY(0);
    }

    .garden-hex-row {
        gap: 1rem;
    }

    .gh-large { width: 140px; height: 161px; }
    .gh-medium { width: 100px; height: 115px; }
    .gh-small { width: 70px; height: 81px; }
    .gh-tiny { width: 45px; height: 52px; }
}

@media (max-width: 600px) {
    .honeycomb-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile: hexagons become rounded rectangles */
    .hex-cell {
        clip-path: none;
        border-radius: 12px;
        aspect-ratio: auto;
        padding: 1.5rem;
    }

    .hex-cell.hex-row-2 {
        margin-top: 0;
    }

    .garden-hex-row {
        flex-wrap: wrap;
        justify-content: center;
    }

    .garden-hex {
        clip-path: none;
        border-radius: 8px;
    }

    .gh-large { width: 120px; height: 120px; }
    .gh-medium { width: 90px; height: 90px; }
    .gh-small { width: 68px; height: 68px; }
    .gh-tiny { width: 45px; height: 45px; }
}
