/* ============================================
   bada.coffee - Kissaten Style
   ============================================ */

/* CSS Custom Properties */
:root {
    --espresso: #2C1A0E;
    --umber: #8B5E3C;
    --parchment: #F0E6D4;
    --kraft: #D4C4A8;
    --amber: #C8973E;
    --milk: #FAF5EC;
    --cold-brew: #1A0F08;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Lora', Georgia, serif;
    --font-mono: 'DM Mono', 'Courier New', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--espresso);
    background-color: var(--parchment);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   Film Grain Overlay
   ============================================ */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.04;
    filter: url(#grain);
    background: var(--milk);
    transform: translateZ(0);
    will-change: opacity;
}

/* ============================================
   Scroll Progress Indicator
   ============================================ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--umber);
    opacity: 0.4;
    z-index: 9999;
    transition: width 50ms linear;
}

/* ============================================
   Section Base
   ============================================ */
.section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ============================================
   SECTION 0: Hero
   ============================================ */
.section-hero {
    height: 100vh;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}

.hero-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-image {
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, var(--espresso) 0%, var(--umber) 30%, var(--kraft) 60%, var(--espresso) 100%);
    background-size: cover;
    filter: saturate(0.15);
    position: relative;
}

/* Simulate a kissaten interior with CSS */
.hero-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(200, 151, 62, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(139, 94, 60, 0.25) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 60%, rgba(44, 26, 14, 0.4) 0%, transparent 60%),
        linear-gradient(180deg, rgba(44, 26, 14, 0.1) 0%, rgba(26, 15, 8, 0.6) 100%);
}

.hero-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--umber);
    opacity: 0.2;
    mix-blend-mode: multiply;
}

.hero-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 150px 60px rgba(26, 15, 8, 0.7);
    z-index: 1;
}

.hero-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(44, 26, 14, 0.7), transparent);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding-bottom: 15vh;
    padding-left: 8vw;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(4rem, 12vw, 10rem);
    color: var(--milk);
    letter-spacing: -0.02em;
    line-height: 1.05;
    text-shadow: 0 2px 40px rgba(26, 15, 8, 0.5);
}

.hero-subtitle {
    display: block;
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kraft);
    margin-top: 1rem;
    opacity: 0.85;
}

.hero-scroll-arrow {
    position: absolute;
    bottom: 4vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    animation: arrowBounce 2.5s ease-in-out infinite;
}

.arrow-path {
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    animation: drawArrow 2s ease-in-out infinite;
}

@keyframes drawArrow {
    0% { stroke-dashoffset: 80; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 80; }
}

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

/* ============================================
   SECTION 1: The Pour
   ============================================ */
.section-pour {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 2rem;
    background-color: var(--parchment);
    position: relative;
}

/* Paper texture via radial gradient */
.section-pour::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(212, 196, 168, 0.3) 100%);
    pointer-events: none;
}

/* Sashiko-like stitching pattern */
.sashiko-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(139, 94, 60, 0.08) 39px, rgba(139, 94, 60, 0.08) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(139, 94, 60, 0.08) 39px, rgba(139, 94, 60, 0.08) 40px);
    pointer-events: none;
    z-index: 0;
}

/* Coffee ring stain */
.coffee-ring {
    position: absolute;
    top: 12vh;
    right: 8vw;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 2px solid var(--amber);
    opacity: 0.25;
    z-index: 1;
    pointer-events: none;
}

.pour-content {
    max-width: 38ch;
    position: relative;
    z-index: 2;
}

.pour-content p {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--espresso);
    margin-bottom: 2rem;
}

/* Text reveal container */
.text-reveal {
    overflow: hidden;
}

.text-reveal p {
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.text-reveal.revealed p {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   SECTION 2: The Gallery
   ============================================ */
.section-gallery {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 4vw;
    background-color: var(--kraft);
    position: relative;
}

/* Kraft paper texture */
.section-gallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(26, 15, 8, 0.08) 100%);
    pointer-events: none;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2rem;
    max-width: 1000px;
    width: 100%;
    position: relative;
}

.gallery-photo {
    position: relative;
}

.photo-frame {
    position: relative;
    overflow: hidden;
    border: 4px solid var(--milk);
    box-shadow: 8px 8px 20px rgba(26, 15, 8, 0.3);
}

.photo-image {
    width: 100%;
    padding-bottom: 130%;
    position: relative;
    filter: saturate(0.15);
}

.photo-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--umber);
    opacity: 0.2;
    mix-blend-mode: multiply;
}

.photo-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 60px 20px rgba(26, 15, 8, 0.4);
    pointer-events: none;
}

