/* ==========================================================================
   Les Terrasses d'Hermance
   One day on the lake. js/main.js writes the live colours (--bg, --fg, ...)
   onto :root while you scroll. The values below are the fallback, which is
   also used when JavaScript is off or when "reduce motion" is on.
   Type: Instrument Serif (display) + Hanken Grotesk (text), self-hosted in fonts/
   ========================================================================== */

/* Self-hosted typefaces (latin subset). Files are in ../fonts */
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("../fonts/hanken-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* live palette (overwritten by JS) */
  --bg: #e4eff4;
  --bg-top: #bbd9ec;
  --bg-rgb: 228 239 244;
  --fg: #12202c;
  --fg-rgb: 18 32 44;
  --accent: #17678f;
  --glow-rgb: 255 243 208;
  --sun-rgb: 255 251 234;
  --sun-o: .3;
  --sun-blur: 34px;
  --hz-o: 0;
  --hz-rgb: 20 30 50;
  --hz-top-rgb: 40 50 80;

  /* derived */
  --muted: rgb(var(--fg-rgb) / .72);
  --line: rgb(var(--fg-rgb) / .22);
  --tint: rgb(var(--fg-rgb) / .06);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 5vw, 72px);
  --max: 1360px;
  --header-h: 68px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: clamp(1rem, .96rem + .2vw, 1.125rem);
  line-height: 1.65;
  font-weight: 400;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--bg); }

.skip {
  position: fixed; left: 12px; top: -80px; z-index: 200;
  background: #fff; color: #000; padding: 10px 16px; border-radius: 4px; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.012em; }
h2 { font-size: clamp(2.5rem, 1.4rem + 4.4vw, 5.2rem); line-height: 1; text-wrap: balance; }
h3 { font-size: 1.7rem; line-height: 1.1; }
p { max-width: 60ch; color: var(--muted); }
.lead {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem);
  line-height: 1.22;
  color: var(--fg);
  max-width: 34ch;
  margin-top: 1.4rem;
}
h2 + p:not(.lead) { margin-top: 1.4rem; }
.lead + p { margin-top: 1.1rem; }

/* ---------- Sky: fixed backdrop ---------- */
.sky {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 78%);
}
.sky::after {
  content: ""; position: absolute; inset: 0; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.sky-sun {
  --size: clamp(92px, 15vmin, 180px);
  position: absolute; left: 0; top: 0;
  width: var(--size); height: var(--size); border-radius: 50%;
  background: radial-gradient(circle at 50% 46%, rgb(var(--sun-rgb)) 0, rgb(var(--sun-rgb)) 45%, rgb(var(--glow-rgb)) 100%);
  opacity: var(--sun-o);
  filter: blur(var(--sun-blur, 0px));
  box-shadow:
    0 0 calc(var(--size) * .5) calc(var(--size) * .1) rgb(var(--glow-rgb) / .7),
    0 0 calc(var(--size) * 1.8) calc(var(--size) * .5) rgb(var(--glow-rgb) / .36),
    0 0 calc(var(--size) * 4.5) calc(var(--size) * 1.2) rgb(var(--glow-rgb) / .15);
  transform: translate3d(70vw, 12vh, 0) translate(-50%, -50%);
  will-change: transform;
}
.sky-horizon {
  position: absolute; left: 0; right: 0; bottom: 0; height: 22vh;
  opacity: var(--hz-o);
  background: linear-gradient(180deg, rgb(var(--hz-top-rgb)) 0, rgb(var(--hz-rgb)) 100%);
  border-top: 1px solid rgb(var(--glow-rgb) / .55);
}
.sky-horizon::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg, rgb(var(--glow-rgb) / .38) 0 1.5px, transparent 1.5px 10px);
  -webkit-mask-image: radial-gradient(ellipse 7vw 100% at var(--sun-px, 50%) 0%, #000 0, transparent 100%);
          mask-image: radial-gradient(ellipse 7vw 100% at var(--sun-px, 50%) 0%, #000 0, transparent 100%);
}
.sky-horizon::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 18vw 100% at var(--sun-px, 50%) 0%, rgb(var(--glow-rgb) / .5), transparent 74%);
}

