/* Turquoise Realty: home page v2 (motion + polish).
   Loads after styles.css and only changes the home page (body.home-v2).
   All movement is gated on html.motion, which is only set when the visitor
   has NOT asked their device to reduce motion. Without it, everything is static and visible. */

.home-v2 { --ease: cubic-bezier(.22, .61, .36, 1); --ease-out: cubic-bezier(.16, 1, .3, 1); }

/* ---------- Header: compacts and gains a soft shadow once you scroll ---------- */
/* The header's background and frosted-glass blur sit on a ::before layer, not on the header itself.
   (A backdrop-filter on the header would trap the full-screen phone menu inside the 60px bar,
   so the menu could not open once the page was scrolled.) */
.home-v2 .site-header { background: transparent; transition: box-shadow .4s var(--ease); }
.home-v2 .site-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--header); transition: background-color .4s var(--ease); }
.home-v2 .site-header .wrap { transition: min-height .4s var(--ease); }
.home-v2 .site-header .brand-mark { transition: width .4s var(--ease), height .4s var(--ease); }
.home-v2 .site-header.is-scrolled { box-shadow: 0 10px 30px -18px rgba(5, 15, 25, .65); }
.home-v2 .site-header.is-scrolled::before { background: rgba(19, 41, 61, .94); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
/* Phone/tablet menu starts right under the compact header */
@media (max-width: 1240px) { .home-v2 .site-header.is-scrolled .menu-panel { top: 60px; } }
.home-v2 .site-header.is-scrolled .wrap { min-height: 60px; }
.home-v2 .site-header.is-scrolled .brand-mark { width: 42px; height: 42px; }

/* ---------- Hero ---------- */
.home-v2 .hero { min-height: min(92vh, 860px); display: flex; align-items: center; }
.home-v2 .hero-title { font-size: clamp(2.5rem, 5.6vw, 4.6rem); max-width: 14ch; }
.home-v2 .hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.home-v2 .hero-title .line > span { display: inline-block; }

/* Frosted search card */
.home-v2 .quick-search { background: rgba(255, 255, 255, .9); border: 1px solid rgba(255, 255, 255, .6); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 24px 60px -24px rgba(5, 20, 30, .55); transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
.home-v2 .quick-search:focus-within { box-shadow: 0 0 0 4px rgba(43, 134, 155, .28), 0 24px 60px -24px rgba(5, 20, 30, .55); }

/* Buttons: gentle lift */
.home-v2 .btn { transition: background .2s, color .2s, border-color .2s, transform .25s var(--ease), box-shadow .25s var(--ease); }
.home-v2 .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -12px rgba(31, 110, 128, .7); }

/* Waves: two layers drifting slowly in opposite directions */
.home-v2 .hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; height: clamp(56px, 8vw, 120px); overflow: hidden; z-index: 1; pointer-events: none; }
.home-v2 .hero-wave .wave { position: absolute; bottom: 0; left: 0; width: 200%; height: 100%; display: block; }
.home-v2 .wave-back path { fill: var(--lagoon); opacity: .45; }
.home-v2 .wave-front path { fill: var(--foam); }

/* Scroll cue: an outline turtle facing up (drawing in home-motion.js) */
.home-v2 .scroll-cue { position: absolute; left: 50%; bottom: clamp(70px, 9vw, 130px); z-index: 3; width: 46px; margin-left: -23px; color: rgba(255, 255, 255, .9); filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3)); opacity: 0; transition: opacity .6s, color .3s; }
.home-v2 .scroll-cue .turtle { transform: rotate(-90deg); }
.home-v2 .scroll-cue:hover { color: #fff; }
.home-v2 .hero.has-video .scroll-cue { opacity: 1; }
@media (max-width: 760px), (max-height: 640px) { .home-v2 .scroll-cue { display: none; } }

/* ---------- Stats ---------- */
.home-v2 .stats { padding: 34px 0 10px; }
.home-v2 .stats > div { position: relative; }
.home-v2 .stats > div::after { content: ""; display: block; width: 36px; height: 2px; margin-top: 12px; background: var(--sun); transform-origin: left; }
.home-v2 .stats strong { font-variant-numeric: tabular-nums; }

/* ---------- Available now: swipeable rail ---------- */
.home-v2 .rail-controls { display: flex; align-items: center; gap: 10px; }
.home-v2 .rail-btn { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--white); color: var(--deep); display: grid; place-items: center; cursor: pointer; transition: border-color .2s, background .2s, color .2s, opacity .2s; }
.home-v2 .rail-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-v2 .rail-btn:hover:not(:disabled) { border-color: var(--lagoon); background: var(--lagoon); color: var(--white); }
.home-v2 .rail-btn:disabled { opacity: .35; cursor: default; }
.home-v2 .rail-controls.is-hidden .rail-btn { display: none; }

