/* ============================================
   xity.bar — Styles
   Aquarium Naturalist's Journal
   Watercolor / Organic-Flow / Tropical Fish
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Palette */
    --rice-paper: #f4f0e8;
    --diluted-ink: #3d3832;
    --coral-reef: #c9715a;
    --deep-lagoon: #4a7c72;
    --faded-indigo: #6b7c9e;
    --sunbleached-gold: #d4b87a;
    --plankton-blush: #e8d5c4;
    --tide-pool: #d6dfd8;

    /* Typography */
    --font-display: 'Caveat', cursive;
    --font-mono: 'IBM Plex Mono', monospace;

    /* Sizes */
    --hero-text: clamp(3.5rem, 12vw, 9rem);
    --heading-text: clamp(1.8rem, 5vw, 3.2rem);
    --body-text: clamp(0.85rem, 1.8vw, 1.05rem);
    --label-text: 0.7rem;

    /* Spacing */
    --grid-gap: clamp(1.5rem, 3vw, 3rem);
}

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

html {
    scroll-behavior: smooth;
    background: var(--rice-paper);
    overflow-x: hidden;
}

body {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: var(--body-text);
    line-height: 1.7;
    color: var(--diluted-ink);
    background: var(--rice-paper);
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

/* Grain Texture Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.02) 0px,
            rgba(0, 0, 0, 0.02) 1px,
            transparent 1px,
            transparent 2px
        );
    background-size: 100% 2px;
    opacity: 0.035;
    mix-blend-mode: overlay;
}

/* Vignette Overlay */
.vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
    box-shadow: inset 0 0 200px rgba(61, 56, 50, 0.08);
}

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

/* ---------- Main Scroll Container ---------- */
.scroll-container {
    width: 100vw;
    position: relative;
    display: block;
}

/* ---------- Sections ---------- */
.section {
    width: 100%;
    padding: var(--grid-gap) 5%;
    position: relative;
}

.section-hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rice-paper);
    position: relative;
    overflow: hidden;
}

/* Hero Content */
.hero-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.hero-wordmark {
    font-family: var(--font-display);
    font-size: var(--hero-text);
    line-height: 0.9;
    color: var(--diluted-ink);
    font-weight: 700;
    text-shadow: 2px 2px 4px var(--sunbleached-gold);
    margin: 0;
    opacity: 0;
    animation: bounceEnter 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s forwards;
}

.hero-fish {
    position: absolute;
    top: 50%;
    right: 5%;
    transform: translateY(-50%);
    width: 35vw;
    max-width: 500px;
    opacity: 0;
    animation: bounceEnterFish 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s forwards,
              drift 8s ease-in-out 2.0s infinite;
}

.hero-tagline {
    font-size: clamp(0.8rem, 2vw, 1.1rem);
    color: var(--faded-indigo);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-top: 2rem;
    opacity: 0;
    animation: bounceEnterText 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s forwards;
}

/* ---------- Specimen Clusters ---------- */
.specimen-cluster {
    width: 100%;
    padding: var(--grid-gap) 5%;
    position: relative;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: var(--grid-gap);
    align-items: start;
}

/* Specimen Cards */
.specimen-card {
    background: linear-gradient(135deg, rgba(232, 213, 196, 0.08) 0%, rgba(214, 223, 216, 0.05) 100%);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(212, 184, 122, 0.15);
    opacity: 0;
    transition: all 0.4s ease;
    animation: slideUpCard 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    will-change: transform, opacity;
}

.specimen-card-left {
    grid-column: 1 / 4;
    transform: rotate(-1deg);
    animation-delay: 0.4s;
    margin-bottom: 2rem;
}

.specimen-card-right {
    grid-column: 5 / 9;
    transform: rotate(1deg);
    animation-delay: 0.6s;
}

.specimen-card-center {
    grid-column: 3 / 7;
    transform: rotate(-0.5deg);
    animation-delay: 0.4s;
    margin: 0 auto;
}

.specimen-card:hover {
    transform: translateY(-4px) rotate(0deg);
    background: linear-gradient(135deg, rgba(232, 213, 196, 0.12) 0%, rgba(214, 223, 216, 0.08) 100%);
    box-shadow: 0 8px 24px rgba(61, 56, 50, 0.06);
}

.specimen-header {
    margin-bottom: 1.5rem;
}

.specimen-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: var(--coral-reef);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.specimen-label {
    font-size: var(--label-text);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--faded-indigo);
    margin: 0;
}