/* time readout */
.clock {
  position: fixed; right: var(--gutter); bottom: 18px; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  font-size: .86rem; letter-spacing: .08em; font-variant-numeric: tabular-nums;
  color: var(--fg); opacity: .82; pointer-events: none;
  padding: 6px 12px; border-radius: 99px;
  background: rgb(var(--bg-rgb) / .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.clock-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgb(var(--sun-rgb)); box-shadow: 0 0 10px 2px rgb(var(--glow-rgb) / .9);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  color: #fff;
  transition: background-color .5s var(--ease), color .5s var(--ease), box-shadow .5s var(--ease);
}
.site-header.scrolled {
  color: var(--fg);
  background: rgb(var(--bg-rgb) / .78);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 var(--line);
}
.header-inner {
  max-width: var(--max); margin-inline: auto; padding: 0 var(--gutter);
  height: var(--header-h); display: flex; align-items: center; gap: 28px;
}
.wordmark { font-family: var(--serif); font-size: 1.55rem; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; margin-right: auto; }
.nav { display: flex; gap: clamp(16px, 2.2vw, 34px); }
.nav a { text-decoration: none; font-size: .95rem; padding: 6px 0; position: relative; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); }

.menu-btn {
  display: none; position: relative; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; margin-right: -8px;
}
.menu-btn span {
  position: absolute; left: 10px; right: 10px; height: 1.5px; background: currentColor;
  transition: transform .4s var(--ease), top .4s var(--ease);
}
.menu-btn span:nth-child(1) { top: 17px; }
.menu-btn span:nth-child(2) { top: 26px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { top: 21.5px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { top: 21.5px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg); color: var(--fg);
  display: flex; align-items: center; padding: calc(var(--header-h) + 10px) var(--gutter) 40px;
  opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility 0s .4s;
}
.menu[hidden] { display: none; }
.menu.open { opacity: 1; visibility: visible; transition: opacity .4s var(--ease); }
.menu nav { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.menu a {
  font-family: var(--serif); font-size: clamp(2.4rem, 11vw, 3.6rem); line-height: 1.15; text-decoration: none;
  padding: 4px 0; border-bottom: 1px solid var(--line);
}
body.menu-open { overflow: hidden; }
body.menu-open .site-header { color: var(--fg); background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 48px; padding: 0 26px; border-radius: 99px; border: 1px solid transparent;
  font-size: .98rem; font-weight: 500; letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: background-color .3s, color .3s, border-color .3s, transform .3s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-small { min-height: 40px; padding: 0 20px; font-size: .9rem; border-color: currentColor; }
.btn-small:hover { background: #fff; color: #10202c; border-color: #fff; }
.site-header.scrolled .btn-small:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-light { background: #fff; color: #10202c; }
.btn-light:hover { background: #dff0fa; }
.btn-ghost { border-color: rgb(255 255 255 / .7); color: #fff; }
.btn-ghost:hover { background: rgb(255 255 255 / .16); }
.btn-solid { background: var(--fg); color: var(--bg); }
.btn-solid:hover { background: rgb(var(--fg-rgb) / .85); }
.btn-wide { width: 100%; }

/* ---------- Hero ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; color: #fff; background: #1d4a6e; }
.hero-media { position: absolute; inset: 0; animation: heroSettle 7s var(--ease) both; }
.hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: 38% 50%; transform-origin: 38% 60%;
  transform: translate3d(0, calc(var(--hero-p, 0) * 6vh), 0) scale(calc(1.04 + var(--hero-p, 0) * .16));
  will-change: transform;
}
.hero-media picture { display: block; width: 100%; height: 100%; }
/* phones and portrait tablets get the portrait crop (see <source> in index.html); keep this query identical */
@media (max-aspect-ratio: 3/4) {
  .hero-media img { object-position: 50% 50%; transform-origin: 50% 60%; }
}
@keyframes heroSettle { from { transform: scale(1.14); } to { transform: scale(1); } }
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgb(6 22 38 / .5) 0, rgb(6 22 38 / 0) 22%),
    linear-gradient(0deg, rgb(6 22 38 / .72) 0, rgb(6 22 38 / .4) 22%, rgb(6 22 38 / 0) 46%),
    linear-gradient(90deg, rgb(6 22 38 / .42) 0, rgb(6 22 38 / 0) 58%);
}
.hero-top { position: absolute; left: 0; right: 0; top: calc(var(--header-h) + clamp(20px, 7vh, 80px)); max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.hero-copy {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: var(--max); margin-inline: auto;
  padding: 0 var(--gutter) clamp(44px, 9vh, 96px);
}
.hero h1 {
  font-size: clamp(3.4rem, 1rem + 10.5vw, 10.5rem); line-height: .9; letter-spacing: -.025em;
  text-shadow: 0 2px 40px rgb(5 20 35 / .35);
  animation: rise 1s .1s var(--ease) both;
}
.hero-sub { color: rgb(255 255 255 / .95); font-size: clamp(1.05rem, .95rem + .5vw, 1.35rem); max-width: 60ch; text-shadow: 0 1px 18px rgb(5 20 35 / .55); animation: rise 1s .25s var(--ease) both; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 12px; margin-top: 1.3rem; animation: rise 1s .4s var(--ease) both; }
.hero-price { color: rgb(255 255 255 / .95); font-family: var(--serif); font-style: italic; font-size: 1.5rem; margin-left: 14px; max-width: none; text-shadow: 0 1px 18px rgb(5 20 35 / .55); }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.hero-cue {
  position: absolute; right: var(--gutter); bottom: clamp(56px, 11vh, 120px);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: .8rem; letter-spacing: .06em; color: rgb(255 255 255 / .85);
  writing-mode: vertical-rl; transform: rotate(180deg);
}
.hero-cue i { width: 1px; height: 64px; background: linear-gradient(180deg, rgb(255 255 255 / .9), rgb(255 255 255 / 0)); animation: cue 2.6s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Sections ---------- */
.section { position: relative; padding-block: clamp(5rem, 11vw, 9.5rem); }
section[id] { scroll-margin-top: calc(var(--header-h) - 4px); }
.hero[id] { scroll-margin-top: 0; }

/* images */
figure img { width: 100%; }
.arch, .arch img { border-radius: 999px 999px 0 0; }
.arch { overflow: hidden; }
figure figcaption { font-size: .9rem; color: var(--muted); margin-top: .8rem; max-width: 52ch; }

/* ---- view ---- */
.view-grid {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(16px, 2.4vw, 36px); row-gap: clamp(36px, 6vw, 80px);
  align-items: start;
}
.view-text { grid-column: 1 / span 5; grid-row: 1; padding-top: clamp(0px, 4vw, 60px); }
.view-steamer { grid-column: 8 / span 5; grid-row: 1 / span 2; }
.view-quay { grid-column: 1 / span 6; grid-row: 2; align-self: end; }
.view-quay img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; }

/* ---- figures ---- */
.figs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 clamp(16px, 3vw, 48px);
  margin-top: clamp(3rem, 7vw, 6rem);
}
.fig { display: flex; flex-direction: column-reverse; justify-content: flex-end; border-top: 1px solid var(--fg); padding-top: 1.1rem; }
.fig dd { font-family: var(--serif); font-size: clamp(3.6rem, 1.6rem + 6.4vw, 8rem); line-height: .95; letter-spacing: -.03em; white-space: nowrap; }
.fig dd sup { font-size: .32em; vertical-align: top; position: relative; top: .35em; margin-left: .12em; letter-spacing: 0; font-family: var(--sans); font-weight: 400; }
.fig dt { color: var(--muted); font-size: .95rem; margin-top: .9rem; max-width: 18ch; }

/* ---- terrace ---- */
.terrace-photo img { aspect-ratio: 16 / 10; object-fit: cover; object-position: 50% 38%; border-radius: 3px; }
.terrace .wrap { position: relative; }
.terrace-card {
  position: relative; z-index: 2;
  width: min(480px, calc(100% - 40px)); margin: -9vw 0 0 clamp(20px, 5vw, 80px);
  padding: clamp(24px, 3vw, 44px);
  background: rgb(var(--bg-rgb) / .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 3px; box-shadow: 0 30px 80px -30px rgb(0 0 0 / .35);
}
.terrace-card h2 { font-size: clamp(2.2rem, 1.2rem + 3vw, 3.6rem); }
.terrace-card p { margin-top: 1rem; }

/* ---- home ---- */
.home-head { max-width: 760px; margin-bottom: clamp(3rem, 7vw, 6rem); }
.rooms {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(16px, 2.4vw, 36px); row-gap: clamp(48px, 8vw, 110px);
}
.room figcaption { font-size: .98rem; margin-top: 1rem; }
.room figcaption b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.9rem; line-height: 1.1; color: var(--fg); margin-bottom: .35rem; }
.room .frame img { object-fit: cover; }
.room-living { grid-column: 1 / span 8; }
.room-living .frame img { aspect-ratio: 4 / 3; border-radius: 3px; }
.room-bedroom { grid-column: 5 / span 8; }
.room-bedroom .frame img { aspect-ratio: 4 / 3; border-radius: 3px; }
.room-bath { grid-column: 2 / span 4; }
.room-bath .frame img { aspect-ratio: 3 / 4.4; }
.room-wc { grid-column: 8 / span 3; margin-top: clamp(40px, 9vw, 140px); }
.room-wc .frame img { aspect-ratio: 3 / 4.8; }

/* ---- residence ---- */
.res-top { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(16px, 2.4vw, 36px); row-gap: 48px; align-items: center; }
.res-text { grid-column: 1 / span 5; }
.plate { grid-column: 7 / span 6; }
.plate-inner { padding: clamp(10px, 1.4vw, 18px); background: rgb(var(--fg-rgb) / .07); border: 1px solid var(--line); border-radius: 3px; }
.plate-inner img { border-radius: 1px; }
.plate figcaption { font-style: italic; }
.specs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 clamp(16px, 3vw, 44px);
  margin-top: clamp(4rem, 9vw, 8rem);
}
.spec { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.spec h3 { margin-bottom: 1rem; }
.spec li { color: var(--muted); font-size: .98rem; padding: .35rem 0; line-height: 1.4; }
.spec li + li { border-top: 1px solid rgb(var(--fg-rgb) / .1); }
.basement {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(16px, 2.4vw, 36px); row-gap: 32px;
  margin-top: clamp(4rem, 9vw, 8rem); align-items: end;
}
.base-garage { grid-column: 1 / span 7; }
.base-garage img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; }
.base-cellar { grid-column: 9 / span 4; }
.base-cellar img { aspect-ratio: 3 / 4; object-fit: cover; }

/* ---- village ---- */
.village-grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(16px, 2.4vw, 36px); row-gap: 48px; align-items: center; }
.village-photo { grid-column: 1 / span 5; }
.village-photo img { aspect-ratio: 3 / 4.2; object-fit: cover; }
.village-text { grid-column: 7 / span 6; }
.distances { margin-top: clamp(2rem, 4vw, 3rem); display: grid; gap: 1.4rem; max-width: 560px; }
.dist { display: grid; grid-template-columns: 9.5rem 1fr auto; align-items: center; gap: 1rem; font-size: .98rem; }
.dist-name { color: var(--fg); }
.dist-val { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dist-bar { position: relative; height: 1px; background: var(--line); }
.dist-bar i { position: absolute; left: 0; top: -1px; height: 3px; width: calc(var(--w) / 45 * 100%); background: var(--accent); border-radius: 3px; transform-origin: left; }
.facts { margin-top: clamp(2rem, 4vw, 3rem); }
.facts li { color: var(--muted); padding: .7rem 0; border-top: 1px solid var(--line); max-width: 560px; }
.facts li:last-child { border-bottom: 1px solid var(--line); }

/* ---- evenings: sticky cross-fade ---- */
.evenings { position: relative; height: 260vh; color: #fff; --ev: 0; }
.eve-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: #1a1230; }
.eve-layer { position: absolute; inset: 0; }
.eve-layer img { width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1.02 + var(--ev) * .1)); will-change: transform; }
.eve-2 { opacity: clamp(0, calc((var(--ev) - .35) * 3.4), 1); }
.eve-2 img { object-position: 50% 60%; }
.eve-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(0deg, rgb(10 6 24 / .7) 0, rgb(10 6 24 / .28) 36%, rgb(10 6 24 / 0) 64%),
    linear-gradient(180deg, rgb(10 6 24 / .45) 0, rgb(10 6 24 / 0) 28%),
    linear-gradient(90deg, rgb(10 6 24 / .35) 0, rgb(10 6 24 / 0) 60%);
}
.eve-copy { position: absolute; left: 0; right: 0; bottom: 0; max-width: var(--max); margin-inline: auto; padding: 0 var(--gutter) clamp(72px, 13vh, 140px); }
.eve-copy p { color: rgb(255 255 255 / .92); text-shadow: 0 1px 20px rgb(0 0 0 / .5); }
.eve-copy h2 { font-size: clamp(3.2rem, 1rem + 8vw, 8.5rem); line-height: .92; text-shadow: 0 2px 40px rgb(0 0 0 / .4); }
.eve-t1 p { font-family: var(--serif); font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem); margin-top: 1.2rem; max-width: 30ch; line-height: 1.2; }
.eve-t1 { transition: none; opacity: clamp(0, calc(1 - (var(--ev) - .35) * 3.4), 1); transform: translateY(calc(var(--ev) * -30px)); }
.eve-t2 { position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(72px, 13vh, 140px); opacity: clamp(0, calc((var(--ev) - .55) * 3.4), 1); transform: translateY(calc((1 - var(--ev)) * 24px)); }
.eve-big { font-family: var(--serif); font-size: clamp(3rem, 1rem + 7vw, 7.5rem); line-height: .95; letter-spacing: -.02em; max-width: 16ch; }
.eve-note { margin-top: 1.2rem; font-size: .95rem; }

/* ---- gallery ---- */
.gallery .lead { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.grid { columns: 3 280px; column-gap: 14px; }
.g {
  display: block; width: 100%; margin: 0 0 14px; padding: 0; border: 0; background: rgb(var(--fg-rgb) / .08);
  break-inside: avoid; cursor: zoom-in; overflow: hidden; border-radius: 3px; position: relative;
}
.g img { width: 100%; transition: transform .8s var(--ease), filter .5s; }
.g:hover img { transform: scale(1.035); }
.g::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06); pointer-events: none; }

