/* ============================================
   PPADDL.com - Wabi-Sabi Digital Memory Vessel
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    --deep-twilight: #1a0e2e;
    --cosmic-violet: #2d1b4e;
    --boreal-teal: #0f3b3d;
    --aurora-mint: #3ec6a0;
    --celestial-lavender: #7b68ee;
    --amber-glow: #f0c27a;
    --aged-linen: #e8ddd0;
    --weathered-oak: #c4a882;
    --morning-mist: #f7f2eb;
    --warm-charcoal: #3d3229;

    --aurora-sweep: linear-gradient(135deg, #1a0e2e 0%, #2d1b4e 25%, #0f3b3d 50%, #1a0e2e 100%);
    --kintsugi-gold: linear-gradient(90deg, #f0c27a 0%, #c4a882 100%);
    --mist-fade: linear-gradient(180deg, #f7f2eb 0%, #e8ddd0 100%);
    --borealis-shimmer: linear-gradient(45deg, #3ec6a0 0%, #7b68ee 50%, #3ec6a0 100%);

    --ease-gentle: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-smooth: cubic-bezier(0.42, 0, 0.58, 1);

    --z-bg: 0;
    --z-cards: 10;
    --z-accents: 20;
    --z-nature: 30;
    --z-nav: 40;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--warm-charcoal);
    background-color: var(--deep-twilight);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Aurora Top Beacon ---------- */
.aurora-beacon {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--borealis-shimmer);
    background-size: 200% 100%;
    animation: beaconShift 6s linear infinite;
    z-index: 100;
}

@keyframes beaconShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ---------- Navigation Pill ---------- */
.nav-pill {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 28px;
    background: rgba(26, 14, 46, 0.6);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    z-index: var(--z-nav);
}

.nav-dot {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.25);
    transition: all 0.6s var(--ease-gentle);
    padding: 0;
}

.nav-dot.active {
    background: var(--aurora-mint);
    box-shadow: 0 0 12px rgba(62, 198, 160, 0.5);
}

.nav-dot:nth-child(2).active {
    background: var(--celestial-lavender);
    box-shadow: 0 0 12px rgba(123, 104, 238, 0.5);
}

.nav-dot:nth-child(4).active {
    background: var(--amber-glow);
    box-shadow: 0 0 12px rgba(240, 194, 122, 0.5);
}

.nav-label {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: 0.8rem;
    color: var(--aged-linen);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.4s var(--ease-gentle);
    pointer-events: none;
}

.nav-dot:hover .nav-label {
    opacity: 1;
}

/* ---------- Sections (Acts) ---------- */
.act {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

/* ---------- Aurora Sweep Backgrounds ---------- */
.aurora-sweep-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--aurora-sweep);
    z-index: var(--z-bg);
}

/* ---------- Water Ripple (Hero) ---------- */
.water-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200vmax;
    height: 200vmax;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle, transparent 20%, rgba(62, 198, 160, 0.05) 21%, transparent 22%),
        radial-gradient(circle, transparent 35%, rgba(123, 104, 238, 0.04) 36%, transparent 37%),
        radial-gradient(circle, transparent 50%, rgba(62, 198, 160, 0.03) 51%, transparent 52%),
        radial-gradient(circle, transparent 65%, rgba(123, 104, 238, 0.03) 66%, transparent 67%),
        radial-gradient(circle, transparent 80%, rgba(62, 198, 160, 0.02) 81%, transparent 82%);
    animation: rippleExpand 8s var(--ease-smooth) infinite;
}

@keyframes rippleExpand {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* ---------- Aurora Orbs ---------- */
.aurora-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 2;
}

.orb-1 {
    width: 120px;
    height: 120px;
    background: var(--aurora-mint);
    top: 30%;
    left: 20%;
    opacity: 0.25;
    animation: orbFloat1 20s var(--ease-smooth) infinite;
}

