/*
  Casa Neos · Nº 1825
  Understated and declarative: a private screening rather than a brochure.
  Night ground, stone-white type. Cormorant for room names, Inter for the lines.
  One sticky stage, captions low-left, a quiet room index on the right,
  a plain contact band at the end.
*/

:root {
  color-scheme: dark;
  --bg: #0d0c0b;
  --ink: #f1ece4;
  --dim: rgba(241, 236, 228, .62);
  --line: rgba(241, 236, 228, .22);
  --serif: Cormorant, Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; min-width: 0; }

html, body { margin: 0; background: var(--bg); color: var(--ink); }

body {
  font: 16px/1.55 var(--sans);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* ---------- The film ---------- */

.film { position: relative; }
/* 1.15 screens of scroll per room, plus one to settle on the last. main.js sets --rooms. */
.js .film { height: calc(var(--rooms, 12) * 115vh + 100vh); }

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #000;
}

.shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  will-change: transform, opacity;
  transform-origin: 50% 50%;
}
.shot:first-child { opacity: 1; }
.shot.wait { display: none; } /* held back until the camera gets close */

.shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, .45) 0,
    rgba(0, 0, 0, 0) 22%,
    rgba(0, 0, 0, 0) 52%,
    rgba(0, 0, 0, .72) 100%);
}

.night {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #000;
  opacity: .4;
  pointer-events: none;
}

.brand {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px max(4vw, 18px);
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--ink);
}
.brand b { font: 500 20px/1 var(--serif); letter-spacing: .04em; }
.brand a {
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, .18);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background .2s;
}
.brand a:hover { background: rgba(0, 0, 0, .34); }

.cap, .rail, .intro { text-shadow: 0 1px 18px rgba(0, 0, 0, .55); }

.intro {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(70px, 13vh, 140px) 20px 0;
  text-align: center;
}
.intro h1 {
  margin: 0;
  font: 400 clamp(64px, 13vw, 168px)/.92 var(--serif);
  letter-spacing: .01em;
}
.intro p { margin: 14px 0 0; font-size: 15px; opacity: .9; }
.intro .by { margin-top: 6px; font-size: 13px; opacity: .75; }

.hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 2;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--dim);
}
.hint i {
  display: block;
  width: 1px;
  height: 38px;
  background: linear-gradient(var(--ink), transparent);
  animation: drip 2.2s ease-in-out infinite;
}
@keyframes drip {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

.cap {
  position: absolute;
  left: max(5vw, 20px);
  bottom: max(9vh, 64px);
  z-index: 2;
  max-width: min(560px, 86vw);
  opacity: 0;
  transform: translateY(14px);
}
.cap h2 {
  margin: 0 0 10px;
  font: 500 clamp(36px, 5.4vw, 64px)/1.02 var(--serif);
  text-wrap: balance;
}
.cap p { margin: 0; max-width: 44ch; font-size: 17px; opacity: .86; }

.rail {
  position: absolute;
  right: max(3vw, 14px);
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rail button {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 28px;
  font-size: 12px;
  color: var(--dim);
}
.rail button span { opacity: 0; transform: translateX(6px); transition: .3s; }
.rail button i { width: 14px; height: 1px; background: var(--dim); transition: .3s; }
.rail button.on { color: var(--ink); }
.rail button.on i { width: 30px; background: var(--ink); }
.rail button.on span,
.rail button:hover span,
.rail button:focus-visible span { opacity: 1; transform: none; }

.bar {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 3;
  width: 0;
  height: 2px;
  background: var(--ink);
  opacity: .8;
}

/* Without JavaScript the film is a single still: hide the controls that need it. */
html:not(.js) .hint,
html:not(.js) .rail { display: none; }

/* ---------- Key facts ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  max-width: 1240px;
  margin: 0 auto;
  border-block: 1px solid var(--line);
}
.stats div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 28px 18px;
  border-inline-start: 1px solid var(--line);
}
.stats div:first-child { border-inline-start: 0; }
.stats b { font: 500 clamp(28px, 3vw, 40px)/1 var(--serif); white-space: nowrap; }
.stats span { font-size: 13px; color: var(--dim); }

/* ---------- The plan ---------- */

.plan {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 110px) max(5vw, 20px) 0;
}
.plan-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 26px;
}
.plan h2 { margin: 0; font: 500 clamp(40px, 5.6vw, 72px)/1.02 var(--serif); }

