/* ============================================================
   THE OLD FARM GATE — STYLE TOKENS
   Every colour, font and measure the site uses is declared here.
   To rebrand, change the values in this block and nothing else.
   Contact details and feature flags live in the CONFIG block at
   the top of index.html.
   ============================================================ */

:root {
  /* Field. Warm white and soft grey, never pure white. */
  --paper:        #FAF8F5;
  --paper-soft:   #F1EEE9;
  --rule:         #E3DED6;

  /* Type. Laila's navy stands in for charcoal everywhere. */
  --ink:          #09033F;
  --ink-mid:      #192853;
  --ink-muted:    #5B5970;
  --on-ink:       #FAF8F5;

  /* Accent. Buttons, links and small marks only. Never a section ground. */
  --accent:       #329CA5;
  --accent-text:  #27777F;
  --accent-dark:  #2A838B;
  --accent-soft:  #E6F3F4;

  /* Feedback */
  --error:        #A3281F;

  /* Type families */
  --font-display: "Playfair Display", Georgia, serif;
  --font-body:    "Montserrat", "Helvetica Neue", Arial, sans-serif;

  /* Rhythm */
  --gap:          1.25rem;
  --section-y:    4.5rem;
  --page-max:     1180px;
  --radius:       2px;
  --sticky-h:     4.5rem;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--sticky-h) + env(safe-area-inset-bottom, 0px));
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.18;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.95rem, 7.4vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 5.6vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, 3.6vw, 1.3rem); }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

.wrap { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 0 1.25rem; }

.section { padding: var(--section-y) 0; }
.section--soft { background: var(--paper-soft); }

.eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 1rem;
}

.lede { font-size: clamp(1.0625rem, 3.4vw, 1.1875rem); color: var(--ink-mid); }

.quiet {
  font-size: 0.875rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--rule);
  padding-top: 1.1rem;
  margin-top: 2rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0.85rem 1.75rem;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.btn:hover, .btn:focus-visible { background: var(--accent-dark); color: #FFFFFF; }
.btn--block { width: 100%; }
.btn--ghost {
  background: transparent;
  color: var(--accent-text);
  border: 1px solid var(--accent);
}
.btn--ghost:hover { background: var(--accent-soft); color: var(--ink); }

.cta-break { padding: 2.5rem 0 0; }
.cta-break .btn { width: 100%; }

:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }

/* ---------- Header: Laila's branding leads ---------- */

.site-header { background: var(--ink); color: var(--on-ink); }
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 4.25rem;
}
.site-header__logo { width: 46px; height: auto; flex: 0 0 auto; }
.site-header__name {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-ink);
  line-height: 1.3;
}
.site-header__role {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: #BFC4DA;
}

/* ---------- Hero ---------- */

.hero { background: var(--paper); }
.hero__media { position: relative; }
.hero__media img { width: 100%; height: auto; }
.hero__mark {
  position: absolute;
  left: 1.25rem;
  top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--paper);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
}
.hero__mark svg { width: 26px; height: 26px; flex: 0 0 auto; color: var(--ink); }
.lockup-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.17em;
  color: var(--ink);
  line-height: 1;
}
.hero__body { padding: 2rem 0 0; }
.hero__body h1 { margin-bottom: 0.7rem; }

.caption {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0.6rem 0 0;
  margin: 0;
}

/* ---------- The homes ---------- */

.features { list-style: none; margin: 2rem 0 0; padding: 0; }
.features li {
  border-top: 1px solid var(--rule);
  padding: 1.25rem 0;
}
.features h3 { margin-bottom: 0.3rem; }
.features p { color: var(--ink-mid); margin: 0; }

.section-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}
.section-mark svg { width: 30px; height: 30px; color: var(--ink); }

/* ---------- Gallery: swipeable, takes more items without restructuring ---------- */

.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 86%;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 1.25rem 0.5rem;
  margin: 2rem -1.25rem 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery figure { margin: 0; scroll-snap-align: center; }
