/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --deep-lagoon: #1a2e3a;
    --reef-teal: #2a6b7c;
    --sunset-coral: #e8a87c;
    --bleached-sand: #f5f0e8;
    --shallow-turquoise: #6bb8c4;
    --driftwood-gray: #8a9a9e;
    --abyssal-indigo: #0f1c2e;
    --bougainvillea-pink: #d4728c;
    --text-light: #e0ecef;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.75;
    color: var(--deep-lagoon);
    background: var(--bleached-sand);
    overflow-x: hidden;
}

/* === NAVIGATION === */
.nav-glyph {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--reef-teal);
    background: rgba(245, 240, 232, 0.9);
    color: var(--reef-teal);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-glyph:hover {
    background: var(--reef-teal);
    color: var(--bleached-sand);
}

.nav-glyph.active {
    background: var(--reef-teal);
    color: var(--bleached-sand);
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    background: rgba(15, 28, 46, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.nav-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links a {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    color: var(--text-light);
    text-decoration: none;
    line-height: 2.5;
    transition: color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-links a:hover {
    color: var(--sunset-coral);
}

/* === HERO — PARADOX GATE === */
.paradox-gate {
    height: 100vh;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bleached-sand) 0%, var(--bleached-sand) 48%, var(--sunset-coral) 52%, var(--reef-teal) 100%);
}

.paradox-gate::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bleached-sand);
    clip-path: polygon(0 0, 100% 0, 0 100%);
    z-index: 1;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.grid-overlay line {
    stroke: var(--reef-teal);
    stroke-width: 1;
    opacity: 0.15;
}

.hero-kanji {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(15rem, 30vw, 35rem);
    color: var(--reef-teal);
    opacity: 0.06;
    z-index: 2;
    pointer-events: none;
    line-height: 1;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center;
    opacity: 0;
    animation: heroFadeIn 1.2s ease-out 0.3s forwards;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 20px));
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(3.5rem, 10vw, 8rem);
    letter-spacing: -0.04em;
    color: var(--deep-lagoon);
    font-weight: 300;
    animation: weightShift 6s ease-in-out infinite alternate;
}

@keyframes weightShift {
    0% { font-variation-settings: 'wght' 300; }
    100% { font-variation-settings: 'wght' 700; }
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--driftwood-gray);
    margin-top: 1rem;
}

/* === TENSION FIELD === */
.tension-field {
    position: relative;
    padding: clamp(4rem, 8vw, 8rem) clamp(1rem, 4vw, 4rem);
    min-height: 100vh;
    overflow: hidden;
}

.kanji-watermark {
    position: absolute;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(20rem, 40vw, 50rem);
    line-height: 1;
    opacity: 0.05;
    pointer-events: none;
    color: var(--reef-teal);
}

.kanji-spear {
    top: 5%;
    left: 10%;
    transform: rotate(5deg);
}

.kanji-shield {
    top: 10%;
    right: 5%;
    transform: rotate(-5deg);
}

.watercolor-wash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    mix-blend-mode: multiply;
}

.blob-a {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--sunset-coral) 0%, transparent 70%);
    top: 10%;
    left: 20%;
    animation: drift1 12s ease-in-out infinite alternate;
}

.blob-b {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--shallow-turquoise) 0%, transparent 70%);
    top: 40%;
    right: 15%;
    animation: drift2 15s ease-in-out infinite alternate;
}

.blob-c {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--bougainvillea-pink) 0%, transparent 70%);
    bottom: 20%;
    left: 40%;
    animation: drift3 8s ease-in-out infinite alternate;
}

@keyframes drift1 {
    from { transform: translate(0, 0); }
    to { transform: translate(15px, -10px); }
}

@keyframes drift2 {
    from { transform: translate(0, 0); }
    to { transform: translate(-20px, 12px); }
}

@keyframes drift3 {
    from { transform: translate(0, 0); }
    to { transform: translate(10px, 18px); }
}

.tension-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto auto auto;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
}

.tension-block {
    padding: 2rem;
    border-left: 1px solid var(--reef-teal);
    border-bottom: 1px solid var(--reef-teal);
    background: rgba(245, 240, 232, 0.6);
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.tension-block.visible {
    opacity: 1;
    transform: translateX(0);
}

.tension-block .block-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--driftwood-gray);
    display: block;
    margin-bottom: 1rem;
}

.tension-block h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--deep-lagoon);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.tension-block p {
    color: var(--deep-lagoon);
    line-height: 1.75;
}

.block-1 {
    grid-column: 1 / 6;
    grid-row: 1 / 3;
}

.block-2 {
    grid-column: 4 / 10;
    grid-row: 2 / 4;
    transition-delay: 0.2s;
}

.block-3 {
    grid-column: 7 / 13;
    grid-row: 1 / 3;
    transition-delay: 0.4s;
}

/* Fish SVGs */
.fish {
    position: absolute;
    z-index: 2;
    pointer-events: none;
}

