
/* =========================================
   CAPIBARAS — JARDÍN ENCANTADO
   Cumpleaños de Vanesa
   ========================================= */

:root {
    --cream: #f7f0e3;
    --cream-light: #fffaf0;
    --sage: #7f9470;
    --sage-dark: #425b45;
    --green: #304b38;
    --brown: #76533d;
    --brown-light: #aa805e;
    --pink: #d98c9e;
    --pink-light: #f2c5ce;
    --gold: #c7a45c;
    --text: #4b4438;
    --muted: #817566;
}

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

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    font-family: "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--cream);
    overflow-x: hidden;
}

.capy-page {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    isolation: isolate;
    overflow: hidden;
}

.capy-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;

    background:
        radial-gradient(ellipse at 50% 32%, rgba(74, 91, 60, 0.19), transparent 56%),
        radial-gradient(circle at 5% 75%, rgba(190, 134, 109, 0.15), transparent 34%),
        linear-gradient(145deg, rgba(20, 30, 22, 0.50), rgba(37, 27, 24, 0.56));
}

.capy-page::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.20;

    background-image:
        radial-gradient(#9b8a6d 0.6px, transparent 0.6px);
    background-size: 22px 22px;
}

/* Navegación */

.garden-header {
    position: relative;
    z-index: 3;

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;

    width: min(100%, 1200px);
    margin: 0 auto;
    padding: 27px 32px;
}

.home-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-self: start;

    color: var(--green);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;

    transition: color 0.2s ease;
}

.home-link:hover {
    color: var(--pink);
}

.home-link span {
    font-size: 1.2rem;
}

.chapter-label {
    color: var(--sage-dark);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-align: center;
}

.chapter-number {
    justify-self: end;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

/* Contenido principal */

.garden-content {
    position: relative;
    z-index: 2;

    display: flex;
    flex-direction: column;
    align-items: center;

    width: min(100% - 32px, 760px);
    margin: 0 auto;
    padding: 32px 0 45px;

    text-align: center;

    animation: garden-enter 0.9s ease both;
}

.garden-eyebrow {
    margin-bottom: 17px;

    color: var(--sage-dark);
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.19em;
    line-height: 1.8;
}

.garden-content h1 {
    color: var(--green);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.7rem, 7vw, 4.8rem);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.045em;
    text-wrap: balance;
}

.garden-content h1 span {
    display: block;
    margin-top: 8px;

    color: var(--pink);
    font-style: italic;
}

.garden-intro {
    max-width: 510px;
    margin: 23px auto 0;

    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.9;
    text-wrap: balance;
}

/* Escena de capibaras */

.capy-scene {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: min(100%, 460px);
    height: 240px;
    margin: 20px auto 5px;
}

.capy-main {
    position: relative;
    z-index: 2;

    display: grid;
    place-items: center;

    width: 160px;
    height: 160px;

    font-size: 7.3rem;
    line-height: 1;

    filter: drop-shadow(0 12px 10px rgba(83, 64, 43, 0.12));

    animation: capy-float 4s ease-in-out infinite;
}

.capy-flower {
    position: absolute;
    z-index: 3;
    font-size: 2.7rem;

    filter: drop-shadow(0 4px 5px rgba(90, 70, 40, 0.10));

    animation: flower-sway 3.8s ease-in-out infinite;
}

.flower-left {
    left: 16%;
    top: 31%;
    transform: rotate(-14deg);
}

.flower-right {
    right: 15%;
    top: 36%;
    animation-delay: -1.8s;
}

.capy-small {
    position: absolute;
    z-index: 1;
    font-size: 2.5rem;
    opacity: 0.78;
    animation: capy-float 4.5s ease-in-out infinite;
}

.capy-small-left {
    bottom: 17%;
    left: 18%;
    transform: scale(0.7);
    animation-delay: -1.5s;
}

.capy-small-right {
    right: 18%;
    bottom: 19%;
    font-size: 2rem;
    animation-delay: -2.4s;
}

.scene-sparkle {
    position: absolute;
    color: var(--gold);
    animation: sparkle 3s ease-in-out infinite;
}

.sparkle-one {
    top: 15%;
    left: 28%;
    font-size: 1.3rem;
}

.sparkle-two {
    top: 22%;
    right: 28%;
    font-size: 1.8rem;
    animation-delay: -1s;
}

.sparkle-three {
    bottom: 25%;
    right: 28%;
    font-size: 1.1rem;
    animation-delay: -2s;
}

.grass-decoration {
    position: absolute;
    right: 0;
    bottom: 1%;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 80px;

    width: 100%;

    color: var(--sage);
    font-size: 1.8rem;
    opacity: 0.75;
}

.grass-decoration span:first-child {
    transform: rotate(-25deg);
}

.grass-decoration span:last-child {
    transform: rotate(25deg) scaleX(-1);
}

/* Mensaje */