.home-v2 .rail { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: calc((100% - 2 * 28px) / 3); gap: 28px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 0; padding: 6px 2px 26px; margin: -6px -2px 0; scrollbar-width: none; cursor: grab; }
.home-v2 .rail::-webkit-scrollbar { display: none; }
.home-v2 .rail.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.home-v2 .rail.is-dragging .card { pointer-events: none; }
.home-v2 .rail > * { scroll-snap-align: start; }
.home-v2 .rail:has(> .state) { display: block; cursor: auto; }
@media (max-width: 1020px) { .home-v2 .rail { grid-auto-columns: calc((100% - 28px) / 2); } }
@media (max-width: 640px) { .home-v2 .rail { grid-auto-columns: 84%; gap: 16px; } }

/* Cards: lift, slow photo zoom, details slide up */
.home-v2 .card { transition: border-color .3s, transform .5s var(--ease-out), box-shadow .5s var(--ease-out); will-change: transform; }
.home-v2 .card-media { overflow: hidden; }
.home-v2 .card-media img { transition: transform 1.4s var(--ease-out); }
.home-v2 .card-body > * { transition: transform .5s var(--ease-out); }
.home-v2 .card:hover { transform: translateY(-6px); border-color: transparent; box-shadow: 0 26px 50px -28px rgba(19, 41, 61, .45); }
.home-v2 .card:hover .card-media img { transform: scale(1.06); }
.home-v2 .card:hover .card-price { transform: translateY(-3px); }
.home-v2 .card:hover .card-title { transform: translateY(-2px); }

/* ---------- Buy from anywhere: timeline that draws as you scroll ---------- */
.home-v2 .timeline { position: relative; }
.home-v2 .timeline::before, .home-v2 .timeline::after { content: ""; position: absolute; left: 19px; top: 38px; bottom: 38px; width: 2px; border-radius: 2px; }
.home-v2 .timeline::before { background: rgba(43, 134, 155, .18); }
.home-v2 .timeline::after { background: var(--lagoon); transform-origin: top; transform: scaleY(var(--progress, 1)); }
.home-v2 .timeline li::before { position: relative; z-index: 1; transition: background .5s var(--ease), color .5s var(--ease), box-shadow .5s var(--ease), transform .5s var(--ease-out); }
.home-v2 .timeline li > div { transition: opacity .5s var(--ease), transform .5s var(--ease-out); }
.home-v2 .timeline li.is-active::before { background: var(--lagoon); color: var(--white); box-shadow: 0 0 0 6px rgba(43, 134, 155, .15); }
html.motion .home-v2 .timeline li:not(.is-active) > div { opacity: .45; }
html.motion .home-v2 .timeline { --progress: 0; }

/* ---------- Island living: curtain reveal + soft parallax ---------- */
.home-v2 .curtain { position: relative; box-shadow: 0 40px 80px -50px rgba(19, 41, 61, .55); }
.home-v2 .curtain img { transform: translate3d(0, var(--py, 0px), 0) scale(1.12); }
.home-v2 .points li { position: relative; border-left-color: transparent; }
.home-v2 .points li::before { content: ""; position: absolute; left: -2px; top: 0; bottom: 0; width: 2px; background: var(--lagoon); transform-origin: top; }

/* ---------- Projects: cards with a brass edge ---------- */
.home-v2 .proj-cards { gap: 16px; margin-top: 0; }
.home-v2 .proj-cards li { display: grid; grid-template-columns: auto 1fr; column-gap: 18px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out), border-color .4s; }
.home-v2 .proj-cards li::before { left: -1px; top: 18px; bottom: 18px; width: 3px; border-radius: 3px; background: var(--sun); }
.home-v2 .proj-cards .pc-num { grid-row: span 2; font: 500 1.6rem/1 var(--display); color: var(--sun); padding-top: 2px; }
.home-v2 .proj-cards li:hover { transform: translateX(6px); border-color: rgba(184, 147, 90, .55); box-shadow: 0 0 0 4px rgba(184, 147, 90, .10), 0 20px 40px -28px rgba(19, 41, 61, .45); }

