/* ============================================
   bada.casa — Styles
   Vaporwave × Pan-Asian Night Market Aesthetic
   Horizontal-scroll narrative experience
   ============================================ */

/* ----- CSS Custom Properties ----- */
:root {
    /* Palette */
    --burnt-ember: #D4622B;
    --terracotta-glow: #C17A4E;
    --midnight-indigo: #0E0B1A;
    --twilight-plum: #1E1433;
    --warm-cream: #F2E8D8;
    --faded-parchment: #B8A892;
    --saffron-flare: #E8A832;
    --soft-coral: #E07850;
    --amber-haze: #D4963C;
    --deep-rose: #A03850;
    --indigo-glow: #3828A0;

    /* Typography sizes */
    --heading-size: clamp(3rem, 8vw, 7rem);
    --body-size: clamp(1rem, 1.8vw, 1.25rem);
    --subheading-size: clamp(1.4rem, 2.5vw, 2rem);
    --mono-size: clamp(0.65rem, 1vw, 0.8rem);
}

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

html {
    overflow: hidden;
    height: 100vh;
}

body {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    background-color: var(--midnight-indigo);
    color: var(--warm-cream);
    font-family: 'Darker Grotesque', sans-serif;
    font-size: var(--body-size);
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ----- Horizontal Scroll Wrapper ----- */
#scroll-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    height: 100vh;
    will-change: transform;
    transform: translateZ(0);
}

/* ----- Panel Base ----- */
.panel {
    position: relative;
    min-width: 100vw;
    height: 100vh;
    overflow: hidden;
    flex-shrink: 0;
}

.panel-content {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* Panel background gradients */
.panel:nth-child(odd) {
    background: radial-gradient(ellipse at 120% 80%, var(--twilight-plum) 0%, var(--midnight-indigo) 70%);
}

.panel:nth-child(even) {
    background: radial-gradient(ellipse at -20% 20%, var(--twilight-plum) 0%, var(--midnight-indigo) 70%);
}

/* ----- Progress Bar ----- */
#progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(14, 11, 26, 0.8);
    z-index: 1000;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: var(--burnt-ember);
    transition: width 0.15s ease-out;
}

#progress-notches {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-evenly;
    pointer-events: none;
}

.progress-notch {
    width: 2px;
    height: 100%;
    background: rgba(242, 232, 216, 0.15);
}

/* ----- Typography ----- */
h1, h2, .statement-heading, .closing-title, .title-main {
    font-family: 'Righteous', cursive;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--warm-cream);
}

h3, .card-subheading {
    font-family: 'Darker Grotesque', sans-serif;
    font-weight: 700;
    font-size: var(--subheading-size);
    color: var(--warm-cream);
    margin-bottom: 0.5em;
}

.card-body {
    font-family: 'Darker Grotesque', sans-serif;
    font-weight: 400;
    font-size: var(--body-size);
    color: var(--warm-cream);
    line-height: 1.65;
}

.secondary-text {
    color: var(--faded-parchment);
}

.mono-label {
    font-family: 'Azeret Mono', monospace;
    font-size: var(--mono-size);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--terracotta-glow);
    display: block;
    margin-bottom: 0.8em;
}

.callout-word {
    font-family: 'Noto Serif JP', serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--saffron-flare);
    display: block;
    margin-bottom: 0.4em;
}

