/* ============================================
   bada.coffee — styles.css
   A five-panel vertical descent through coffee
   ============================================ */

/* Custom Properties */
:root {
    --parchment-cream: #f4ede4;
    --warm-linen: #ebe3d7;
    --espresso-dark: #2c2420;
    --roasted-brown: #4a3f35;
    --cream-white: #f8f3ec;
    --crema-gold: #c9a96e;
    --husk-tan: #8a7e6f;
    --sepia-wash: #6b5a48;
    --milk-foam: #e8ddd0;
    --deep-black: #1a1612;
    --inner-dark: #3d3228;

    --font-display: 'Inter', sans-serif;
    --font-body: 'Source Serif 4', serif;
    --font-mono: 'Space Mono', monospace;

    --card-border: 2px solid #b8a88a;
    --card-radius: 4px;
    --flip-duration: 600ms;
    --flip-easing: cubic-bezier(0.34, 1.56, 0.64, 1);
    --entrance-easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--roasted-brown);
    background-color: var(--parchment-cream);
    line-height: 1.7;
    overflow-x: hidden;
    cursor: default;
}

/* Custom Cursor */
body.interactive-hover {
    cursor: none;
}

/* SVG Filters (hidden) */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ============================================
   Fixed Navigation
   ============================================ */
.fixed-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(1.2rem, 3vw, 2rem) clamp(1.5rem, 4vw, 3rem);
    mix-blend-mode: difference;
    pointer-events: none;
}

.wordmark {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 1rem;
    letter-spacing: 0.08em;
    color: var(--cream-white);
    opacity: 0;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

.wordmark.visible {
    opacity: 1;
}

.radial-menu-icon {
    color: var(--cream-white);
    opacity: 0;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.radial-menu-icon.visible {
    opacity: 1;
}

.radial-menu-icon:hover {
    transform: scale(1.3);
}

/* ============================================
   Panels (General)
   ============================================ */
.panel {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.panel-content {
    max-width: 800px;
    padding: clamp(2rem, 5vw, 6rem);
    position: relative;
    z-index: 2;
}

.panel-content--center-left {
    margin-right: auto;
    margin-left: 10%;
}

.panel-content--center-right {
    margin-left: auto;
    margin-right: 10%;
}

.panel-content--center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Animate entry - hidden by default */
.animate-entry {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.animate-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Panel 2 specific slide from right */
.panel-roast .animate-entry {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 700ms var(--entrance-easing), transform 700ms var(--entrance-easing);
}

.panel-roast .animate-entry.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   Panel Headings
   ============================================ */
.panel-heading {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(3rem, 7vw, 5.5rem);
    color: var(--roasted-brown);
    text-transform: lowercase;
    letter-spacing: 0.06em;
    line-height: 1.1;
    margin-bottom: clamp(1.5rem, 3vw, 3rem);
}

.panel-heading--medium {
    font-weight: 500;
}

/* ============================================
   Panel Backgrounds
   ============================================ */
.panel-origin {
    background-color: var(--parchment-cream);
}

.panel-roast {
    background-color: var(--warm-linen);
}

.panel-brew {
    background-color: var(--parchment-cream);
}

.panel-pour {
    background-color: var(--warm-linen);
}

.panel-taste {
    background: linear-gradient(to bottom, var(--espresso-dark), var(--deep-black));
}

.panel-taste .panel-heading {
    color: var(--cream-white);
}

/* ============================================
   Cards Row
   ============================================ */
.cards-row {
    display: flex;
    gap: clamp(1.5rem, 3vw, 3rem);
    flex-wrap: wrap;
    justify-content: center;
}

.cards-row--triple {
    justify-content: center;
}

/* ============================================
   Card Flip Component
   ============================================ */
.card-flip {
    width: 320px;
    height: 440px;
    perspective: 1000px;
    cursor: pointer;
}

.card-flip--large {
    width: 400px;
    height: 550px;
}

.card-flip--small {
    width: 240px;
    height: 320px;
}

.card-flip--tall {
    width: 300px;
    height: 500px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform var(--flip-duration) var(--flip-easing);
}

.card-flip.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: var(--card-border);
    border-radius: var(--card-radius);
    overflow: hidden;
}

.card-front {
    background-color: var(--milk-foam);
}

.card-back {
    background-color: var(--parchment-cream);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

/* Duotone photo styling */
.duotone-photo {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.duotone-photo svg {
    width: 100%;
    height: 100%;
    display: block;
}

.duotone-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 40px rgba(44, 36, 32, 0.15);
    pointer-events: none;
}

/* Card back content */
.card-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--husk-tan);
    margin-bottom: 1.2rem;
}

.card-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--roasted-brown);
    text-align: center;
    max-width: 260px;
}

.card-params {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: var(--husk-tan);
    margin-top: 1rem;
}

.card-rule {
    width: 60px;
    height: 1px;
    background-color: var(--crema-gold);
    margin-bottom: 1.2rem;
}

/* Card back — Pour (special) */
.card-back--pour {
    justify-content: center;
    align-items: center;
}