.orb-2 {
    width: 90px;
    height: 90px;
    background: var(--celestial-lavender);
    top: 60%;
    right: 25%;
    opacity: 0.2;
    animation: orbFloat2 18s var(--ease-smooth) infinite;
}

.orb-3 {
    width: 100px;
    height: 100px;
    background: var(--aurora-mint);
    top: 40%;
    right: 15%;
    opacity: 0.2;
    animation: orbFloat1 22s var(--ease-smooth) infinite;
}

.orb-4 {
    width: 80px;
    height: 80px;
    background: var(--celestial-lavender);
    top: 20%;
    left: 10%;
    opacity: 0.18;
    animation: orbFloat2 24s var(--ease-smooth) infinite;
}

.orb-5 {
    width: 110px;
    height: 110px;
    background: var(--boreal-teal);
    bottom: 20%;
    right: 20%;
    opacity: 0.22;
    animation: orbFloat1 19s var(--ease-smooth) infinite;
}

.orb-6 {
    width: 100px;
    height: 100px;
    background: var(--aurora-mint);
    top: 25%;
    left: 15%;
    opacity: 0.3;
    animation: orbFloat1 16s var(--ease-smooth) infinite;
}

.orb-7 {
    width: 80px;
    height: 80px;
    background: var(--celestial-lavender);
    top: 50%;
    right: 10%;
    opacity: 0.28;
    animation: orbFloat2 14s var(--ease-smooth) infinite;
}

.orb-8 {
    width: 120px;
    height: 120px;
    background: var(--boreal-teal);
    bottom: 15%;
    left: 30%;
    opacity: 0.25;
    animation: orbFloat1 20s var(--ease-smooth) infinite;
}

.orb-intense {
    filter: blur(50px);
    opacity: 0.35;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(20px, -15px); }
    50% { transform: translate(-10px, 25px); }
    75% { transform: translate(15px, 10px); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-15px, 20px); }
    50% { transform: translate(25px, -10px); }
    75% { transform: translate(-20px, -15px); }
}

/* ---------- ACT 1: DAWN (Hero) ---------- */
.act-dawn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 5vh 0;
}

.hero-content {
    position: relative;
    z-index: var(--z-cards);
    text-align: left;
    padding-left: calc(100vw / 16 * 2);
    padding-right: calc(100vw / 16 * 2);
    max-width: calc(100vw / 16 * 12);
}

.hero-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: 10vw;
    letter-spacing: 0.02em;
    line-height: 1.15;
    color: var(--aged-linen);
    display: inline-block;
}

.hero-title .letter {
    display: inline-block;
    transform: rotate(var(--rot, 0deg));
    animation: letterFadeIn 1.2s var(--ease-gentle) forwards;
    animation-delay: var(--delay, 0s);
    opacity: 0;
}

@keyframes letterFadeIn {
    from {
        opacity: 0;
        transform: rotate(var(--rot, 0deg)) translateY(20px);
    }
    to {
        opacity: 1;
        transform: rotate(var(--rot, 0deg)) translateY(0);
    }
}