.gallery figure img { width: 100%; height: auto; background: var(--paper-soft); }
.gallery figcaption { padding-top: 0.6rem; }
.gallery__title {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 0.15rem;
}
.gallery-hint {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  margin: 1rem 0 0;
}

/* ---------- Floor plans (hidden behind the flag) ---------- */

#floorplans[hidden] { display: none; }

.tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--rule);
  margin: 1.75rem 0 0;
}
.tabs button {
  flex: 1 1 auto;
  min-height: 3rem;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.plot-toggle {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
}
.plot-toggle button {
  flex: 1 1 0;
  min-height: 2.75rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-mid);
  cursor: pointer;
}
.plot-toggle button[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}

.plan {
  margin: 1.5rem 0 0;
  background: var(--paper-soft);
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: zoom-in;
  width: 100%;
  font-family: var(--font-body);
  color: var(--ink-mid);
}
.plan strong { display: block; font-size: 1rem; color: var(--ink); margin-bottom: 0.4rem; }
.plan span { font-size: 0.8125rem; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(9, 3, 63, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.lightbox[hidden] { display: none; }
.lightbox__inner { max-width: 100%; max-height: 100%; overflow: auto; text-align: center; color: var(--on-ink); }
.lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  min-width: 3rem;
  min-height: 3rem;
  background: none;
  border: 1px solid rgba(250, 248, 245, 0.4);
  color: var(--on-ink);
  font-size: 1.25rem;
  border-radius: var(--radius);
  cursor: pointer;
}

/* ---------- Local area ---------- */

.area-grid { margin-top: 2rem; }
.area-grid > div { border-top: 1px solid var(--rule); padding: 1.25rem 0; }
.area-grid h3 { margin-bottom: 0.3rem; }
.area-grid p { color: var(--ink-mid); margin: 0; }

/* ---------- Register form ---------- */

.form { margin-top: 2rem; }
.field { margin-bottom: 1.4rem; }
.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}
.field .opt { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-muted); }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 0.9rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  appearance: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[aria-invalid="true"] { border-color: var(--error); }

.err { display: none; color: var(--error); font-size: 0.8125rem; margin-top: 0.4rem; }
.err.is-shown { display: block; }

