/* ==========================================================================
   Terra – Main Stylesheet
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
    font-family: 'Micaroline';
    src: url('../fonts/woff2/Micaroline.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('../fonts/woff2/Poppins-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('../fonts/woff2/Poppins-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('../fonts/woff2/Poppins-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Allura';
    src: url('../fonts/woff2/Allura-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Athelas';
    src: url('../fonts/woff2/Athelas-BoldItalic.woff2') format('woff2');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
    --clr-primary: #7c5e52;
    --clr-primary-dark: #664a40;
    --clr-sage: #6a7f78;
    --clr-text: #141414;
    --clr-muted: #5f5552;
    --clr-cream: #fbf7f1;
    --clr-white: #ffffff;

    --ff-display: 'Micaroline', 'Didot', serif;
    --ff-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --ff-script: 'Allura', cursive;
    --ff-serif: 'Athelas', Georgia, serif;

    --container: 1680px;
    --gutter: clamp(16px, 4vw, 120px);
    --header-h: clamp(76px, 6.8vw, 130px);
    --radius: 8px;
    --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--ff-body);
    font-weight: 400;
    color: var(--clr-text);
    background: var(--clr-white);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.nav-open { overflow: hidden; }

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

a { color: inherit; text-decoration: none; }

ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4, p { margin: 0; }

button { font: inherit; cursor: pointer; }

.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: var(--radius);
    font-family: var(--ff-body);
    font-size: clamp(14px, .94vw, 18px);
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    transition: background-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}

.btn-primary {
    background: var(--clr-primary);
    color: var(--clr-white);
    padding: clamp(14px, 1.25vw, 24px) clamp(16px, 1vw, 18px);
}

.btn-primary:hover {
    background: var(--clr-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -10px rgba(124, 94, 82, .7);
}

.btn-primary:focus-visible,
.nav-link:focus-visible,
.brand:focus-visible,
.nav-toggle:focus-visible {
    outline: 2px solid var(--clr-primary);
    outline-offset: 4px;
}

.btn-lg {
    min-width: clamp(190px, 13.8vw, 265px);
    padding-block: clamp(16px, 1.3vw, 25px);
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--header-h);
    transition: height .4s var(--ease);
}

/* blur lives on a pseudo-element: backdrop-filter on the header itself
   would trap the fixed mobile drawer inside the header box */
.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(251, 247, 241, .88);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 rgba(124, 94, 82, .12), 0 8px 30px -18px rgba(60, 40, 30, .35);
    opacity: 0;
    transition: opacity .4s var(--ease);
}

.site-header.is-scrolled { --header-h: 80px; }
.site-header.is-scrolled::before { opacity: 1; }

.header-inner {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}

.header-cta { justify-self: end; }

.brand img {
    width: clamp(140px, 11vw, 210px);
    height: auto;
    transition: width .4s var(--ease);
}

.site-header.is-scrolled .brand img { width: clamp(130px, 9vw, 170px); }

.main-nav ul {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.1vw, 21px);
}

.nav-link {
    position: relative;
    display: inline-block;
    padding: 8px 10px;
    font-size: clamp(15px, 1.04vw, 20px);
    color: var(--clr-primary);
    transition: color .3s var(--ease);
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .35s var(--ease);
}

.nav-link:hover::after,
.nav-link.is-active::after { transform: scaleX(1); }

.nav-link.is-active { font-weight: 500; }

.header-cta { padding-inline: clamp(14px, .94vw, 18px); }

.nav-cta-mobile,
.nav-toggle,
.nav-backdrop { display: none; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    animation: heroZoom 14s var(--ease) both;
}

@keyframes heroZoom {
    from { transform: scale(1.08); }
    to   { transform: scale(1); }
}

.hero-content {
    padding-top: calc(var(--header-h) + 3vh);
    padding-bottom: 8vh;
}

.hero-content > * { margin-left: clamp(0px, 2.35vw, 45px); }

.hero-title {
    font-family: var(--ff-display);
    font-weight: 400;
    font-size: clamp(54px, 7.4vw, 142px);
    line-height: 1;
    color: var(--clr-primary);
    letter-spacing: -.01em;
}

.hero-title span { display: block; }

.hero-text {
    max-width: min(34em, 55vw);
    margin-top: clamp(20px, 1.2vw, 24px);
    font-size: clamp(16px, 1.25vw, 24px);
    line-height: 1.5;
    color: var(--clr-text);
}

.hero-content .btn { margin-top: clamp(24px, 1.9vw, 36px); }

/* Reveal-on-load */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    animation: revealUp 1s var(--ease) forwards;
}
.hero-content .reveal:nth-child(1) { animation-delay: .25s; }
.hero-content .reveal:nth-child(2) { animation-delay: .5s; }
.hero-content .reveal:nth-child(3) { animation-delay: .7s; }

