/* =============================================================
   Villa Panta Rhei — design system
   ============================================================= */

:root {
  --ink: #1a1a1a;
  --ink-soft: #2a2a2a;
  --bone: #f7f3ee;
  --bone-warm: #efe8de;
  --sand: #d9cdb7;
  --stone: #6e6760;
  --stone-soft: #8a847d;
  --terracotta: #b85a3e;
  --sky: #c8d7df;

  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --t-reveal: 700ms;

  --max: 1440px;
  --max-prose: 1180px;
  --gutter: clamp(20px, 5vw, 88px);
  --section-y: clamp(80px, 12vw, 160px);

  --line: rgba(26, 26, 26, .12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--terracotta); color: var(--bone); }

/* skip link */
.skip {
  position: fixed; top: 8px; left: 8px;
  padding: 8px 12px; background: var(--ink); color: var(--bone);
  transform: translateY(-200%); transition: transform .2s var(--ease);
  z-index: 1000; font-size: 14px;
}
.skip:focus { transform: translateY(0); }

/* ============= TYPE ============= */
.h-display {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 5.5vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.005em;
  color: var(--ink);
  max-width: 18ch;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 22px;
  font-weight: 500;
}
.eyebrow.on-dark, .h-display.on-dark, .lead.on-dark { color: var(--bone); }
.eyebrow.on-dark { color: rgba(247, 243, 238, .8); }
.lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 52ch;
  margin-top: 28px;
}
.lead.on-dark { color: rgba(247, 243, 238, .88); }

/* ============= HEADER ============= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  color: var(--bone);
  pointer-events: none;
  transition: color .4s var(--ease), text-shadow .4s var(--ease);
  /* Soft dark halo keeps the brand legible when it overlaps a light area
     of the hero photo (the "Panta Rhei" wall is white plaster). */
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45), 0 0 14px rgba(0, 0, 0, .35);
}
.site-header > * { pointer-events: auto; }
.site-header.is-pinned {
  color: var(--ink);
  text-shadow: none;
}
.brand {
  display: inline-flex; align-items: baseline; gap: 10px;
  font-family: var(--serif);
}
.brand__mark {
  font-size: 22px;
  font-weight: 500;
  opacity: .85;
}
.brand__name {
  font-size: 17px;
  letter-spacing: .04em;
}
.lang { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .12em; }
.lang__btn {
  opacity: .55;
  transition: opacity .25s var(--ease);
  padding: 4px 2px;
  font-weight: 500;
}
.lang__btn.is-active { opacity: 1; }
.lang__btn:hover { opacity: .9; }
.lang__sep { opacity: .4; }

/* visually-hidden — for SEO h1 we don't want on screen */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ============= HERO ============= */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  color: var(--bone);
  display: flex;
  align-items: flex-end;
}
.hero__media {
  position: absolute; inset: 0;
  z-index: 0;
  overflow: hidden;
  will-change: transform;
}
.hero__media picture, .hero__media img {
  width: 100%; height: 100%;
}
.hero__media img {
  /* Full-bleed cover. Anchor low enough that the entire "Panta Rhei" cursive
     (orig. y_frac 0.68–0.92) lands inside the viewport on landscape. */
  object-fit: cover;
  object-position: 50% 92%;
  transform-origin: 50% 80%;
  transform: scale(1);
  animation: hero-zoom 32s var(--ease) both;
  will-change: transform;
}
@media (orientation: portrait) {
  /* Portrait viewports overflow on X; sign sits in the photo's left third. */
  .hero__media img { object-position: 28% 55%; }
}
@keyframes hero-zoom {
  from { transform: scale(1); }
  to   { transform: scale(1.03); }
}
.hero__veil {
  position: absolute; inset: 0;
  /* Strong top band so the brand + lang switcher read against ANY part of the
     hero photo — the villa is mostly white plaster, which would otherwise eat
     a light brand. The middle of the hero stays clear so the "Panta Rhei"
     cursive on the wall reads at full contrast. */
  background: linear-gradient(180deg,
      rgba(0,0,0,.78) 0%,
      rgba(0,0,0,.62) 3%,
      rgba(0,0,0,.32) 7%,
      rgba(0,0,0,.10) 12%,
      rgba(0,0,0,0) 20%,
      rgba(0,0,0,0) 100%);
}

/* ============= RIBBON (eyebrow + motto, sits just under the hero) ============= */
.ribbon {
  border-bottom: 1px solid var(--line);
  padding: 22px var(--gutter);
}
.ribbon__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 14px 22px;
  color: var(--stone);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.ribbon__eyebrow { color: var(--ink); font-weight: 500; }
