*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-primary);
    color: var(--color-ink);
    background-color: var(--color-cream);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

/* header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-cream);
    padding: 1.25rem var(--container-padding-x);
    border-bottom: 0.0625rem solid var(--color-header-border);
}

.site-header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    gap: var(--space-l);
}

.site-header__menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    padding: 0 0.75rem;
    background-color: var(--color-burger-bg);
    border: none;
    border-radius: var(--radius-s);
    cursor: pointer;
    align-self: stretch;
    transition: background-color 0.2s ease;
}

.site-header__menu-toggle:hover {
    background-color: var(--color-burger-bg-hover);
}

.site-header__menu-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: clamp(1.5rem, 1.35rem + 0.75vw, 2.25rem);
    height: 1rem;
}

.site-header__menu-icon::before,
.site-header__menu-icon::after,
.site-header__menu-icon span {
    content: "";
    display: block;
    width: 100%;
    height: 0.125rem;
    background-color: var(--color-cream);
}

.site-header__nav {
    grid-column: 2;
    justify-self: center;
}

.site-header__nav-list {
    display: flex;
    gap: 1.875rem; /* 30px, Figma */
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-header__nav-list a {
    text-decoration: none;
    color: var(--color-ink);
    font-family: var(--font-primary);
    font-size: var(--text-s);
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.site-header__nav-list a:hover {
    color: var(--color-teal);
}

.site-header__logo {
    grid-column: 1;
    justify-self: start;
    display: flex;
    align-items: center;
    transition: opacity 0.35s ease, translate 0.35s ease;
}

.site-header__logo img {
    display: block;
    width: auto;
    height: clamp(2rem, 1.78rem + 0.939vw, 2.625rem); /* 32 -> 42px */
}

/* front page */
.site-header--logo-on-scroll .site-header__logo {
    opacity: 0;
    translate: 0 -0.5rem;
    pointer-events: none;
}

.site-header--logo-on-scroll.is-scrolled .site-header__logo {
    opacity: 1;
    translate: 0 0;
    pointer-events: auto;
}

.site-header__actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.625rem; /* 10px, Figma */
}

/* buttons */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.875rem;
    border-radius: var(--radius-m);
    border: 0.125rem solid var(--color-teal);
    font-family: var(--font-primary);
    font-size: var(--text-s);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: 0;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.button--outline {
    color: var(--color-teal);
    background-color: transparent;
}

.button--outline:hover {
    background-color: var(--color-teal);
    color: var(--color-cream);
    border-color: var(--color-teal);
}

.button--filled {
    background-color: var(--color-teal);
    color: var(--color-cream);
}

.button--filled:hover {
    background-color: var(--color-teal-hover);
    border-color: var(--color-teal-hover);
}

@media (max-width: 62rem) {
    .site-header__nav {
        display: none;
    }

    /* narrow screens */
    .site-header__actions .button--filled {
        display: none;
    }

    .site-header__actions .button--outline {
        background-color: var(--color-teal);
        color: var(--color-cream);
    }

    .site-header__actions .button--outline:hover {
        background-color: var(--color-teal-hover);
        border-color: var(--color-teal-hover);
    }
}

@media (max-width: 48rem) {
    .button {
        padding: 0.75rem 1.25rem;
    }
}

@media (max-width: 20rem) {
    .site-header__inner:not(.site-header__inner--no-menu) .site-header__actions {
        display: none;
    }

    .site-header__inner--no-menu .button {
        padding: 0.625rem 0.875rem;
    }

    .site-header__menu-toggle {
        padding: 0.75rem;
        align-self: center;
    }
}

/* hero */

.hero {
    position: relative;
    background-color: var(--color-cream);
    padding-top: var(--space-3xl);
    overflow: hidden;
}

.hero__inner {
    position: relative;
    z-index: 2;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding-x);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero__logo-wrap {
    position: relative;
    display: inline-block;
}

.hero__title {
    margin: 0;
    line-height: 0;
}

.hero__logo {
    width: clamp(16rem, 1.83rem + 60.47vw, 56.25rem);
    height: auto;
}

