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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
}

body {
    background: #e8e8e8;
    color: #1a1a1a;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    overflow-x: hidden;
    position: relative;
}

/* Paper texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(0,0,0,0.03) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(0,0,0,0.02) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, rgba(0,0,0,0.04) 0.5px, transparent 0.5px);
    background-size: 4px 4px, 6px 6px, 3px 3px;
    pointer-events: none;
    z-index: 1000;
}

/* === Sections === */
.section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
}

/* === Spacers with brush strokes === */
.spacer {
    position: relative;
    height: 20vh;
}

.brush-stroke {
    position: absolute;
    height: 0.5px;
    background: #d0d0d0;
    opacity: 0.4;
}

/* === Section 1: Threshold === */
#threshold {
    background: #f5f5f5;
    flex-direction: column;
}

.threshold-content {
    text-align: center;
}

#title-kanji {
    font-family: 'Noto Serif JP', serif;
    font-size: clamp(6rem, 15vw, 14rem);
    font-variation-settings: 'wght' 100;
    line-height: 1.1;
    color: #1a1a1a;
    will-change: font-variation-settings;
}

#title-kanji.animate {
    animation: weight-shift 4s ease-in-out forwards;
}

@keyframes weight-shift {
    0%   { font-variation-settings: 'wght' 100; }
    100% { font-variation-settings: 'wght' 900; }
}

#title-cafe {
    display: block;
    margin-top: 1.5rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    text-transform: lowercase;
    color: #888888;
    opacity: 0;
    transition: opacity 1.5s ease-in 2s;
}

#title-cafe.visible {
    opacity: 0.6;
}

/* === Vertical Lines === */
.vertical-line {
    position: absolute;
    width: 1px;
    height: 100vh;
    background: #3a3a3a;
    top: 0;
    transition: left 1.2s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.vertical-line-left {
    left: 33.333%;
}

.vertical-line-right {
    left: 66.666%;
}

.vertical-line-center {
    left: 50%;
}

/* === Section Text (Spear & Shield) === */
.section-text {
    position: relative;
    max-width: 500px;
    z-index: 1;
}

.poetic-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    line-height: 2.0;
    letter-spacing: 0.01em;
    color: #2a2a2a;
    margin-bottom: 1.5em;
}

/* Spear: text on right, reveals right-to-left */
.spear-text {
    margin-left: auto;
    margin-right: 10%;
    text-align: right;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.2s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.spear-text.revealed {
    clip-path: inset(0 0 0 0);
}

/* Shield: text on left, reveals left-to-right */
.shield-text {
    margin-right: auto;
    margin-left: 10%;
    text-align: left;
    clip-path: inset(0 0 0 100%);
    transition: clip-path 1.2s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.shield-text.revealed {
    clip-path: inset(0 0 0 0);
}

/* === Section 4: The Question === */
#question {
    background: #0a0a0a;
    flex-direction: column;
}

.question-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.question-jp {
    font-family: 'Noto Serif JP', serif;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: #a0a0a0;
    opacity: 0.3;
    position: absolute;
    width: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.question-en {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    line-height: 2.0;
    color: #d4d4d4;
    opacity: 0.7;
    min-height: 2em;
}

#question .vertical-line-center {
    background: #3a3a3a;
    opacity: 0.4;
}

/* === Section 5: The Cafe === */
#cafe {
    background: #faf8f4;
    flex-direction: column;
}

#bubble-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: transparent;
    border: 1px solid #a0a0a0;
    will-change: transform, opacity;
    animation: bubble-rise var(--duration) var(--delay) ease-in infinite;
    opacity: var(--start-opacity);
}

@keyframes bubble-rise {
    0%   { transform: translateY(0) translateX(0); opacity: var(--start-opacity); }
    25%  { transform: translateY(-25vh) translateX(12px); }
    50%  { transform: translateY(-50vh) translateX(-8px); }
    75%  { transform: translateY(-75vh) translateX(6px); }
    100% { transform: translateY(-100vh) translateX(0); opacity: 0; }
}

.cafe-content {
    text-align: center;
    z-index: 1;
}

.cafe-invitation {
    color: #2a2a2a;
    margin-bottom: 3rem;
}

/* Enso circle with gap */
.enso {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    position: relative;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(
        from 300deg,
        transparent 0deg,
        transparent 30deg,
        #c8a882 30deg,
        #c8a882 360deg
    );
    -webkit-mask: radial-gradient(circle, transparent calc(50% - 2px), black calc(50% - 2px), black calc(50%), transparent calc(50%));
    mask: radial-gradient(circle, transparent calc(50% - 2px), black calc(50% - 2px), black calc(50%), transparent calc(50%));
}

.enso-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: #6b6b6b;
    text-transform: lowercase;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    #title-kanji {
        font-variation-settings: 'wght' 900;
    }
    #title-kanji.animate {
        animation: none;
    }
    #title-cafe {
        opacity: 0.6;
        transition: none;
    }
    .spear-text, .shield-text {
        clip-path: inset(0 0 0 0);
        transition: none;
    }
    .bubble {
        animation: none;
        display: none;
    }
}