/* Gallery image backgrounds - CSS-generated vintage scenes */
.gallery-img-1 {
    background:
        radial-gradient(ellipse at 40% 50%, rgba(200, 151, 62, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 40%, rgba(139, 94, 60, 0.3) 0%, transparent 40%),
        linear-gradient(180deg, var(--umber) 0%, var(--espresso) 100%);
}

.gallery-img-2 {
    background:
        radial-gradient(circle at 50% 45%, rgba(250, 245, 236, 0.3) 0%, transparent 30%),
        radial-gradient(ellipse at 50% 50%, rgba(200, 151, 62, 0.25) 0%, transparent 50%),
        linear-gradient(160deg, var(--kraft) 0%, var(--umber) 50%, var(--espresso) 100%);
}

.gallery-img-3 {
    background:
        radial-gradient(ellipse at 30% 60%, rgba(200, 151, 62, 0.35) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 30%, rgba(240, 230, 212, 0.2) 0%, transparent 35%),
        linear-gradient(200deg, var(--umber) 0%, var(--cold-brew) 100%);
}

/* Photo tilts */
.photo-1 {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    transform: rotate(-1.5deg);
    z-index: 2;
}

.photo-2 {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    transform: rotate(0.8deg);
    margin-top: 3rem;
    z-index: 1;
}

.photo-3 {
    grid-column: 3 / 4;
    grid-row: 1 / 3;
    transform: rotate(-2.2deg);
    margin-top: -2rem;
    z-index: 3;
}

.gallery-photo figcaption {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--espresso);
    opacity: 0.6;
    margin-top: 0.75rem;
    text-align: center;
}

/* ============================================
   SECTION 3: The Origin
   ============================================ */
.section-origin {
    min-height: 80vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background-color: var(--parchment);
    position: relative;
}

.origin-image {
    position: relative;
    overflow: hidden;
}

.origin-photo {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 40% 50%, rgba(200, 151, 62, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 60%, rgba(139, 94, 60, 0.35) 0%, transparent 45%),
        linear-gradient(150deg, var(--kraft) 0%, var(--umber) 40%, var(--espresso) 80%, var(--cold-brew) 100%);
    filter: saturate(0.15) sepia(0.3);
}

.origin-photo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--umber);
    opacity: 0.15;
    mix-blend-mode: multiply;
}

.origin-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6vh 6vw;
}

.origin-text h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--umber);
    margin-bottom: 2.5rem;
}

.origin-text p {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--espresso);
    max-width: 38ch;
    margin-bottom: 1.5rem;
}

/* ============================================
   SECTION 4: The Ritual
   ============================================ */
.section-ritual {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ritual-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.ritual-image {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(44, 26, 14, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 70%, rgba(200, 151, 62, 0.15) 0%, transparent 40%),
        linear-gradient(180deg, var(--cold-brew) 0%, var(--espresso) 40%, var(--umber) 80%, var(--cold-brew) 100%);
    filter: saturate(0.15);
}

.ritual-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--umber);
    opacity: 0.2;
    mix-blend-mode: multiply;
}

.ritual-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 15, 8, 0.55);
    z-index: 1;
}

.ritual-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ritual-quote {
    font-family: var(--font-display);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.5rem, 4vw, 3rem);
    line-height: 1.4;
    color: var(--milk);
    letter-spacing: -0.02em;
    max-width: 600px;
    text-shadow: 0 2px 30px rgba(26, 15, 8, 0.6);
}

.ritual-quote em {
    font-style: italic;
}

.ritual-wordmark {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 1.25rem;
    color: var(--kraft);
    letter-spacing: 0.1em;
    margin-top: 4rem;
    opacity: 0.6;
}

/* ============================================
   Fade Reveal Animation
   ============================================ */
.fade-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for gallery photos */
.photo-1.fade-reveal {
    transition-delay: 0ms;
}

.photo-2.fade-reveal {
    transition-delay: 150ms;
}

.photo-3.fade-reveal {
    transition-delay: 300ms;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .hero-content {
        padding-left: 6vw;
        padding-bottom: 18vh;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 3rem;
        max-width: 320px;
    }

    .photo-1 {
        grid-column: 1;
        grid-row: auto;
    }

    .photo-2 {
        grid-column: 1;
        grid-row: auto;
        margin-top: 0;
    }

    .photo-3 {
        grid-column: 1;
        grid-row: auto;
        margin-top: 0;
    }

    .section-origin {
        grid-template-columns: 1fr;
        grid-template-rows: 50vh auto;
    }

    .origin-text {
        padding: 4vh 6vw 6vh;
    }

    .coffee-ring {
        width: 120px;
        height: 120px;
        top: 6vh;
        right: 4vw;
    }

    .ritual-quote {
        padding: 0 2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(3rem, 16vw, 5rem);
    }
}