.hero__badge {
    position: absolute;
    z-index: 1;
    top: 13%;   /* position relative to the logo */
    left: 16.5%;
    transform: rotate(-5deg);
    background-color: var(--color-orange);
    color: var(--color-cream);
    padding: 0.6em 1em;
    border-radius: 0.5em;
    border: 0.15em solid var(--color-cream);
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: clamp(0.625rem, 0.405rem + 0.939vw, 1.25rem); /* 10 -> 20px */
    line-height: 1.2;
    letter-spacing: 0;
    white-space: nowrap;
}

.hero__subtitle {
    margin: 1.25rem 0 0;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: clamp(1.125rem, 0.993rem + 0.563vw, 1.5rem);
    line-height: 1.2;
    letter-spacing: 0;
    color: var(--color-ink);
}

.hero__since {
    margin: 0.875rem 0 0;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: clamp(0.8125rem, 0.746rem + 0.282vw, 1rem);
    line-height: 1.2;
    letter-spacing: 0;
    color: var(--color-orange);
}

.hero__palm {
    position: absolute;
    top: 0;
    width: 36.25rem;
    height: auto;
    z-index: 0;
    pointer-events: none;
}

.hero__palm--left {
    left: -14.125rem;
    transform: translateY(2rem);
}

.hero__palm--right {
    right: -14.125rem;
    transform: translateY(-2rem);
}

.hero__palm-img {
    display: block;
    width: 100%;
    height: auto;
    transform-origin: 50% 100%;
    animation: palm-sway 5s ease-in-out infinite;
}

.hero__palm--right .hero__palm-img {
    transform: scaleX(-1);
    animation-name: palm-sway-mirrored;
}

@keyframes palm-sway {

    0%,
    100% {
        rotate: -2deg;
    }

    50% {
        rotate: 2deg;
    }
}

@keyframes palm-sway-mirrored {

    0%,
    100% {
        rotate: 2deg;
    }

    50% {
        rotate: -2deg;
    }
}

.hero__palm-coconut {
    position: absolute;
    top: 35.6%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    margin-left: -1rem;
    margin-top: -1rem;
    border-radius: 50%;
    background-color: #D97E1E;
    box-shadow: inset -0.25rem -0.25rem 0 rgba(0, 0, 0, 0.15);
    opacity: 0;
    z-index: 1;
    animation: coconut-drop 8s linear infinite;
}

@keyframes coconut-drop {

    0%,
    70% {
        opacity: 0;
        transform: translate(0, 0) scale(0.6) rotate(0deg);
    }

    74% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    90% {
        opacity: 1;
        transform: translate(1.5rem, 24rem) scale(0.8) rotate(150deg);
    }

    100% {
        opacity: 0;
        transform: translate(1.5rem, 26rem) scale(0.6) rotate(170deg);
    }
}

@keyframes coconut-hide {

    0%,
    71% {
        opacity: 0;
    }

    74%,
    96% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.hero__wave {
    position: relative;
    width: 100%;
    height: clamp(9rem, 6rem + 12vw, 18rem);
    margin-top: var(--space-3xl);
    z-index: 1;
}

.hero__wave-inner {
    position: absolute;
    top: 0;
    left: 50%;
    width: max(100%, 44rem); /* 704px */
    height: 100%;
    translate: -50% 0;
}

.hero__wave-layer {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
}

.hero__wave-layer--back {
    z-index: 1;
    width: 167%;
    left: -55%;
    transform: translate(22.87%, -8.83%);
}

.hero__wave-layer--middle {
    z-index: 2;
    transform: translateX(-13.33%);
}

.hero__wave-layer--front {
    z-index: 3;
    width: 112%;
    left: -6%;
}

@media (max-width: 48rem) {
    .hero__palm {
        display: none;
    }

    .hero__logo-wrap {
        display: block;
        width: 100%;
    }

    .hero__logo {
        width: 100%;
    }

    .hero__badge {
        top: 10%;
        left: 36%;          /* center of the letters "am" */
        translate: -50% 0;
    }
}

@keyframes wave-drift {

    0%,
    100% {
        translate: 0 0;
    }

    50% {
        translate: -2.5% 1rem; /* % of the layer width */
    }
}

.hero__wave-layer--back {
    animation: wave-drift 9s ease-in-out infinite;
}

.hero__wave-layer--middle {
    animation: wave-drift 7s ease-in-out infinite reverse;
}

.hero__wave-layer--front {
    animation: wave-drift 6s ease-in-out infinite;
}

/* section head */

.section-head {
    max-width: 52.5rem; /* 840px */
    margin-inline: auto;
    text-align: center;
}

.section-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--text-display-l);
    line-height: var(--leading-tight);
    text-transform: uppercase;
    text-wrap: balance;
}

