/* =========================================================
   BUJI — GLOBAL STYLES
   ========================================================= */

* {
    box-sizing: border-box;
}

:root {
    --tan: #d2b48c;
    --sand: #f9f2ea;
    --ink: #333833;

    --body: "Montserrat", Arial, sans-serif;
    --serif: "Cormorant Garamond", Georgia, serif;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #fff;
    color: var(--ink);
    font-family: var(--body);
    font-weight: 300;
}

main {
    overflow: hidden;
}

h1,
h2,
h3,
p {
    margin: 0;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
    cursor: pointer;
}

button:focus-visible,
a:focus-visible,
.gallery:focus-visible {
    outline: 3px solid var(--tan);
    outline-offset: 5px;
}


/* =========================================================
   GALLERY / IMAGE CONTAINERS
   ========================================================= */

.gallery {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: #aeb4a6;
}

.slides,
.slide,
.hero-shade,
.bottom-shade,
.home-shade {
    position: absolute;
    inset: 0;
}

.slide {
    opacity: 0;
    overflow: hidden;
    transition: opacity 1.5s ease;
}

.slide.active {
    opacity: 1;
}

.slide > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crop-window {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.crop-window img {
    position: absolute;
    max-width: none;
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
    height: 61.5vw;
    max-height: 850px;
    min-height: 480px;
}

.hero .slide.active:not(.is-crop) > img {
    animation: kenburns 12s ease-out both;
}

.hero-shade {
    background: linear-gradient(
        180deg,
        #16232255,
        #14252460
    );
}


/* =========================================================
   HERO BRAND / LOGO
   ========================================================= */

.hero-brand {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    padding-bottom: 1%;

    color: #fff;
    pointer-events: none;
}

.buji {
    display: flex;
    align-items: center;
    gap: clamp(15px, 4vw, 55px);

    animation: none;
    transform: none;
}

.buji-symbol {
    width: clamp(125px, 22vw, 250px);
    height: auto;
    aspect-ratio: 246 / 268;
    object-fit: contain;
    flex: 0 0 auto;
    overflow: visible;

    animation: none;
    transform: none;
}

.buji-symbol * {
    animation: none;
    transform: none;
}

.buji-type {
    animation: none;
    transform: none;
}

.buji-type > span {
    font-size: clamp(42px, 8.2vw, 96px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.38em;
    margin-right: -0.38em;
    white-space: nowrap;
}

.buji-type small {
    display: block;

    font-size: clamp(12px, 2.2vw, 24px);
    font-weight: 500;
    letter-spacing: 0.43em;
    margin-right: -0.43em;
    white-space: nowrap;
}

.logo-letter {
    opacity: 1;
    animation: buji-letter-in 0.28s ease-out both;
    animation-delay: var(--letter-delay);
}


/* =========================================================
   KOZO
   ========================================================= */

.inspired,
#hero-kozo-credit {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 24px;
    z-index: 4;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;

    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 20px;

    color: #fff;
    text-align: center;
    transform: none;

    animation: brand-enter 2.6s ease both;
}

.inspired > span,
#hero-kozo-credit > span {
    display: block;
    width: auto;
    margin: 0;

    color: #fff;
    font: 400 12px / 1.2 var(--body);
    letter-spacing: 0.14em;
    text-align: center;
    white-space: nowrap;
}

.kozo,
.hero-kozo-logo {
    position: relative;
    isolation: isolate;

    width: clamp(112px, 12vw, 150px);
    margin: 0 auto;

    mix-blend-mode: normal;

    animation: float 8s ease-in-out -3s infinite;
}

#hero-kozo-credit .hero-kozo-logo {
    width: clamp(112px, 12vw, 150px) !important;
    max-width: 150px !important;
    flex: 0 0 auto !important;
}

.kozo::before,
.hero-kozo-logo::before {
    content: "";

    position: absolute;
    inset: -10% -14%;
    z-index: 0;

    pointer-events: none;

    background:
        radial-gradient(
            ellipse at center,
            rgba(255, 255, 255, 0.98) 25%,
            rgba(255, 255, 255, 0.9) 48%,
            rgba(255, 255, 255, 0.45) 64%,
            rgba(255, 255, 255, 0) 78%
        );

    filter: blur(7px);
}

.kozo img,
.hero-kozo-logo img {
    position: relative;
    z-index: 1;

    display: block;
    width: 100%;
    height: auto;

    filter: none;
    mix-blend-mode: normal;
}