.check { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 1.4rem; }
.check input { width: 1.25rem; height: 1.25rem; margin: 0.25rem 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.check label { font-size: 0.9375rem; font-weight: 400; text-transform: none; letter-spacing: 0; margin: 0; }

.privacy { font-size: 0.8125rem; color: var(--ink-muted); }

.form-success {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 1.5rem;
  border-radius: var(--radius);
}
.form-success[hidden] { display: none; }
.form-success h3 { margin-bottom: 0.4rem; }

/* ---------- Footer: navy band carries the white logo ---------- */

.site-footer { background: var(--ink); color: var(--on-ink); padding: 3rem 0 6.5rem; }
.site-footer h3 { color: var(--on-ink); }
.site-footer a { color: #9FD9DE; }
.site-footer a:hover { color: #FFFFFF; }
.site-footer__logo { width: 100px; height: auto; margin-bottom: 1.5rem; }
.footer-block { padding: 1.5rem 0; border-top: 1px solid rgba(250, 248, 245, 0.18); }
.footer-block:first-of-type { border-top: 0; padding-top: 0; }
.footer-name { font-family: var(--font-display); font-size: 1.25rem; margin: 0 0 0.3rem; }
.footer-meta { font-size: 0.875rem; color: #C5C9DC; }
.footer-mark { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.25rem; }
.footer-mark svg { width: 28px; height: 28px; color: var(--on-ink); }
.footer-mark .lockup-word { color: var(--on-ink); }
.site-footer .legal { font-size: 0.75rem; color: #A4A9C2; margin-top: 1.5rem; }

/* ---------- Sticky mobile registration ---------- */

.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 0.75rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: rgba(250, 248, 245, 0.96);
  border-top: 1px solid var(--rule);
}
.sticky-cta .btn { width: 100%; }

/* ---------- Wider screens ---------- */

@media (min-width: 700px) {
  :root { --section-y: 6rem; }
  .gallery { grid-auto-columns: 48%; }
  .features { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2.5rem; }
  .area-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2.5rem; }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.25rem; }
  .cta-break .btn, .btn--block { width: auto; min-width: 18rem; }
  .site-footer { display: block; }
  .footer-cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3rem; }
  .footer-block:nth-of-type(2) { border-top: 0; padding-top: 0; }
}

@media (min-width: 1000px) {
  :root { --section-y: 7rem; --sticky-h: 0rem; }
  body { padding-bottom: 0; }
  .sticky-cta { display: none; }
  .hero__body { padding-top: 2.75rem; }
  .hero__mark { left: 2rem; top: 2rem; padding: 0.8rem 1.1rem; }
  .hero__mark svg { width: 32px; height: 32px; }
  .lockup-word { font-size: 1.0625rem; }
  .gallery { grid-auto-columns: 42%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Sources note under the local area section ---------- */

.sources {
  margin-top: 2.25rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.1rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}
.sources summary {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  cursor: pointer;
  list-style: none;
  padding: 0.35rem 0;
}
.sources summary::-webkit-details-marker { display: none; }
.sources summary::after { content: " +"; }
.sources[open] summary::after { content: " \2212"; }
.sources p { margin: 0.6rem 0 0; }

/* ============================================================
   MOTION
   ============================================================

   Three constraints hold everything below.

   1. Nothing is hidden unless the browser has said it can run the
      motion. Every hiding rule is scoped to html.js-motion, and that
      class is set by an inline script in the head that first checks
      for IntersectionObserver and for prefers-reduced-motion. No
      script, old browser, or a reader who asked for less motion, and
      the page renders complete and still.
   2. Only transform and opacity are animated. Nothing here changes a
      width, a height, a margin or a padding while the page is moving.
   3. Distances are short and the easing has no overshoot.

   One curve is used throughout, --ease: a decelerating cubic with no
   bounce. Change it here and every movement on the page changes.
   ============================================================ */

:root {
  --ease:       cubic-bezier(0.22, 0.61, 0.36, 1);
  --rise:       14px;
  --dur:        680ms;
  --dur-fast:   220ms;
  --stagger:    80ms;
}

html { scroll-padding-top: 5.5rem; }

/* ---------- Reveal on scroll ----------
   An element with .reveal rises and fades once, when it first comes
   into view. .reveal-group staggers its own children instead, so a
   heading lands before the copy under it. Both become visible by
   having .is-in added; the observer in site.js adds it. */

html.js-motion .reveal,
html.js-motion .reveal-group > * {
  opacity: 0;
  transform: translate3d(0, var(--rise), 0);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  will-change: opacity, transform;
}
html.js-motion .reveal.is-in,
html.js-motion .reveal-group.is-in > * {
  opacity: 1;
  transform: none;
}
html.js-motion .reveal.is-in,
html.js-motion .reveal-group.is-in > * { will-change: auto; }

/* The stagger. Capped at the sixth child so a long list never leaves
   a reader waiting on the bottom of it. */
html.js-motion .reveal-group.is-in > *:nth-child(1) { transition-delay: 0ms; }
html.js-motion .reveal-group.is-in > *:nth-child(2) { transition-delay: var(--stagger); }
html.js-motion .reveal-group.is-in > *:nth-child(3) { transition-delay: calc(var(--stagger) * 2); }
html.js-motion .reveal-group.is-in > *:nth-child(4) { transition-delay: calc(var(--stagger) * 3); }
html.js-motion .reveal-group.is-in > *:nth-child(5) { transition-delay: calc(var(--stagger) * 4); }
html.js-motion .reveal-group.is-in > *:nth-child(n+6) { transition-delay: calc(var(--stagger) * 5); }

/* The feature list and the area grid carry their own items, so they
   stagger per item rather than as one block, and they opt out of their
   section's group so nothing fades twice. */
html.js-motion .reveal-group > .features,
html.js-motion .reveal-group > .area-grid {
  opacity: 1;
  transform: none;
  transition: none;
}
html.js-motion .features li,
html.js-motion .area-grid > div {
  opacity: 0;
  transform: translate3d(0, var(--rise), 0);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
html.js-motion .features.is-in li,
html.js-motion .area-grid.is-in > div { opacity: 1; transform: none; }
html.js-motion .features.is-in li:nth-child(2),
html.js-motion .area-grid.is-in > div:nth-child(2) { transition-delay: var(--stagger); }
html.js-motion .features.is-in li:nth-child(3),
html.js-motion .area-grid.is-in > div:nth-child(3) { transition-delay: calc(var(--stagger) * 2); }
html.js-motion .features.is-in li:nth-child(4),
html.js-motion .area-grid.is-in > div:nth-child(4) { transition-delay: calc(var(--stagger) * 3); }
html.js-motion .area-grid.is-in > div:nth-child(5) { transition-delay: calc(var(--stagger) * 4); }
html.js-motion .area-grid.is-in > div:nth-child(6) { transition-delay: calc(var(--stagger) * 5); }

/* ---------- Hero ----------
   The elevation holds a slow one-way drift: it scales up a little over
   half a minute and decelerates to a stop. It runs once. There is no
   loop and no direction change, so nothing about it reads as a
   slideshow. The frame is fixed by aspect-ratio, so the drift cannot
   move the headline underneath it. */

/* The frame is fixed before the image arrives, so nothing below it
   moves as it loads. On a phone that is the image's own 3:2. On a wide
   screen 3:2 would be most of the window and would push the headline
   off the bottom, so the frame is capped against the viewport height
   and the image is cropped into it. The headline and the register
   button are on the first screen at every width. */
.hero__media {
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--paper-soft);
}
@media (min-width: 700px) {
  .hero__media { aspect-ratio: auto; height: clamp(320px, 56vh, 620px); }
  /* The crop is held high so the roof and the dormers stay in it. */
  .hero__media img { object-position: center 30%; transform-origin: 50% 40%; }
}
.hero__media img {
  height: 100%;
  object-fit: cover;
  transform-origin: 52% 60%;
}
html.js-motion .hero__media img {
  animation: hero-drift 34s var(--ease) 240ms both;
}
@keyframes hero-drift {
  from { transform: scale(1.005); }
  to   { transform: scale(1.075); }
}

/* Headline, lede and button arrive in sequence. The caption above them
   is part of the same run so the block reads as one movement. */
html.js-motion .hero .wrap > .caption,
html.js-motion .hero__body > * {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  animation: hero-in 900ms var(--ease) both;
}
html.js-motion .hero .wrap > .caption { animation-delay: 120ms; }
html.js-motion .hero__body > h1     { animation-delay: 220ms; }
html.js-motion .hero__body > .lede  { animation-delay: 380ms; }
html.js-motion .hero__body > p:last-child { animation-delay: 520ms; }

@keyframes hero-in {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to   { opacity: 1; transform: none; }
}

/* The gate mark draws itself once, on the hero only. The frame, then the
   three middle bars, then the brace are stroked in over a second and a
   half, then it is left alone for the rest of the page. Each dash length
   below is that path's own measured length, rounded up, so every stroke
   is hidden at the start and complete at the end. */

html.js-motion .hero__mark {
  opacity: 0;
  animation: hero-in 700ms var(--ease) 700ms both;
}
html.js-motion .hero__mark svg .m-frame,
html.js-motion .hero__mark svg .m-bars,
html.js-motion .hero__mark svg .m-brace {
  animation: mark-draw 1500ms var(--ease) 820ms both;
}
html.js-motion .hero__mark svg .m-frame {
  stroke-dasharray: 136;
  stroke-dashoffset: 136;
}
html.js-motion .hero__mark svg .m-bars {
  stroke-dasharray: 114;
  stroke-dashoffset: 114;
  animation-delay: 1000ms;
}
html.js-motion .hero__mark svg .m-brace {
  stroke-dasharray: 49;
  stroke-dashoffset: 49;
  animation-delay: 1200ms;
}
html.js-motion .hero__mark .lockup-word {
  opacity: 0;
  animation: hero-in 700ms var(--ease) 1500ms both;
}
@keyframes mark-draw {
  to { stroke-dashoffset: 0; }
}

/* ---------- Typographic care ----------
   Lining, tabular numerals so 2027 sits level with the caps around it,
   and a little tracking on the year in the headline. The two house
   names get a hairline rule that draws out under them when the heading
   reveals. */

body { font-feature-settings: "kern" 1, "liga" 1; }
h1, h2, h3, .lede { font-variant-numeric: lining-nums; }
.num { letter-spacing: 0.015em; font-variant-numeric: lining-nums tabular-nums; }

/* The heading that carries the rules is given a little more leading,
   so a rule under a wrapped first line never crowds the second. */
#the-homes h2 { line-height: 1.45; }
.named {
  position: relative;
  display: inline-block;
}
.named::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.18em;
  height: 1px;
  background: var(--accent);
  transform-origin: left center;
}
/* The rule is drawn by default and only collapsed where it is going to
   be animated, so a page with the motion off still has it. */
html.js-motion .named::after { transform: scaleX(0); }
html.js-motion .reveal-group.is-in .named::after,
html.js-motion .reveal.is-in .named::after {
  transform: scaleX(1);
  transition: transform 900ms var(--ease) 420ms;
}

/* ---------- Header: settles on scroll ----------
   The band is sticky. Past the first screen it gains a hairline and a
   shadow, the logo scales down a touch and the role line fades out.
   Nothing here changes the band's height, so no content under it ever
   moves. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 55;
  box-shadow: 0 0 0 rgba(9, 3, 63, 0);
  transition: box-shadow var(--dur-fast) var(--ease);
}
.site-header .wrap { min-height: 3.9rem; }
.site-header__logo { transition: transform var(--dur-fast) var(--ease); transform-origin: left center; }
.site-header__role { transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }

.site-header.is-settled { box-shadow: 0 1px 18px rgba(9, 3, 63, 0.28); }
.site-header.is-settled .site-header__logo { transform: scale(0.82); }
.site-header.is-settled .site-header__role { opacity: 0; transform: translate3d(0, -3px, 0); }

/* ---------- Gallery ----------
   Snapped on both pointer types. On a phone it is a swipe. On a desktop
   it is a drag, with the cursor saying so, plus two arrow buttons.
   A fade on each edge says there is more that way, and it goes when
   there is not. The caption of the image in the middle is full ink and
   the rest sit back, so they stop competing with the pictures. */

.gallery-frame { position: relative; margin: 2rem -1.25rem 0; }
.gallery { margin: 0; }

.gallery-frame::before,
.gallery-frame::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3rem;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.gallery-frame::before { left: 0;  background: linear-gradient(to right, var(--paper), rgba(250, 248, 245, 0)); }
.gallery-frame::after  { right: 0; background: linear-gradient(to left,  var(--paper), rgba(250, 248, 245, 0)); }
.section--soft .gallery-frame::before { background: linear-gradient(to right, var(--paper-soft), rgba(241, 238, 233, 0)); }
.section--soft .gallery-frame::after  { background: linear-gradient(to left,  var(--paper-soft), rgba(241, 238, 233, 0)); }
.gallery-frame.has-prev::before { opacity: 1; }
.gallery-frame.has-next::after  { opacity: 1; }

.gallery.is-draggable { cursor: grab; }
.gallery.is-dragging  { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.gallery.is-dragging img { pointer-events: none; }

.gallery figure img { transition: opacity var(--dur) var(--ease); }
.gallery figcaption {
  transition: opacity var(--dur-fast) var(--ease);
}
/* Scoped to is-marked, which the observer that tracks the centred
   figure adds to the scroller itself. No observer, no dimming: the
   captions are content, and they are never left sitting at
   three-quarters strength with nothing able to bring one forward. */
.gallery.is-marked figcaption { opacity: 0.45; }
.gallery.is-marked figure.is-active figcaption { opacity: 1; }

.gallery-foot { margin-top: 1rem; }
.gallery-hint { margin: 0; }
.gallery-nav { display: none; }

@media (min-width: 700px) {
  .gallery-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }
  .gallery-nav {
    display: flex;
    gap: 0.5rem;
    flex: 0 0 auto;
  }
  .gallery-nav button {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    color: var(--ink);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease),
                border-color var(--dur-fast) var(--ease),
                transform var(--dur-fast) var(--ease),
                opacity var(--dur-fast) var(--ease);
  }
  .gallery-nav button:hover { background: var(--accent-soft); border-color: var(--accent); }
  .gallery-nav button:active { transform: scale(0.94); }
  .gallery-nav button[disabled] { opacity: 0.3; cursor: default; }
  .gallery-nav svg { width: 15px; height: 15px; }
}

/* ---------- Button and field states ---------- */

.btn {
  transition: background var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  box-shadow: 0 1px 2px rgba(9, 3, 63, 0.10);
}
.btn:hover {
  transform: translate3d(0, -1px, 0);
  box-shadow: 0 6px 18px rgba(9, 3, 63, 0.18);
}
.btn:active {
  transform: translate3d(0, 0, 0) scale(0.985);
  box-shadow: 0 1px 2px rgba(9, 3, 63, 0.12);
}

/* The focus ring is two rings: a white gap against the warm white, then
   the accent. It reads at a glance and does not sit on the colour. */
:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
}
.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px var(--accent-soft), 0 6px 18px rgba(9, 3, 63, 0.18);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select {
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
.field input:hover, .field select:hover { border-color: var(--ink-muted); }
.field input:focus, .field select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input:focus-visible, .field select:focus-visible { outline: none; }

/* The error line keeps its display toggle, so no height is ever
   animated. The fade and the short rise come from a keyframe, which
   runs on the frame the element becomes visible. */
.err.is-shown { animation: err-in 260ms var(--ease) both; }
@keyframes err-in {
  from { opacity: 0; transform: translate3d(0, -4px, 0); }
  to   { opacity: 1; transform: none; }
}

.check label { transition: color var(--dur-fast) var(--ease); }
.check:hover label { color: var(--ink); }

/* The success panel resolves in rather than appearing finished. */
#register-success {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
}
#register-success.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 560ms var(--ease), transform 560ms var(--ease);
}