.section-subtitle {
    max-width: 41.625rem; /* 666px */
    margin: 0.9375rem auto 0; /* 15px */
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: var(--text-m);
    line-height: var(--leading-tight);
}

.section-actions {
    margin-top: var(--space-2xl);
    text-align: center;
}

.container {
    max-width: var(--container-max-width);
    margin-inline: auto;
    padding-inline: var(--container-padding-x);
}

/* photo grid */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--grid-gap);
    margin-top: var(--space-2xl);
}

.photo-grid__item {
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-l);
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.15);
}

.photo-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.photo-grid__item:hover img {
    transform: scale(1.04);
}

@media (max-width: 64rem) {
    .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .photo-grid__item img {
        transition: none;
    }
}

/* season */

.season {
    /* no z-index here on purpose */
    position: relative;
    overflow-x: clip;
    background-color: var(--color-wave-front); /* #0E719F */
    padding-top: calc(var(--space-3xl) + var(--space-l)); /* a bit more than other blocks */
    padding-bottom: calc(var(--space-4xl) + var(--radius-section));
    color: var(--color-cream);
}

/* photo fan */

.photo-fan {
    --fan-card: clamp(8rem, 4.656rem + 14.27vw, 17.5rem);  /* card width */
    --fan-spread: 0.97;                                       /* step between cards, × card width */
    --fan-step: calc(var(--fan-card) * var(--fan-spread));
    position: relative;
    height: calc(var(--fan-card) * 1.25 + var(--fan-card) * 0.25); /* card height + room for tilt/offset */
    margin-top: var(--space-2xl);
}

.photo-fan__item {
    --x: 0;      /* position in steps from the center */
    --y: 0px;    /* vertical offset */
    --r: 0deg;   /* tilt */
    position: absolute;
    top: 0;
    left: 50%;
    width: var(--fan-card);
    aspect-ratio: 4 / 5;
    margin-left: calc(var(--fan-card) / -2);
    border-radius: var(--radius-l);
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 1.25rem 2.5rem rgba(0, 0, 0, 0.25);
    transform: translate(calc(var(--fan-step) * var(--x)), var(--y)) rotate(var(--r));
    transition: transform 2.2s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.photo-fan__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* final positions */
.photo-fan__item--far-left  { --x: -1.5; --y: calc(var(--fan-card) * 0.1); --r: 6deg;  z-index: 1; }
.photo-fan__item--left      { --x: -0.5; --y: 0px;                          --r: -6deg; z-index: 3; }
.photo-fan__item--right     { --x: 0.5;  --y: calc(var(--fan-card) * 0.1);  --r: 6deg;  z-index: 2; }
.photo-fan__item--far-right { --x: 1.5;  --y: 0px;                          --r: -6deg; z-index: 1; }

.photo-fan__item--far-left,
.photo-fan__item--far-right {
    transition-delay: 0.25s;
}

/* start state */
.photo-fan.is-collapsed .photo-fan__item {
    transform: translate(0, 0) rotate(0deg) scale(0.94);
    transition-delay: 0s;
}

.photo-fan.is-collapsed .photo-fan__item--left {
    transform: none;
}

.photo-fan.is-instant .photo-fan__item {
    transition: none;
}

@media (max-width: 64rem) {
    .photo-fan {
        --fan-spread: 0.85;
    }
}

@media (max-width: 40rem) {
    .photo-fan {
        --fan-spread: 0.55;
    }

    .photo-fan__item {
        box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.25);
    }
}

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

.season > .container {
    position: relative;
    z-index: 2;
    margin-top: calc(-1 * clamp(4.3rem, 4.3rem + (100vw - 23.4375rem) * 0.097, 6.875rem));
}

