/* ============================================
   a6c.quest - Tropical Deco
   Art Deco ocean liner meets tropical reef
   ============================================ */

/* --- Color Variables --- */
:root {
    --burgundy-deep: #5B1A2E;
    --cream-aged: #F5EDD6;
    --antique-gold: #C9A84C;
    --burgundy-black: #2A0D16;
    --coral-reef: #E87461;
    --teal-lagoon: #2A8C82;
    --pearl-white: #FAF6EE;
    --hammered-brass: #8B6914;
    --rose-dark: #3D1520;
    --sand-muted: #D4C9A8;
    --diagonal-angle: 12deg;
}

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

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

body {
    background-color: var(--cream-aged);
    color: var(--rose-dark);
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    line-height: 1.75;
    font-weight: 400;
    overflow-x: hidden;
    cursor: none;
}

/* --- Paper Texture Overlay --- */
#paper-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' fill='%23D4C9A8'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

/* --- Pufferfish Cursor --- */
#pufferfish-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.05s linear;
    will-change: transform;
    opacity: 0;
}

#pufferfish-cursor.visible {
    opacity: 1;
}

#pufferfish-cursor svg {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#pufferfish-cursor.inflated svg {
    transform: scale(1.4);
}

#pufferfish-cursor.inflated .puffer-dot {
    animation: dotExpand 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes dotExpand {
    to { r: 3; opacity: 1; }
}

/* --- Bubble Effects --- */
#bubble-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

.bubble {
    position: fixed;
    border-radius: 50%;
    background: var(--pearl-white);
    pointer-events: none;
    animation: bubbleFloat 0.8s ease-out forwards;
}

@keyframes bubbleFloat {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.7;
    }
    100% {
        transform: translate(var(--bx), -80px) scale(0.3);
        opacity: 0;
    }
}

/* --- Fish School --- */
#fish-school {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.fish {
    position: absolute;
    opacity: 0;
    transition: opacity 0.6s ease;
    animation: fishDrift 12s ease-in-out infinite alternate;
}

.fish.visible {
    opacity: 1;
}

.fish-fg {
    z-index: 5;
}

.fish-fg.visible {
    opacity: 0.85;
}

.fish-bg {
    z-index: 1;
}

.fish-bg.visible {
    opacity: 0.35;
}

@keyframes fishDrift {
    0% { transform: translate(0, 0) rotate(-2deg); }
    25% { transform: translate(15px, -10px) rotate(1deg); }
    50% { transform: translate(-10px, 8px) rotate(-1deg); }
    75% { transform: translate(8px, 15px) rotate(2deg); }
    100% { transform: translate(-12px, -5px) rotate(0deg); }
}

.fish-angel { animation-duration: 14s; }
.fish-tang { animation-duration: 10s; }
.fish-lion { animation-duration: 16s; }
.fish-seahorse { animation-duration: 18s; animation-name: fishFloat; }
.fish-angel2 { animation-duration: 13s; }
.fish-tang2 { animation-duration: 11s; }

@keyframes fishFloat {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(5px, -15px) rotate(3deg); }
    100% { transform: translate(-5px, 10px) rotate(-2deg); }
}

/* --- Diagonal Sections --- */
.diagonal-section {
    position: relative;
    min-height: 100vh;
    padding: 120px 0;
    overflow: hidden;
}

/* Hero section */
#hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--burgundy-deep);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8vw), 0 100%);
    z-index: 10;
}

#hero .section-content {
    position: relative;
    z-index: 20;
    text-align: center;
}

/* Typewriter seahorse */
#type-seahorse {
    display: inline-block;
    vertical-align: middle;
    opacity: 0;
    margin-left: 4px;
    animation: seahorseSwim 1.5s ease-in-out infinite;
}

#type-seahorse.visible {
    opacity: 1;
}

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

/* Deco title (hero heading) */
.deco-title {
    font-family: 'Poiret One', sans-serif;
    font-size: 96px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--antique-gold);
    text-shadow: 2px 2px 0 var(--burgundy-deep);
    position: relative;
    overflow: hidden;
}

.title-letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
}

.title-letter.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hero subtitle */
.hero-subtitle {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    font-style: italic;
    color: var(--cream-aged);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 16px;
    opacity: 0;
    transition: opacity 1s ease 2.5s;
}

.hero-subtitle.visible {
    opacity: 0.7;
}

/* Section backgrounds */
.section-dark {
    background-color: var(--burgundy-deep);
    color: var(--cream-aged);
}

.section-light {
    background-color: var(--cream-aged);
    color: var(--rose-dark);
}

.section-footer {
    background-color: var(--burgundy-black);
    color: var(--cream-aged);
}

/* Diagonal clip paths */
#section-1 {
    clip-path: polygon(0 8vw, 100% 0, 100% calc(100% - 8vw), 0 100%);
    margin-top: -8vw;
    z-index: 9;
    position: relative;
}

#section-2 {
    clip-path: polygon(0 0, 100% 8vw, 100% 100%, 0 calc(100% - 8vw));
    margin-top: -8vw;
    z-index: 8;
    position: relative;
}

#section-3 {
    clip-path: polygon(0 8vw, 100% 0, 100% calc(100% - 8vw), 0 100%);
    margin-top: -8vw;
    z-index: 7;
    position: relative;
}

