:root {
    --tide-sand: #E8E4DF;
    --wet-stone: #C9C4BD;
    --salt-foam: #F5F2EE;
    --kelp-shadow: #B0ABA4;
    --basalt: #2C3033;
    --driftwood: #6B7178;
    --tidal-teal: #3A8C8C;
    --sunset-lichen: #C47D4E;
    --abyssal-blue: #1B3A4B;

    --nm-light: #F5F2EE;
    --nm-dark: #B0ABA4;
    --nm-offset: 6px;
    --nm-blur: 12px;

    --font-display: 'Libre Baskerville', Georgia, serif;
    --font-body: 'Source Serif 4', Georgia, serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--tide-sand);
    color: var(--basalt);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ================================================
   FLOATING NEOMORPHIC FORMS
   ================================================ */

.floating-el {
    position: fixed;
    border-radius: 50%;
    background-color: var(--tide-sand);
    box-shadow: calc(-1 * var(--nm-offset)) calc(-1 * var(--nm-offset)) var(--nm-blur) var(--nm-light),
                var(--nm-offset) var(--nm-offset) var(--nm-blur) var(--nm-dark);
    z-index: 0;
    will-change: transform;
    pointer-events: none;
}

.float-a {
    width: 48px;
    height: 48px;
    top: 18%;
    left: 7%;
    animation: floatA 25s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.float-b {
    width: 32px;
    height: 32px;
    top: 42%;
    right: 10%;
    animation: floatB 32s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.float-c {
    width: 56px;
    height: 56px;
    top: 68%;
    left: 14%;
    animation: floatC 19s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.float-d {
    width: 48px;
    height: 24px;
    border-radius: 12px;
    top: 28%;
    right: 22%;
    animation: floatD 38s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.float-e {
    width: 40px;
    height: 40px;
    top: 82%;
    left: 58%;
    animation: floatE 28s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.float-f {
    width: 36px;
    height: 36px;
    top: 55%;
    right: 5%;
    animation: floatF 22s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.float-g {
    width: 56px;
    height: 24px;
    border-radius: 12px;
    top: 10%;
    left: 45%;
    animation: floatG 35s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

@keyframes floatA {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(5px, -8px); }
    50% { transform: translate(8px, -12px); }
    75% { transform: translate(3px, -5px); }
}

@keyframes floatB {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-6px, 4px); }
    50% { transform: translate(-10px, 8px); }
    75% { transform: translate(-4px, 3px); }
}

@keyframes floatC {
    0%, 100% { transform: translate(0, 0); }
    30% { transform: translate(3px, -10px); }
    50% { transform: translate(5px, -15px); }
    70% { transform: translate(2px, -8px); }
}

@keyframes floatD {
    0%, 100% { transform: translate(0, 0); }
    35% { transform: translate(-5px, 7px); }
    50% { transform: translate(-7px, 10px); }
    65% { transform: translate(-3px, 5px); }
}

@keyframes floatE {
    0%, 100% { transform: translate(0, 0); }
    40% { transform: translate(4px, -6px); }
    50% { transform: translate(6px, -8px); }
    60% { transform: translate(3px, -4px); }
}

@keyframes floatF {
    0%, 100% { transform: translate(0, 0); }
    30% { transform: translate(-8px, -5px); }
    60% { transform: translate(-5px, 7px); }
}

@keyframes floatG {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(6px, -10px); }
    75% { transform: translate(-4px, 8px); }
}

/* ================================================
   SECTION 1: HERO
   ================================================ */

.section-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 2rem;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw + 0.5rem, 5.5rem);
    letter-spacing: 0.01em;
    line-height: 1.15;
    color: var(--basalt);
    margin-bottom: 2rem;
    min-height: 1.15em;
    position: relative;
}

.hero-title .char {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.hero-title .char.shown {
    opacity: 1;
}

.hero-title .char.drop-letter {
    color: var(--sunset-lichen);
}

.hero-title .title-cursor {
    display: inline-block;
    width: 2px;
    height: 0.85em;
    background-color: var(--tidal-teal);
    vertical-align: baseline;
    margin-left: 2px;
    animation: cursorBlink 530ms steps(1) infinite;
}

.hero-title .title-cursor.fade-out {
    animation: cursorFadeOut 800ms ease forwards;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes cursorFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.neo-lens {
    width: clamp(280px, 50vw, 520px);
    height: clamp(280px, 50vw, 520px);
    border-radius: 50%;
    background-color: var(--tide-sand);
    box-shadow: inset var(--nm-offset) var(--nm-offset) var(--nm-blur) var(--nm-dark),
                inset calc(-1 * var(--nm-offset)) calc(-1 * var(--nm-offset)) var(--nm-blur) var(--nm-light);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.lens-image {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.lens-image.revealed {
    opacity: 1;
}

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

.lens-strips {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
}

.lens-strip-line {
    position: absolute;
    left: 0;
    width: 100%;
    background-color: var(--tide-sand);
    transition: opacity 0.4s ease;
}

.lens-strip-line.cleared {
    opacity: 0;
}

.hero-sub {
    font-family: var(--font-body);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: var(--driftwood);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.hero-sub.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================
   DIAGONAL SECTION SYSTEM
   ================================================ */

.diagonal-down {
    clip-path: polygon(0 4vw, 100% 0, 100% calc(100% - 4vw), 0 100%);
    padding: clamp(6rem, 10vw, 10rem) clamp(1.5rem, 4vw, 4rem);
    position: relative;
    z-index: 1;
    margin-top: -4vw;
}

.diagonal-up {
    clip-path: polygon(0 0, 100% 4vw, 100% 100%, 0 calc(100% - 4vw));
    padding: clamp(6rem, 10vw, 10rem) clamp(1.5rem, 4vw, 4rem);
    position: relative;
    z-index: 1;
    margin-top: -4vw;
}

.diagonal-ridge {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    pointer-events: none;
    z-index: 2;
}

.diagonal-ridge.ridge-top {
    top: 0;
    background: linear-gradient(to bottom, var(--salt-foam), var(--kelp-shadow));
}

/* ================================================
   SECTION 2: CARDS
   ================================================ */

.section-cards {
    background-color: var(--tide-sand);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.cards-container {
    display: flex;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    justify-content: center;
    flex-wrap: wrap;
}

.neo-card {
    flex: 1 1 260px;
    max-width: 300px;
    background-color: var(--tide-sand);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: calc(-1 * var(--nm-offset)) calc(-1 * var(--nm-offset)) var(--nm-blur) var(--nm-light),
                var(--nm-offset) var(--nm-offset) var(--nm-blur) var(--nm-dark);
    transition: box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-orbit-1 {
    animation: cardOrbit1 24s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.card-orbit-2 {
    animation: cardOrbit2 28s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.card-orbit-3 {
    animation: cardOrbit3 22s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

@keyframes cardOrbit1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-4px, -6px); }
    50% { transform: translate(2px, -10px); }
    75% { transform: translate(5px, -3px); }
}

@keyframes cardOrbit2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(5px, -4px); }
    50% { transform: translate(-3px, -8px); }
    75% { transform: translate(-6px, 2px); }
}

@keyframes cardOrbit3 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-3px, 5px); }
    50% { transform: translate(4px, -6px); }
    75% { transform: translate(-2px, -9px); }
}

.neo-card:hover {
    box-shadow: inset var(--nm-offset) var(--nm-offset) var(--nm-blur) var(--nm-dark),
                inset calc(-1 * var(--nm-offset)) calc(-1 * var(--nm-offset)) var(--nm-blur) var(--nm-light);
}

.card-strip {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, var(--tidal-teal), var(--kelp-shadow));
    margin-bottom: 1.25rem;
    opacity: 0.6;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.15rem, 1.8vw, 1.4rem);
    letter-spacing: 0.01em;
    margin-bottom: 0.75rem;
    color: var(--basalt);
}

.card-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw + 0.1rem, 1.1rem);
    line-height: 1.75;
    color: var(--driftwood);
    letter-spacing: 0.005em;
}