@keyframes revealUp {
    to { opacity: 1; transform: none; }
}

/* ---------- Shared section title ---------- */
.section-title {
    font-family: var(--ff-display);
    font-weight: 400;
    font-size: clamp(40px, 6.25vw, 120px);
    line-height: 1.05;
    color: var(--clr-text);
    text-align: center;
}

/* ==========================================================================
   Story Behind Terra – scroll-driven envelope & letter
   Static by default; JS adds .is-animated to pin the stage and drive it.
   ========================================================================== */
.story {
    --letter-w: min(760px, 92vw);
    --letter-pad: clamp(26px, 4vw, 64px);
    position: relative;
    background: #f4f8f4;
}

.story-stage {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: clamp(80px, 9vw, 140px) var(--gutter) clamp(60px, 7vw, 110px);
}

.story-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

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

.story-title {
    position: relative;
    z-index: 1;
    will-change: transform, opacity;
}

.envelope,
.story-hint { display: none; }

/* ---------- Letter ---------- */
.letter {
    position: relative;
    z-index: 2;
    width: var(--letter-w);
    margin: clamp(40px, 5vw, 80px) auto 0;
    background: #fbf9f6;
    border-radius: 4px;
    box-shadow: 0 30px 60px -30px rgba(40, 55, 40, .45), 0 2px 6px rgba(40, 55, 40, .08);
    overflow: hidden;
}

/* watercolour hills fading in at the foot of the paper */
.letter::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 46%;
    background: url('../images/optimized/letter-paper.webp') center bottom / cover no-repeat;
    opacity: .28;
    -webkit-mask-image: linear-gradient(to top, #000 15%, transparent);
    mask-image: linear-gradient(to top, #000 15%, transparent);
    pointer-events: none;
}

.letter-body {
    position: relative;
    z-index: 1;
    height: 100%;
    overflow: hidden;
}

.letter-content {
    padding: var(--letter-pad);
    font-family: var(--ff-script);
    font-size: clamp(23px, 1.65vw, 31px);
    line-height: 1.38;
    color: #2b2420;
    will-change: transform;
}

.letter-content p + p { margin-top: .85em; }

.letter-greeting {
    font-size: 1.35em;
    margin-bottom: .2em;
}

.letter-welcome { color: var(--clr-primary); }

.letter-signoff {
    padding-top: .4em;
    text-align: right;
}

.letter-signoff span {
    display: inline-block;
    font-size: 1.6em;
    line-height: 1.1;
    color: var(--clr-primary);
}

/* ---------- Animated (pinned) mode ---------- */
.story.is-animated .story-track {
    height: 600vh;
}

.story.is-animated .story-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    padding: 0;
}

.story.is-animated .story-title {
    position: absolute;
    left: var(--gutter);
    right: var(--gutter);
    top: clamp(96px, 11vh, 130px);
}

.story.is-animated .envelope {
    display: block;
    position: absolute;
    left: 50%;
    bottom: 8vh;
    z-index: 1;
    width: clamp(270px, 27vw, 520px);
    aspect-ratio: 520 / 532;
    margin-left: calc(clamp(270px, 27vw, 520px) / -2);
}

.envelope img {
    position: absolute;
    left: 0;
    width: 100%;
    height: auto;
    will-change: transform, opacity;
}

.envelope-back { top: 0; }

/* the front pocket sits above the letter so the letter looks tucked inside */
.envelope-front { bottom: 0; }

.story.is-animated .letter {
    position: absolute;
    left: 50%;
    top: 0;
    z-index: 2;
    margin: 0 0 0 calc(var(--letter-w) / -2);
    height: var(--letter-h, 80vh);
    transform-origin: 50% 0;
    will-change: transform, clip-path;
}

/* the envelope must not form its own stacking context, so the letter
   (z 2) can sit between the back (z 1) and the front pocket (z 3) */
.story.is-animated .envelope { z-index: auto; }
.story.is-animated .envelope-back { z-index: 1; }
.story.is-animated .envelope-front { z-index: 3; }

/* soft paper edges while the letter scrolls inside itself */
.story.is-animated .letter-body {
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 24px, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}

@media (max-width: 767px) {
    .story.is-animated .envelope { bottom: 14vh; }
}

.story.is-animated [data-reveal] {
    opacity: 0;
    will-change: opacity, transform, filter;
}

.story.is-animated .story-hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2.2vh;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #3d4a40;
    pointer-events: none;
}

