/* styles.css */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

html {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0) 38%),
        radial-gradient(circle at bottom right, rgba(120, 90, 50, 0.05) 0%, rgba(120, 90, 50, 0) 42%),
        linear-gradient(180deg, #eee7dc 0%, #e9e1d5 100%);
}

body {
    min-height: 100svh;
    font-family: Georgia, "Times New Roman", serif;
    color: #1a1a1a;
    background:
        radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 26%),
        radial-gradient(circle at 82% 76%, rgba(120, 92, 56, 0.05) 0%, rgba(120, 92, 56, 0) 30%),
        linear-gradient(180deg, #efe7db 0%, #e9e1d5 100%);
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.16;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 220px 220px;
    mix-blend-mode: multiply;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.18;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.35) 0.6px, transparent 0.8px),
        radial-gradient(rgba(120, 92, 56, 0.08) 0.55px, transparent 0.75px);
    background-size: 16px 16px, 22px 22px;
    background-position: 0 0, 8px 10px;
    mix-blend-mode: soft-light;
    z-index: 0;
}

.page {
    width: 100%;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.carousel-shell {
    position: relative;
    width: 100%;
    overflow: visible;
    padding: 34px 0 46px;
}

.carousel-viewport {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    cursor: grab;
    user-select: none;
    touch-action: pan-x;
    padding: 52px 0 78px;
    z-index: 2;
}

.carousel-viewport::-webkit-scrollbar {
    display: none;
}

.carousel-viewport.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.carousel-track {
    display: flex;
    align-items: center;
    gap: 24px;
    width: max-content;
    padding: 0 calc(50vw - 150px);
    overflow: visible;
}

.tip-card {
    flex: 0 0 300px;
    width: 300px;
    height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    opacity: 0.7;
    transition: opacity 280ms ease;
    position: relative;
    z-index: 1;
}

.tip-card.is-active {
    opacity: 1;
    z-index: 3;
}

.tip-card:hover {
    opacity: 0.78;
}

.tip-card.is-active:hover {
    opacity: 1;
}

.tip-card-inner {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid rgba(110, 88, 60, 0.08);
    border-radius: 32px;
    box-shadow:
        0 32px 84px rgba(108, 89, 63, 0.09),
        0 14px 34px rgba(108, 89, 63, 0.05);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    transform: scale(0.9);
    transform-origin: center center;
    transition:
        transform 280ms ease,
        box-shadow 280ms ease,
        border-color 280ms ease,
        background 280ms ease;
}

.tip-card.is-active .tip-card-inner {
    transform: scale(1.18);
    box-shadow:
        0 48px 120px rgba(108, 89, 63, 0.12),
        0 18px 44px rgba(108, 89, 63, 0.07);
}

.tip-card:hover .tip-card-inner {
    box-shadow:
        0 36px 92px rgba(108, 89, 63, 0.10),
        0 15px 36px rgba(108, 89, 63, 0.055);
    border-color: rgba(110, 88, 60, 0.1);
}

.tip-card.is-active:hover .tip-card-inner {
    transform: scale(1.18);
    box-shadow:
        0 48px 120px rgba(108, 89, 63, 0.12),
        0 18px 44px rgba(108, 89, 63, 0.07);
}

.tip-meta {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(68, 58, 46, 0.42);
    margin-bottom: 18px;
}

.tip-body {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.tip-text {
    margin: 0;
    font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem);
    line-height: 1.55;
    font-style: italic;
    color: #2c2722;
}

.carousel-fade {
    position: absolute;
    left: auto;
    right: auto;
    top: 0;
    bottom: 0;
    width: min(14vw, 140px);
    pointer-events: none;
    z-index: 5;
}

.carousel-fade-left {
    left: 0;
    background: linear-gradient(
        to right,
        #eee7dc 0%,
        rgba(238, 231, 220, 0.95) 35%,
        rgba(238, 231, 220, 0) 100%
    );
}

.carousel-fade-right {
    right: 0;
    background: linear-gradient(
        to left,
        #e9e1d5 0%,
        rgba(233, 225, 213, 0.95) 35%,
        rgba(233, 225, 213, 0) 100%
    );
}

@media (max-width: 900px) {
    .carousel-shell {
        padding: 28px 0 38px;
    }

    .carousel-viewport {
        padding: 42px 0 66px;
    }

    .carousel-track {
        gap: 20px;
        padding: 0 calc(50vw - 130px);
    }

    .tip-card {
        flex: 0 0 260px;
        width: 260px;
        height: 320px;
    }

    .tip-card-inner {
        padding: 22px 20px 24px;
        border-radius: 28px;
        transform: scale(0.92);
    }

    .tip-card.is-active .tip-card-inner {
        transform: scale(1.16);
    }

    .tip-card.is-active:hover .tip-card-inner {
        transform: scale(1.16);
    }
}

@media (max-width: 640px) {
    .carousel-shell {
        padding: 22px 0 28px;
    }

    .carousel-viewport {
        padding: 32px 0 54px;
    }

    .carousel-track {
        gap: 16px;
        padding: 0 calc(50vw - 110px);
    }

    .tip-card {
        flex: 0 0 220px;
        width: 220px;
        height: 280px;
    }

    .tip-card-inner {
        padding: 20px 18px 22px;
        border-radius: 24px;
        transform: scale(0.94);
    }

    .tip-card.is-active .tip-card-inner {
        transform: scale(1.12);
    }

    .tip-card.is-active:hover .tip-card-inner {
        transform: scale(1.12);
    }

    .tip-text {
        line-height: 1.5;
    }

    .carousel-fade {
        width: 72px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .carousel-viewport {
        scroll-behavior: auto;
    }

    .tip-card,
    .tip-card-inner {
        transition: none;
    }
}