/* Keyhaven design tokens — the CMS Colours and Fonts tabs map onto these custom properties. */
:root {
  --color-primary: #2a2770;
  --color-primary-dark: #1d1a55;
  --color-secondary: #1b1a3b;
  --color-accent: #8c7af0;
  --color-accent-soft: #efebfd;
  --color-rose: #e0567f;
  --color-surface: #f3f3fa;
  --color-surface-soft: #fafafd;
  --color-default: #5a5c75;
  --color-muted: #8d8fa5;
  --color-line: #e8e8f2;
  --color-white: #ffffff;
  --font-default: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-primary: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-heading: 'Plus Jakarta Sans', system-ui, sans-serif;
  --radius: 24px;
  --radius-sm: 16px;
  --section-max-width: 80rem;
  --header-h: 84px;
  --section-pad-y: 96px;
  --base-size: 16px;
  --shadow: 0 18px 50px -30px color-mix(in srgb, var(--color-primary) 45%, transparent);
  --shadow-lg: 0 30px 70px -36px color-mix(in srgb, var(--color-primary) 55%, transparent);
  --ease: cubic-bezier(.2, .75, .25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: var(--base-size); scroll-behavior: smooth; }
body {
  font-family: var(--font-default); color: var(--color-default); line-height: 1.65; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(42rem 42rem at 104% 22rem, color-mix(in srgb, var(--color-accent) 22%, transparent), transparent 70%),
    radial-gradient(36rem 30rem at -8% 75rem, color-mix(in srgb, var(--color-accent) 12%, transparent), transparent 70%),
    var(--color-surface);
  background-repeat: no-repeat;
}
h1, h2, h3, h4, h5 { font-family: var(--font-heading); color: var(--color-secondary); font-weight: 600; line-height: 1.14; letter-spacing: -.025em; }
a { color: inherit; text-decoration: none; transition: color .25s ease; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
::selection { background: var(--color-accent); color: #fff; }

.container { max-width: var(--section-max-width); margin: 0 auto; padding: 0 24px; }
section { padding: var(--section-pad-y) 0; position: relative; }
section, footer { overflow-x: clip; }
section.tight { padding-top: calc(var(--section-pad-y) * .55); }
section.white { background: #fff; }
section.dark { background: var(--color-primary); color: color-mix(in srgb, #fff 78%, transparent); }
section.dark h2, section.dark h3 { color: #fff; }

/* the accent words in a headline */
.hl { color: var(--color-accent); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem; padding: .95rem 1.6rem; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--color-primary); color: #fff; font-weight: 600; font-size: .92rem; line-height: 1; white-space: nowrap;
  transition: background .3s ease, color .3s ease, transform .3s var(--ease), box-shadow .3s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { background: var(--color-primary-dark); transform: translateY(-2px); box-shadow: 0 16px 30px -14px color-mix(in srgb, var(--color-primary) 70%, transparent); }
.btn.light { background: #fff; color: var(--color-primary); }
.btn.light:hover { background: #fff; }
.btn.soft { background: var(--color-accent-soft); color: var(--color-primary); }
.btn.soft:hover { background: color-mix(in srgb, var(--color-accent) 22%, #fff); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--color-primary); box-shadow: inset 0 0 0 1.5px var(--color-line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--color-primary); }
.btn.small { padding: .7rem 1.1rem; font-size: .86rem; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }
/* text link with an arrow ("View All Properties →") */
.arrow-link { display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; font-size: .92rem; color: var(--color-primary); }
.arrow-link svg { width: 20px; height: 20px; transition: transform .3s var(--ease); }
.arrow-link:hover svg { transform: translateX(4px); }
.arrow-link:hover { color: var(--color-accent); }

/* ── Section heads: lavender eyebrow, headline with accent words ── */
.eyebrow { display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--color-accent); }
section.dark .eyebrow { color: color-mix(in srgb, var(--color-accent) 55%, #fff); }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); margin-top: .7rem; }
.section-head p { margin-top: .9rem; font-size: 1.04rem; max-width: 60ch; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center p { margin-left: auto; margin-right: auto; }
.section-head.split { max-width: none; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 40px; }
.section-head.split p { max-width: 52ch; }

/* a white card */
.card-white { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-weight: 600; font-size: .8rem; color: var(--color-secondary); margin-bottom: .35rem; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; background: var(--color-surface-soft); border: 1.5px solid var(--color-line); border-radius: 12px; padding: .8rem 1rem; color: var(--color-secondary);
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: none; background: #fff; border-color: var(--color-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 16%, transparent); }
.form-grid ::placeholder { color: color-mix(in srgb, var(--color-muted) 75%, #fff); }
.form-grid .check { display: flex; gap: .6rem; align-items: flex-start; font-size: .86rem; font-weight: 500; }
.form-grid .check input { width: auto; margin-top: .25rem; }
.field-err { color: #c0362c; font-size: .82rem; margin-top: .35rem; }
.form-note { font-size: .8rem; color: var(--color-muted); }
.form-ok { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius-sm); background: color-mix(in srgb, #2e9e62 12%, #fff); color: #1d6b41; }
.form-ok svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.form-bad { padding: 12px 16px; border-radius: 12px; background: #fdecea; color: #a12e24; font-size: .9rem; }

/* a tick list, the tick drawn in CSS so it follows the theme colours */
.tick-list { list-style: none; display: grid; gap: .6rem; }
.tick-list li { position: relative; padding-left: 1.8rem; font-size: .95rem; }
.tick-list li::before { content: ''; position: absolute; left: 0; top: .22em; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--color-accent-soft); }
.tick-list li::after { content: ''; position: absolute; left: .41rem; top: .45em; width: .3rem; height: .55rem; border: solid var(--color-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* rating stars */
.stars { display: inline-flex; gap: 2px; color: #f5b400; }
.stars svg { width: 15px; height: 15px; fill: currentColor; }

/* a property's label chip (Featured / New / Hot Deal / Reduced) */
.tag { display: inline-flex; align-items: center; padding: .3rem .7rem; border-radius: 8px; font-size: .74rem; font-weight: 600; background: #fff; color: var(--color-secondary); }
.tag.featured { background: var(--color-accent-soft); color: var(--color-accent); }
.tag.hot-deal { background: color-mix(in srgb, var(--color-rose) 14%, #fff); color: var(--color-rose); }
.tag.reduced { background: color-mix(in srgb, #2e9e62 14%, #fff); color: #1d7a4a; }
.tag.let { background: var(--color-secondary); color: #fff; }

/* round icon tiles in four soft tints */
.tint { display: grid; place-items: center; border-radius: 50%; flex: none; }
.tint svg { width: 46%; height: 46%; }
.tint.lavender { background: var(--color-accent-soft); color: var(--color-accent); }
.tint.indigo { background: color-mix(in srgb, var(--color-primary) 10%, #fff); color: var(--color-primary); }
.tint.sky { background: color-mix(in srgb, #3b82f6 12%, #fff); color: #2f6fd8; }
.tint.rose { background: color-mix(in srgb, var(--color-rose) 13%, #fff); color: var(--color-rose); }

/* ── Header logo ── */
.logo { display: inline-flex; align-items: center; gap: .65rem; font: 700 1.3rem var(--font-heading); color: var(--color-secondary); letter-spacing: -.03em; min-width: 0; }
.logo img { max-height: 44px; width: auto; max-width: min(46vw, 240px); object-fit: contain; }
.logo .mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--color-primary); background: #fff; box-shadow: inset 0 0 0 1.5px var(--color-line); }
.logo .mark svg { width: 24px; height: 24px; }
.logo .wordmark { display: inline-flex; flex-direction: column; justify-content: center; line-height: 1.05; min-width: 0; }
.logo .wl { display: block; }
.logo .sub { display: block; margin-top: .3em; font-size: .52em; font-weight: 500; letter-spacing: .01em; color: var(--color-muted); }

/* ══ Motion: section-enter animations (plugins/motion.client.ts) ══
   Hidden states apply only while html.hg-motion is set and the section has not
   entered the frame yet; --i staggers siblings, --d adds a fixed delay. */
.hg-motion [data-anim] {
  transition:
    opacity .8s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0ms)),
    transform 1s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0ms)),
    filter .9s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0ms)),
    clip-path 1.1s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0ms));
}
.hg-motion section:not(.hg-inview) [data-anim], .hg-motion footer:not(.hg-inview) [data-anim] { opacity: 0; }
.hg-motion section:not(.hg-inview) [data-anim="up"], .hg-motion footer:not(.hg-inview) [data-anim="up"] { transform: translateY(36px); }
.hg-motion section:not(.hg-inview) [data-anim="down"] { transform: translateY(-30px); }
.hg-motion section:not(.hg-inview) [data-anim="left"] { transform: translateX(56px); }
.hg-motion section:not(.hg-inview) [data-anim="right"] { transform: translateX(-56px); }
.hg-motion section:not(.hg-inview) [data-anim="zoom"] { transform: scale(.9); }
.hg-motion section:not(.hg-inview) [data-anim="blur"] { filter: blur(12px); transform: scale(1.03); }
.hg-motion section:not(.hg-inview) [data-anim="pop"] { transform: translateY(16px) scale(.85); }
.hg-motion section:not(.hg-inview) [data-anim="rise"] { clip-path: inset(0 0 100% 0); transform: translateY(40%); }
.hg-motion section.hg-inview [data-anim="rise"] { clip-path: inset(-10% -5% -20% -5%); }
.hg-motion section:not(.hg-inview) [data-anim="clip"] { opacity: 1; clip-path: inset(0 0 100% 0 round var(--radius)); }
.hg-motion section.hg-inview [data-anim="clip"] { clip-path: inset(0 0 0 0 round var(--radius)); }
.hg-motion [data-anim="clip"] img { transition: transform 1.6s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0ms)); }
.hg-motion section:not(.hg-inview) [data-anim="clip"] img { transform: scale(1.15); }

@keyframes kh-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.float { animation: kh-float 6s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .float { animation: none; }
}
@media (max-width: 640px) {
  :root { --section-pad-y: 68px; --radius: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .section-head { margin-bottom: 32px; }
}