.ribbon__sep { opacity: .35; }
.ribbon__motto {
  font-family: var(--serif);
  font-style: italic;
  text-transform: none;
  letter-spacing: .02em;
  font-size: 15px;
  display: inline-flex; align-items: baseline; gap: 12px;
  color: var(--ink-soft);
}
.ribbon__motto-sub {
  font-style: normal;
  font-family: var(--sans);
  text-transform: lowercase;
  letter-spacing: .14em;
  font-size: 12px;
  color: var(--stone);
}
@media (max-width: 599px) {
  .ribbon__inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ribbon__sep { display: none; }
}
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}
.hero__scroll {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  width: 1px; height: 56px;
  background: rgba(247, 243, 238, .35);
  z-index: 2;
  display: block;
}
.hero__scroll span {
  position: absolute; top: 0; left: -1px;
  width: 3px; height: 18px;
  background: rgba(247, 243, 238, .9);
  animation: hero-tick 2.4s var(--ease) infinite;
}
@keyframes hero-tick {
  0%   { top: 0; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ============= SECTION FRAME ============= */
.section {
  padding: var(--section-y) var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
}
.section__head { margin-bottom: clamp(40px, 6vw, 72px); }

/* ============= REVEAL ============= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--t-reveal) var(--ease), transform var(--t-reveal) var(--ease);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* ============= WELCOME ============= */
.welcome__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
@media (min-width: 900px) {
  .welcome__grid { grid-template-columns: 1.05fr .95fr; gap: clamp(60px, 8vw, 120px); }
}
.welcome__media img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; border-radius: 2px; }

/* ============= STATS ============= */
.stats { padding-top: 0; padding-bottom: var(--section-y); }
.stats__grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  border-top: 1px solid var(--line);
  padding-top: 56px;
}
@media (min-width: 700px) { .stats__grid { grid-template-columns: repeat(3, 1fr); } }
.stats__item { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.stats__num {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 7vw, 5.5rem);
  line-height: 1;
  letter-spacing: -.02em;
  font-weight: 400;
  display: inline;
}
.stats__unit {
  font-family: var(--serif);
  font-size: 1.4rem;
  margin-left: 6px;
  color: var(--stone);
  font-style: italic;
}
.stats__label {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--stone);
  margin-top: 6px;
}

/* ============= ROOMS ============= */
.rooms__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 3vw, 32px);
}
@media (min-width: 900px) {
  .rooms__grid { grid-template-columns: 1fr 1fr; gap: clamp(28px, 3.5vw, 44px) clamp(28px, 4vw, 56px); }
  .room:nth-child(odd) { transform: translateY(0); }
  .room:nth-child(even) { transform: translateY(40px); }
  .room:nth-child(even).reveal { transform: translateY(68px); }
  .room:nth-child(even).reveal.is-in { transform: translateY(40px); }
}
.room { position: relative; }
.room__card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  overflow: hidden;
  border-radius: 2px;
  background: var(--bone-warm);
}
.room__card picture { display: block; overflow: hidden; }
.room__card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  transition: transform 900ms var(--ease), filter 600ms var(--ease);
  will-change: transform;
}
.room__card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.55) 100%);
  opacity: .65;
  transition: opacity .6s var(--ease);
  pointer-events: none;
}
.room__card:hover img, .room__card:focus-visible img { transform: scale(1.04); }
.room__card:hover::after { opacity: .8; }
.room__meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: clamp(20px, 3vw, 36px) clamp(20px, 3vw, 36px) clamp(24px, 3.5vw, 40px);
  color: var(--bone);
  z-index: 2;
}
.room__num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  opacity: .75;
  display: block;
  margin-bottom: 6px;
  letter-spacing: .1em;
}
.room__name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1;
  letter-spacing: -.005em;
  margin-bottom: 10px;
  transition: transform .5s var(--ease);
}
.room__theme {
  font-size: 13px;
  letter-spacing: .04em;
  opacity: .88;
  max-width: 38ch;
}
.room__card:hover .room__name,
.room__card:focus-visible .room__name {
  transform: translateY(-4px);
}

/* ============= POOL ============= */
.pool {
  position: relative;
  height: clamp(540px, 78vh, 820px);
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.pool__media { position: absolute; inset: 0; z-index: 0; }
.pool__media picture, .pool__media img { width: 100%; height: 100%; }
.pool__media img { object-fit: cover; }
.pool::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.25) 60%, rgba(0,0,0,0) 100%);
  z-index: 1;
}
.pool__inner {
  position: relative;
  z-index: 2;
  padding: 0 var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}