.season__surfer {
    --surfer-width: clamp(7.5rem, 4.4rem + 13.2vw, 16.125rem);
    position: absolute;
    z-index: 3;
    width: var(--surfer-width);
    height: auto;
    left: calc(var(--surfer-width) * -0.128);
    bottom: calc(var(--radius-section) - var(--surfer-width) * 0.322);
    pointer-events: none;
}

/* accent button */

.button--accent {
    background-color: var(--color-orange);
    border-color: var(--color-orange);
    color: var(--color-cream);
}

.button--accent:hover {
    background-color: var(--color-orange-hover);
    border-color: var(--color-orange-hover);
}

.section {
    position: relative;
}

.section--rounded {
    margin-top: calc(var(--radius-section) * -1);
    border-radius: var(--radius-section) var(--radius-section) 0 0;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.25rem;               /* 12px 20px */
    border-radius: var(--radius-s);
    background-color: var(--color-teal);
    color: var(--color-cream);
    font-weight: 500;
    font-size: var(--text-s);
    line-height: var(--leading-tight);
    white-space: nowrap;
}

.chip--s {
    padding: 0.625rem 1rem;                 /* 10px 16px */
    font-size: var(--text-xs);
}

/* Tag list "A / B / C" */
.tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-weight: 500;
    font-size: var(--text-xs);
    line-height: var(--leading-tight);
}

.tags li:not(:last-child)::after {
    content: "/";
    margin-left: 0.25rem;
    color: var(--color-teal);
    font-weight: 400;
}

.tags--light {
    color: var(--color-cream);
}

.tags--pill {
    gap: 0.25rem 0.625rem;                  /* 10px, Figma */
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-s);
    background-color: var(--color-cream);
    color: var(--color-ink);
    font-size: var(--text-2xs);
}

.tags--pill li:not(:last-child)::after {
    margin-left: 0.625rem;
    font-size: 1rem;
    line-height: 1;
}

.card-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--text-display-s);
    line-height: var(--leading-tight);
    text-transform: uppercase;
}

.card-title--l {
    font-size: var(--text-display-m);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--grid-gap);
    margin-top: var(--space-2xl);
}

@media (max-width: 48rem) {
    .card-grid {
        grid-template-columns: minmax(0, 1fr);
        row-gap: var(--space-xl);
    }
}

/* choose your season */

.choose {
    background-color: var(--color-cream);
    padding-top: var(--space-3xl);
    padding-bottom: calc(var(--space-3xl) + var(--space-l) + var(--radius-section));
}

.location-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.location-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 670 / 350;
    border-radius: var(--radius-l);
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.08);
}

.location-card__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.location-card__dates {
    position: absolute;
    top: var(--card-inset);
    left: var(--card-inset);
}

.location-card__tags {
    position: absolute;
    left: var(--card-inset);
    right: var(--card-inset);
    bottom: var(--card-inset);
    width: fit-content;
    max-width: calc(100% - 2 * var(--card-inset));
}

.location-card__title {
    margin-top: var(--space-s);
}

.location-card__text {
    margin: 0.625rem 0 0;
    font-weight: 500;
    font-size: var(--text-s);
    line-height: var(--leading-tight);
}

.location-card__button {
    margin-top: var(--space-s);
}

@media (max-width: 48rem) {
    .location-card__media {
        aspect-ratio: 4 / 3;
    }
}

/* Life at Mambos */

.life {
    background-color: var(--color-teal);
    color: var(--color-cream);
    padding-top: var(--space-3xl);
    padding-bottom: calc(var(--space-4xl) + var(--radius-section));
}

/* Live Instagram feed */

.instagram-feed {
    margin-top: var(--space-2xl);
}

.instagram-feed #sb_instagram {
    padding: 0 !important;
    width: 100% !important;
}

.instagram-feed #sb_instagram #sbi_images {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--grid-gap) !important;
    padding: 0 !important;
}

.instagram-feed #sb_instagram .sbi_item {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-l);
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.15);
}

.instagram-feed #sb_instagram .sbi_photo_wrap,
.instagram-feed #sb_instagram .sbi_photo {
    display: block;
    width: 100%;
    height: 100% !important;
}

.instagram-feed #sb_instagram .sbi_photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1 !important;
    transition: transform 0.4s ease;
}