.hero-tagline {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: 1.25rem;
    color: var(--weathered-oak);
    margin-top: 2rem;
    opacity: 0;
    animation: fadeInUp 1.2s var(--ease-gentle) 2s forwards;
    line-height: 1.8;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Nature Motifs ---------- */
.nature-motif {
    position: absolute;
    z-index: var(--z-nature);
    pointer-events: none;
    color: var(--aurora-mint);
    animation: spin 120s linear infinite, floatGentle 8s ease-in-out infinite;
}

.leaf-1 {
    width: 80px;
    top: 25%;
    right: 8%;
}

.fern-1 {
    width: 50px;
    bottom: 10%;
    left: 5%;
    color: var(--weathered-oak);
}

.seed-pod-1 {
    width: 40px;
    top: 15%;
    right: 5%;
    color: var(--weathered-oak);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes floatGentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* Layer both animations */
.nature-motif {
    animation: floatGentle 8s ease-in-out infinite;
}

.nature-motif svg {
    animation: spin 120s linear infinite;
}

/* ---------- Kintsugi Crack Lines ---------- */
.kintsugi-crack {
    position: absolute;
    pointer-events: none;
    z-index: var(--z-accents);
    mix-blend-mode: screen;
}

.crack-morning {
    width: 60%;
    height: 80%;
    top: 10%;
    left: 20%;
}

.crack-midday {
    width: 100%;
    height: 100px;
    bottom: 0;
    left: 0;
}

.crack-dusk-top {
    width: 100%;
    height: 40px;
    top: 40px;
    left: 0;
}

.crack-dusk-bottom {
    width: 100%;
    height: 40px;
    bottom: 40px;
    left: 0;
}

/* ---------- Glassmorphic Cards ---------- */
.glass-card {
    border-radius: 16px 20px 14px 18px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

.glass-dark {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: var(--aged-linen);
}

.glass-light {
    background: rgba(26, 14, 46, 0.06);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid rgba(26, 14, 46, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    color: var(--warm-charcoal);
}

.glass-transitional {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: var(--aged-linen);
}

.glass-extra-blur {
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
    .glass-dark {
        background: rgba(45, 27, 78, 0.92);
    }
    .glass-light {
        background: rgba(247, 242, 235, 0.92);
    }
    .glass-transitional {
        background: rgba(45, 27, 78, 0.88);
    }
}

/* ---------- Card Flip ---------- */
.flip-container {
    perspective: 1200px;
    cursor: pointer;
    will-change: transform;
}

.flip-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s var(--ease-gentle);
}

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

.flip-front,
.flip-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.flip-back {
    transform: rotateY(180deg);
    background: var(--cosmic-violet);
    border-radius: 16px 20px 14px 18px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(123, 104, 238, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.glass-card-back {
    color: var(--aged-linen);
}

.card-motif {
    width: 60px;
    height: auto;
    margin-bottom: 1.5rem;
    color: var(--aurora-mint);
    opacity: 0.7;
}

.card-motif svg {
    width: 100%;
    height: auto;
}

.card-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: 1.6rem;
    letter-spacing: 0.02em;
    line-height: 1.3;
    margin-bottom: 0.8rem;
}

.card-hint {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.5;
    font-weight: 400;
}

.back-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--celestial-lavender);
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.back-content {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--aged-linen);
    opacity: 0.9;
}

/* ---------- ACT 2: MORNING ---------- */
.act-morning {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 10vh 0;
}

.morning-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 0;
    width: 100%;
    padding: 0 2vw;
    position: relative;
    z-index: var(--z-cards);
}

.card-morning-1 {
    grid-column: 2 / 8;
    height: 420px;
    margin-top: -40px;
}

.card-morning-2 {
    grid-column: 8 / 15;
    height: 420px;
    margin-top: 40px;
}

/* ---------- ACT 3: MIDDAY ---------- */
.act-midday {
    min-height: 120vh;
    padding: 10vh 0;
    position: relative;
}

.midday-bg-transition {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-bg);
    background:
        linear-gradient(180deg,
            #1a0e2e 0%,
            #2d1b4e 20%,
            #0f3b3d 40%,
            #f7f2eb 60%,
            #e8ddd0 80%,
            #f7f2eb 100%
        );
}

.midday-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 0;
    width: 100%;
    padding: 0 2vw;
    position: relative;
    z-index: var(--z-cards);
    min-height: 100vh;
    align-content: center;
}

.card-midday-1 {
    grid-column: 2 / 8;
    grid-row: 1;
    height: 380px;
    margin-top: 0;
    align-self: start;
}

.card-midday-2 {
    grid-column: 8 / 15;
    grid-row: 1;
    height: 380px;
    margin-top: 80px;
    transform: rotate(1.5deg);
    align-self: start;
}

.card-midday-3 {
    grid-column: 4 / 12;
    grid-row: 2;
    height: 380px;
    margin-top: 40px;
    align-self: start;
}