/* ---- contact ---- */
.contact { padding-bottom: 0; }
.contact-grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(16px, 2.4vw, 36px); row-gap: 56px; align-items: start; }
.contact-text { grid-column: 1 / span 5; }
.price { font-family: var(--serif); font-style: italic; font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); color: var(--accent); margin-bottom: 1rem; }
.form {
  grid-column: 7 / span 6;
  padding: clamp(24px, 3.2vw, 48px);
  background: rgb(var(--bg-rgb) / .62); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 4px;
  display: grid; gap: 22px;
}
.field { display: grid; gap: 6px; }
.field label { font-size: .88rem; color: var(--muted); }
.opt { opacity: .8; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--fg); background: transparent;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 0; outline: none;
  transition: border-color .3s;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.field input::placeholder { color: rgb(var(--fg-rgb) / .5); }
.field input:focus, .field textarea:focus { border-bottom-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }
.field input:user-invalid, .field textarea:user-invalid { border-bottom-color: #ff8f8f; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.4em; color: var(--fg); font-size: .95rem; max-width: none; }
.form-status a { color: var(--accent); }
.form-status.error { color: #ff9b9b; }
.form-note { font-size: .82rem; max-width: none; margin-top: -10px; }

.footer { margin-top: clamp(5rem, 10vw, 9rem); padding-block: 3rem calc(6rem + 28vh * 0); position: relative; z-index: 1; border-top: 1px solid var(--line); }
.footer-inner { display: grid; gap: 6px; padding-bottom: 8rem; }
.footer-name { font-family: var(--serif); font-size: 1.8rem; color: var(--fg); }
.footer p { color: var(--muted); max-width: none; }
.footer-small { font-size: .85rem; margin-top: 1rem; }

/* ---------- Lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 300; background: rgb(4 8 18 / .975);
  display: flex; align-items: center; justify-content: center; color: #fff;
  opacity: 0; transition: opacity .35s var(--ease); touch-action: pan-y;
}
.lb[hidden] { display: none; }
.lb.open { opacity: 1; }
.lb-fig { margin: 0; max-width: min(1500px, 100vw); width: 100%; padding: 64px clamp(8px, 8vw, 120px) 72px; display: flex; flex-direction: column; align-items: center; }
.lb-fig img { max-height: calc(100vh - 150px); max-height: calc(100svh - 150px); width: auto; max-width: 100%; object-fit: contain; border-radius: 2px; transition: opacity .25s; }
.lb-fig img.swap { opacity: 0; }
.lb-fig figcaption { display: flex; gap: 18px; justify-content: space-between; width: 100%; max-width: 1100px; color: rgb(255 255 255 / .85); margin-top: 14px; font-size: .95rem; }
.lb-count { font-variant-numeric: tabular-nums; opacity: .7; white-space: nowrap; }
.lb-btn {
  position: absolute; width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .3);
  background: rgb(255 255 255 / .06); color: #fff; cursor: pointer; display: grid; place-items: center;
  transition: background-color .25s, border-color .25s;
}
.lb-btn:hover { background: rgb(255 255 255 / .18); border-color: rgb(255 255 255 / .7); }
.lb-btn:focus-visible { outline-color: #fff; }
.lb-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
body.lb-open { overflow: hidden; }

/* ---------- Loader: covers the page until every photo has loaded (js/main.js) ---------- */
.loader { display: none; }
.js .loader {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px;
  position: fixed; inset: 0; z-index: 1000;
  background: linear-gradient(180deg, #bbd9ec 0%, #e4eff4 78%); color: #12202c;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .7s var(--ease), visibility 0s .7s;
}
.js.is-loading .loader { opacity: 1; visibility: visible; pointer-events: auto; transition: none; }
.loader-mark { font-family: var(--serif); font-size: clamp(2.4rem, 1.2rem + 5vw, 4.6rem); line-height: .92; letter-spacing: -.02em; text-align: center; color: #12202c; max-width: none; }
.loader-bar { width: min(220px, 52vw); height: 1px; background: rgb(18 32 44 / .18); overflow: hidden; }
.loader-bar i { display: block; width: 100%; height: 100%; background: #17678f; transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
html.is-loading { overflow: hidden; }
/* hold the hero entrance until the loader lifts */
.is-loading .hero-media, .is-loading .hero h1, .is-loading .hero-sub, .is-loading .hero-cta { animation-play-state: paused; }

/* ---------- Reveal (only with JS and when motion is allowed) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .reveal-img img { clip-path: inset(0 0 100% 0); transform: scale(1.14); transition: clip-path 1.1s var(--ease), transform 1.6s var(--ease); }
  .js .reveal-img figcaption { opacity: 0; transition: opacity .8s .4s; }
  .js .reveal-img.in img { clip-path: inset(0 0 0 0); transform: none; }
  .js .reveal-img.in figcaption { opacity: 1; }
  .js .dist-bar i { transform: scaleX(0); transition: transform 1.4s .2s var(--ease); }
  .js .distances.in .dist-bar i { transform: scaleX(1); }
}

/* ---------- Static palette: no JS engine (reduce motion, or JS off) ---------- */
html:not(.dn) .sky, html:not(.dn) .clock { display: none; }
html:not(.dn) [data-phase] { background: var(--bg); color: var(--fg); --muted: rgb(var(--fg-rgb) / .72); --line: rgb(var(--fg-rgb) / .22); --tint: rgb(var(--fg-rgb) / .06); }
html:not(.dn) .site-header.scrolled { background: rgb(12 22 38 / .88); color: #fff; box-shadow: 0 1px 0 rgb(255 255 255 / .14); }
html:not(.dn) .site-header.scrolled .btn-small:hover { background: #fff; color: #10202c; border-color: #fff; }
html:not(.dn) [data-phase="morning"] { --bg: #e4eff4; --bg-rgb: 228 239 244; --fg: #12202c; --fg-rgb: 18 32 44; --accent: #17678f; }
html:not(.dn) [data-phase="gold"]    { --bg: #f7e2bc; --bg-rgb: 247 226 188; --fg: #26190f; --fg-rgb: 38 25 15; --accent: #0b6670; }
html:not(.dn) [data-phase="dusk"]    { --bg: #4b2c4e; --bg-rgb: 75 44 78; --fg: #f6ece8; --fg-rgb: 246 236 232; --accent: #ffb59a; }
html:not(.dn) [data-phase="night"]   { --bg: #0b1426; --bg-rgb: 11 20 38; --fg: #e9edf6; --fg-rgb: 233 237 246; --accent: #f2c879; }
html:not(.dn) .hero { background: #1d4a6e; color: #fff; }
html:not(.dn) .evenings { background: #1a1230; color: #fff; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-media, .hero h1, .hero-sub, .hero-price, .hero-cta, .hero-cue i { animation: none; }
  .hero-media img { transform: none; }
  .evenings { height: auto; }
  .eve-stage { position: relative; height: auto; display: flex; flex-direction: column; }
  .eve-copy { order: -1; width: 100%; }
  .eve-layer { position: relative; inset: auto; height: 70vh; }
  .eve-layer img { transform: none; }
  .eve-2 { opacity: 1; }
  .eve-shade { display: none; }
  .eve-copy { position: relative; padding: 2.5rem var(--gutter) 3rem; }
  .eve-t1, .eve-t2 { position: static; opacity: 1; transform: none; }
  .eve-t2 { margin-top: 1.4rem; }
  .eve-big { font-size: clamp(2.4rem, 1rem + 5vw, 4.5rem); }
  .btn, .nav a::after, .g img, .menu, .lb, .loader, .loader-bar i { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav { display: none; }
  .menu-btn { display: block; }
  .header-cta { display: none; }
  .specs { grid-template-columns: repeat(2, 1fr); row-gap: 2.5rem; }
}
@media (max-width: 899px) {
  :root { --header-h: 60px; }
  .view-text, .view-steamer, .view-quay, .res-text, .plate, .village-photo, .village-text, .contact-text, .form,
  .room-living, .room-bedroom, .room-bath, .room-wc, .base-garage, .base-cellar { grid-column: 1 / -1; grid-row: auto; }
  .view-steamer { width: 84%; margin-inline: auto; }
  .view-text { padding-top: 0; }
  .room-bath { grid-column: 1 / span 9; }
  .room-wc { grid-column: 4 / -1; margin-top: 0; }
  .base-cellar { width: 70%; justify-self: end; }
  .village-photo { width: 82%; }
  .figs { grid-template-columns: repeat(2, 1fr); row-gap: 2.4rem; }
  .terrace-card { margin: -14vw 0 0 0; width: calc(100% - 24px); margin-inline: auto; }
  .grid { columns: 2 150px; column-gap: 10px; }
  .g { margin-bottom: 10px; }
  .hero-cue { display: none; }
  .dist { grid-template-columns: 7.8rem 1fr auto; gap: .7rem; font-size: .92rem; }
  .lb-fig { padding: 70px 8px 80px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; }
  .lb-prev { left: calc(50% - 64px); }
  .lb-next { right: calc(50% - 64px); }
  .clock { bottom: 12px; padding: 4px 10px; font-size: .78rem; }
  .evenings { height: 230vh; }
}
@media (max-width: 480px) {
  .hero-scrim { background:
    linear-gradient(180deg, rgb(6 22 38 / .5) 0, rgb(6 22 38 / 0) 22%),
    linear-gradient(0deg, rgb(6 22 38 / .88) 0, rgb(6 22 38 / .74) 24%, rgb(6 22 38 / .38) 42%, rgb(6 22 38 / 0) 60%),
    linear-gradient(90deg, rgb(6 22 38 / .4) 0, rgb(6 22 38 / 0) 70%); }
  .hero h1 { font-size: clamp(3.2rem, 17vw, 4.6rem); }
  .hero-cta { gap: 10px; }
  .hero-cta .btn { padding: 0 16px; min-height: 46px; font-size: .92rem; }
  .hero-price { flex-basis: 100%; margin: 4px 0 0; order: -1; font-size: 1.3rem; }
  .hero-sub { font-size: 1rem; }
  .specs { grid-template-columns: 1fr; }
  .fig dd { font-size: clamp(3.2rem, 17vw, 4.5rem); }
  .room-bath { grid-column: 1 / span 10; }
  .room-wc { grid-column: 3 / -1; }
}

/* short phone screens: drop the tagline so the steamer stays clear */
@media (max-width: 480px) and (max-height: 700px) {
  .hero-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .evenings { height: auto; }
}

/* contact: keep the heading beside the taller form while it scrolls past */
@media (min-width: 900px) {
  .contact-text { position: sticky; top: calc(var(--header-h) + 18vh); align-self: start; }
}