.story-hint i {
    width: 1px;
    height: 34px;
    background: linear-gradient(#3d4a40, transparent);
    animation: hintDrop 1.8s var(--ease) infinite;
    transform-origin: top;
}

@keyframes hintDrop {
    0%   { transform: scaleY(0); opacity: 1; }
    70%  { transform: scaleY(1); opacity: 1; }
    100% { transform: scaleY(1); opacity: 0; }
}

/* ==========================================================================
   It's Nice To Finally Have Room To Breathe – highlights
   JS adds .will-animate, then .is-inview when the section scrolls into view.
   ========================================================================== */
.breathe {
    position: relative;
    min-height: clamp(640px, 62.2vw, 1195px);
    display: flex;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
    background: #0d1110;
    color: var(--clr-white);
}

.breathe-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.breathe-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
    transition: transform 2.4s var(--ease);
}

/* keeps the copy readable where it overlaps the building on narrower screens */
.breathe::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(8, 11, 10, .7) 0%, rgba(8, 11, 10, .35) 38%, rgba(8, 11, 10, 0) 62%);
    pointer-events: none;
}

.breathe-inner {
    padding-block: clamp(80px, 6.25vw, 120px);
}

.breathe-title {
    font-family: var(--ff-display);
    font-weight: 400;
    font-size: clamp(42px, 6.25vw, 120px);
    line-height: 1.04;
    letter-spacing: -.005em;
}

.breathe-title .line {
    display: block;
    overflow: hidden;
    padding-bottom: .04em;
}

.breathe-title .line > span { display: inline-block; }

.breathe-stats {
    margin-top: clamp(28px, 3.1vw, 60px);
    display: grid;
    gap: clamp(10px, 1.2vw, 22px);
}

.breathe-stats li {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: clamp(8px, .75vw, 14px);
}

.stat-value {
    font-family: var(--ff-display);
    font-weight: 400;
    font-size: clamp(30px, 2.6vw, 50px);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-family: var(--ff-serif);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(15px, 1.15vw, 22px);
}

/* entrance */
.breathe.will-animate .breathe-bg img { transform: scale(1.1); }
.breathe.will-animate .breathe-title .line > span {
    transform: translateY(110%);
    transition: transform 1.1s var(--ease);
}
.breathe.will-animate .breathe-stats li {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .8s var(--ease), transform .8s var(--ease);
}

.breathe.is-inview .breathe-bg img { transform: none; }
.breathe.is-inview .breathe-title .line > span { transform: none; }
.breathe.is-inview .breathe-stats li { opacity: 1; transform: none; }

.breathe-title .line:nth-child(2) > span { transition-delay: .12s; }
.breathe-title .line:nth-child(3) > span { transition-delay: .24s; }
.breathe-stats li:nth-child(1) { transition-delay: .45s; }
.breathe-stats li:nth-child(2) { transition-delay: .55s; }
.breathe-stats li:nth-child(3) { transition-delay: .65s; }
.breathe-stats li:nth-child(4) { transition-delay: .75s; }
.breathe-stats li:nth-child(5) { transition-delay: .85s; }
.breathe-stats li:nth-child(6) { transition-delay: .95s; }
.breathe-stats li:nth-child(7) { transition-delay: 1.05s; }

@media (max-width: 900px) {
    .breathe {
        align-items: flex-start;
        min-height: 0;
    }

    .breathe-bg img { object-position: 68% center; }

    .breathe::before {
        background: linear-gradient(180deg, rgba(8, 11, 10, .82) 0%, rgba(8, 11, 10, .62) 55%, rgba(8, 11, 10, .25) 100%);
    }
}

/* ---------- Generic scroll reveal (JS adds .fx-ready to <html>) ---------- */
.fx-ready [data-animate] {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity .9s var(--ease) var(--d, 0s), transform .9s var(--ease) var(--d, 0s);
}

.fx-ready [data-animate].is-in {
    opacity: 1;
    transform: none;
}

.br-desk { display: inline; }

/* ==========================================================================
   Life Open Up Here – feature carousel
   ========================================================================== */
.life {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: #fbf8ef;
    padding: clamp(80px, 6.25vw, 120px) 0 clamp(160px, 15vw, 290px);
}

.life-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.life-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
}

.life-head { text-align: center; }

.life-title { color: var(--clr-sage); }

.life-intro {
    margin-top: clamp(18px, 1.6vw, 30px);
    font-size: clamp(16px, 1.25vw, 24px);
    font-style: italic;
    line-height: 1.6;
    color: var(--clr-text);
}

/* ---------- Carousel ---------- */
.carousel {
    --per-view: 3.4;
    --gap: clamp(20px, 2vw, 40px);
    margin-top: clamp(50px, 6vw, 115px);
}

.carousel-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - var(--gap) * (var(--per-view) - 1)) / var(--per-view));
    gap: var(--gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    cursor: grab;
    padding-bottom: 8px;
}

