/* ─────────────────────────────────────────────
   The Loft — styles
   Colours and fonts live in :root, change them there.
   ───────────────────────────────────────────── */

:root {
  --bg: #f4f1ec;          /* warm paper */
  --bg-alt: #ebe6de;      /* slightly deeper stone */
  --ink: #1d1d1b;         /* near-black text */
  --muted: #76726a;       /* secondary text */
  --line: rgba(29, 29, 27, 0.14);
  --accent: #5f6b52;      /* sage / tree green */
  --dark: #171815;        /* contact + lightbox */

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Manrope", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(20px, 5vw, 72px);
  --section: clamp(96px, 14vw, 200px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 300; margin: 0; line-height: 1.05; }
p { margin: 0 0 1.2em; }
p:last-child { margin-bottom: 0; }

.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section) 0; }

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 28px;
}
.eyebrow--light { color: rgba(255, 255, 255, 0.75); }

.section-title { font-size: clamp(2.4rem, 5vw, 4.2rem); margin-bottom: 32px; }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--muted); max-width: 34em; }

/* ───────── Navigation ───────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px var(--gutter);
  color: #fff;
  transition: background 0.5s var(--ease), padding 0.5s var(--ease), color 0.5s var(--ease);
}
.nav.scrolled {
  background: rgba(244, 241, 236, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--ink);
  padding-top: 18px; padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.nav__logo { font-family: var(--serif); font-size: 1.6rem; letter-spacing: 0.04em; }
.nav__links { display: flex; align-items: center; gap: clamp(20px, 3vw, 44px); }
.nav__links a {
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 400;
  position: relative; padding: 4px 0;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__cta { border: 1px solid currentColor; padding: 10px 18px !important; }
.nav__cta::after { display: none; }
.nav__toggle {
  display: none; background: none; border: 0; color: inherit; cursor: pointer;
  font: 500 12px var(--sans); letter-spacing: 0.24em; text-transform: uppercase;
}

/* ───────── Hero ───────── */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; color: #fff; }
.hero__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.08); animation: heroIn 2.6s var(--ease) forwards;
}
.hero__shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 28%, rgba(0,0,0,0) 45%, rgba(0,0,0,0.6) 100%);
}
.hero__content {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(56px, 10vh, 120px);
  opacity: 0; animation: fadeUp 1.6s 0.5s var(--ease) forwards;
}
.hero__title { font-size: clamp(4rem, 13vw, 12rem); letter-spacing: -0.02em; line-height: 0.9; }
.hero__sub { font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 2.4vw, 2rem); margin-top: 18px; opacity: 0.9; }
.hero__scroll {
  position: absolute; right: var(--gutter); bottom: clamp(56px, 10vh, 120px);
  width: 1px; height: 72px; background: rgba(255,255,255,0.3); overflow: hidden;
}
.hero__scroll span {
  position: absolute; left: 0; top: 0; width: 1px; height: 100%; background: #fff;
  animation: scrollLine 2.4s var(--ease) infinite;
}

.hero--right .hero__content { left: auto; text-align: right; }
@media (max-width: 820px) { .hero--right .hero__content { left: var(--gutter); } }
.hero--right .hero__scroll { right: auto; left: var(--gutter); }