.pool__inner .h-display { color: var(--bone); }

/* ============= LIVING / MASONRY ============= */
.living__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(14px, 2vw, 22px);
}
@media (min-width: 700px) { .living__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .living__grid { grid-template-columns: repeat(3, 1fr); } }
.living__cell { overflow: hidden; border-radius: 2px; background: var(--bone-warm); }
.living__cell img {
  aspect-ratio: var(--ar, 3/4);
  width: 100%;
  object-fit: cover;
  transition: transform 1.4s var(--ease);
}
.living__cell:hover img { transform: scale(1.03); }
.living__cell--tall { grid-row: span 2; }
.living__cell--tall img { aspect-ratio: 3/5; }
@media (max-width: 699px) { .living__cell--tall { grid-row: auto; } .living__cell--tall img { aspect-ratio: 3/4; } }

/* ============= LOCATION ============= */
.location__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 5vw, 60px);
  align-items: stretch;
}
@media (min-width: 900px) { .location__grid { grid-template-columns: 1.4fr 1fr; } }
.location__map {
  background: var(--bone-warm);
  border-radius: 2px;
  overflow: hidden;
  min-height: 420px;
  position: relative;
}
.location__map iframe { width: 100%; height: 100%; min-height: 420px; border: 0; filter: grayscale(.25); }
.location__list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.location__list li {
  display: flex; align-items: baseline; gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.location__list li:first-child { border-top: 1px solid var(--line); }
.loc__km {
  font-family: var(--serif);
  font-size: 1.3rem;
  width: 78px;
  flex-shrink: 0;
  color: var(--ink);
  letter-spacing: -.01em;
  font-style: italic;
}
.loc__name {
  font-size: 15px;
  color: var(--ink-soft);
  letter-spacing: .01em;
}

/* ============= RESERVE ============= */
.reserve { text-align: left; }
.reserve__inner { max-width: 720px; }
.cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  padding: 16px 28px;
  background: var(--ink);
  color: var(--bone);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 500;
  transition: background .3s var(--ease), transform .3s var(--ease), gap .3s var(--ease);
}
.cta:hover { background: var(--terracotta); gap: 18px; }
.cta svg { transition: transform .3s var(--ease); }
.cta:hover svg { transform: translate(2px, -2px); }

/* ============= FOOTER ============= */
.footer {
  border-top: 1px solid var(--line);
  padding: clamp(48px, 7vw, 88px) var(--gutter);
  color: var(--stone);
  font-size: 14px;
}
.footer__inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; flex-direction: column; gap: 10px;
}
.footer__name { font-family: var(--serif); font-size: 1.25rem; color: var(--ink); letter-spacing: .02em; }
.footer__links { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.footer__links a:hover { color: var(--ink); }
.footer__credit { margin-top: 14px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }

/* ============= LIGHTBOX ============= */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(20, 18, 16, .94);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .35s var(--ease);
  padding: clamp(16px, 4vw, 56px);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox__stage {
  max-width: min(1400px, 92vw);
  max-height: 85vh;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  transform: scale(.98);
  opacity: 0;
  transition: transform .4s var(--ease), opacity .35s var(--ease);
}
.lightbox.is-open .lightbox__stage { opacity: 1; transform: scale(1); }
.lightbox__img {
  max-width: 100%; max-height: 80vh;
  width: auto; height: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.lightbox__caption {
  color: rgba(247, 243, 238, .8);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-family: var(--serif);
  font-style: italic;
  text-transform: none;
  letter-spacing: .02em;
  font-size: 15px;
}
.lightbox__close, .lightbox__nav {
  position: absolute;
  color: var(--bone);
  opacity: .8;
  transition: opacity .25s var(--ease), background .25s var(--ease);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
}
.lightbox__close { top: 22px; right: 22px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 22px; }
.lightbox__nav--next { right: 22px; }
.lightbox__close:hover, .lightbox__nav:hover { opacity: 1; background: rgba(247, 243, 238, .08); }
.lightbox__count {
  position: absolute;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  color: rgba(247, 243, 238, .55);
  font-size: 12px;
  letter-spacing: .2em;
  font-family: var(--serif);
  font-style: italic;
}
@media (max-width: 600px) {
  .lightbox__close { top: 12px; right: 12px; }
  .lightbox__nav--prev { left: 4px; }
  .lightbox__nav--next { right: 4px; }
}

/* ============= REDUCED MOTION ============= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hero__media img { animation: none; transform: none; }
  .reveal { opacity: 1; transform: none; }
  .room:nth-child(even) { transform: none !important; }
}