.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
    user-select: none;
}

.feature {
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}

.feature-media {
    position: relative;
    aspect-ratio: 640 / 470;
}

/* absolutely placed so taller artwork can't stretch the box and misalign the copy */
.feature-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
}

.feature-copy {
    margin-top: clamp(28px, 3.6vw, 70px);
    padding-left: 12%;
}

.feature-num {
    display: block;
    font-family: var(--ff-display);
    font-size: clamp(50px, 4.6vw, 88px);
    line-height: 1;
    color: var(--clr-text);
}

.feature-title {
    margin-top: clamp(8px, .8vw, 14px);
    font-family: var(--ff-serif);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(20px, 1.5vw, 28px);
    line-height: 1.25;
}

.feature-text {
    margin-top: 6px;
    max-width: 17em;
    font-size: clamp(15px, 1.05vw, 20px);
    font-style: italic;
    font-weight: 300;
    line-height: 1.65;
}

.carousel-controls {
    margin-top: clamp(36px, 3.4vw, 64px);
    display: flex;
    align-items: center;
    gap: 12px;
}

.carousel-progress {
    flex: 1;
    max-width: 320px;
    height: 2px;
    margin-right: auto;
    background: rgba(106, 128, 122, .22);
    border-radius: 2px;
    overflow: hidden;
}

.carousel-progress span {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--clr-sage);
    transform-origin: left;
    transform: scaleX(var(--progress, .2));
    transition: transform .4s var(--ease);
}

.carousel-btn {
    width: 48px;
    height: 48px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(106, 128, 122, .5);
    background: rgba(255, 255, 255, .55);
    color: var(--clr-sage);
    transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}

.carousel-btn:hover {
    background: var(--clr-sage);
    border-color: var(--clr-sage);
    color: var(--clr-white);
}

.carousel-btn:focus-visible {
    outline: 2px solid var(--clr-sage);
    outline-offset: 3px;
}

@media (max-width: 1100px) {
    .carousel { --per-view: 2.3; }
}

@media (max-width: 640px) {
    .carousel { --per-view: 1.25; }
    .br-desk { display: none; }
    .feature-copy { padding-left: 6%; }
}

/* ==========================================================================
   Amenities – Indoor / Outdoor tabs + mosaic
   ========================================================================== */
.amenities {
    padding: clamp(80px, 5.2vw, 100px) 0 clamp(80px, 6.25vw, 120px);
    background: var(--clr-white);
}

.amenities-title { color: var(--clr-sage); }

.tabs {
    margin: clamp(24px, 2.3vw, 44px) auto clamp(24px, 1.6vw, 30px);
    display: flex;
    justify-content: center;
    gap: clamp(12px, 2.4vw, 46px);
}

.tab {
    min-width: clamp(120px, 8vw, 154px);
    padding: clamp(9px, .6vw, 12px) 24px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-family: var(--ff-serif);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(18px, 1.25vw, 24px);
    line-height: 1.2;
    color: var(--clr-text);
    transition: background-color .35s var(--ease), color .35s var(--ease);
}

.tab:hover { color: var(--clr-sage); }

.tab.is-active {
    background: var(--clr-sage);
    color: var(--clr-white);
}

.tab:focus-visible {
    outline: 2px solid var(--clr-sage);
    outline-offset: 3px;
}

/* mosaic: large + wide on the left, two squares + wide on the right (as in the design) */
.amen-grid {
    --gap: clamp(10px, 1.05vw, 20px);
    display: grid;
    grid-template-columns: 832fr 405fr 405fr;
    grid-template-rows: 355fr 127fr 249fr;
    grid-template-areas:
        "t1 t3 t4"
        "t1 t5 t5"
        "t2 t5 t5";
    gap: var(--gap);
    aspect-ratio: 1680 / 771;
}

.amen-tile--1 { grid-area: t1; }
.amen-tile--2 { grid-area: t2; }
.amen-tile--3 { grid-area: t3; }
.amen-tile--4 { grid-area: t4; }
.amen-tile--5 { grid-area: t5; }

.amen-tile {
    position: relative;
    display: block;
    min-height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #e9ece8;
    isolation: isolate;
}

.amen-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.1s var(--ease);
}

.amen-tile::after {
    content: '';
    position: absolute;
    inset: 45% 0 0 0;
    background: linear-gradient(transparent, rgba(10, 14, 12, .65));
    opacity: 0;
    transition: opacity .5s var(--ease);
}