/* ---------- ACT 4: DUSK ---------- */
.act-dusk {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 2vw;
}

.dusk-content {
    position: relative;
    z-index: var(--z-cards);
    width: 100%;
    max-width: calc(100vw / 16 * 14);
    margin: 0 auto;
}

.dusk-panel {
    padding: 4rem 5rem;
}

.section-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: 4vw;
    letter-spacing: 0.02em;
    line-height: 1.15;
    color: var(--aged-linen);
    margin-bottom: 2.5rem;
}

.dusk-text p {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1.125rem;
    line-height: 2.0;
    color: var(--aged-linen);
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.dusk-text p:last-child {
    margin-bottom: 0;
}

/* ---------- ACT 5: NIGHT ---------- */
.act-night {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--deep-twilight);
    position: relative;
}

.night-content {
    position: relative;
    z-index: var(--z-cards);
    text-align: center;
    padding: 0 2rem;
}

.epilogue-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: 3.5vw;
    color: var(--aged-linen);
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.epilogue-text .char {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.3s var(--ease-gentle);
}

.epilogue-text .char.visible {
    opacity: 1;
}

.epilogue-text .char-space {
    display: inline;
    width: 0.3em;
}

.epilogue-dots {
    display: flex;
    gap: 16px;
    margin-top: 3rem;
    z-index: var(--z-cards);
}

.epilogue-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-mint {
    background: var(--aurora-mint);
    animation: dotPulse 3s var(--ease-smooth) infinite;
}

.dot-lavender {
    background: var(--celestial-lavender);
    animation: dotPulse 3s var(--ease-smooth) infinite 1s;
}

@keyframes dotPulse {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

/* ---------- Moss Overlay ---------- */
.moss-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 3;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='1' height='1' x='0' y='0' fill='%233ec6a0' opacity='0.5'/%3E%3Crect width='1' height='1' x='2' y='2' fill='%230f3b3d' opacity='0.4'/%3E%3Crect width='1' height='1' x='3' y='1' fill='%233ec6a0' opacity='0.3'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ---------- Scroll Reveal ---------- */
.reveal-element {
    opacity: 0;
    transform: translate(var(--reveal-x, 0px), 30px);
    transition: opacity 1.2s var(--ease-gentle), transform 1.2s var(--ease-gentle);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translate(0, 0);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 14vw;
    }

    .morning-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 5vw;
    }

    .card-morning-1,
    .card-morning-2 {
        grid-column: 1;
        margin-top: 0;
        height: 360px;
    }

    .card-morning-2 {
        margin-top: 0;
    }

    .midday-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 5vw;
    }

    .card-midday-1,
    .card-midday-2,
    .card-midday-3 {
        grid-column: 1;
        grid-row: auto;
        margin-top: 0;
        height: 360px;
        transform: none;
    }

    .dusk-panel {
        padding: 2.5rem 2rem;
    }

    .section-title {
        font-size: 6vw;
    }

    .epilogue-text {
        font-size: 6vw;
    }

    .crack-morning {
        display: none;
    }
}

@media (max-width: 640px) {
    .hero-content {
        padding-left: 5vw;
        padding-right: 5vw;
        max-width: 100%;
    }

    .hero-title {
        font-size: 18vw;
    }

    .hero-tagline {
        font-size: 1rem;
    }

    .card-morning-1,
    .card-morning-2,
    .card-midday-1,
    .card-midday-2,
    .card-midday-3 {
        height: 320px;
    }

    .flip-front,
    .flip-back {
        padding: 1.5rem;
    }

    .glass-card {
        padding: 1.5rem;
    }

    .nav-pill {
        bottom: 16px;
        padding: 8px 18px;
        gap: 14px;
    }

    .section-title {
        font-size: 8vw;
    }

    .dusk-panel {
        padding: 2rem 1.5rem;
    }

    .dusk-text p {
        font-size: 1rem;
        line-height: 1.8;
    }
}
