/* ============================================
   CHAPTER 1 — THE BEGINNING (About Section)
   Prefix: .ch1-
   ============================================ */

/* --- Layout --- */
.ch1-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-top: 48px;
    align-items: center;
}

/* --- Text Column --- */
.ch1-text p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.05rem;
    line-height: 1.8;
}

.ch1-text .highlight {
    color: var(--accent-secondary);
    font-weight: 500;
}

/* --- Quote Block --- */
.ch1-quote {
    padding: 24px 28px;
    border-left: 3px solid;
    border-image: var(--accent-gradient) 1;
    background: var(--surface);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-top: 28px;
}

.ch1-quote p {
    font-style: italic;
    color: var(--text-primary) !important;
    font-size: 1.05rem;
    margin: 0 !important;
    line-height: 1.7;
}

/* --- Image Column --- */
.ch1-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ch1-image-card {
    position: relative;
    width: 100%;
    max-width: 380px;
    z-index: 1;
}

.ch1-image-card img {
    border-radius: var(--radius-lg);
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
}

/* Gradient border glow (::before pseudo) */
.ch1-image-card::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: calc(var(--radius-lg) + 4px);
    background: var(--accent-gradient);
    z-index: 0;
    opacity: 0.3;
    transition: opacity var(--transition-normal);
}

.ch1-image-card:hover::before {
    opacity: 0.5;
}

/* --- Staggered Letter Animation --- */
.stagger-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s var(--ease-spring), transform 0.6s var(--ease-spring);
}

.stagger-title.visible span {
    opacity: 1;
    transform: translateY(0);
}

/* Preserve word spacing — space characters */
.stagger-title .ch1-space {
    width: 0.3em;
}

/* --- Diagonal Split Reveal --- */
.diagonal-reveal {
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    transition: clip-path 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.diagonal-reveal.visible {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .stagger-title span {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .diagonal-reveal {
        clip-path: none !important;
        transition: none !important;
    }

    .diagonal-reveal.visible {
        clip-path: none !important;
    }
}

/* --- Responsive: Tablet (1024px) --- */
@media (max-width: 1024px) {
    .ch1-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .ch1-image-wrapper {
        order: -1;
    }

    .ch1-image-card {
        max-width: 320px;
    }
}

/* --- Chapter 1 Section Background — matches graduate image tones (cyan campus + green foliage) --- */
#about.section {
    background:
        radial-gradient(ellipse at 70% 60%, rgba(0, 180, 180, 0.14) 0%, transparent 55%),
        radial-gradient(ellipse at 55% 35%, rgba(160, 200, 50, 0.1) 0%, transparent 50%),
        var(--bg);
}

/* --- Chapter 2 Section Background — matches tea image tones (sunset orange + green fields) --- */
.ch2-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    background:
        radial-gradient(ellipse at 50% 25%, rgba(232, 160, 112, 0.16) 0%, transparent 55%),
        radial-gradient(ellipse at 30% 65%, rgba(92, 184, 92, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 45%, rgba(232, 140, 90, 0.08) 0%, transparent 45%);
    pointer-events: none;
    z-index: 0;
}

/* --- Chapter 5 Section Background — matches beach/travel photo tones (sunset peach + ocean blue) --- */
#explorer.section {
    background:
        radial-gradient(ellipse at 25% 55%, rgba(232, 180, 140, 0.15) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 35%, rgba(100, 150, 200, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 75%, rgba(200, 160, 80, 0.08) 0%, transparent 45%),
        var(--bg);
}

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

    .ch1-grid {
        gap: 32px;
        margin-top: 32px;
    }

    .ch1-image-card {
        max-width: 280px;
    }

    .ch1-quote {
        padding: 20px 22px;
    }
}

/* ── Chapter 1.5: Coffee Story ── */
#coffee-story {
    position: relative;
    min-height: 450vh;
    background: var(--bg);
    z-index: 2;
}

.coffee-story-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.coffee-story-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    height: 100%;
}

.coffee-story-text-container {
    position: relative;
    height: 380px;
    display: flex;
    align-items: center;
}

.coffee-slide {
    position: absolute;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.coffee-slide.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.coffee-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: #6366f1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    padding: 0.4rem 1rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 9999px;
}

.coffee-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.25;
    margin-bottom: 1.25rem;
}

.coffee-desc {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem;
    color: #94a3b8;
    line-height: 1.8;
}

.coffee-story-canvas-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#coffee-canvas {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.6));
}

/* Responsive Styles */
@media (max-width: 900px) {
    .coffee-story-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        align-content: center;
        padding-top: 80px;
    }
    
    .coffee-story-canvas-wrap {
        order: -1;
        height: 280px;
    }
    
    #coffee-canvas {
        width: 280px;
        height: 280px;
    }
    
    .coffee-story-text-container {
        height: 220px;
    }
}