/* ================================================
   SECTION 3: PROSE / TYPEWRITER
   ================================================ */

.section-prose {
    background-color: var(--tide-sand);
    position: relative;
    min-height: 140vh;
    display: flex;
    align-items: center;
}

.tidal-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 1px;
    background-color: var(--tidal-teal);
    animation: tidalPulse 12s ease-in-out infinite;
    z-index: 0;
}

@keyframes tidalPulse {
    0%, 100% { width: 0; opacity: 0.6; }
    50% { width: 100vw; opacity: 0.2; }
}

.neo-disc {
    position: absolute;
    left: 5%;
    top: 50%;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--tide-sand);
    box-shadow: calc(-1 * var(--nm-offset)) calc(-1 * var(--nm-offset)) var(--nm-blur) var(--nm-light),
                var(--nm-offset) var(--nm-offset) var(--nm-blur) var(--nm-dark);
    animation: spinDisc 20s linear infinite;
    z-index: 1;
}

@keyframes spinDisc {
    to { transform: rotate(360deg); }
}

.glow-bar {
    position: absolute;
    right: 8%;
    top: 20%;
    bottom: 20%;
    width: 2px;
    background-color: var(--tidal-teal);
    border-radius: 1px;
    animation: glowPulse 4s ease-in-out infinite;
    z-index: 1;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.3;
        box-shadow: 0 0 6px rgba(58, 140, 140, 0.2);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 14px rgba(58, 140, 140, 0.5);
    }
}

.prose-container {
    max-width: 38rem;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.typewriter-block {
    position: relative;
}

.typewriter-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1.05rem, 1.2vw + 0.3rem, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.005em;
    color: var(--basalt);
}

