/* ========================================
   HHASSL.com - Underwater Daydream
   ======================================== */

/* CSS Custom Properties */
:root {
    --bg-abyss: #0A0E17;
    --bg-midnight: #111B2A;
    --text-pearl: #E8E4DF;
    --text-periwinkle: #8A9BB5;
    --accent-coral: #FF6B6B;
    --accent-teal: #0D7377;
    --gradient-warm: #FF9A5C;
    --gradient-cool: #2A5C8F;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Lato', 'Segoe UI', sans-serif;
    --column-width: min(680px, calc(100vw - 48px));
    --fish-speed-slow: 45s;
    --fish-speed-fast: 25s;
}

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

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-abyss);
    color: var(--text-pearl);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Sections (general)
   ======================================== */
.section {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    scroll-snap-align: start;
}

.section-content {
    position: relative;
    z-index: 2;
    width: var(--column-width);
    max-width: 680px;
    margin: 0 auto;
    padding: 60px 0;
}

/* ========================================
   Section 1: The Surface (Hero)
   ======================================== */
.section--hero {
    background-color: var(--bg-abyss);
    flex-direction: column;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 10vw, 8rem);
    font-weight: 700;
    color: var(--text-pearl);
    letter-spacing: 0.15em;
    line-height: 1.15;
    margin-bottom: 8px;
    position: relative;
    display: inline-block;
}

.hero-underline {
    display: block;
    width: 100%;
    height: 12px;
    margin: 0 auto 24px;
}

.hero-underline .underline-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 0.8s ease-in-out;
}

.hero-underline.animated .underline-path {
    stroke-dashoffset: 0;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-periwinkle);
    letter-spacing: 0.08em;
    opacity: 0;
    transition: opacity 1.5s ease;
}

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

/* Scroll Chevron */
.scroll-chevron {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    animation: chevronPulse 2.5s ease-in-out infinite;
}

.scroll-chevron span {
    display: block;
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--text-periwinkle);
    border-bottom: 2px solid var(--text-periwinkle);
    transform: rotate(45deg);
    opacity: 0.5;
}

@keyframes chevronPulse {
    0%, 100% { opacity: 0.3; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.8; transform: translateX(-50%) translateY(10px); }
}

/* ========================================
   Section 2: The Shallows
   ======================================== */
.section--shallows {
    background-color: var(--bg-midnight);
}

.gradient-mesh--shallows {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(255, 107, 107, 0.4), transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(13, 115, 119, 0.5), transparent 50%),
        linear-gradient(to bottom, #111B2A, #0A0E17);
    background-attachment: fixed;
}

.shallows-text {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.85;
    color: var(--text-pearl);
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
}

/* ========================================
   Section 3: The Reef
   ======================================== */
.section--reef {
    background-color: var(--bg-midnight);
    padding: 15vh 0;
    min-height: auto;
    scroll-snap-align: start;
}

.gradient-mesh--reef {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(255, 154, 92, 0.35), transparent 55%),
        radial-gradient(ellipse at 80% 20%, rgba(42, 92, 143, 0.4), transparent 50%),
        radial-gradient(ellipse at 50% 70%, rgba(13, 115, 119, 0.35), transparent 55%),
        radial-gradient(ellipse at 65% 50%, rgba(255, 107, 107, 0.25), transparent 45%),
        linear-gradient(to bottom, #111B2A, #0A0E17);
    background-attachment: fixed, scroll, fixed, scroll, scroll;
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--text-pearl);
    letter-spacing: 0.04em;
    line-height: 1.15;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
}

.heading-underline {
    display: block;
    width: 100%;
    height: 12px;
    margin-top: 4px;
}

.heading-underline .underline-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 0.8s ease-in-out;
}

.heading-underline.animated .underline-path {
    stroke-dashoffset: 0;
}

.reef-text {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.85;
    color: var(--text-pearl);
    margin-bottom: 32px;
}

.reef-values {
    list-style: none;
    padding: 0;
    margin-top: 40px;
}

.reef-values li {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.85;
    color: var(--text-pearl);
    padding: 12px 0;
    border-bottom: 1px solid rgba(138, 155, 181, 0.1);
}

.reef-values li:last-child {
    border-bottom: none;
}

/* ========================================
   Section 4: The Deep
   ======================================== */
.section--deep {
    background-color: var(--bg-abyss);
    flex-direction: column;
    justify-content: space-between;
    padding: 15vh 0 0;
}