#section-4 {
    clip-path: polygon(0 0, 100% 8vw, 100% 100%, 0 calc(100% - 8vw));
    margin-top: -8vw;
    z-index: 6;
    position: relative;
}

#footer {
    clip-path: polygon(0 8vw, 100% 0, 100% 100%, 0 100%);
    margin-top: -8vw;
    z-index: 5;
    position: relative;
    min-height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Section Content --- */
.section-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 40px;
    position: relative;
    z-index: 5;
}

.narrative-block {
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.narrative-block.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Drop Caps --- */
.drop-cap {
    float: left;
    font-family: 'Cinzel Decorative', serif;
    font-size: 72px;
    line-height: 0.8;
    color: var(--antique-gold);
    margin-right: 12px;
    margin-top: 8px;
    position: relative;
    background: linear-gradient(135deg, var(--antique-gold) 0%, var(--hammered-brass) 40%, var(--antique-gold) 60%, var(--pearl-white) 70%, var(--antique-gold) 80%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.drop-cap.shimmer {
    animation: goldShimmer 0.6s ease forwards;
}

@keyframes goldShimmer {
    0% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* --- Section Headings --- */
.section-heading {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 700;
    font-style: italic;
    margin-bottom: 24px;
    margin-top: 12px;
}

.section-dark .section-heading {
    color: var(--cream-aged);
}

.section-light .section-heading {
    color: var(--burgundy-deep);
}

/* --- Body Text --- */
.body-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    line-height: 1.75;
    font-weight: 400;
}

.section-dark .body-text {
    color: var(--cream-aged);
}

.section-light .body-text {
    color: var(--rose-dark);
}

/* --- Gilded Rules --- */
.gilded-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 15;
    padding: 0 5%;
    transform: translateY(50%);
}

.rule-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--hammered-brass), var(--antique-gold), var(--hammered-brass));
    transform: scaleX(0);
    transition: transform 1s ease;
    transform-origin: center;
}

.rule-line.drawn {
    transform: scaleX(1);
}

.keystone-motif {
    flex-shrink: 0;
    margin: 0 8px;
    transform: scale(0);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.keystone-motif.revealed {
    transform: scale(1);
}

/* --- Deco Pattern Backgrounds --- */
.deco-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    z-index: 0;
}

.deco-pattern.visible {
    opacity: 0.06;
}

/* Chevron pattern */
.pattern-chevrons {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='30' viewBox='0 0 60 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30 L30 0 L60 30' fill='none' stroke='%235B1A2E' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 60px 30px;
}

/* Nested arcs pattern */
.pattern-arcs {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 60 A60 60 0 0 1 60 0' fill='none' stroke='%23C9A84C' stroke-width='1'/%3E%3Cpath d='M10 60 A50 50 0 0 1 60 10' fill='none' stroke='%23C9A84C' stroke-width='0.5'/%3E%3Cpath d='M20 60 A40 40 0 0 1 60 20' fill='none' stroke='%23C9A84C' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 60px 60px;
}

/* Sunbursts pattern */
.pattern-sunbursts {
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='40' y1='40' x2='40' y2='5' stroke='%235B1A2E' stroke-width='0.8'/%3E%3Cline x1='40' y1='40' x2='65' y2='10' stroke='%235B1A2E' stroke-width='0.8'/%3E%3Cline x1='40' y1='40' x2='75' y2='40' stroke='%235B1A2E' stroke-width='0.8'/%3E%3Cline x1='40' y1='40' x2='65' y2='70' stroke='%235B1A2E' stroke-width='0.8'/%3E%3Cline x1='40' y1='40' x2='40' y2='75' stroke='%235B1A2E' stroke-width='0.8'/%3E%3Cline x1='40' y1='40' x2='15' y2='70' stroke='%235B1A2E' stroke-width='0.8'/%3E%3Cline x1='40' y1='40' x2='5' y2='40' stroke='%235B1A2E' stroke-width='0.8'/%3E%3Cline x1='40' y1='40' x2='15' y2='10' stroke='%235B1A2E' stroke-width='0.8'/%3E%3Ccircle cx='40' cy='40' r='8' fill='none' stroke='%235B1A2E' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 80px 80px;
}

/* --- Footer --- */
.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

#footer-medallion {
    animation: medallionPulse 4s ease-in-out infinite;
}

@keyframes medallionPulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.03); }
}

/* --- Gold Shimmer Hover Effect --- */
.shimmer-hover {
    position: relative;
    overflow: hidden;
}

.shimmer-hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        transparent 40%,
        rgba(250, 246, 238, 0.6) 50%,
        transparent 60%,
        transparent 100%
    );
    transition: left 0s;
    pointer-events: none;
}

.shimmer-hover:hover::after {
    left: 100%;
    transition: left 0.5s ease;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .deco-title {
        font-size: 48px;
    }

    .section-heading {
        font-size: 24px;
    }

    .drop-cap {
        font-size: 48px;
    }

    .section-content {
        padding: 40px 24px;
    }

    body {
        cursor: auto;
    }

    #pufferfish-cursor {
        display: none;
    }

    .diagonal-section {
        padding: 80px 0;
    }

    .hero-subtitle {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .deco-title {
        font-size: 36px;
    }

    .section-heading {
        font-size: 20px;
    }

    .body-text {
        font-size: 16px;
    }
}