.typewriter-text .tw-char {
    opacity: 0;
    transition: opacity 0.05s ease;
}

.typewriter-text .tw-char.tw-visible {
    opacity: 1;
}

.typewriter-text .tw-char.tw-glow {
    text-shadow: 0 0 8px rgba(58, 140, 140, 0.3);
}

.typewriter-text .tw-paragraph {
    display: block;
    margin-bottom: 1.5em;
}

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

.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--tidal-teal);
    vertical-align: text-bottom;
    margin-left: 1px;
    animation: cursorBlink 530ms steps(1) infinite;
    opacity: 0;
}

.typewriter-cursor.tw-cursor-active {
    opacity: 1;
}

.typewriter-cursor.tw-cursor-fadeout {
    animation: cursorFadeOut 800ms ease forwards;
}

/* ================================================
   SECTION 4: QUOTE BAND
   ================================================ */

.section-quote {
    background-color: var(--abyssal-blue);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.quote-band {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

.quote-photo-strip {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: calc(-1 * var(--nm-offset)) calc(-1 * var(--nm-offset)) 16px rgba(245, 242, 238, 0.05),
                var(--nm-offset) var(--nm-offset) 16px rgba(0, 0, 0, 0.3);
    margin-bottom: 3rem;
}

.strip-svg {
    width: 100%;
    height: auto;
    display: block;
}

.pull-quote {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    line-height: 1.5;
    color: var(--salt-foam);
    padding: 2rem 2.5rem;
    border-radius: 100px;
    background-color: rgba(27, 58, 75, 0.6);
    box-shadow: calc(-1 * var(--nm-offset)) calc(-1 * var(--nm-offset)) 16px rgba(58, 140, 140, 0.08),
                var(--nm-offset) var(--nm-offset) 16px rgba(0, 0, 0, 0.25);
    margin-left: auto;
    max-width: 85%;
    text-align: right;
}

/* ================================================
   SECTION 5: CLOSING
   ================================================ */

.section-closing {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    background: linear-gradient(to bottom, var(--wet-stone), var(--abyssal-blue));
    padding: clamp(4rem, 8vw, 8rem) 2rem;
}

.bubble-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background-color: var(--wet-stone);
    box-shadow: -4px -4px 8px var(--nm-light),
                4px 4px 8px var(--nm-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bubble-1 {
    width: 56px;
    height: 56px;
    left: 28%;
    bottom: 22%;
    animation: rise1 18s ease-in-out infinite;
}

.bubble-2 {
    width: 40px;
    height: 40px;
    left: 52%;
    bottom: 32%;
    animation: rise2 22s ease-in-out infinite;
}

.bubble-3 {
    width: 48px;
    height: 48px;
    left: 72%;
    bottom: 18%;
    animation: rise3 15s ease-in-out infinite;
}

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

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

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

.mono-glyph {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--driftwood);
}

.closing-content {
    max-width: 38rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.closing-text {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    line-height: 1.7;
    color: var(--salt-foam);
    margin-bottom: 2rem;
}

.closing-label {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tidal-teal);
    opacity: 0.7;
}

/* ================================================
   SCROLL REVEAL SYSTEM
   ================================================ */

.fade-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================
   REDUCED MOTION
   ================================================ */

@media (prefers-reduced-motion: reduce) {
    .floating-el,
    .neo-disc,
    .tidal-pulse,
    .glow-bar,
    .bubble,
    .card-orbit-1,
    .card-orbit-2,
    .card-orbit-3 {
        animation: none;
    }

    .fade-reveal {
        transition: none;
        opacity: 1;
        transform: none;
    }

    .hero-title .char {
        opacity: 1;
    }

    .hero-sub {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .typewriter-text .tw-char {
        opacity: 1;
    }

    .typewriter-cursor {
        display: none;
    }

    .lens-image {
        opacity: 1;
    }
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
    .cards-container {
        flex-direction: column;
        align-items: center;
    }

    .neo-card {
        max-width: 100%;
    }

    .neo-disc {
        display: none;
    }

    .glow-bar {
        display: none;
    }

    .diagonal-down,
    .diagonal-up {
        clip-path: none;
        margin-top: 0;
        padding: clamp(4rem, 8vw, 6rem) 1.5rem;
    }

    .floating-el {
        display: none;
    }

    .pull-quote {
        max-width: 100%;
        text-align: center;
        border-radius: 24px;
        padding: 1.5rem;
    }

    .card-orbit-1,
    .card-orbit-2,
    .card-orbit-3 {
        animation: none;
    }
}

@media (max-width: 480px) {
    .neo-lens {
        width: 70vw;
        height: 70vw;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }

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

    .pull-quote {
        font-size: 1.1rem;
    }

    .section-closing {
        min-height: 60vh;
    }
}