@keyframes heroIn { to { transform: scale(1); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes scrollLine { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* ───────── Intro ───────── */
.intro__grid { display: grid; grid-template-columns: 1fr 2.4fr; gap: 48px; }
.statement { font-size: clamp(2.2rem, 4.6vw, 4.4rem); margin-bottom: 40px; max-width: 16em; }
.statement em { color: var(--accent); }

.facts {
  display: grid; grid-template-columns: repeat(5, 1fr);
  margin: clamp(80px, 10vw, 140px) 0 0;
}
.fact { border-top: 1px solid var(--line); padding: 24px 24px 0 0; }
.fact dt { font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.fact dd { margin: 14px 0 0; font-family: var(--serif); font-size: clamp(2.4rem, 4vw, 3.6rem); line-height: 1; }
.fact dd span { font-size: 0.42em; margin-left: 4px; color: var(--muted); }

/* ───────── Full-bleed band ───────── */
.band { position: relative; height: 92vh; min-height: 480px; overflow: hidden; color: #fff; display: grid; place-items: center; }
.band__media { position: absolute; inset: 0; }
.band__media img { width: 100%; height: 100%; object-fit: cover; }
.band::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,0.42) 0%, rgba(0,0,0,0.22) 60%, rgba(0,0,0,0.12) 100%); }
.band__quote {
  position: relative; z-index: 1; margin: 0; padding: 0 var(--gutter); text-align: center;
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(2rem, 4.6vw, 4.2rem); max-width: 18em; line-height: 1.15;
  text-shadow: 0 2px 30px rgba(0,0,0,0.35);
}

/* ───────── Features ───────── */
.feature {
  display: grid; grid-template-columns: repeat(12, 1fr); align-items: center;
  gap: 0 24px; margin-bottom: clamp(100px, 14vw, 200px);
}
.feature:last-child { margin-bottom: 0; }
.feature__media { grid-column: 1 / span 7; aspect-ratio: 6 / 5; }
.feature__text { grid-column: 9 / span 4; }
.feature--reverse .feature__media { grid-column: 6 / span 7; grid-row: 1; }
.feature--reverse .feature__text { grid-column: 1 / span 4; grid-row: 1; }
.feature__media img { width: 100%; height: 100%; object-fit: cover; }
.feature__index { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 1.2rem; margin-bottom: 16px; }
.feature__title { font-size: clamp(2.4rem, 4.4vw, 4rem); margin-bottom: 28px; }
.feature__text p:not(.feature__index) { color: var(--muted); }

/* ───────── Ruimtes: wisselende layouts ───────── */
.spaces { padding: var(--section) 0; }
.space { margin-bottom: clamp(120px, 16vw, 240px); }
.space figure img { width: 100%; height: 100%; object-fit: cover; }
.space__text p:not(.feature__index) { color: var(--muted); }

/* 01 groot beeld */
.space--wide .space__media { aspect-ratio: 21 / 10; }
.space__row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 24px; margin-top: clamp(32px, 4vw, 56px); }
.space__head { grid-column: 1 / span 5; }
.space__body { grid-column: 7 / span 5; color: var(--muted); font-size: clamp(1.05rem, 1.3vw, 1.15rem); padding-top: 12px; }

/* 02 collage van twee */
.space--duo { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 24px; }
.duo__a { grid-column: 1 / span 8; grid-row: 1; aspect-ratio: 3 / 2; }
.space--duo .space__text { grid-column: 10 / span 3; grid-row: 1; align-self: end; }
.duo__b { grid-column: 6 / span 4; grid-row: 2; aspect-ratio: 4 / 5; position: relative; z-index: 1;
  margin-top: calc(-1 * clamp(60px, 9vw, 160px)); outline: clamp(8px, 1vw, 14px) solid var(--bg); }

/* 03 naast elkaar: hergebruikt .feature */
.space.feature { margin-bottom: clamp(120px, 16vw, 240px); }

/* 04 compact */
.space--compact { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 24px; align-items: center; }
.space--compact figure { grid-column: 3 / span 4; aspect-ratio: 3 / 4; }
.space--compact .space__text { grid-column: 8 / span 4; }

/* 05 volle breedte + drieluik */
.space--bleed { position: relative; height: 92vh; min-height: 560px; overflow: hidden; color: #fff; margin-bottom: clamp(12px, 1.6vw, 24px); }
.bleed__media { position: absolute; inset: 0; z-index: 0; }
.space--bleed::after { content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,0.6) 100%); }
.bleed__text { position: absolute; left: 0; right: 0; bottom: clamp(48px, 9vh, 110px); z-index: 2; }
.bleed__text .feature__index { color: rgba(255,255,255,0.8); }
.bleed__text p:not(.feature__index) { max-width: 30em; color: rgba(255,255,255,0.88); }
.trio { display: grid; grid-template-columns: 5fr 3fr 4fr; gap: clamp(12px, 1.6vw, 24px); align-items: start; }
.trio__a { aspect-ratio: 4 / 3; }
.trio__b { aspect-ratio: 3 / 4; }
.trio__c { aspect-ratio: 1 / 1; }
.trio img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 820px) {
  .space--wide .space__media { aspect-ratio: 4 / 3; }
  .space__row { display: block; }
  .space__body { padding-top: 0; }

  .space--duo { display: block; }
  .space--duo .space__text { margin-bottom: 32px; }
  .duo__b { width: 66%; margin: -48px 0 0 auto; outline-width: 8px; }

  .space--compact { display: block; }
  .space--compact figure { width: 72%; margin-bottom: 32px; }

  .space--bleed { height: 82vh; min-height: 480px; }
  .trio { grid-template-columns: 1fr 1fr; }
  .trio__a { grid-column: span 2; }
}