.section-content--deep {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.deep-text {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-style: italic;
    color: var(--text-pearl);
    text-align: center;
    letter-spacing: 0.04em;
    line-height: 1.6;
    max-width: 560px;
    margin: 0 auto;
}

.deep-text em {
    font-style: italic;
}

.footer-area {
    position: absolute;
    bottom: 40px;
    right: 40px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 5;
}

.footer-text {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-style: italic;
    color: var(--text-periwinkle);
    letter-spacing: 0.06em;
}

/* ========================================
   Underline-draw animation system
   ======================================== */
.underline-draw-word {
    position: relative;
    display: inline;
}

.underline-draw-word::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: var(--accent-coral);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.8s ease-in-out;
}

.underline-draw-word.animated::after {
    transform: scaleX(1);
}

/* ========================================
   Section Dividers
   ======================================== */
.section-divider {
    position: relative;
    width: 100%;
    height: 12px;
    overflow: hidden;
    z-index: 10;
    background: transparent;
}

.section-divider svg {
    width: 100%;
    height: 100%;
}

.divider-path {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    transition: stroke-dashoffset 1.2s ease-in-out;
}

.section-divider.animated .divider-path {
    stroke-dashoffset: 0;
}

/* ========================================
   Fish Animations
   ======================================== */
.fish {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.fish svg {
    display: block;
}

/* Angelfish - Hero */
.fish--angelfish {
    width: 100px;
    height: 120px;
    top: 35%;
    right: -120px;
    z-index: 2;
    animation:
        swimAngelfish var(--fish-speed-fast) linear infinite,
        bobAngelfish 4s ease-in-out infinite;
    transform: scaleX(-1);
}

.fish-trail {
    position: absolute;
    top: 50%;
    right: 100%;
    width: 250px;
    height: 20px;
    transform: translateY(-50%) scaleX(-1);
}

.fish-trail .trail-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 0;
    animation: trailDraw 3s ease-in-out infinite;
}

@keyframes swimAngelfish {
    0% { right: -120px; }
    100% { right: calc(100vw + 120px); }
}

@keyframes bobAngelfish {
    0%, 100% { margin-top: 0; }
    50% { margin-top: -15px; }
}

@keyframes trailDraw {
    0% { stroke-dashoffset: 0; opacity: 0.4; }
    50% { stroke-dashoffset: 200; opacity: 0.2; }
    100% { stroke-dashoffset: 400; opacity: 0; }
}

/* Betta - Shallows */
.fish--betta {
    width: 130px;
    height: 80px;
    top: 55%;
    left: -150px;
    z-index: 1;
    opacity: 0;
    animation:
        swimBetta var(--fish-speed-slow) linear infinite,
        bobBetta 5s ease-in-out infinite;
}

.fish--betta.active {
    opacity: 1;
}

@keyframes swimBetta {
    0% { left: -150px; }
    100% { left: calc(100vw + 150px); }
}

@keyframes bobBetta {
    0%, 100% { margin-top: 0; }
    50% { margin-top: 20px; }
}

/* Clownfish - Reef */
.fish--clownfish {
    width: 65px;
    height: 45px;
    z-index: 1;
    opacity: 0;
}

.fish--clownfish.active {
    opacity: 1;
}

.fish--clownfish-1 {
    top: 25%;
    right: -80px;
    transform: scaleX(-1);
    animation:
        swimClown1 38s linear infinite,
        bobClown1 3.5s ease-in-out infinite;
}

.fish--clownfish-2 {
    top: 50%;
    right: -80px;
    transform: scaleX(-1) scale(0.8);
    animation:
        swimClown2 42s linear infinite,
        bobClown2 4.2s ease-in-out infinite;
    opacity: 0;
}

.fish--clownfish-2.active {
    opacity: 0.7;
}

.fish--clownfish-3 {
    top: 70%;
    right: -80px;
    transform: scaleX(-1) scale(0.6);
    animation:
        swimClown3 50s linear infinite,
        bobClown3 5s ease-in-out infinite;
    opacity: 0;
}

.fish--clownfish-3.active {
    opacity: 0.4;
}

@keyframes swimClown1 {
    0% { right: -80px; }
    100% { right: calc(100vw + 80px); }
}

@keyframes swimClown2 {
    0% { right: -80px; }
    100% { right: calc(100vw + 80px); }
}

@keyframes swimClown3 {
    0% { right: -80px; }
    100% { right: calc(100vw + 80px); }
}

@keyframes bobClown1 {
    0%, 100% { margin-top: 0; }
    50% { margin-top: -12px; }
}

@keyframes bobClown2 {
    0%, 100% { margin-top: 0; }
    50% { margin-top: 10px; }
}