/* ---------- Sellers: deep navy band, form stays in view ---------- */
.home-v2 .sellers-dark { position: relative; overflow: hidden; background: var(--deep); color: #DCE4EA; isolation: isolate; }
.home-v2 .sellers-dark::before { content: ""; position: absolute; z-index: -1; width: 900px; height: 900px; right: -320px; top: -360px; border-radius: 50%; background: radial-gradient(closest-side, rgba(43, 134, 155, .30), transparent 70%); }
.home-v2 .sellers-dark::after { content: ""; position: absolute; z-index: -1; width: 700px; height: 700px; left: -300px; bottom: -380px; border-radius: 50%; background: radial-gradient(closest-side, rgba(184, 147, 90, .18), transparent 70%); }
.home-v2 .sellers-dark h2 { color: var(--white); font-size: clamp(2rem, 3.6vw, 3rem); max-width: 18ch; }
.home-v2 .sellers-dark .lede { color: #C9D4DC; }
.home-v2 .sellers-dark .steps li { border-top-color: rgba(255, 255, 255, .12); }
.home-v2 .sellers-dark .steps li::before { background: transparent; border-color: var(--sun); color: var(--sun); }
.home-v2 .sellers-dark .steps strong { color: var(--white); }
.home-v2 .sellers-dark .steps span { color: #B9C5CF; }
.home-v2 .sellers-dark .form-card { box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .6); }
@media (min-width: 900px) { .home-v2 .sticky-card { position: sticky; top: 96px; } }

/* ======================================================================
   Motion (only when html.motion is set)
   ====================================================================== */
@media (prefers-reduced-motion: no-preference) {
  /* Hero entrance */
  html.motion .home-v2 .hero-title .line > span { transform: translateY(105%); animation: tr-rise 1.1s var(--ease-out) var(--d, 0s) forwards; }
  html.motion .home-v2 .hero-in { opacity: 0; transform: translateY(18px); animation: tr-fade-up .9s var(--ease-out) var(--d, 0s) forwards; }
  html.motion .home-v2 .wave-back { animation: tr-drift 38s linear infinite; }
  html.motion .home-v2 .wave-front { animation: tr-drift 26s linear infinite reverse; }
  html.motion .home-v2 .scroll-cue { animation: tr-bob 2.4s var(--ease) infinite; }

  /* Generic reveal */
  html.motion .home-v2 [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform 1s var(--ease-out); transition-delay: var(--d, 0s); }
  html.motion .home-v2 [data-reveal].is-in { opacity: 1; transform: none; }

  /* Staggered children */
  html.motion .home-v2 [data-stagger] > * { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .9s var(--ease-out); transition-delay: calc(var(--i, 0) * 110ms); }
  html.motion .home-v2 [data-stagger].is-in > * { opacity: 1; transform: none; }
  html.motion .home-v2 .stats > div::after { transform: scaleX(0); transition: transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 110ms + .3s); }
  html.motion .home-v2 .stats.is-in > div::after { transform: scaleX(1); }
  html.motion .home-v2 .points li::before { transform: scaleY(0); transition: transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 110ms + .2s); }
  html.motion .home-v2 [data-stagger].is-in .points li::before,
  html.motion .home-v2 .points[data-stagger].is-in li::before { transform: scaleY(1); }
  /* hover lift wins over stagger once revealed */
  html.motion .home-v2 .proj-cards.is-in li { transition: opacity .8s var(--ease), transform .5s var(--ease-out), box-shadow .5s var(--ease-out), border-color .4s; }
  html.motion .home-v2 .proj-cards.is-in li:hover { transform: translateX(6px); }

  /* Listing cards fade in one after another when they arrive */
  html.motion .home-v2 .rail > .card { opacity: 0; transform: translateY(26px); }
  html.motion .home-v2 .rail > .card.is-in { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform .9s var(--ease-out), border-color .3s, box-shadow .5s var(--ease-out); transition-delay: calc(var(--i, 0) * 120ms); }
  html.motion .home-v2 .rail > .card.is-in:hover { transform: translateY(-6px); transition-delay: 0s; }

  /* Curtain reveal of the photo */
  html.motion .home-v2 .curtain { clip-path: inset(0 0 100% 0 round var(--radius-lg)); transition: clip-path 1.4s var(--ease-out); }
  html.motion .home-v2 .curtain.is-in { clip-path: inset(0 0 0 0 round var(--radius-lg)); }
  html.motion .home-v2 .curtain img { transition: scale 1.8s var(--ease-out); scale: 1.08; }
  html.motion .home-v2 .curtain.is-in img { scale: 1; }
}