.fish-spear {
    width: 100px;
    top: 35%;
    left: 5%;
    animation: swimRight 20s linear infinite;
}

.fish-shield {
    width: 70px;
    top: 60%;
    right: 10%;
    animation: swimCircle 25s linear infinite;
}

@keyframes swimRight {
    0% { transform: translate(-120px, 0); }
    50% { transform: translate(calc(100vw + 120px), -30px); }
    50.01% { transform: translate(-120px, 20px); }
    100% { transform: translate(calc(100vw + 120px), 0); }
}

@keyframes swimCircle {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-50px, -30px); }
    50% { transform: translate(-100px, 0); }
    75% { transform: translate(-50px, 30px); }
    100% { transform: translate(0, 0); }
}

/* === REEF LEDGER === */
.reef-ledger {
    position: relative;
    padding: clamp(3rem, 6vw, 6rem) 0;
    overflow: hidden;
}

.reef-ledger .section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--deep-lagoon);
    padding-left: clamp(1rem, 4vw, 4rem);
    margin-bottom: 2rem;
}

.reef-track {
    display: inline-flex;
    gap: 2rem;
    padding: 2rem 10vw;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--reef-teal) var(--bleached-sand);
    scroll-snap-type: x proximity;
}

.reef-track::-webkit-scrollbar {
    height: 6px;
}

.reef-track::-webkit-scrollbar-track {
    background: var(--bleached-sand);
}

.reef-track::-webkit-scrollbar-thumb {
    background: var(--reef-teal);
    border-radius: 3px;
}

.paradox-card {
    width: 280px;
    aspect-ratio: 3 / 5;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: rgba(245, 240, 232, 0.85);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    scroll-snap-align: start;
    opacity: 0;
    transform: translateY(20px);
}

.paradox-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.paradox-card:hover {
    transform: translateY(-8px);
}

.paradox-card.visible:hover {
    transform: translateY(-8px);
}

.card-top {
    padding: 2rem 1.5rem;
    flex: 1;
    white-space: normal;
}

.card-top h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--deep-lagoon);
    margin-bottom: 0.75rem;
}

.card-top p {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    color: var(--deep-lagoon);
    font-size: 1rem;
    line-height: 1.6;
}

.card-wash {
    height: 40%;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 8px 8px;
}

.blob-d {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--sunset-coral) 0%, transparent 70%);
    top: -30%;
    left: -10%;
    animation: drift1 10s ease-in-out infinite alternate;
}

.blob-e {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, var(--shallow-turquoise) 0%, transparent 70%);
    top: 10%;
    right: -20%;
    animation: drift2 13s ease-in-out infinite alternate;
}

.blob-f {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--bougainvillea-pink) 0%, transparent 70%);
    top: -20%;
    left: 20%;
    animation: drift3 11s ease-in-out infinite alternate;
}

.blob-g {
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, var(--reef-teal) 0%, transparent 70%);
    bottom: -30%;
    right: 0;
    animation: drift1 9s ease-in-out infinite alternate;
}

/* === ESTUARY === */
.estuary {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--abyssal-indigo) 0%, var(--deep-lagoon) 60%, var(--reef-teal) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4rem 2rem;
}

.coral-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.coral-path {
    fill: none;
    stroke: var(--reef-teal);
    stroke-width: 1;
    opacity: 0.2;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s ease;
}

.coral-grid.visible .coral-path {
    stroke-dashoffset: 0;
}

.fish-paradox {
    width: 120px;
    top: 50%;
    z-index: 3;
    animation: swimParadox 30s linear infinite;
}

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

.wash-estuary {
    z-index: 1;
}

.blob-h {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(42, 107, 124, 0.3) 0%, transparent 70%);
    top: 20%;
    left: 10%;
    animation: drift1 15s ease-in-out infinite alternate;
}

.blob-i {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(232, 168, 124, 0.2) 0%, transparent 70%);
    top: 40%;
    right: 20%;
    animation: drift2 12s ease-in-out infinite alternate;
}

.blob-j {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212, 114, 140, 0.15) 0%, transparent 70%);
    bottom: 20%;
    left: 40%;
    animation: drift3 10s ease-in-out infinite alternate;
}

.estuary-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.estuary-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.estuary-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    line-height: 1.9;
    color: var(--text-light);
}

.site-footer {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding-bottom: 4rem;
    padding-top: 4rem;
}

.site-footer span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #6b9ea8;
    letter-spacing: 0.05em;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .paradox-gate::before {
        clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
    }

    .tension-grid {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .tension-block {
        transform: translateY(20px);
    }

    .tension-block.visible {
        transform: translateY(0);
    }

    .paradox-card {
        width: 240px;
    }

    .reef-track {
        scroll-snap-type: x mandatory;
    }

    .fish-spear {
        width: 60px;
    }

    .fish-shield {
        width: 42px;
    }

    .fish-paradox {
        width: 72px;
    }

    .hero-kanji {
        font-size: clamp(8rem, 20vw, 15rem);
    }
}
