/* ==========================================================================
   conc.quest - Street-Style Botanical Nostalgia
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    color: #4A3728;
    background-color: #F5E6D3;
    overflow-x: hidden;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
    font-family: 'Urbanist', sans-serif;
    color: #3D2417;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h1 {
    font-weight: 700;
    font-size: clamp(40px, 6vw, 72px);
}

h2 {
    font-weight: 600;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.2;
    margin-bottom: 32px;
}

h3 {
    font-weight: 500;
    font-size: clamp(20px, 2.5vw, 32px);
    line-height: 1.2;
    margin-bottom: 12px;
}

p {
    max-width: 65ch;
    margin-bottom: 1.2em;
}

/* ---------- Bounce-Enter Animation ---------- */
@keyframes bounceEnter {
    0% { opacity: 0; transform: translateY(24px); }
    60% { opacity: 1; transform: translateY(-6px); }
    80% { transform: translateY(2px); }
    100% { transform: translateY(0); }
}

@keyframes bounceEnterSmall {
    0% { opacity: 0; transform: translateY(12px); }
    60% { opacity: 1; transform: translateY(-4px); }
    80% { transform: translateY(1px); }
    100% { transform: translateY(0); }
}

.bounce-target {
    opacity: 0;
    transform: translateY(24px);
}

.bounce-target.visible {
    animation: bounceEnter 500ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Sticker items keep their rotation when bouncing */
.sticker.bounce-target.visible {
    animation: bounceEnter 500ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .bounce-target {
        opacity: 1;
        transform: none;
    }
    .bounce-target.visible {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .hero-title, .hero-subtitle {
        opacity: 1 !important;
        transform: none !important;
    }
    #hero-vine-path {
        stroke-dashoffset: 0 !important;
    }
    .vine-leaf {
        opacity: 1 !important;
    }
    #ginkgo-leaf {
        animation: none !important;
    }
    .scroll-hint {
        animation: none !important;
    }
}

/* ---------- Hero Section ---------- */
.hero {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-color: #F5E6D3;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-content {
    padding-left: clamp(40px, 10vw, 280px);
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: 'Urbanist', sans-serif;
    font-weight: 700;
    font-size: clamp(48px, 10vw, 96px);
    color: #3D2417;
    letter-spacing: -0.02em;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(20px);
}

.hero-title.animate {
    animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 300ms forwards;
}

.hero-subtitle {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #B8714D;
    margin-top: 16px;
    opacity: 0;
    transform: translateY(12px);
}

.hero-subtitle.animate {
    animation: bounceEnterSmall 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 500ms forwards;
}

.hero-vine {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 100%;
    z-index: 1;
}

#hero-vine-svg {
    width: 100%;
    height: 100%;
}

#hero-vine-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 2s cubic-bezier(0.65, 0, 0.35, 1);
}

#hero-vine-path.animate {
    stroke-dashoffset: 0;
}

.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    opacity: 0;
    animation: pulseArrow 2s ease-in-out 3s infinite;
}

@keyframes pulseArrow {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
    50% { opacity: 1; transform: translateX(-50%) translateY(8px); }
}

/* ---------- Site Wrapper (Grid Layout) ---------- */
.site-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background-color: #C4A882;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 23px,
        rgba(212, 184, 150, 0.3) 23px,
        rgba(212, 184, 150, 0.3) 24px
    );
    z-index: 100;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-inner {
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-brand {
    margin-bottom: 40px;
}

.sidebar-domain {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #B8714D;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border: 1px solid #B8714D;
    border-radius: 8px;
    text-decoration: none;
    font-family: 'Urbanist', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #3D2417;
    transition: background-color 0.2s ease;
}

.nav-item:hover {
    background-color: rgba(181, 113, 77, 0.1);
}

.nav-item:hover span {
    text-decoration-color: #D4A843;
}

.nav-item.active {
    border-color: #8B9E7C;
}

.nav-flower {
    width: 20px;
    height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
}

.nav-item:hover .nav-flower {
    opacity: 0.4;
}

/* Sidebar vine progress */
.sidebar-vine-container {
    flex: 1;
    min-height: 200px;
    display: flex;
    align-items: stretch;
    padding: 20px 0;
}

#sidebar-vine-svg {
    width: 40px;
    height: 100%;
    margin: 0 auto;
}

#sidebar-vine-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
}

