:root {
  --bg: #14120f;
  --surface: #1d1a16;
  --ink: #f3eee5;
  --muted: #b3aa9c;
  --line: #2f2a23;
  --accent: #c9a66b;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[id] { scroll-margin-top: 72px; }

.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1.08; margin: 0; }
h2 { font-size: clamp(32px, 4.4vw, 56px); }

/* Header */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px var(--gutter);
  background: rgb(20 18 15 / .72); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.brand { font-family: var(--serif); font-size: 20px; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--accent); }
.bar nav { display: flex; gap: clamp(12px, 2.5vw, 28px); font-size: 14px; }
.bar nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.bar nav a:hover { color: var(--ink); }

/* Hero */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; overflow: hidden; }
.hero picture, .hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgb(20 18 15 / .75) 0%, rgb(20 18 15 / .3) 55%, rgb(20 18 15 / 0) 80%),
    linear-gradient(to top, rgb(20 18 15 / .95) 0%, rgb(20 18 15 / .5) 50%, rgb(20 18 15 / .15) 100%);
}
.hero-text { position: relative; z-index: 1; padding: 0 var(--gutter) clamp(48px, 10vh, 110px); max-width: 860px; }
.hero h1 { font-size: clamp(52px, 10vw, 128px); letter-spacing: -.01em; }
.lead { font-size: clamp(18px, 2vw, 22px); color: #e6dfd3; max-width: 34ch; margin: 18px 0 30px; }
.cta {
  display: inline-block; padding: 14px 26px; border: 1px solid var(--accent); border-radius: 999px;
  text-decoration: none; letter-spacing: .04em; transition: background .25s, color .25s;
}
.cta:hover { background: var(--accent); color: var(--bg); }

@supports (animation-timeline: scroll()) {
  .hero img { animation: drift linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
  @keyframes drift { to { transform: scale(1.08) translateY(4%); } }
}

/* Sections */
section:not(.hero) { padding: clamp(72px, 12vw, 140px) var(--gutter) 0; max-width: 1320px; margin: 0 auto; }
.section-head { margin-bottom: clamp(28px, 4vw, 48px); }
.note { color: var(--muted); margin: 14px 0 0; }

.project { display: grid; grid-template-columns: 1fr; gap: 28px; }
.project p { margin: 0; color: #ddd5c8; font-size: 18px; max-width: 60ch; }
.facts { list-style: none; padding: 0; margin: 32px 0 0; border-top: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts span { color: var(--muted); font-size: 14px; }
@media (min-width: 900px) { .project { grid-template-columns: 5fr 7fr; gap: 64px; } }

/* Gallery */
.gallery { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .gallery { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.tile { position: relative; padding: 0; border: 0; background: var(--surface); cursor: zoom-in; overflow: hidden; border-radius: 4px; text-align: left; }
.tile img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.tile:hover img, .tile:focus-visible img { transform: scale(1.04); }
.tile span {
  position: absolute; inset: auto 0 0; padding: 28px 14px 12px; font-size: 14px; color: #efe8dc;
  background: linear-gradient(to top, rgb(0 0 0 / .65), transparent);
}
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Lightbox */
.lightbox { border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: rgb(10 9 8 / .96); color: var(--ink); }
.lightbox::backdrop { background: rgb(0 0 0 / .7); }
.lightbox figure { margin: 0; height: 100%; display: grid; place-items: center; padding: 56px 16px 64px; }
.lightbox img { max-height: calc(100vh - 140px); width: auto; object-fit: contain; }
.lightbox figcaption { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; color: var(--muted); font-size: 14px; }
.lb-btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .25); background: rgb(20 18 15 / .6); font-size: 28px; line-height: 1; cursor: pointer; }
.lb-btn:hover { border-color: var(--accent); }
.lb-prev { left: 16px; top: 50%; translate: 0 -50%; }
.lb-next { right: 16px; top: 50%; translate: 0 -50%; }
.lb-close { right: 16px; top: 12px; }

/* 360 tour */
.tour-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tour-tabs button {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--muted);
}
.tour-tabs button[aria-selected="true"] { border-color: var(--accent); color: var(--ink); }
#pano.pano {
  position: relative; height: clamp(360px, 70vh, 720px); width: 100%; border-radius: 6px; overflow: hidden;
  background: center / cover url("/stills/terrace-frame-1280.jpg"), var(--surface);
}
.pano-start {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; justify-items: center; width: 100%;
  border: 0; background: rgb(20 18 15 / .45); cursor: pointer; font-size: 18px; letter-spacing: .04em;
}
.pano-icon { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; border: 1px solid var(--accent); font-family: var(--serif); font-size: 26px; transition: transform .3s; }
.pano-start:hover .pano-icon { transform: scale(1.06); }
.pano.loading::after { content: "Loading panorama…"; position: absolute; left: 16px; bottom: 14px; color: var(--muted); font-size: 14px; z-index: 3; }
.hs-move { width: 34px; height: 34px; border-radius: 50%; background: rgb(201 166 107 / .9); border: 2px solid #fff; cursor: pointer; box-shadow: 0 0 0 6px rgb(201 166 107 / .25); }
.hs-move span { visibility: hidden; position: absolute; bottom: 44px; left: 50%; translate: -50% 0; white-space: nowrap; background: var(--bg); color: var(--ink); padding: 5px 10px; border-radius: 4px; font: 13px var(--sans); }
.hs-move:hover span { visibility: visible; }

/* Film */
.film video { width: 100%; border-radius: 6px; background: #000; aspect-ratio: 16 / 9; }

/* Footer */
.foot { max-width: 1320px; margin: clamp(80px, 12vw, 140px) auto 0; padding: 32px var(--gutter) 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot p { margin: 0 0 8px; }

/* Reveal on scroll — only when JS is on, never for reduced motion */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero img { animation: none !important; }
}

@media (max-width: 560px) {
  .bar nav a:nth-child(n+3) { display: none; }
  .facts li { grid-template-columns: 110px 1fr; }
}

.more-card {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: center; gap: clamp(20px, 4vw, 48px);
  color: inherit; text-decoration: none; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
.more-card img { width: 100%; height: auto; display: block; }
.more-text { display: grid; gap: 22px; justify-items: start; padding: 24px 28px 24px 0; }
.more-text b { font-weight: 400; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.45; color: #e6dfd3; }
.more-card:hover .cta { background: var(--accent); color: var(--bg); }
@media (max-width: 760px) {
  .more-card { grid-template-columns: 1fr; }
  .more-text { padding: 0 20px 24px; }
}