.tabs {
  display: flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.tabs button {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--dim);
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: #111; }

.plan-body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.plan-body[hidden] { display: none; }

.sheet {
  all: unset;
  cursor: zoom-in;
  position: relative;
  display: block;
  padding: clamp(10px, 2vw, 22px);
  border-radius: 4px;
  background: #fbfaf8;
}
.sheet img { display: block; width: 100%; height: auto; }
.zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  font-size: 12px;
  color: #222;
}

.lvnote { margin: 0 0 10px; font-size: 14px; color: var(--dim); }
.rooms ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rooms li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.rooms li b { font-weight: 500; }
.rooms li span { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.rooms li small { grid-column: 1 / -1; font-size: 13px; color: var(--dim); }
.fine { margin: 16px 0 0; font-size: 13px; color: var(--dim); }

/* Without JavaScript, show both floors one after the other. */
html:not(.js) .tabs { display: none; }
html:not(.js) .plan-body[hidden] { display: grid; margin-top: 48px; }

/* Full-size floor plan */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: rgba(10, 9, 8, .96);
  color: var(--ink);
}
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox::backdrop { background: transparent; }
.lb-close {
  all: unset;
  cursor: pointer;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 14px max(4vw, 16px);
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink);
}
.lb-scroll {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 max(4vw, 16px) 24px;
  -webkit-overflow-scrolling: touch;
}
.lb-scroll img {
  display: block;
  width: max(100%, 1400px);
  height: auto;
  margin: 0 auto;
  background: #fbfaf8;
}

/* ---------- Contact ---------- */

.end {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 110px) max(5vw, 20px);
}
.end h2 {
  margin: 0 0 18px;
  font: 500 clamp(40px, 5.6vw, 72px)/1.02 var(--serif);
  text-wrap: balance;
}
.end p { margin: 0; max-width: 52ch; color: var(--dim); }
.end .small { margin-top: 14px; font-size: 13px; }
.end .small a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
.end .small a:hover { color: var(--ink); }
.num { font-size: 16px; color: var(--ink); white-space: nowrap; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cta a,
.cta button {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  transition: background .2s, border-color .2s;
}
.cta .primary { background: var(--ink); color: #111; }
.cta .primary:hover { background: #fff; }
.cta .ghost { border: 1px solid var(--line); color: var(--ink); }
.cta .ghost:hover { border-color: var(--dim); }

.facts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.facts li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.facts li span:first-child { color: var(--dim); }
.facts li span:last-child { max-width: 62%; text-align: right; }

/* ---------- Builder and footer ---------- */

.builder {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 max(5vw, 20px) clamp(64px, 8vw, 110px);
}
.bmark {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border: 1px solid var(--ink);
  font: 500 34px/1 var(--serif);
  letter-spacing: .06em;
}
.builder h3 { margin: 0 0 10px; font: 500 32px/1.1 var(--serif); }
.builder p { margin: 0 0 14px; max-width: 62ch; color: var(--dim); }
.builder a { color: var(--ink); text-underline-offset: 4px; }

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 22px max(5vw, 20px);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--dim);
}

/* ---------- Focus ---------- */

.brand a:focus-visible,
.rail button:focus-visible,
.tabs button:focus-visible,
.sheet:focus-visible,
.lb-close:focus-visible,
.cta a:focus-visible,
.cta button:focus-visible,
.end .small a:focus-visible,
.builder a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- Smaller screens ---------- */

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats div:nth-child(4) { border-inline-start: 0; }
  .stats div:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .plan-body { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .end { grid-template-columns: minmax(0, 1fr); }
  .rail { gap: 0; }
  .rail button span { display: none; }
  .brand .who { display: none; }
  .cap p { font-size: 16px; }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div { border-inline-start: 0 !important; border-top: 1px solid var(--line); }
  .stats div:nth-child(even) { border-inline-start: 1px solid var(--line) !important; }
  .stats div:nth-child(-n + 2) { border-top: 0; }
  .bmark { width: 64px; height: 64px; font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .hint i { animation: none; }
}