.instagram-feed #sb_instagram .sbi_item:hover .sbi_photo img {
    transform: scale(1.04);
}

.instagram-feed #sb_instagram .sb_instagram_header,
.instagram-feed #sb_instagram #sbi_load {
    display: none !important;
}

@media (max-width: 64rem) {
    .instagram-feed #sb_instagram #sbi_images {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* CTA banner */

.cta {
    position: relative;
    display: grid;
    place-items: center;
    min-height: clamp(25rem, 17.5rem + 32.02vw, 46.3125rem); /* 400 -> 741px */
    margin-top: calc(var(--radius-section) * -1);
    padding: var(--space-3xl) var(--container-padding-x);
    color: var(--color-cream);
    text-align: center;
}

.cta__media {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-section);
    overflow: hidden;
    background-color: var(--color-ink);
}

.cta__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cta__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(21, 13, 10, 0.5);
}

.cta__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
}

.cta__title {
    max-width: 32rem; /* 510px -> two lines as in Figma */
}

.cta__coconuts {
    --coconuts-width: clamp(7rem, 4.25rem + 11.74vw, 14.1875rem); /* 112 -> 227px */
    position: absolute;
    z-index: 2;
    left: calc(var(--coconuts-width) * -0.346);
    bottom: calc(var(--coconuts-width) * -0.341);
    width: var(--coconuts-width);
    height: auto;
    pointer-events: none;
}

/* more destinations */

.dest {
    padding-top: var(--space-4xl);
    padding-bottom: var(--space-3xl);
}

.dest__subtitle {
    max-width: 28.375rem; /* 454px */
    margin-top: var(--space-s);
}

.dest-card {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-xl);
    aspect-ratio: 4 / 3; /* was 670 / 720 in Figma */
    padding: var(--card-inset);
    border-radius: var(--radius-l);
    overflow: hidden;
    background-color: var(--color-ink);
    color: var(--color-cream);
}

.dest-card__bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.dest-card:hover .dest-card__bg {
    transform: scale(1.03);
}

.dest-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(220.69deg, rgba(0, 0, 0, 0) 44.444%, rgba(0, 0, 0, 0.8) 77.778%);
}

.dest-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.dest-card__text {
    margin: 0.5rem 0 0;
    font-weight: 500;
    font-size: var(--text-s);
    line-height: var(--leading-tight);
    opacity: 0.9;
}

.dest-card .tags {
    margin-top: var(--space-xs);
}

.dest-card__button {
    margin-top: calc(var(--space-xs) + 0.75rem); /* 16 + 12px */
    white-space: normal;
}

@media (max-width: 48rem) {
    .dest-card {
        aspect-ratio: auto;
        min-height: 24rem;
    }
}

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

/* footer */

.site-footer {
    position: relative;
    color: var(--color-cream);
}

.site-footer a {
    text-decoration: none;
}

.site-footer__waves {
    position: relative;
}

.site-footer__waves svg {
    display: block;
    width: 100%;
    height: clamp(4rem, 1.844rem + 9.202vw, 10.125rem); /* 64 -> 162px */
}

/* footer waves drift like the hero ones */
.site-footer__wave--back {
    animation: wave-drift 9s ease-in-out infinite;
}

.site-footer__wave--front {
    animation: wave-drift 7s ease-in-out infinite reverse;
}

@media (prefers-reduced-motion: reduce) {
    .site-header__logo,
    .site-footer__wave,
    .hero__wave-layer {
        animation: none;
    }
}

.site-footer__surfer {
    --surfer-width: clamp(7.5rem, 4.4rem + 13.2vw, 16.125rem);
    position: absolute;
    top: calc(var(--surfer-width) * -0.12);
    right: 5.4%;
    width: var(--surfer-width);
    height: auto;
    pointer-events: none;
}

.site-footer__main {
    margin-top: -1px; /* no hairline between wave and fill */
    padding-top: var(--space-3xl);
    padding-bottom: calc(var(--space-3xl) * 0.6);
    background-color: var(--color-wave-front);
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 50% minmax(0, 1fr) minmax(0, 1fr) auto;
    row-gap: var(--space-2xl);
}