/* =========================================================
   PAPER / TORN EDGES
   ========================================================= */

.torn::after,
.torn.both::before {
    content: "";

    position: absolute;
    left: -1px;
    right: -1px;

    height: 40px;

    background: url("paper-tear.svg")
        center / 100% 100%
        no-repeat;

    z-index: 5;
    pointer-events: none;
}

.torn::after {
    bottom: -1px;
}

.torn.both::before {
    top: -1px;
    bottom: auto;

    transform: rotate(180deg);
}


/* =========================================================
   WELCOME SECTION
   ========================================================= */

.welcome {
    padding: 75px 30px 82px;

    text-align: center;

    /*
       Soft natural sand background.
       This uses your existing --sand variable.
    */
    background: var(--sand);

    color: #fff;
}

.welcome .eyebrow {
    color: #000;
}

.welcome h1 {
    margin: 2px 0 38px;

    color: #000;
    font: 400 clamp(48px, 7.5vw, 84px) / 1.1 var(--serif);
}

.welcome-copy {
    max-width: 850px;
    margin: 0 auto;

    color: #000;

    font-size: clamp(16px, 1.8vw, 19px);
    line-height: 1.45;
}

.welcome-copy p + p {
    margin-top: 22px;
}

.eyebrow {
    text-transform: uppercase;

    font-size: clamp(19px, 3.4vw, 32px);
    font-weight: 600;
    letter-spacing: 0.25em;

    color: var(--sand);
}


/* =========================================================
   EXPERIENCE SECTION
   ========================================================= */

.experience {
    height: 65vw;
    max-height: 820px;
    min-height: 400px;
}

.bottom-shade {
    background: linear-gradient(
        transparent 55%,
        #0d333955
    );
}

.experience-caption {
    position: absolute;
    bottom: 9%;
    left: 20px;
    right: 20px;

    text-align: center;
    color: #e1d9af;
}

.experience h2 {
    margin-bottom: 15px;

    text-transform: uppercase;

    font-size: clamp(18px, 3vw, 34px);
    font-weight: 300;
    letter-spacing: 0.25em;
}


/* =========================================================
   GALLERY CONTROLS
   ========================================================= */

.gallery-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    color: #fff;
}

.gallery-controls button {
    display: grid;
    place-items: center;

    width: 36px;
    height: 36px;

    border: 1px solid #ffffffb5;

    color: inherit;
    background: #24392b24;

    font-size: 24px;
    line-height: 1;

    transition:
        background 0.3s,
        transform 0.3s;
}

.gallery-controls button:hover {
    background: #ffffffd9;
    color: #333;
    transform: translateY(-2px);
}

.hero-controls {
    display: none;
    position: absolute;
    bottom: 42px;
    left: 0;
    right: 0;

    opacity: 0.85;
}

.counter {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    font-variant-numeric: tabular-nums;
}

.pause {
    font-size: 15px !important;
}


/* =========================================================
   ESCAPES / HOME CARDS
   ========================================================= */

.escapes {
    max-width: 1500px;
    margin: auto;
    padding: 72px 4% 100px;
}

.escapes > h2 {
    margin-bottom: 52px;

    text-align: center;
    text-transform: uppercase;

    color: var(--tan);

    font-size: clamp(23px, 3.5vw, 36px);
    font-weight: 500;
    letter-spacing: 0.23em;
}

.homes {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );

    gap: 20px;
}

.home {
    position: relative;

    min-width: 0;
    aspect-ratio: 1.44;

    transition: transform 0.7s ease;
}

.home:hover {
    transform: translateY(-4px);
}

.home::after,
.home.both::before {
    height: 19px;
}

.home-shade {
    background: linear-gradient(
        transparent 56%,
        #fff6 72%,
        #fffffff2 94%
    );
}


/* =========================================================
   HOME CARD INFORMATION
   ========================================================= */