.card-back-word {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 3rem;
    color: var(--roasted-brown);
    text-transform: lowercase;
    letter-spacing: 0.06em;
}

.card-drip-line {
    width: 1px;
    height: 60px;
    background-color: var(--crema-gold);
    margin-top: 1.5rem;
}

/* ============================================
   Panel 2 — Caffeine Molecule
   ============================================ */
.caffeine-molecule {
    position: absolute;
    left: 8%;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    height: 200px;
    z-index: 1;
    opacity: 0;
    transition: opacity 1s ease;
}

.caffeine-molecule.visible {
    opacity: 1;
}

.molecule-path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 2s ease;
}

.caffeine-molecule.visible .molecule-path {
    stroke-dashoffset: 0;
}

/* ============================================
   Panel 3 — Brew Cascade
   ============================================ */
.panel-brew .card-flip--small {
    opacity: 0;
    transition: opacity 500ms ease;
}

.panel-brew .card-flip--small.cascade-reveal {
    opacity: 1;
}

/* ============================================
   Panel 5 — Taste
   ============================================ */
.concentric-circles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    z-index: 1;
    pointer-events: none;
}

@keyframes pulseRings {
    0%, 100% {
        opacity: 0.12;
        transform: scale(1);
    }
    50% {
        opacity: 0.06;
        transform: scale(1.02);
    }
}

.pulse-ring {
    animation: pulseRings 8s ease-in-out infinite;
}

.pulse-ring:nth-child(2) { animation-delay: 0.5s; }
.pulse-ring:nth-child(3) { animation-delay: 1s; }
.pulse-ring:nth-child(4) { animation-delay: 1.5s; }
.pulse-ring:nth-child(5) { animation-delay: 2s; }
.pulse-ring:nth-child(6) { animation-delay: 2.5s; }

.taste-circle {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 1px solid rgba(201, 169, 110, 0.3);
    background: radial-gradient(circle, var(--inner-dark), var(--espresso-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    position: relative;
    z-index: 2;
}

.taste-word {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 2.5rem;
    color: var(--cream-white);
    text-transform: lowercase;
    letter-spacing: 0.06em;
}

.taste-line {
    font-family: var(--font-body);
    font-weight: 300;
    font-style: italic;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--cream-white);
    max-width: 480px;
    margin: 0 auto;
    opacity: 0.85;
    position: relative;
    z-index: 2;
}

/* ============================================
   Drip Lines Between Panels
   ============================================ */
.drip-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 0;
    background-color: var(--crema-gold);
    z-index: 10;
    opacity: 0;
    transition: height 800ms ease, opacity 600ms ease;
    pointer-events: none;
}

.drip-line.visible {
    height: 60px;
    opacity: 0.5;
}

/* Position drip lines at panel transitions */
.drip-1 { top: calc(100vh - 30px); }
.drip-2 { top: calc(200vh - 30px); }
.drip-3 { top: calc(300vh - 30px); }
.drip-4 { top: calc(400vh - 30px); }

/* ============================================
   Coordinate Grid Dots (Panel 1 & 3)
   ============================================ */
.panel-origin::before,
.panel-brew::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(201, 169, 110, 0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   Decorative Horizontal Rule
   ============================================ */
.panel-heading::after {
    content: '';
    display: block;
    width: 120px;
    height: 1px;
    background-color: var(--crema-gold);
    margin-top: 1rem;
}

.panel-content--center .panel-heading::after {
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   Initial page load blank hold
   ============================================ */
body.loading {
    overflow: hidden;
}

body.loading .panel,
body.loading .fixed-nav {
    opacity: 0;
}

/* ============================================
   Responsive — Mobile (< 768px)
   ============================================ */
@media (max-width: 768px) {
    .panel {
        min-height: 100vh;
        height: auto;
    }

    .panel-content--center-left,
    .panel-content--center-right {
        margin-left: auto;
        margin-right: auto;
    }

    .panel-content {
        padding: clamp(1.5rem, 4vw, 3rem);
    }

    .cards-row {
        flex-direction: column;
        align-items: center;
    }

    .card-flip {
        width: 280px;
        height: 385px;
    }

    .card-flip--large {
        width: 320px;
        height: 440px;
    }

    .card-flip--small {
        width: 240px;
        height: 320px;
    }

    .card-flip--tall {
        width: 260px;
        height: 430px;
    }

    .caffeine-molecule {
        display: none;
    }

    .concentric-circles {
        width: 400px;
        height: 400px;
    }

    .taste-circle {
        width: 220px;
        height: 220px;
    }

    .taste-word {
        font-size: 2rem;
    }

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

    .drip-line {
        display: none;
    }
}

/* ============================================
   Responsive — Small Mobile (< 480px)
   ============================================ */
@media (max-width: 480px) {
    .card-flip,
    .card-flip--large,
    .card-flip--small,
    .card-flip--tall {
        width: 260px;
        height: 360px;
    }

    .taste-circle {
        width: 180px;
        height: 180px;
    }

    .taste-word {
        font-size: 1.6rem;
    }

    .taste-line {
        font-size: 1rem;
        padding: 0 1rem;
    }
}