.site-footer__brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.site-footer__logo img {
    width: clamp(10rem, 9.12rem + 3.756vw, 12.5rem); /* 160 -> 200px */
    height: auto;
}

.site-footer__tagline {
    margin: 0.625rem 0 0;
    font-weight: 500;
    font-size: var(--text-s);
    line-height: var(--leading-tight);
}

.site-footer__button {
    margin-top: var(--space-xl);
}

.site-footer__heading {
    margin: 0 0 var(--space-m);
    font-weight: 500;
    font-size: var(--text-s);
    line-height: var(--leading-tight);
}

.site-footer__links,
.site-footer__contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-weight: 500;
    line-height: var(--leading-tight);
}

.site-footer__links {
    font-size: var(--text-xs);
}

.site-footer__links a {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.site-footer__links a:hover {
    opacity: 1;
}

.site-footer__contact-list {
    font-size: var(--text-s);
    white-space: nowrap;
}

.site-footer__contact-list a:hover {
    color: var(--color-orange);
}

.site-footer__socials {
    display: flex;
    gap: 0.625rem;
    margin-top: var(--space-xl);
}

.social-icon {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: var(--color-orange);
    color: var(--color-white);
    transition: background-color 0.2s ease;
}

.social-icon:hover {
    background-color: var(--color-orange-hover);
}

.site-footer__bar {
    padding-block: 1.25rem;
    background-color: var(--color-wave-back);
    color: var(--color-ink);
    font-weight: 500;
    font-size: var(--text-s);
    line-height: var(--leading-tight);
}

.site-footer__bar-inner {
    display: grid;
    grid-template-columns: 50% minmax(0, 1fr);
    gap: 0.75rem var(--space-m);
    align-items: center;
}

.site-footer__copy {
    margin: 0;
}

.site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem var(--space-m);
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer__legal a:hover {
    color: var(--color-blue);
}

@media (max-width: 64rem) {
    .site-footer__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .site-footer__brand {
        grid-column: 1 / -1;
    }

    .site-footer__bar-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .site-footer__legal {
        justify-content: flex-start;
    }
}

@media (max-width: 48rem) {
    .site-footer__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--space-m);
    }

    .site-footer__contacts {
        grid-column: 1 / -1;
    }

    .site-footer__legal {
        flex-direction: column;
    }
}

/* surfer animation 1) rides the wave */

.surfer {
    transform-origin: 35% 85%; /* pivot around the feet on the board */
    animation: surfer-ride 5s ease-in-out infinite;
    transition: translate 1.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 1s ease;
}

.surfer--late {
    animation-delay: -2.5s;
}

@keyframes surfer-ride {
    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(0.25rem, -0.5rem) rotate(-3deg);
    }

    50% {
        transform: translate(0.5rem, 0.125rem) rotate(1.5deg);
    }

    75% {
        transform: translate(0.25rem, -0.375rem) rotate(-2deg);
    }
}

.surfer.is-hidden {
    translate: -120% 15%;
    opacity: 0;
}

.surfer.is-instant {
    transition: none;
}

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

/* micro animations */

/* fade-up on scroll */
.reveal-up {
    transition:
        opacity 0.8s ease var(--reveal-delay, 0s),
        translate 0.9s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0s);
}

.reveal-up.is-hidden {
    opacity: 0;
    translate: 0 1.5rem;
}

.reveal-up.is-instant {
    transition: none;
}

/* coconuts */
.cta__coconuts {
    transform-origin: 50% 90%;
    animation: coconuts-sway 4.5s ease-in-out 1.6s infinite;
    transition:
        translate 1.1s cubic-bezier(0.34, 1.56, 0.64, 1),   /* overshoot = bounce on landing */
        rotate 1.1s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.4s ease;
}

.cta__coconuts.is-hidden {
    translate: 0 -140%;
    rotate: -25deg;
    opacity: 0;
}

.cta__coconuts.is-instant {
    transition: none;
}

@keyframes coconuts-sway {
    0%,
    100% {
        transform: rotate(0deg);
    }

    30% {
        transform: rotate(-3deg);
    }

    65% {
        transform: rotate(2deg);
    }
}