.amen-caption {
    position: absolute;
    left: clamp(14px, 1.3vw, 24px);
    right: clamp(14px, 1.3vw, 24px);
    bottom: clamp(12px, 1.1vw, 20px);
    z-index: 1;
    font-family: var(--ff-serif);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(15px, 1.05vw, 20px);
    color: var(--clr-white);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .5s var(--ease), transform .5s var(--ease);
}

.amen-tile:hover img,
.amen-tile:focus-visible img { transform: scale(1.06); }

.amen-tile:hover::after,
.amen-tile:focus-visible::after,
.amen-tile:hover .amen-caption,
.amen-tile:focus-visible .amen-caption {
    opacity: 1;
    transform: none;
}

.amen-tile:focus-visible {
    outline: 2px solid var(--clr-sage);
    outline-offset: 3px;
}

/* touch screens have no hover, so captions stay visible */
@media (hover: none) {
    .amen-tile::after,
    .amen-caption { opacity: 1; transform: none; }
}

/* tiles cascade in when a tab is shown */
.amen-panel.is-switching .amen-tile {
    animation: tileIn .7s var(--ease) both;
    animation-delay: calc(var(--i) * .07s);
}

@keyframes tileIn {
    from { opacity: 0; transform: translateY(18px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

@media (max-width: 767px) {
    .amen-grid {
        aspect-ratio: auto;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: none;
        grid-template-areas:
            "t1 t1"
            "t3 t4"
            "t2 t2"
            "t5 t5";
    }

    .amen-tile--1 { aspect-ratio: 16 / 11; }
    .amen-tile--3,
    .amen-tile--4 { aspect-ratio: 1; }
    .amen-tile--2,
    .amen-tile--5 { aspect-ratio: 16 / 9; }
}

/* ==========================================================================
   Legend – master plan + numbered list
   ========================================================================== */
.legend {
    position: relative;
    padding: clamp(60px, 4vw, 76px) 0 clamp(90px, 8vw, 150px);
    background: #fff url('../images/optimized/legend-bg.webp') center bottom / 100% auto no-repeat;
}

.legend-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(40px, 6.5vw, 125px);
    align-items: start;
}

.legend-plan {
    position: relative;
    display: block;
    margin-top: clamp(30px, 3.4vw, 64px);
    padding: clamp(10px, 1vw, 20px) 0 clamp(30px, 2.6vw, 50px);
    border-top: 1px solid #e6e1da;
    cursor: zoom-in;
}

.legend-plan img {
    width: 100%;
    height: auto;
    transition: transform .8s var(--ease);
}

.legend-plan:hover img { transform: scale(1.015); }

.legend-entry {
    position: absolute;
    right: 9%;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: clamp(12px, .95vw, 18px);
    text-transform: uppercase;
    color: var(--clr-text);
}

.legend-zoom {
    position: absolute;
    left: 0;
    bottom: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .85);
    font-size: 13px;
    color: var(--clr-sage);
    box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .2);
    opacity: 0;
    transition: opacity .35s var(--ease);
}

.legend-plan:hover .legend-zoom,
.legend-plan:focus-visible .legend-zoom { opacity: 1; }

.legend-title {
    font-family: var(--ff-display);
    font-weight: 400;
    font-size: clamp(48px, 6.25vw, 120px);
    line-height: 1;
    color: var(--clr-text);
}

.legend-list {
    margin-top: clamp(24px, 3.4vw, 64px);
    display: grid;
    gap: clamp(4px, .55vw, 10px);
    counter-reset: none;
}

.legend-list li {
    font-size: clamp(14px, 1.25vw, 24px);
    font-style: italic;
    line-height: 1.45;
    text-transform: uppercase;
    color: var(--clr-text);
    transition: transform .3s var(--ease), color .3s var(--ease);
}

.legend-list li:first-child,
.legend-list li:hover {
    font-weight: 500;
    color: #000;
}

.legend-list li:hover { transform: translateX(4px); }

@media (max-width: 1100px) {
    .legend-inner { grid-template-columns: 1fr; }
    .legend-list-wrap { order: -1; }
    .legend-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
    .legend-zoom { opacity: 1; }
}