/* ───────── Gallery ───────── */
.gallery { background: var(--bg-alt); }
.section-head { margin-bottom: clamp(48px, 6vw, 80px); }
.gallery__grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: clamp(160px, 18vw, 280px);
  grid-auto-flow: dense; gap: clamp(8px, 1vw, 16px);
}
.g { position: relative; overflow: hidden; cursor: zoom-in; background: #d9d3c8; }
.g.wide { grid-column: span 2; }
.g.tall { grid-row: span 2; }
.g img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity 0.6s var(--ease); }
.g::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0); transition: background 0.6s var(--ease); }
.g:hover img { transform: scale(1.04); }
.g:hover::after { background: rgba(0,0,0,0.08); }
.g:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ───────── Details ───────── */
.details__grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(48px, 8vw, 140px); }
.spec { margin: 0; }
.spec__row { display: flex; justify-content: space-between; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.spec__row:first-child { border-top: 1px solid var(--line); }
.spec dt { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); font-weight: 400; align-self: center; }
.spec dd { margin: 0; font-family: var(--serif); font-size: 1.4rem; text-align: right; }

/* ───────── Residentie (buitenbeelden) ───────── */
.site { padding-top: 0; }
.site__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 24px; align-items: end; }
.site__a { grid-column: 1 / span 8; aspect-ratio: 3 / 2; }
.site__text { grid-column: 10 / span 3; padding-bottom: 8px; }
.site__text p:not(.eyebrow) { color: var(--muted); }
.site__b { grid-column: 2 / span 4; aspect-ratio: 4 / 5; margin-top: clamp(40px, 5vw, 80px); }
.site__c { grid-column: 7 / span 5; aspect-ratio: 4 / 5; align-self: start; margin-top: clamp(120px, 14vw, 220px); }
.site figure img { width: 100%; height: 100%; object-fit: cover; }