/* ----- Watermark Characters ----- */
.watermark-char {
    position: absolute;
    font-family: 'Noto Serif JP', serif;
    font-weight: 200;
    font-size: 30vw;
    opacity: 0.06;
    color: var(--warm-cream);
    z-index: 1;
    pointer-events: none;
    user-select: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.watermark-center {
    opacity: 0.06;
    font-size: 40vw;
}

/* ----- Title Panel ----- */
.panel-title .panel-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.title-main {
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: 0.06em;
    position: relative;
    z-index: 3;
    text-shadow: 0 0 80px rgba(212, 98, 43, 0.3), 0 0 160px rgba(212, 98, 43, 0.1);
}

.brush-stroke-title {
    width: 60vw;
    max-width: 800px;
    height: auto;
    margin-top: -2vh;
    position: relative;
    z-index: 3;
}

/* ----- Content Cards ----- */
.content-card {
    position: absolute;
    background: rgba(30, 20, 51, 0.75);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border-radius: 4px;
    border: 1px solid rgba(184, 168, 146, 0.08);
}

.card-heading {
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    margin-bottom: 0.5em;
    line-height: 1.15;
}

.card-subheading {
    margin-bottom: 0.4em;
}

/* Tilt-3D system */
.tilt-card {
    --tilt-x: 2deg;
    --tilt-y: -3deg;
    transform: perspective(1200px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tilt-strong {
    --tilt-x: 3deg;
    --tilt-y: -5deg;
}

/* Textured card (sashiko/batik pattern) */
.card-textured {
    position: relative;
}

.card-textured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle, rgba(184, 168, 146, 0.04) 1px, transparent 1px),
        radial-gradient(circle, rgba(184, 168, 146, 0.03) 1px, transparent 1px);
    background-size: 20px 20px, 30px 30px;
    background-position: 0 0, 10px 10px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 0;
}

.card-textured > * {
    position: relative;
    z-index: 1;
}

/* Text overlay gradient for readability */
.content-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(14, 11, 26, 0.15) 100%);
    border-radius: 4px;
    pointer-events: none;
    z-index: 0;
}

/* ----- Statement Panels ----- */
.panel-statement .panel-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.statement-text {
    max-width: 70vw;
    text-align: center;
}

.statement-heading {
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 1.05;
    margin-bottom: 0.3em;
    text-shadow: 0 0 60px rgba(212, 98, 43, 0.2);
}

.statement-large {
    font-size: clamp(3.5rem, 10vw, 9rem);
}

.statement-sub {
    font-family: 'Darker Grotesque', sans-serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--faded-parchment);
    max-width: 50vw;
    margin: 0 auto;
    line-height: 1.5;
}

/* ----- Breathing Panel ----- */
.panel-breathing {
    background: radial-gradient(ellipse at 50% 50%, var(--twilight-plum) 0%, var(--midnight-indigo) 80%);
}

.panel-breathing .panel-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ----- Seal Stamps ----- */
.seal-stamp {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 2px solid var(--burnt-ember);
    background: rgba(212, 98, 43, 0.08);
    z-index: 3;
}

.seal-stamp::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--burnt-ember);
    opacity: 0.7;
}

.seal-stamp::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--burnt-ember);
    border-radius: 50%;
    opacity: 0.5;
}

.seal-stamp-lg {
    width: 60px;
    height: 60px;
}

/* ----- Lantern Elements ----- */
.lantern {
    position: absolute;
    width: 40px;
    height: 60px;
    z-index: 3;
}

.lantern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 10px;
    background: var(--saffron-flare);
    opacity: 0.2;
    clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
}

.lantern::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 48px;
    background: var(--saffron-flare);
    opacity: 0.2;
    border-radius: 6px;
    box-shadow: 0 0 30px rgba(232, 168, 50, 0.15);
}

/* ----- Brush Strokes (SVG) ----- */
.brush-stroke {
    position: absolute;
    z-index: 3;
    overflow: visible;
}

.brush-stroke path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.brush-stroke.animated path {
    stroke-dashoffset: 0;
}

.brush-stroke-title {
    position: relative;
}

.brush-stroke-accent {
    bottom: 10vh;
    right: 5vw;
    width: 25vw;
    height: auto;
}

.brush-stroke-side {
    position: absolute;
    right: 8vw;
    top: 10vh;
    width: 8vw;
    height: 70vh;
}

.brush-stroke-large {
    bottom: 5vh;
    left: 5vw;
    width: 80vw;
    height: auto;
}

/* ----- Bokeh Background System ----- */
.bokeh-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
}

/* Bokeh drift animations */
@keyframes bokeh-drift-1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(3vw, 2vw); }
}

@keyframes bokeh-drift-2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-2vw, 3vw); }
}

@keyframes bokeh-drift-3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(4vw, -2vw); }
}

@keyframes bokeh-drift-4 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-3vw, -2vw); }
}

@keyframes bokeh-drift-5 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(2vw, 4vw); }
}