@media (max-width: 520px) {
    .legend-list { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Floor plans – tower plan with clickable flats
   ========================================================================== */
.floorplans {
    padding: clamp(70px, 5.2vw, 100px) 0 clamp(80px, 7vw, 130px);
    background: #fff url('../images/optimized/floorplans-bg.webp') center bottom / cover no-repeat;
}

.floorplans-intro {
    margin-top: clamp(12px, 1vw, 18px);
    text-align: center;
    font-size: clamp(15px, 1.05vw, 20px);
    font-style: italic;
    color: var(--clr-muted);
}

.floorplans-layout {
    margin-top: clamp(30px, 3.4vw, 64px);
    display: grid;
    grid-template-columns: minmax(0, 560px) minmax(280px, 420px);
    justify-content: center;
    gap: clamp(30px, 5vw, 96px);
    align-items: center;
}

.tower {
    position: relative;
    border-radius: 14px;
    background: rgba(255, 255, 255, .7);
    box-shadow: 0 30px 60px -40px rgba(40, 60, 50, .45);
}

.tower-img {
    width: 100%;
    height: auto;
}

.flat-spot {
    position: absolute;
    display: grid;
    place-items: center;
    border-radius: 4px;
    transition: background-color .3s var(--ease), box-shadow .3s var(--ease);
}

.flat-badge {
    display: grid;
    place-items: center;
    min-width: clamp(26px, 2.1vw, 38px);
    height: clamp(26px, 2.1vw, 38px);
    padding: 0 6px;
    border-radius: 999px;
    background: var(--clr-primary);
    color: #fff;
    font-size: clamp(11px, .8vw, 14px);
    font-weight: 500;
    box-shadow: 0 6px 16px -6px rgba(60, 40, 30, .6);
    transition: transform .3s var(--ease), background-color .3s var(--ease);
}

.flat-spot:hover,
.flat-spot:focus-visible,
.flat-spot.is-hot {
    background: rgba(106, 128, 122, .28);
    box-shadow: inset 0 0 0 2px var(--clr-sage);
    outline: none;
}

.flat-spot:hover .flat-badge,
.flat-spot:focus-visible .flat-badge,
.flat-spot.is-hot .flat-badge {
    transform: scale(1.15);
    background: var(--clr-sage);
}

.flat-spot.is-dimmed {
    background: rgba(255, 255, 255, .55);
}

.flat-spot.is-dimmed .flat-badge { opacity: .35; }

/* side panel */
.flat-panel {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    max-height: min(100%, 860px);
    min-height: 0;
}

.flat-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.chip {
    padding: 9px 18px;
    border: 1px solid rgba(106, 128, 122, .5);
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    font-family: var(--ff-serif);
    font-weight: 700;
    font-style: italic;
    font-size: 16px;
    color: var(--clr-text);
    transition: background-color .3s var(--ease), color .3s var(--ease);
}

.chip:hover { border-color: var(--clr-sage); }

.chip.is-active {
    background: var(--clr-sage);
    border-color: var(--clr-sage);
    color: #fff;
}

.flat-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
    border-top: 1px solid rgba(20, 20, 20, .12);
}

.flat-list li[hidden] { display: none; }

.flat-row {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: baseline;
    gap: 14px;
    padding: 14px 6px;
    border: 0;
    border-bottom: 1px solid rgba(20, 20, 20, .12);
    background: transparent;
    text-align: left;
    color: var(--clr-text);
    transition: background-color .25s var(--ease), padding .25s var(--ease);
}

.flat-row:hover,
.flat-row:focus-visible,
.flat-row.is-hot {
    background: rgba(255, 255, 255, .75);
    padding-left: 14px;
    outline: none;
}

.flat-row-no {
    font-family: var(--ff-serif);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(17px, 1.15vw, 21px);
}

.flat-row-meta {
    font-size: 14px;
    color: var(--clr-muted);
}

.flat-row-area {
    font-family: var(--ff-display);
    font-size: clamp(22px, 1.6vw, 30px);
    line-height: 1;
}

.flat-row-area small {
    font-family: var(--ff-body);
    font-size: 12px;
    color: var(--clr-muted);
}

@media (max-width: 900px) {
    .floorplans-layout { grid-template-columns: minmax(0, 560px); }
    .flat-list { max-height: 420px; }
}

/* ==========================================================================
   Location – enquiry form + map
   ========================================================================== */
.location {
    padding: clamp(50px, 2.2vw, 40px) 0 clamp(80px, 5.2vw, 100px);
    background: var(--clr-white);
    overflow: hidden;
}

.location-inner {
    display: grid;
    grid-template-columns: minmax(0, 41fr) minmax(0, 59fr);
    grid-template-areas:
        "head ."
        "form map";
    justify-content: space-between;
    column-gap: clamp(30px, 3vw, 56px);
    /* form and map share one row, so their top and bottom edges line up */
    align-items: stretch;
}

.location-head { grid-area: head; }
.enquiry { grid-area: form; }
.location-map { grid-area: map; }

.location-birds {
    width: clamp(260px, 37vw, 700px);
    height: auto;
    margin-left: clamp(0px, 1.6vw, 30px);
    mix-blend-mode: multiply;
    animation: birdsDrift 9s ease-in-out infinite alternate;
}

@keyframes birdsDrift {
    from { transform: translate(0, 0); }
    to   { transform: translate(18px, -10px); }
}

.location-title {
    margin-top: clamp(-20px, -1vw, -10px);
    font-family: var(--ff-display);
    font-weight: 400;
    font-size: clamp(54px, 5.6vw, 108px);
    line-height: 1;
    color: var(--clr-text);
}

.enquiry {
    margin-top: clamp(30px, 3.6vw, 70px);
    display: flex;
    flex-direction: column;
    padding: clamp(24px, 2.5vw, 48px);
    border-radius: 10px;
    background: #fafafa;
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .12);
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(14px, 1.25vw, 24px);
}