/* ───────── Ligging + kaart ───────── */
.location { background: var(--bg-alt); }
.location__head { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; margin-bottom: clamp(40px, 5vw, 72px); }
.location__head .lead { justify-self: end; }
.map-wrap { position: relative; }
.map { height: clamp(420px, 68vh, 680px); background: #e4dfd6; z-index: 0; }
.map .leaflet-tile-pane { filter: grayscale(1) sepia(0.22) brightness(1.06) contrast(0.82) opacity(0.9); }
.map-card {
  position: absolute; left: clamp(16px, 3vw, 40px); bottom: clamp(16px, 3vw, 40px); z-index: 2;
  width: min(360px, calc(100% - 32px)); background: var(--bg); padding: 32px 32px 28px;
  box-shadow: 0 24px 60px rgba(29, 29, 27, 0.12);
}
.map-card .eyebrow { margin-bottom: 14px; }
.map-card__address { font-family: var(--serif); font-size: 1.8rem; line-height: 1.15; margin-bottom: 24px; }
.map-card__list { list-style: none; margin: 0 0 24px; padding: 0; }
.map-card__list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.map-card__list li span:last-child { color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 1.05rem; }
.map-card__links { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.link--dark { border-bottom-color: var(--line); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 500; transition: border-color 0.4s var(--ease); }
.link--dark:hover { border-bottom-color: var(--ink); }

.map-pin { position: relative; width: 18px; height: 18px; }
.map-pin::before { content: ""; position: absolute; inset: 0; background: var(--accent); border: 3px solid #fff; border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,0.25); }
.map-pin::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 1px solid var(--accent); animation: pinPulse 2.8s var(--ease) infinite; }
@keyframes pinPulse { 0% { transform: scale(0.4); opacity: 0.9; } 100% { transform: scale(1.6); opacity: 0; } }

.map .leaflet-control-zoom { border: 0 !important; box-shadow: 0 8px 24px rgba(0,0,0,0.08); margin: 20px !important; }
.map .leaflet-control-zoom a { width: 40px; height: 40px; line-height: 40px; color: var(--ink); background: var(--bg); border: 0; font: 300 20px var(--sans); border-radius: 0 !important; }
.map .leaflet-control-zoom a:first-child { border-bottom: 1px solid var(--line); }
.map .leaflet-control-zoom a:hover { background: #fff; }
.map .leaflet-control-attribution { background: rgba(244,241,236,0.8); color: var(--muted); font: 10px var(--sans); }
.map .leaflet-control-attribution a { color: var(--muted); }
.map-hint { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); white-space: nowrap; z-index: 2; background: rgba(244,241,236,0.92); padding: 8px 14px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); pointer-events: none; transition: opacity 0.4s; }
.map-hint.hide { opacity: 0; }

/* ───────── Contact ───────── */
.contact { background: var(--dark); color: #fff; text-align: center; }
.contact__inner { display: flex; flex-direction: column; align-items: center; }
.contact__title { font-size: clamp(2.8rem, 7vw, 6.4rem); max-width: 10em; }
.contact__lead { font-family: var(--serif); font-style: italic; font-size: 1.4rem; opacity: 0.7; margin: 24px 0 56px; }
.contact__actions { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; justify-content: center; }
.btn {
  display: inline-block; padding: 20px 44px; border: 1px solid rgba(255,255,255,0.6);
  font-size: 12px; letter-spacing: 0.26em; text-transform: uppercase; font-weight: 500;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}
.btn:hover { background: #fff; color: var(--dark); }
.link { font-size: 14px; letter-spacing: 0.12em; border-bottom: 1px solid rgba(255,255,255,0.35); padding-bottom: 4px; }

.footer { background: var(--dark); color: rgba(255,255,255,0.45); border-top: 1px solid rgba(255,255,255,0.08); }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; padding-top: 28px; padding-bottom: 28px; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; flex-wrap: wrap; }

/* ───────── Lightbox ───────── */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 20, 18, 0.97);
  display: grid; grid-template-columns: 80px 1fr 80px; align-items: center;
  opacity: 0; transition: opacity 0.45s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.open { opacity: 1; }
.lb__figure { grid-column: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; height: 100svh; padding: 72px 0 24px; min-width: 0; }
.lb__figure img {
  max-width: 100%; max-height: calc(100% - 48px); object-fit: contain;
  opacity: 0; transform: scale(0.985); transition: opacity 0.5s var(--ease), transform 0.7s var(--ease);
  user-select: none; -webkit-user-drag: none;
}
.lb__figure img.ready { opacity: 1; transform: none; }
.lb__caption { display: flex; justify-content: space-between; width: 100%; max-width: 100%; color: rgba(255,255,255,0.7); margin-top: 18px; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; gap: 24px; }
.lb__count { font-family: var(--serif); font-style: italic; letter-spacing: 0.05em; text-transform: none; font-size: 1.05rem; }
.lb__close {
  position: absolute; top: 24px; right: var(--gutter); background: none; border: 0; color: #fff; cursor: pointer;
  font: 500 12px var(--sans); letter-spacing: 0.24em; text-transform: uppercase; opacity: 0.8; padding: 8px 0;
}
.lb__close:hover { opacity: 1; }
.lb__close:focus { outline: none; }
.lb__close:focus-visible, .lb__nav:focus-visible { outline: 1px solid rgba(255,255,255,0.5); outline-offset: 6px; }
.lb__nav { height: 100%; background: none; border: 0; cursor: pointer; display: grid; place-items: center; opacity: 0.6; transition: opacity 0.3s; }
.lb__nav:hover { opacity: 1; }
.lb__nav span { width: 18px; height: 18px; border-left: 1px solid #fff; border-bottom: 1px solid #fff; }
.lb__prev span { transform: rotate(45deg); margin-left: 8px; }
.lb__next span { transform: rotate(-135deg); margin-right: 8px; }

/* ───────── Scroll reveal ───────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.img-reveal { overflow: hidden; }
.img-reveal img { transform: scale(1.12); opacity: 0; transition: transform 2s var(--ease), opacity 1.2s var(--ease); }
.img-reveal.in img { transform: scale(1); opacity: 1; }

/* ───────── Responsive ───────── */
@media (max-width: 1024px) {
  .facts { grid-template-columns: repeat(3, 1fr); row-gap: 40px; }
  .gallery__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  .nav__toggle, .nav__logo { display: block; position: relative; z-index: 2; }
  .nav__links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 28px;
    background: var(--bg); color: var(--ink);
    opacity: 0; pointer-events: none; transition: opacity 0.5s var(--ease);
  }
  .nav__links a { font-size: 14px; }
  .nav.menu-open .nav__links { opacity: 1; pointer-events: auto; }
  .nav.menu-open { color: var(--ink); }

  .intro__grid, .details__grid { grid-template-columns: 1fr; gap: 0; }
  .details__grid > div:first-child { margin-bottom: 48px; }

  .site__grid { display: block; }
  .site__a { margin-bottom: 40px; }
  .site__text { margin-bottom: 48px; }
  .site__b, .site__c { margin-top: 0; }
  .site__b { width: 78%; margin-bottom: 16px; }
  .site__c { width: 78%; margin-left: auto; }

  .location__head { grid-template-columns: 1fr; gap: 0; }
  .location__head .lead { justify-self: start; }
  .map { height: 60vh; min-height: 360px; }
  .map-card { position: relative; left: auto; bottom: auto; width: 100%; box-shadow: none; padding: 28px 0 0; background: transparent; }

  .feature { display: block; }
  .feature__media { aspect-ratio: 4 / 3; margin-bottom: 36px; }

  .facts { grid-template-columns: repeat(2, 1fr); }
  .gallery__grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 42vw; }

  .lightbox { grid-template-columns: 0 1fr 0; }
  .lb__nav { display: none; }
  .lb__figure { padding: 64px 16px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .img-reveal img, .hero__content { opacity: 1 !important; transform: none !important; }
  .hero__img { transform: none; }
}
