/* /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;
    /* Mesma caixa da nav do site (1200px + 2rem de calha): o texto do herói
       nasce na vertical do logo em vez de na borda da janela. O `%` resolve
       contra a largura de quem usa, que aqui é sempre o herói full-bleed. */
    --tiw-gutter: 2rem;
    --tiw-largura: 1200px;
    --tiw-inset: max(
        var(--tiw-gutter),
        calc((100% - var(--tiw-largura)) / 2 + var(--tiw-gutter))
    );
    --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-controls {
    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;
    width: 100%;
    max-width: var(--tiw-largura);
    margin: 0 auto;
    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;
}

/* A caixa agora tem a largura da nav; quem segura a medida da linha é o texto. */
.tiw-hero__brand,
.tiw-hero__headline,
.tiw-hero__lede {
    max-width: 40rem;
    opacity: 0;
    transform: translateY(1rem);
}

.tiw-hero__brand {
    margin: 0 0 var(--tiw-space-sm);
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6.5vw, 4.75rem);
    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(0.875rem, 1.7vw, 1rem);
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--tiw-ink);
}

.tiw-hero__lede {
    margin: 0;
    max-width: 34rem;
    font-family: var(--font-serif);
    font-size: clamp(1rem, 1.9vw, 1.15rem);
    line-height: 1.55;
    color: var(--tiw-ink-muted);
}

/* No tema claro a cena vira manhã de sol e o texto continua branco: o véu
   precisa segurar mais contraste do que segura sobre o mar noturno. */
[data-theme="light"] .tiw-hero__veil {
    background:
        linear-gradient(180deg, rgba(6, 16, 24, 0.58) 0%, rgba(6, 16, 24, 0.12) 42%, rgba(6, 16, 24, 0.62) 100%),
        radial-gradient(ellipse 75% 60% at 50% 40%, transparent 0%, rgba(6, 16, 24, 0.3) 100%);
}

.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-controls {
    position: absolute;
    z-index: 4;
    right: var(--tiw-inset);
    bottom: var(--tiw-space);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--tiw-space-sm);
}

.tiw-credit {
    margin: 0;
    font-family: "Inter Tight", sans-serif;
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-align: right;
    color: rgba(232, 238, 244, 0.55);
    text-shadow: 0 1px 6px rgba(6, 16, 24, 0.65);
}

.tiw-sound {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0.85rem 0.3rem 0.4rem;
    border: 1px solid rgba(232, 238, 244, 0.4);
    background: rgba(6, 16, 24, 0.55);
    color: var(--tiw-ink);
    backdrop-filter: blur(6px);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.tiw-sound:hover,
.tiw-sound:focus-within {
    border-color: rgba(232, 238, 244, 0.85);
    background: rgba(6, 16, 24, 0.75);
}

.tiw-sound__toggle {
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0.35rem;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}

.tiw-sound__toggle svg {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
}

.tiw-sound__toggle[aria-pressed="false"] .tiw-sound__wave,
.tiw-sound__toggle[aria-pressed="true"] .tiw-sound__mute {
    display: none;
}

.tiw-sound__toggle[aria-pressed="false"] {
    color: var(--tiw-ink-muted);
}

.tiw-sound__level {
    width: 5.5rem;
    height: 1rem;
    accent-color: var(--tiw-ink);
    cursor: pointer;
}

.tiw-hero__status {
    position: absolute;
    z-index: 3;
    left: var(--tiw-inset);
    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);
}

/* --- Easter egg (tartaruga) -------------------------------------- */

.tiw-egg {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: var(--tiw-gutter);
}

.tiw-egg[hidden] {
    display: none;
}

.tiw-egg__backdrop {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(6, 16, 24, 0.62);
    cursor: pointer;
}

.tiw-egg__card {
    position: relative;
    z-index: 1;
    width: min(28rem, 100%);
    padding: var(--tiw-space-md);
    border: 1px solid rgba(232, 238, 244, 0.35);
    background: rgba(6, 16, 24, 0.88);
    color: var(--tiw-ink);
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
    animation: tiw-egg-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tiw-egg__kicker {
    margin: 0 0 var(--tiw-space-xs);
    font-family: "Inter Tight", sans-serif;
    font-size: 0.6875rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(232, 238, 244, 0.55);
}

.tiw-egg__title {
    margin: 0 0 var(--tiw-space-sm);
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.tiw-egg__body {
    margin: 0 0 var(--tiw-space);
    font-family: var(--font-serif);
    font-size: 1.0625rem;
    line-height: 1.5;
    color: var(--tiw-ink-muted);
}

.tiw-egg__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.tiw-egg__whats,
.tiw-egg__close {
    margin: 0;
    padding: 0.55rem 1rem;
    border: 1px solid rgba(232, 238, 244, 0.45);
    background: transparent;
    color: var(--tiw-ink);
    font-family: "Inter Tight", sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
}

.tiw-egg__whats {
    border-color: rgba(37, 211, 102, 0.65);
    background: rgba(37, 211, 102, 0.14);
}

.tiw-egg__whats:hover,
.tiw-egg__whats:focus-visible,
.tiw-egg__close:hover,
.tiw-egg__close:focus-visible {
    border-color: var(--tiw-ink);
    background: rgba(232, 238, 244, 0.08);
}

.tiw-egg__whats:hover,
.tiw-egg__whats:focus-visible {
    border-color: rgb(37, 211, 102);
    background: rgba(37, 211, 102, 0.22);
}

@keyframes tiw-egg-in {
    from {
        opacity: 0;
        transform: translateY(0.75rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 768px) {
    .tiw-hero__brand {
        font-size: clamp(2.125rem, 10.5vw, 2.875rem);
    }

    /* No mobile o texto ocupa a largura toda e passaria por baixo do crédito
       e do controle de som (ambos absolutos no canto): abre o rodapé pra eles. */
    .tiw-hero__copy {
        padding-bottom: calc(var(--tiw-space-lg) * 2);
    }

    .tiw-credit {
        font-size: 0.625rem;
    }
}

@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;
    }

    .tiw-egg__card {
        animation: none;
    }
}