.field { margin-bottom: clamp(16px, 1.4vw, 26px); }

/* the message box grows so the form matches the map's height */
.field-grow {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.field-grow textarea { flex: 1; }

.field label {
    display: block;
    margin-bottom: 10px;
    font-size: clamp(14px, .85vw, 16px);
    font-style: italic;
    text-transform: uppercase;
    color: var(--clr-text);
}

.field input,
.field textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #edeef0;
    font: inherit;
    font-size: 15px;
    color: var(--clr-text);
    transition: border-color .25s var(--ease), background-color .25s var(--ease), box-shadow .25s var(--ease);
}

.field textarea {
    min-height: 90px;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
    font-style: italic;
    color: #9a9ca2;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--clr-sage);
    box-shadow: 0 0 0 3px rgba(106, 128, 122, .18);
}

.field.is-invalid input,
.field.is-invalid textarea { border-color: #b4553d; }

.field-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #b4553d;
}

.hp {
    position: absolute !important;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.btn-sage {
    background: var(--clr-sage);
    color: #fff;
    padding: 16px 28px;
}

.btn-sage:hover {
    background: #566b65;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -10px rgba(86, 107, 101, .7);
}

.btn-sage:focus-visible {
    outline: 2px solid var(--clr-sage);
    outline-offset: 3px;
}

.btn-block {
    width: 100%;
    padding-block: clamp(18px, 1.3vw, 24px);
    font-family: var(--ff-serif);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(18px, 1.15vw, 22px);
}

.btn[disabled] { opacity: .65; pointer-events: none; }

.form-status {
    min-height: 1.5em;
    margin-top: 14px;
    font-size: 14px;
    color: var(--clr-sage);
}

.form-status.is-error { color: #b4553d; }

.location-map {
    position: relative;
    margin-top: clamp(30px, 3.6vw, 70px);
}

.location-map > a:first-child {
    display: block;
    height: 100%;
    overflow: hidden;
    border-radius: 6px;
    cursor: zoom-in;
}

.location-map img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .8s var(--ease);
}

.location-map > a:first-child:hover img { transform: scale(1.02); }

.map-directions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: #fff;
    font-size: 14px;
    color: var(--clr-primary);
    box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .3);
    transition: background-color .3s var(--ease), color .3s var(--ease);
}

.map-directions:hover {
    background: var(--clr-primary);
    color: #fff;
}

@media (max-width: 1100px) {
    .location-inner {
        grid-template-columns: 1fr;
        grid-template-areas: "head" "form" "map";
    }
}

@media (max-width: 560px) {
    .field-row { grid-template-columns: 1fr; gap: 0; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    padding: clamp(70px, 6vw, 115px) 0 clamp(30px, 3.4vw, 64px);
    background: #fbf3ec url('../images/optimized/footer-bg.webp') center / cover no-repeat;
}

.footer-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
}

.footer-logo img {
    width: clamp(160px, 11vw, 210px);
    height: auto;
}

.footer-links {
    margin-top: clamp(28px, 2.4vw, 44px);
    display: flex;
    flex-wrap: wrap;
    gap: 12px clamp(24px, 2.6vw, 50px);
}

.footer-links a,
.footer-legal a {
    position: relative;
    color: var(--clr-text);
    transition: color .3s var(--ease);
}

.footer-links a {
    font-size: clamp(16px, 1.15vw, 22px);
}

.footer-links a:hover,
.footer-legal a:hover { color: var(--clr-primary); }

.newsletter { width: min(100%, 534px); }

.newsletter-title {
    display: block;
    margin-bottom: 16px;
    font-size: clamp(17px, 1.15vw, 22px);
    font-weight: 500;
    color: var(--clr-text);
}

.newsletter-row {
    display: flex;
    gap: 10px;
}

.newsletter input[type="email"] {
    flex: 1;
    min-width: 0;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--clr-primary);
    font: inherit;
    font-size: 15px;
    color: #fff;
}

.newsletter input[type="email"]::placeholder { color: rgba(255, 255, 255, .85); }

.newsletter input[type="email"]:focus {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(124, 94, 82, .3);
}

.newsletter .btn { padding: 12px 34px; }