@keyframes bobClown3 {
    0%, 100% { margin-top: 0; }
    50% { margin-top: -8px; }
}

/* Surgeonfish - Deep, swims upward */
.fish--surgeonfish {
    width: 110px;
    height: 60px;
    bottom: -80px;
    left: 30%;
    z-index: 1;
    opacity: 0;
    transform: rotate(-70deg);
    animation:
        swimSurgeon 35s linear infinite;
}

.fish--surgeonfish.active {
    opacity: 1;
}

@keyframes swimSurgeon {
    0% { bottom: -80px; left: 30%; }
    100% { bottom: calc(100vh + 100px); left: 45%; }
}

/* Pufferfish - Deep footer, breathing */
.fish--pufferfish {
    width: 55px;
    height: 55px;
    position: relative;
    animation: puffBreath 3s ease-in-out infinite;
}

@keyframes puffBreath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Fish hover startle effect (desktop) */
@media (hover: hover) {
    .fish:hover svg {
        transition: transform 0.3s ease-out;
        transform: translateX(20px);
    }
}

/* ========================================
   Bubbles
   ======================================== */
.bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--text-pearl);
    border-radius: 50%;
    opacity: 0.08;
    animation: bubbleRise linear infinite;
}

.bubble:nth-child(1) {
    left: 15%;
    width: 4px;
    height: 4px;
    animation-duration: 18s;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    left: 35%;
    width: 6px;
    height: 6px;
    animation-duration: 22s;
    animation-delay: 3s;
}

.bubble:nth-child(3) {
    left: 55%;
    width: 5px;
    height: 5px;
    animation-duration: 20s;
    animation-delay: 7s;
}

.bubble:nth-child(4) {
    left: 75%;
    width: 8px;
    height: 8px;
    animation-duration: 25s;
    animation-delay: 2s;
    opacity: 0.06;
}

.bubble:nth-child(5) {
    left: 88%;
    width: 4px;
    height: 4px;
    animation-duration: 19s;
    animation-delay: 10s;
}

.bubble:nth-child(6) {
    left: 45%;
    width: 5px;
    height: 5px;
    animation-duration: 23s;
    animation-delay: 5s;
}

@keyframes bubbleRise {
    0% {
        bottom: -10px;
        opacity: 0;
        transform: translateX(0);
    }
    10% {
        opacity: 0.1;
    }
    50% {
        transform: translateX(15px);
    }
    90% {
        opacity: 0.06;
    }
    100% {
        bottom: 100%;
        opacity: 0;
        transform: translateX(-10px);
    }
}

/* ========================================
   Gradient Mesh Panels
   ======================================== */
.gradient-mesh {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
}

/* ========================================
   Responsive (< 640px)
   ======================================== */
@media (max-width: 640px) {
    html {
        scroll-snap-type: y proximity;
    }

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

    .hero-title {
        letter-spacing: 0.08em;
    }

    /* Simplify gradient meshes */
    .gradient-mesh--shallows {
        background:
            radial-gradient(ellipse at 40% 50%, rgba(255, 107, 107, 0.3), transparent 60%),
            linear-gradient(to bottom, #111B2A, #0A0E17);
    }

    .gradient-mesh--reef {
        background:
            radial-gradient(ellipse at 50% 40%, rgba(255, 154, 92, 0.3), transparent 55%),
            radial-gradient(ellipse at 50% 70%, rgba(13, 115, 119, 0.3), transparent 55%),
            linear-gradient(to bottom, #111B2A, #0A0E17);
    }

    /* Reduce fish complexity */
    .fish--angelfish {
        width: 70px;
        height: 85px;
    }

    .fish-trail {
        display: none;
    }

    .fish--betta {
        width: 90px;
        height: 55px;
    }

    .fish--clownfish {
        width: 45px;
        height: 32px;
    }

    .fish--clownfish-3 {
        display: none;
    }

    .fish--surgeonfish {
        width: 80px;
        height: 45px;
    }

    .footer-area {
        right: 24px;
        bottom: 24px;
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }

    .fish--pufferfish {
        width: 40px;
        height: 40px;
    }

    .shallows-text {
        font-size: 1rem;
    }

    .reef-text {
        font-size: 1rem;
    }

    .reef-values li {
        font-size: 1rem;
    }
}

/* ========================================
   Larger screens - more breathing room
   ======================================== */
@media (min-width: 1200px) {
    .section--reef {
        padding: 20vh 0;
    }

    .fish--angelfish {
        width: 120px;
        height: 140px;
    }

    .fish--betta {
        width: 160px;
        height: 100px;
    }
}