.home-info {
    position: absolute;
    bottom: 19px;
    left: 4%;
    right: 4%;
    z-index: 3;

    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.home h3 {
    font-size: clamp(16px, 1.8vw, 22px);
    font-weight: 400;
    white-space: nowrap;
}

.amenities {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-right: auto;

    font-size: 12px;
    font-weight: 400;
}

.amenities > span {
    display: flex;
    align-items: center;
    gap: 4px;

    white-space: nowrap;
}

.amenities > span + span {
    padding-left: 7px;

    border-left: 1px solid #b6aaa0;
}

.amenities svg {
    width: 14px;
    height: 14px;

    fill: none;
    stroke: var(--tan);
    stroke-width: 1.3;
}


/* =========================================================
   BOOKING BUTTON
   ========================================================= */

.book {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 36px;
    padding: 9px 12px;

    background: var(--tan);
    color: #fff;

    text-decoration: none;
    text-transform: uppercase;

    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.055em;

    transition:
        background 0.3s,
        transform 0.3s;
}

.book[href]:hover {
    background: #b86c30;
    transform: translateY(-2px);
}

.unavailable {
    background: #ad774d;
}


/* =========================================================
   HOME CARD ARROWS
   ========================================================= */

.home-arrows {
    position: absolute;
    top: 44%;
    left: 15px;
    right: 15px;

    justify-content: space-between;
}

.home-arrows button {
    width: 34px;
    height: 34px;

    background: #23332855;
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.sr-only {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    white-space: nowrap;
    border: 0;
}

.icon-library {
    position: absolute;
    width: 0;
    height: 0;
}


/* =========================================================
   SCROLL REVEAL
   ========================================================= */

.motion-ready .reveal {
    opacity: 0;
    transform: translateY(22px);

    transition:
        opacity 1.1s ease,
        transform 1.1s ease;
}

.motion-ready .reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.homes .home:nth-child(even) {
    transition-delay: 0.12s;
}


/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

@keyframes breathe {
    0%,
    100% {
        opacity: 0.65;
        transform: scale(0.98);
    }

    50% {
        opacity: 1;
        transform: scale(1.025);
    }
}

@keyframes sun-glow {
    50% {
        filter: drop-shadow(
            0 0 10px #e9905266
        );
    }
}

@keyframes brand-enter {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes kenburns {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.06);
    }
}

@keyframes buji-letter-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


/* =========================================================
   LARGE DESKTOP
   ========================================================= */

@media (min-width: 1200px) {

    .home-info {
        gap: 9px;
    }

    .book {
        font-size: 11px;
    }
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .home-info {
        gap: 7px;
    }

    .home h3 {
        flex: 1;
    }

    .amenities {
        order: 3;
        width: 100%;
    }

    .book {
        padding: 8px;
        font-size: 9px;
    }

    .hero {
        min-height: 430px;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    /* Hero */

    .hero {
        height: 78svh;
        min-height: 470px;
        max-height: 720px;
    }

    .hero-brand {
        padding: 0 22px 35px;
    }

    .buji {
        gap: 15px;
    }

    .buji-symbol {
        width: 125px;
    }

    .buji-type > span {
        font-size: 43px;
    }

    .buji-type small {
        font-size: 12px;
    }

    .inspired,
    #hero-kozo-credit {
        bottom: 18px;
        gap: 4px;
        width: 100%;
        margin: 0;
    }

    .inspired > span,
    #hero-kozo-credit > span {
        font-size: 10px;
        letter-spacing: 0.11em;
    }

    .kozo,
    .hero-kozo-logo {
        width: 130px;
    }

    #hero-kozo-credit .hero-kozo-logo {
        width: 130px !important;
        max-width: 130px !important;
    }


    /* Welcome */

    .welcome {
        padding: 58px 25px 65px;
    }

    .eyebrow {
        font-size: 18px;
        letter-spacing: 0.2em;
    }

    .welcome h1 {
        margin: 9px 0 28px;
        font-size: 51px;
    }

    .welcome-copy {
        font-size: 16px;
        line-height: 1.65;
    }


    /* Experience */

    .experience {
        height: 70svh;
        min-height: 430px;
        max-height: 620px;
    }

    .experience h2 {
        font-size: 18px;
        letter-spacing: 0.18em;
    }

    .experience-caption {
        bottom: 10%;
    }


    /* Escapes */

    .escapes {
        padding: 52px 18px 60px;
    }

    .escapes > h2 {
        margin-bottom: 32px;

        font-size: 21px;
        letter-spacing: 0.18em;
    }

    .homes {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .home {
        aspect-ratio: 1.25;
    }

    .home h3 {
        font-size: 19px;
    }

    .home-info {
        bottom: 22px;
    }

    .book {
        padding: 10px;
        font-size: 10px;
    }

    .amenities {
        font-size: 12px;
    }


    /* Torn edges */

    .torn::after,
    .torn.both::before {
        height: 30px;
    }

    .home::after,
    .home.both::before {
        height: 18px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .motion-ready .reveal {
        opacity: 1;
        transform: none;
    }

    .logo-letter {
        opacity: 1;
        animation: none;
    }
}