/* hero */
.hero__logo {
    animation: hero-logo-in 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__badge {
    animation: hero-pop-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both;
}

.hero__subtitle {
    animation: hero-fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

.hero__since {
    animation: hero-fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

@keyframes hero-logo-in {
    from {
        opacity: 0;
        scale: 0.92;
    }
}

@keyframes hero-pop-in {
    from {
        opacity: 0;
        scale: 0.6;
    }
}

@keyframes hero-fade-up {
    from {
        opacity: 0;
        translate: 0 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal-up,
    .cta__coconuts,
    .hero__logo,
    .hero__badge,
    .hero__subtitle,
    .hero__since {
        animation: none;
        transition: none;
    }
}

/* "Book your stay" popup */

html.has-booking-open {
    overflow: hidden; /* no page scroll behind the popup */
}

.booking {
    width: min(40rem, calc(100% - 2 * var(--container-padding-x)));
    max-height: calc(100dvh - 2rem);
    padding: 0;
    border: none;
    border-radius: var(--radius-l);
    background-color: var(--color-cream);
    color: var(--color-ink);
    box-shadow: 0 1.5rem 4rem rgba(21, 13, 10, 0.35);
    overflow: hidden;
}

.booking::backdrop {
    background-color: rgba(21, 13, 10, 0.55);
    backdrop-filter: blur(4px);
}

.booking[open] {
    animation: booking-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.booking[open]::backdrop {
    animation: booking-fade 0.35s ease;
}

@keyframes booking-in {
    from {
        opacity: 0;
        translate: 0 1.5rem;
        scale: 0.98;
    }
}

@keyframes booking-fade {
    from {
        opacity: 0;
    }
}

.booking__panel {
    position: relative;
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-xl);
}

.booking__step[hidden] {
    display: none;
}

.booking__close {
    position: absolute;
    top: var(--space-xs);
    right: var(--space-xs);
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: transparent;
    color: var(--color-ink);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.booking__close:hover {
    background-color: rgba(21, 13, 10, 0.08);
}

.booking__title {
    margin: 0;
    padding-right: 2.5rem; /* room for the close button */
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--text-display-m);
    line-height: var(--leading-tight);
    text-transform: uppercase;
}

.booking__title:focus {
    outline: none;
}

.booking__intro {
    margin: 0.75rem 0 0;
    font-weight: 500;
    font-size: var(--text-s);
    line-height: var(--leading-text);
    opacity: 0.8;
}

.booking__form {
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
    margin-top: var(--space-m);
}

.booking__field {
    margin: 0;
    padding: 0;
    border: none;
    min-width: 0;
}

.booking__label {
    display: block;
    margin: 0 0 0.5rem;
    padding: 0;
    font-weight: 600;
    font-size: var(--text-s);
    line-height: var(--leading-tight);
}

.booking__sublabel {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: var(--text-xs);
    opacity: 0.7;
}

.booking__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.booking__input {
    display: block;
    width: 100%;
    min-height: 3rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(21, 13, 10, 0.18);
    border-radius: var(--radius-s);
    background-color: var(--color-white);
    color: var(--color-ink);
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: var(--leading-tight);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.booking__input::placeholder {
    color: rgba(21, 13, 10, 0.4);
}

.booking__input:focus {
    outline: none;
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px rgba(23, 153, 140, 0.2);
}

.booking__input[aria-invalid] {
    border-color: var(--color-red);
}

.booking__textarea {
    min-height: 6.5rem;
    resize: vertical;
}

.booking__error,
.booking__form-error {
    margin: 0.375rem 0 0;
    color: var(--color-red);
    font-weight: 500;
    font-size: var(--text-xs);
    line-height: var(--leading-tight);
}

.booking__error:empty,
.booking__form-error:empty {
    display: none;
}

/* accommodation */
.booking__choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.booking__choice {
    position: relative;
    cursor: pointer;
}

.booking__choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.booking__choice span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: 1px solid rgba(21, 13, 10, 0.18);
    border-radius: var(--radius-s);
    background-color: var(--color-white);
    font-weight: 500;
    font-size: var(--text-s);
    line-height: var(--leading-tight);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.booking__choice span::before {
    content: "";
    width: 1rem;
    height: 1rem;
    border: 1.5px solid currentColor;
    border-radius: 0.25rem;
    opacity: 0.5;
}

.booking__choice input:checked + span {
    border-color: var(--color-teal);
    background-color: var(--color-teal);
    color: var(--color-cream);
}

.booking__choice input:checked + span::before {
    opacity: 1;
    background: center / 0.75rem no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.5 2.5L10 3' fill='none' stroke='%23fbefd8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.booking__choice input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(23, 153, 140, 0.3);
}

/* anti-spam field */
.booking__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.booking__submit {
    position: relative;
    width: 100%;
    margin-top: var(--space-2xs);
}

.booking__submit:disabled {
    cursor: progress;
    opacity: 0.85;
}

.booking__spinner {
    display: none;
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: booking-spin 0.7s linear infinite;
}

.booking__submit.is-loading .booking__submit-text {
    opacity: 0;
}

.booking__submit.is-loading .booking__spinner {
    display: block;
    position: absolute;
}

@keyframes booking-spin {
    to {
        rotate: 360deg;
    }
}

/* after sending */
.booking__success {
    text-align: center;
    padding-block: var(--space-m);
}

.booking__success .booking__title {
    padding-right: 0;
}

.booking__success-icon {
    display: grid;
    place-items: center;
    margin-bottom: var(--space-s);
    color: var(--color-teal);
}

.booking__contacts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: var(--space-m) 0 0;
    padding: var(--space-s);
    border-radius: var(--radius-s);
    background-color: rgba(23, 153, 140, 0.08);
    list-style: none;
}

.booking__contacts li {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.booking__contacts-label {
    font-weight: 500;
    font-size: var(--text-xs);
    opacity: 0.7;
}

.booking__contacts a {
    color: var(--color-teal);
    font-weight: 600;
    font-size: var(--text-m);
    text-decoration: none;
    word-break: break-word;
}

.booking__contacts a:hover {
    color: var(--color-teal-hover);
}

.booking__done {
    margin-top: var(--space-m);
}

/* phones */
@media (max-width: 40rem) {
    .booking {
        width: 100%;
        max-width: 100%;
        max-height: 92dvh;
        margin: auto 0 0;
        border-radius: var(--radius-l) var(--radius-l) 0 0;
    }

    .booking__panel {
        max-height: 92dvh;
        padding: var(--space-l) var(--container-padding-x) calc(var(--space-l) + env(safe-area-inset-bottom));
    }

    .booking[open] {
        animation-name: booking-sheet-in;
    }

    @keyframes booking-sheet-in {
        from {
            translate: 0 100%;
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .booking[open],
    .booking[open]::backdrop {
        animation: none;
    }
}

/* text pages */

.text-page {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
}

.text-page__container {
    max-width: calc(48rem + 2 * var(--container-padding-x)); /* ~70 characters per line */
}

.text-page__title {
    margin: 0 0 var(--space-l);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--text-display-l);
    line-height: var(--leading-tight);
    text-transform: uppercase;
    text-wrap: balance;
}

/* Readable long text from the WordPress editor */
.prose {
    font-size: var(--text-s);
    line-height: 1.65;
}

.prose > * {
    margin: 0 0 1em;
}

.prose > :last-child {
    margin-bottom: 0;
}

.prose h2 {
    margin: 2.25em 0 0.75em;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: var(--text-xl);
    line-height: var(--leading-tight);
}

.prose h3 {
    margin: 1.75em 0 0.5em;
    font-weight: 600;
    font-size: var(--text-m);
    line-height: var(--leading-tight);
}

.prose ul,
.prose ol {
    padding-left: 1.25em;
}

.prose li + li {
    margin-top: 0.35em;
}

.prose li::marker {
    color: var(--color-teal);
}

.prose a {
    color: var(--color-teal);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.prose a:hover {
    color: var(--color-teal-hover);
}

.prose .legal-updated {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-s);
    background-color: rgba(23, 153, 140, 0.1);
    color: var(--color-teal-hover);
    font-weight: 500;
    font-size: var(--text-xs);
}

/* consent line under the booking form */
.booking__consent {
    margin: 0;
    font-size: var(--text-xs);
    line-height: var(--leading-text);
    opacity: 0.75;
}

.booking__consent a {
    color: var(--color-teal);
    text-decoration: underline;
}