.garden-message {
    position: relative;
    width: min(100%, 550px);

    margin: 8px auto 0;
    padding: 28px 30px 25px;

    background: rgba(255, 250, 240, 0.76);
    border: 1px solid rgba(127, 148, 112, 0.25);
    border-radius: 22px;

    box-shadow:
        0 12px 35px rgba(83, 94, 61, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.message-ornament {
    display: block;
    margin-bottom: 7px;

    color: var(--pink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.8rem;
    line-height: 1;
}

.garden-message > p {
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
    line-height: 1.95;
    text-wrap: pretty;
}

.message-signature {
    display: block;
    margin-top: 18px;

    color: var(--sage-dark);
    font-size: 0.84rem;
    font-style: italic;
}

/* Botón para continuar */

.garden-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 17px;

    margin-top: 30px;
}

.garden-footer > p {
    color: var(--sage-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
    font-style: italic;
}

.garden-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 13px;

    min-height: 53px;
    padding: 14px 25px;

    color: #fffdf6;
    background: var(--sage-dark);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;

    font-size: 0.91rem;
    font-weight: 600;
    text-decoration: none;

    box-shadow: 0 8px 23px rgba(48, 75, 56, 0.16);

    transition:
        transform 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.garden-button span {
    font-size: 1.2rem;
    transition: transform 0.25s ease;
}

.garden-button:hover {
    background: #527357;
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(48, 75, 56, 0.22);
}

.garden-button:hover span {
    transform: translateX(4px);
}

.garden-button:focus-visible,
.home-link:focus-visible {
    outline: 3px solid var(--pink);
    outline-offset: 5px;
}

.garden-bottom-note {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

/* Flores decorativas de fondo */

.garden-background {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.garden-flower {
    position: absolute;
    display: block;

    font-size: clamp(1.4rem, 3vw, 2.3rem);
    opacity: 0.58;

    animation: garden-drift 8s ease-in-out infinite;
}

.flower-a {
    top: 14%;
    left: 7%;
}

.flower-b {
    top: 28%;
    right: 8%;
    animation-delay: -2s;
}

.flower-c {
    top: 57%;
    left: 4%;
    animation-delay: -4s;
}

.flower-d {
    top: 70%;
    right: 6%;
    animation-delay: -1s;
}

.flower-e {
    top: 45%;
    left: 10%;
    animation-delay: -3s;
}

.flower-f {
    top: 17%;
    right: 22%;
    animation-delay: -5s;
}

.flower-g {
    bottom: 9%;
    left: 23%;
    animation-delay: -6s;
}

.flower-h {
    bottom: 12%;
    right: 24%;
    animation-delay: -2.5s;
}

/* Pie de página */

.garden-page-footer {
    position: relative;
    z-index: 2;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;

    margin-top: auto;
    padding: 22px 15px;

    color: #918673;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-align: center;
}

.garden-page-footer span {
    color: var(--pink);
    font-size: 0.9rem;
}

/* Animaciones */

@keyframes garden-enter {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes capy-float {
    0%, 100% {
        translate: 0 0;
    }

    50% {
        translate: 0 -10px;
    }
}

@keyframes flower-sway {
    0%, 100% {
        rotate: -5deg;
    }

    50% {
        rotate: 7deg;
    }
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0.35;
        scale: 0.85;
    }

    50% {
        opacity: 1;
        scale: 1.15;
    }
}

@keyframes garden-drift {
    0%, 100% {
        translate: 0 0;
        rotate: -7deg;
    }

    50% {
        translate: 0 -17px;
        rotate: 8deg;
    }
}

/* Pantallas pequeñas */

@media (max-width: 600px) {
    .garden-header {
        grid-template-columns: 1fr auto;
        padding: 20px 18px;
        gap: 12px;
    }

    .chapter-label {
        display: none;
    }

    .garden-content {
        width: min(100% - 28px, 500px);
        padding-top: 30px;
        padding-bottom: 35px;
    }

    .garden-eyebrow {
        font-size: 0.59rem;
        letter-spacing: 0.12em;
    }

    .garden-intro {
        font-size: 0.9rem;
        line-height: 1.8;
    }

    .capy-scene {
        height: 205px;
        margin-top: 18px;
    }

    .capy-main {
        width: 130px;
        height: 140px;
        font-size: 6rem;
    }

    .capy-flower {
        font-size: 2.1rem;
    }

    .flower-left {
        left: 11%;
    }

    .flower-right {
        right: 10%;
    }

    .capy-small-left {
        left: 12%;
    }

    .capy-small-right {
        right: 12%;
    }

    .grass-decoration {
        gap: 50px;
        font-size: 1.5rem;
    }

    .garden-message {
        padding: 23px 19px;
        border-radius: 19px;
    }

    .garden-message > p {
        font-size: 0.97rem;
        line-height: 1.85;
    }

    .garden-footer {
        margin-top: 25px;
    }

    .garden-button {
        width: min(100%, 300px);
    }

    .garden-bottom-note {
        font-size: 0.55rem;
        letter-spacing: 0.11em;
    }

    .garden-flower {
        opacity: 0.38;
    }

    .flower-e,
    .flower-f {
        display: none;
    }

    .garden-page-footer {
        flex-wrap: wrap;
        gap: 8px;
        padding-top: 16px;
        font-size: 0.51rem;
    }
}

/* Accesibilidad */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Transición de salida */

.garden-content {
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.garden-content.is-leaving {
    opacity: 0;
    transform: translateY(-10px);
}

body.page-leaving {
    pointer-events: none;
}