@keyframes bokeh-drift-6 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-4vw, 1vw); }
}

@keyframes bokeh-drift-7 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(1vw, -3vw); }
}

@keyframes bokeh-drift-8 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(5vw, -1vw); }
}

/* ----- Vertical Interlude Panel ----- */
.panel-interlude {
    background: radial-gradient(ellipse at 50% 30%, var(--twilight-plum) 0%, var(--midnight-indigo) 70%);
}

.interlude-scroll {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 2;
    scrollbar-width: thin;
    scrollbar-color: var(--terracotta-glow) var(--twilight-plum);
}

.interlude-scroll::-webkit-scrollbar {
    width: 4px;
}

.interlude-scroll::-webkit-scrollbar-track {
    background: var(--twilight-plum);
}

.interlude-scroll::-webkit-scrollbar-thumb {
    background: var(--terracotta-glow);
    border-radius: 2px;
}

.interlude-content {
    padding: 15vh 15vw;
    display: flex;
    flex-direction: column;
    gap: 8vh;
}

.interlude-item {
    max-width: 500px;
    padding: 2rem;
    background: rgba(30, 20, 51, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 3px solid var(--burnt-ember);
    border-radius: 2px;
}

.interlude-item:nth-child(even) {
    align-self: flex-end;
}

.interlude-heading {
    font-family: 'Righteous', cursive;
    font-weight: 400;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--warm-cream);
    margin-bottom: 0.5em;
}

.interlude-indicator {
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 5;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.interlude-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--terracotta-glow);
    border-bottom: 2px solid var(--terracotta-glow);
    transform: rotate(45deg);
    margin: 8px auto 0;
    animation: arrow-bounce 1.5s ease-in-out infinite;
}

@keyframes arrow-bounce {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(5px); }
}

/* ----- Culmination Panels ----- */
.panel-culmination .card-heading {
    color: var(--warm-cream);
    text-shadow: 0 0 40px rgba(212, 98, 43, 0.25);
}

.culmination-heading {
    font-size: clamp(2rem, 4vw, 3.5rem);
}

/* ----- Closing Panel ----- */
.panel-closing {
    background: var(--midnight-indigo);
}

.panel-closing .panel-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.closing-title {
    font-size: clamp(3rem, 7vw, 6rem);
    letter-spacing: 0.06em;
    margin-bottom: 0.3em;
    text-shadow: 0 0 60px rgba(212, 98, 43, 0.2);
    opacity: 0;
    animation: closing-fade-in 2s ease forwards;
}

.closing-statement {
    font-family: 'Darker Grotesque', sans-serif;
    font-weight: 300;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--faded-parchment);
    margin-bottom: 2em;
    opacity: 0;
    animation: closing-fade-in 2s ease 0.5s forwards;
}

.closing-link {
    font-family: 'Azeret Mono', monospace;
    font-size: var(--mono-size);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--terracotta-glow);
    text-decoration: none;
    border-bottom: 1px solid rgba(193, 122, 78, 0.3);
    padding-bottom: 2px;
    transition: color 0.3s ease, border-color 0.3s ease;
    opacity: 0;
    animation: closing-fade-in 2s ease 1s forwards;
}

.closing-link:hover {
    color: var(--burnt-ember);
    border-color: var(--burnt-ember);
}

@keyframes closing-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ----- Bokeh Minimal for closing ----- */
.bokeh-field-minimal .bokeh-circle {
    opacity: 0.08 !important;
}

/* ----- Label utility ----- */
.label {
    display: block;
    margin-bottom: 1em;
}

/* ----- Selection ----- */
::selection {
    background: rgba(212, 98, 43, 0.3);
    color: var(--warm-cream);
}

/* ----- Responsive adjustments ----- */
@media (max-width: 768px) {
    .content-card {
        max-width: 80vw !important;
        left: 10vw !important;
    }

    .statement-heading {
        font-size: clamp(2rem, 10vw, 4rem);
    }

    .statement-sub {
        max-width: 80vw;
    }

    .interlude-content {
        padding: 10vh 8vw;
    }

    .interlude-item {
        max-width: 85vw;
    }

    .interlude-item:nth-child(even) {
        align-self: flex-start;
    }
}