.specimen-body {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.specimen-fish {
    flex-shrink: 0;
    filter: url(#watercolor-filter);
}

.specimen-note {
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    line-height: 1.7;
    color: var(--diluted-ink);
    opacity: 0.85;
}

/* Pufferfish Hover Animation */
.pufferfish-hover:hover {
    animation: inflate 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Wash Dividers ---------- */
.wash-divider {
    width: 100vw;
    height: 60px;
    margin: 120px -5vw;
    background: linear-gradient(
        180deg,
        rgba(201, 113, 90, 0.06) 0%,
        rgba(74, 124, 114, 0.04) 50%,
        transparent 100%
    );
    position: relative;
    animation: rippleWave 4s ease-in-out infinite;
}

/* ---------- Void Spacers ---------- */
.void-spacer {
    height: 200px;
    width: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(232, 213, 196, 0.02) 50%,
        transparent 100%
    );
    position: relative;
}

.void-spacer-final {
    height: 300px;
}

/* ---------- Footer ---------- */
.field-notes-footer {
    width: 100%;
    padding: 2rem 5%;
    text-align: center;
    background: var(--rice-paper);
    border-top: 1px solid rgba(212, 184, 122, 0.1);
    font-size: var(--label-text);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--faded-indigo);
}

.footer-content {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-label, .footer-separator, .footer-date {
    display: inline-block;
}

/* ---------- Animations ---------- */

/* Bounce Enter - Hero Wordmark */
@keyframes bounceEnter {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Bounce Enter - Fish */
@keyframes bounceEnterFish {
    from {
        transform: translateY(-20px) translateX(50px) rotate(-3deg);
        opacity: 0;
    }
    to {
        transform: translateY(-50%) translateX(0) rotate(0deg);
        opacity: 0.07;
    }
}

/* Bounce Enter - Text */
@keyframes bounceEnterText {
    from {
        transform: translateY(15px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide Up Card */
@keyframes slideUpCard {
    from {
        transform: translateY(25px) rotate(var(--card-rotate, 0deg));
        opacity: 0;
    }
    to {
        transform: translateY(0) rotate(var(--card-rotate, 0deg));
        opacity: 1;
    }
}

/* Drift Animation */
@keyframes drift {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(8px, -5px);
    }
    50% {
        transform: translate(0, -10px);
    }
    75% {
        transform: translate(-8px, -5px);
    }
}

/* Ripple Wave */
@keyframes rippleWave {
    0%, 100% {
        clip-path: polygon(
            0% 40%, 2% 35%, 4% 40%, 6% 35%, 8% 40%, 10% 35%,
            12% 40%, 14% 35%, 16% 40%, 18% 35%, 20% 40%, 22% 35%,
            24% 40%, 26% 35%, 28% 40%, 30% 35%, 32% 40%, 34% 35%,
            36% 40%, 38% 35%, 40% 40%, 42% 35%, 44% 40%, 46% 35%,
            48% 40%, 50% 35%, 52% 40%, 54% 35%, 56% 40%, 58% 35%,
            60% 40%, 62% 35%, 64% 40%, 66% 35%, 68% 40%, 70% 35%,
            72% 40%, 74% 35%, 76% 40%, 78% 35%, 80% 40%, 82% 35%,
            84% 40%, 86% 35%, 88% 40%, 90% 35%, 92% 40%, 94% 35%,
            96% 40%, 98% 35%, 100% 40%,
            100% 100%, 0% 100%
        );
    }
    50% {
        clip-path: polygon(
            0% 38%, 2% 33%, 4% 38%, 6% 33%, 8% 38%, 10% 33%,
            12% 38%, 14% 33%, 16% 38%, 18% 33%, 20% 38%, 22% 33%,
            24% 38%, 26% 33%, 28% 38%, 30% 33%, 32% 38%, 34% 33%,
            36% 38%, 38% 33%, 40% 38%, 42% 33%, 44% 38%, 46% 33%,
            48% 38%, 50% 33%, 52% 38%, 54% 33%, 56% 38%, 58% 33%,
            60% 38%, 62% 33%, 64% 38%, 66% 33%, 68% 38%, 70% 33%,
            72% 38%, 74% 33%, 76% 38%, 78% 33%, 80% 38%, 82% 33%,
            84% 38%, 86% 33%, 88% 38%, 90% 33%, 92% 38%, 94% 33%,
            96% 38%, 98% 33%, 100% 38%,
            100% 100%, 0% 100%
        );
    }
}

/* Pufferfish Inflate */
@keyframes inflate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .specimen-card-left,
    .specimen-card-right,
    .specimen-card-center {
        grid-column: 1 / -1 !important;
        transform: rotate(0deg) !important;
    }

    .specimen-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .specimen-card:hover {
        transform: translateY(-4px);
    }

    .hero-fish {
        width: 50vw;
        right: 0;
        opacity: 0.03;
    }
}

@media (max-width: 480px) {
    :root {
        --grid-gap: 1rem;
    }

    .section {
        padding: 1.5rem 5%;
    }

    .hero-wordmark {
        text-shadow: 1px 1px 3px var(--sunbleached-gold);
    }

    .specimen-card {
        padding: 1.5rem;
    }

    .specimen-title {
        font-size: 1.2rem;
    }

    .wash-divider {
        height: 40px;
        margin: 80px -5vw;
    }

    .void-spacer {
        height: 120px;
    }
}