/* ---------- Sticky registration button ----------
   It is a second copy of a button already on the page, so hiding it
   hides nothing. It arrives once the hero button has gone off the top,
   and it leaves when the registration form itself is on screen. With
   no script it simply stays, which is the behaviour the page shipped
   with. */

html.js-cta .sticky-cta {
  transform: translate3d(0, calc(100% + 1px), 0);
  transition: transform 420ms var(--ease);
  will-change: transform;
}
html.js-cta .sticky-cta.is-up { transform: none; }

/* ---------- Floor plan tabs and the plot toggle ---------- */

.tabs button, .plot-toggle button, .plan {
  transition: color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.tabs button:hover, .plot-toggle button:hover { color: var(--ink); }
.plot-toggle button:active, .tabs button:active { transform: scale(0.98); }
.plan:hover { border-color: var(--accent); }

.sources summary { transition: color var(--dur-fast) var(--ease); }
.sources summary:hover { color: var(--ink); }

/* ---------- Reduced motion ----------
   Asked for less motion, and there is none. Every animation and every
   transition is off, and anything the observer would have revealed is
   drawn in its finished state. The page is whole and unchanged in
   every other respect. The inline script in the head never sets
   html.js-motion in this case, so the hiding rules above never apply
   either; this block is the second line of defence. */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
  html { scroll-behavior: auto; }
  .hero__media img { transform: none; }
  .named::after { transform: scaleX(1); }
  #register-success { opacity: 1; transform: none; }
}