@keyframes tr-rise { to { transform: translateY(0); } }
@keyframes tr-fade-up { to { opacity: 1; transform: none; } }
@keyframes tr-drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes tr-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }

/* ======================================================================
   Turtle (outline drawing used as the scroll cue, see TURTLE in home-motion.js)
   ====================================================================== */
.home-v2 .turtle { display: block; width: 100%; height: auto; overflow: visible; color: inherit; }
.home-v2 .turtle * { fill: var(--t-fill, none); stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.home-v2 .turtle .t-scutes, .home-v2 .turtle .t-tail { fill: none; }
.home-v2 .turtle .t-eye { fill: currentColor; stroke: none; }
.home-v2 .turtle .t-flip, .home-v2 .turtle .t-body { transform-box: view-box; }
.home-v2 .turtle .t-body { transform-origin: 32px 24px; }
.home-v2 .turtle .t-fl { transform-origin: 40px 16.5px; }
.home-v2 .turtle .t-fr { transform-origin: 40px 31.5px; }
.home-v2 .turtle .t-bl { transform-origin: 22px 17.5px; }
.home-v2 .turtle .t-br { transform-origin: 22px 30.5px; }

@media (prefers-reduced-motion: no-preference) {
  /* Diagonal gait: front-left with back-right, then front-right with back-left */
  html.motion .home-v2 .turtle .t-fl, html.motion .home-v2 .turtle .t-bl { animation: t-top var(--t-speed, .9s) ease-in-out infinite paused; }
  html.motion .home-v2 .turtle .t-fr, html.motion .home-v2 .turtle .t-br { animation: t-bot var(--t-speed, .9s) ease-in-out infinite paused; }
  html.motion .home-v2 .turtle .t-bl, html.motion .home-v2 .turtle .t-fr { animation-delay: calc(var(--t-speed, .9s) / -2); }
  html.motion .home-v2 .turtle .t-body { animation: t-sway var(--t-speed, .9s) ease-in-out infinite paused; }
  html.motion .home-v2 .turtle.is-crawling * { animation-play-state: running; }
}
@keyframes t-top { 0%, 100% { transform: rotate(-18deg); } 50% { transform: rotate(12deg); } }
@keyframes t-bot { 0%, 100% { transform: rotate(18deg); } 50% { transform: rotate(-12deg); } }
@keyframes t-sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }

/* Hero videos: two stacked layers crossfade between clips */
.home-v2 .hero.has-video .hero-video { opacity: 0; transition: opacity 1.2s ease; }
.home-v2 .hero.has-video .hero-video.is-on { opacity: 1; }

/* Recently sold and rented: one row of 4 (2 x 2 on tablets, 1 per row on phones) */
.home-v2 .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.home-v2 .grid-4 .card-body { padding: 16px 18px 18px; }
.home-v2 .grid-4 .card-price { font-size: 1.12rem; }
@media (max-width: 1020px) { .home-v2 .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .home-v2 .grid-4 { grid-template-columns: 1fr; } }

/* FAQ on the home page: deep turquoise band with light text (contrast with the ivory sections around it) */
.home-v2 .faq-dark { position: relative; overflow: hidden; isolation: isolate; color: #E3F1F4; background: linear-gradient(160deg, #1F6E80 0%, #185769 55%, #134456 100%); }
.home-v2 .faq-dark::before { content: ""; position: absolute; z-index: -1; width: 820px; height: 820px; right: -300px; top: -380px; border-radius: 50%; background: radial-gradient(closest-side, rgba(126, 211, 224, .22), transparent 70%); }
.home-v2 .faq-dark h2 { color: var(--white); }
.home-v2 .faq-dark .section-head p { color: #E0F0F3; }
.home-v2 .faq-dark .faq-item { border-top-color: rgba(255, 255, 255, .22); }
.home-v2 .faq-dark .faq-item:last-of-type { border-bottom: 1px solid rgba(255, 255, 255, .22); }
.home-v2 .faq-dark .faq-item summary h3 { color: var(--white); }
.home-v2 .faq-dark .faq-item summary::after { color: #F3D9A8; }
.home-v2 .faq-dark .faq-item p { color: #E0F0F3; }
.home-v2 .faq-dark .faq-item summary:focus-visible { outline: 2px solid #F3D9A8; outline-offset: 4px; border-radius: 4px; }
.home-v2 .faq-dark .btn-ghost { color: var(--white); border-color: rgba(255, 255, 255, .85); }
.home-v2 .faq-dark .btn-ghost:hover { background: var(--white); color: #134456; }