.vine-bud {
    transform-origin: center;
    transform: scale(0);
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vine-bud.bloomed {
    transform: scale(1);
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    width: 48px;
    height: 48px;
    background: #C4A882;
    border: 1px solid #B8714D;
    border-radius: 12px;
    cursor: pointer;
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ---------- Main Content ---------- */
.main-content {
    grid-column: 2;
    max-width: 780px;
    padding: 0 clamp(24px, 5vw, 80px);
}

/* ---------- Sections ---------- */
.section {
    padding: clamp(64px, 10vh, 140px) 0;
    position: relative;
}

/* ---------- Section 1: The Concrete Garden ---------- */
.section-concrete-garden {
    background-color: #F5E6D3;
    position: relative;
}

.section-margin-flower {
    position: absolute;
    left: -50px;
    top: clamp(64px, 10vh, 140px);
    width: 60px;
    opacity: 0.7;
}

/* ---------- Botanical Dividers ---------- */
.botanical-divider {
    padding: 20px 0;
}

.botanical-divider svg {
    width: 100%;
    height: 24px;
}

/* ---------- Section 2: Sticker Wall ---------- */
.section-sticker-wall {
    background-color: #C4A882;
    padding-left: 0;
    padding-right: 0;
    margin-left: calc(-1 * clamp(24px, 5vw, 80px));
    margin-right: calc(-1 * clamp(24px, 5vw, 80px));
    padding: clamp(64px, 10vh, 140px) clamp(24px, 5vw, 80px);
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.sticker {
    background-color: #F5E6D3;
    border: 2px solid #B8714D;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    text-align: center;
}

.sticker svg {
    width: 60px;
    height: 60px;
}

.sticker-text {
    font-family: 'Urbanist', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #3D2417;
    line-height: 1.3;
}

/* ---------- Section 3: The Dark Soil ---------- */
.section-dark-soil {
    background-color: #1E110B;
    padding: 0;
    margin-left: calc(-1 * clamp(24px, 5vw, 80px));
    margin-right: calc(-1 * clamp(24px, 5vw, 80px));
    position: relative;
}

.torn-edge {
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.torn-edge svg {
    width: 100%;
    height: 40px;
    display: block;
}

.torn-edge-top {
    margin-top: -1px;
}

.torn-edge-bottom {
    margin-bottom: -1px;
}

.dark-soil-content {
    padding: clamp(48px, 8vh, 120px) clamp(24px, 5vw, 80px);
    position: relative;
}

.dark-soil-botanical {
    position: absolute;
    right: clamp(24px, 5vw, 80px);
    top: clamp(48px, 8vh, 120px);
    opacity: 0.3;
}

.pull-quote {
    border-left: 3px solid #C1694F;
    padding-left: 24px;
    margin-bottom: 40px;
    max-width: 65ch;
}

.pull-quote p {
    font-family: 'Urbanist', sans-serif;
    font-weight: 600;
    font-size: clamp(24px, 4vw, 44px);
    line-height: 1.25;
    color: #D4917A;
    max-width: none;
}

.dark-soil-text {
    color: #D4B896;
    font-size: 17px;
    line-height: 1.65;
}

/* ---------- Section 4: Field Notes ---------- */
.section-field-notes {
    background-color: #F5E6D3;
}

.field-notes-layout {
    display: flex;
    gap: 40px;
}

.field-notes-illustration {
    flex-shrink: 0;
    width: 120px;
    opacity: 0.6;
}

.field-notes-illustration svg {
    width: 100%;
    height: auto;
    position: sticky;
    top: 100px;
}

.field-notes-entries {
    flex: 1;
}

.field-entry {
    margin-bottom: 12px;
}

.field-date {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #B8714D;
    display: block;
    margin-bottom: 6px;
}

.field-entry h3 {
    font-family: 'Urbanist', sans-serif;
    color: #3D2417;
}

.field-entry p {
    color: #4A3728;
}

.vine-divider {
    padding: 16px 0;
}

.vine-divider svg {
    width: 100%;
    height: 12px;
}

/* ---------- Section 5: The Last Page ---------- */
.section-last-page {
    background-color: #C4A882;
    margin-left: calc(-1 * clamp(24px, 5vw, 80px));
    margin-right: calc(-1 * clamp(24px, 5vw, 80px));
    padding: clamp(64px, 10vh, 140px) clamp(24px, 5vw, 80px);
    position: relative;
    overflow: hidden;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.last-page-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Urbanist', sans-serif;
    font-weight: 700;
    font-size: clamp(80px, 15vw, 200px);
    color: #3D2417;
    opacity: 0.08;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

.last-page-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.last-page-closing {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #3D2417;
    max-width: none;
}

.ginkgo-leaf {
    margin: 40px auto 0;
    width: 60px;
}

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

@keyframes ginkgoFloat {
    0% { transform: translateY(-40px) translateX(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    25% { transform: translateY(20px) translateX(15px) rotate(10deg); }
    50% { transform: translateY(80px) translateX(-10px) rotate(-5deg); }
    75% { transform: translateY(140px) translateX(12px) rotate(8deg); }
    100% { transform: translateY(200px) translateX(0) rotate(3deg); opacity: 0.6; }
}

.ginkgo-leaf.floating {
    animation: ginkgoFloat 4s ease-in-out forwards;
}

/* ---------- Spray-paint drip texture behind headings ---------- */
.section-concrete-garden h2,
.section-field-notes h2 {
    position: relative;
}

.section-concrete-garden h2::before,
.section-field-notes h2::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -20px;
    right: -20px;
    bottom: -10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='60' viewBox='0 0 100 60'%3E%3Cpath d='M10 0 C10 15 8 30 12 45 C14 55 10 60 10 60' fill='none' stroke='%23C1694F' stroke-width='2' opacity='0.12'/%3E%3Cpath d='M50 0 C48 20 52 35 50 50' fill='none' stroke='%23C1694F' stroke-width='1.5' opacity='0.1'/%3E%3Cpath d='M85 0 C87 10 83 25 86 40 C88 50 85 55 85 60' fill='none' stroke='%23C1694F' stroke-width='2' opacity='0.08'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 100px 60px;
    z-index: -1;
    pointer-events: none;
}

/* ---------- Responsive / Mobile ---------- */
@media (max-width: 960px) {
    .sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .site-wrapper {
        grid-template-columns: 1fr;
    }

    .main-content {
        grid-column: 1;
    }

    .section-margin-flower {
        display: none;
    }

    .field-notes-illustration {
        display: none;
    }

    .field-notes-layout {
        flex-direction: column;
    }
}

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

    .hero-content {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* ---------- Sidebar overlay on mobile ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 17, 11, 0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}
