/* /estudos/this-is-water/ — single full-bleed ocean section */

.page-this-is-water {
    --tiw-ink: #e8eef4;
    --tiw-ink-muted: rgba(232, 238, 244, 0.72);
    --tiw-deep: #061018;
    --tiw-gutter: 2rem;
    --tiw-space-xs: 0.75rem;
    --tiw-space-sm: 1rem;
    --tiw-space: 1.5rem;
    --tiw-space-md: 2rem;
    --tiw-space-lg: 4rem;
}

.page-this-is-water header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    border-bottom-color: rgba(232, 238, 244, 0.22);
    background: linear-gradient(180deg, rgba(6, 16, 24, 0.72) 0%, rgba(6, 16, 24, 0) 100%);
    padding: var(--tiw-space-md) 0;
}

.page-this-is-water header nav a,
.page-this-is-water header .logo-link,
.page-this-is-water header .theme-toggle {
    color: var(--tiw-ink);
}

.page-this-is-water main {
    padding: 0;
    max-width: none;
    min-height: 100svh;
}

.page-this-is-water footer {
    display: none;
}

.tiw-hero {
    position: relative;
    min-height: 100svh;
    background: var(--tiw-deep);
    overflow: hidden;
    color: var(--tiw-ink);
}

.tiw-hero__canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.tiw-hero__canvas canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.tiw-hero__veil {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(6, 16, 24, 0.42) 0%, rgba(6, 16, 24, 0.05) 42%, rgba(6, 16, 24, 0.35) 100%),
        radial-gradient(ellipse 75% 60% at 50% 40%, transparent 0%, rgba(6, 16, 24, 0.28) 100%);
}

/* --- Loader (centered while selected/loading) -------------------- */

.tiw-loader {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--tiw-space-sm);
    padding: var(--tiw-gutter);
    background: var(--tiw-deep);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.tiw-loader.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.tiw-loader__label {
    margin: 0;
    font-family: "Inter Tight", sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tiw-ink-muted);
}

.tiw-loader__track {
    width: min(16rem, 70vw);
    height: 2px;
    background: rgba(232, 238, 244, 0.14);
    overflow: hidden;
}

.tiw-loader__fill {
    height: 100%;
    width: 0%;
    background: var(--tiw-ink);
    transform-origin: left center;
    transition: width 0.35s ease;
}

.tiw-loader__pct {
    margin: 0;
    font-family: "Inter Tight", sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--tiw-ink);
    font-variant-numeric: tabular-nums;
}

.tiw-hero.is-loading .tiw-hero__copy,
.tiw-hero.is-loading .tiw-dive {
    visibility: hidden;
}

.tiw-hero.is-ready .tiw-hero__brand,
.tiw-hero.is-ready .tiw-hero__headline,
.tiw-hero.is-ready .tiw-hero__lede {
    animation: tiw-rise 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.tiw-hero.is-ready .tiw-hero__brand { animation-delay: 0.1s; }
.tiw-hero.is-ready .tiw-hero__headline { animation-delay: 0.28s; }
.tiw-hero.is-ready .tiw-hero__lede { animation-delay: 0.42s; }

.tiw-hero__copy {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100svh;
    max-width: calc(40rem + var(--tiw-gutter) * 2);
    padding:
        calc(var(--tiw-space-lg) + var(--tiw-space-md))
        var(--tiw-gutter)
        var(--tiw-space-lg);
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.tiw-hero__brand,
.tiw-hero__headline,
.tiw-hero__lede {
    opacity: 0;
    transform: translateY(1rem);
}

.tiw-hero__brand {
    margin: 0 0 var(--tiw-space-sm);
    font-family: "EB Garamond", Georgia, serif;
    font-size: clamp(3.25rem, 9vw, 6.5rem);
    font-weight: 500;
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--tiw-ink);
}

.tiw-hero__headline {
    margin: 0 0 var(--tiw-space);
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--tiw-ink);
}

.tiw-hero__lede {
    margin: 0;
    max-width: 34rem;
    font-family: "EB Garamond", Georgia, serif;
    font-size: clamp(1.15rem, 2.4vw, 1.4rem);
    line-height: 1.5;
    color: var(--tiw-ink-muted);
}

.tiw-hero__veil.is-under {
    background:
        linear-gradient(180deg, rgba(4, 40, 48, 0.35) 0%, rgba(4, 40, 48, 0.12) 50%, rgba(4, 28, 34, 0.45) 100%);
}

.tiw-hero__copy.is-under {
    opacity: 0.35;
}

.tiw-dive {
    position: absolute;
    z-index: 4;
    right: var(--tiw-gutter);
    bottom: var(--tiw-space);
    margin: 0;
    padding: 0.65rem 1rem;
    border: 1px solid rgba(232, 238, 244, 0.4);
    background: rgba(6, 16, 24, 0.55);
    color: var(--tiw-ink);
    font-family: "Inter Tight", sans-serif;
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.tiw-dive:hover:not(:disabled),
.tiw-dive[aria-pressed="true"] {
    border-color: rgba(232, 238, 244, 0.85);
    background: rgba(6, 16, 24, 0.75);
}

.tiw-dive:disabled {
    opacity: 0.55;
    cursor: wait;
}

.tiw-hero__status {
    position: absolute;
    z-index: 3;
    left: var(--tiw-gutter);
    bottom: var(--tiw-space);
    margin: 0;
    max-width: 28rem;
    font-size: 0.8125rem;
    color: #f0c4a8;
    background: rgba(6, 16, 24, 0.7);
    padding: var(--tiw-space-xs) var(--tiw-space-sm);
    border: 1px solid rgba(240, 196, 168, 0.35);
}

@keyframes tiw-rise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .page-this-is-water {
        --tiw-gutter: 1.5rem;
    }

    .tiw-hero__brand {
        font-size: clamp(2.75rem, 14vw, 3.75rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tiw-loader__fill {
        transition: none;
    }

    .tiw-hero.is-ready .tiw-hero__brand,
    .tiw-hero.is-ready .tiw-hero__headline,
    .tiw-hero.is-ready .tiw-hero__lede {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