.footer-bottom {
    margin-top: clamp(40px, 4vw, 76px);
    padding-top: clamp(20px, 1.8vw, 34px);
    border-top: 1px solid rgba(20, 20, 20, .6);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px 30px;
    font-size: clamp(13px, .85vw, 16px);
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 0;
}

.footer-legal li + li::before {
    content: '|';
    margin: 0 clamp(12px, 1.4vw, 24px);
    color: var(--clr-text);
}

.footer-credit { color: var(--clr-text); }

@media (max-width: 560px) {
    .footer-legal { gap: 8px 20px; }
    .footer-legal li + li::before { display: none; }
    .newsletter-row { flex-direction: column; }
    .newsletter .btn { width: 100%; }
}

/* ==========================================================================
   Lightbox (shared – amenities, floor plans)
   ========================================================================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    place-items: center;
    padding: clamp(56px, 6vw, 90px) clamp(12px, 6vw, 110px) clamp(16px, 2vw, 30px);
    background: rgba(16, 18, 17, .92);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s var(--ease), visibility 0s linear .35s;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity .35s var(--ease), visibility 0s;
}

.lightbox-figure {
    margin: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    background: #f4f2ee;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
    transform: scale(.96);
    opacity: 0;
    transition: transform .45s var(--ease), opacity .45s var(--ease);
}

.lightbox-img.is-loaded {
    transform: none;
    opacity: 1;
}

.lightbox-caption {
    margin-top: 16px;
    font-family: var(--ff-serif);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(16px, 1.15vw, 22px);
    color: #f3efe8;
    text-align: center;
}

.lightbox-count {
    display: block;
    margin-top: 4px;
    font-family: var(--ff-body);
    font-style: normal;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: .12em;
    color: rgba(243, 239, 232, .6);
}

.lightbox-btn {
    position: absolute;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    transition: background-color .3s var(--ease);
}

.lightbox-btn:hover { background: rgba(255, 255, 255, .18); }
.lightbox-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.lightbox-close { top: 16px; right: 16px; }
.lightbox-prev { left: clamp(10px, 2vw, 36px); top: 50%; transform: translateY(-50%); }
.lightbox-next { right: clamp(10px, 2vw, 36px); top: 50%; transform: translateY(-50%); }
.lightbox.is-single .lightbox-prev,
.lightbox.is-single .lightbox-next { display: none; }

@media (max-width: 767px) {
    .lightbox-prev,
    .lightbox-next { top: auto; bottom: 14px; transform: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
    .header-inner { display: flex; justify-content: space-between; }

    .header-cta { display: none; }

    .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        width: 44px;
        height: 44px;
        padding: 10px;
        margin-right: -10px;
        background: transparent;
        border: 0;
        position: relative;
        z-index: 120;
    }

    .nav-toggle span {
        display: block;
        height: 1.5px;
        width: 100%;
        background: var(--clr-primary);
        border-radius: 2px;
        transition: transform .35s var(--ease), opacity .25s;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 110;
        width: min(340px, 86vw);
        padding: 110px 32px 40px;
        display: flex;
        flex-direction: column;
        gap: 32px;
        background: var(--clr-cream);
        box-shadow: -20px 0 50px -20px rgba(60, 40, 30, .3);
        transform: translateX(100%);
        visibility: hidden;
        transition: transform .45s var(--ease), visibility 0s linear .45s;
    }

    .main-nav.is-open {
        transform: none;
        visibility: visible;
        transition: transform .45s var(--ease), visibility 0s;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .nav-link {
        font-size: 20px;
        padding: 10px 0;
    }

    .nav-link::after { bottom: 4px; transform-origin: left; }

    .nav-cta-mobile {
        display: inline-flex;
        align-self: flex-start;
        padding: 16px 24px;
        font-size: 16px;
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(30, 20, 15, .35);
        opacity: 0;
        visibility: hidden;
        transition: opacity .4s var(--ease), visibility 0s linear .4s;
    }

    .nav-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
        transition: opacity .4s var(--ease), visibility 0s;
    }
}

@media (max-width: 900px) {
    .hero {
        align-items: flex-start;
        min-height: 100svh;
    }

    .hero-bg img { object-position: 72% bottom; }

    /* soft wash over the sky so the copy stays readable */
    .hero-bg::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(251, 247, 241, .94) 0%, rgba(251, 247, 241, .86) 42%, rgba(251, 247, 241, 0) 64%);
    }

    .hero-content {
        padding-top: calc(var(--header-h) + 32px);
    }

    .hero-text { max-width: 30em; }

    .hero-content .btn { width: 100%; max-width: 280px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-delay: 0s !important;
        transition-duration: .01ms !important;
    }
}
