/* ═══════════════════════════════════════════════════════════════
   NORA HOUSE — experience design system
   Dark editorial: ink #0e0e0e · cream #f2f1ec · amber #f7941d
   Showcases: scroll-driven animations, view transitions, anchor
   positioning, @property, :has(), container queries, @starting-style,
   popover, interpolate-size, linear() easing, color-mix, text-wrap.
   ═══════════════════════════════════════════════════════════════ */

@property --ga {
  syntax: "<angle>"; inherits: false; initial-value: 135deg;
}
@property --glow {
  syntax: "<percentage>"; inherits: true; initial-value: 0%;
}

:root {
  /* semantic: --ink = surfaces, --cream = foreground (swapped in light mode) */
  --ink: #0e0e0e;
  --ink-2: #161616;
  --ink-3: #1d1c19;
  --cream: #f2f1ec;
  --cream-60: rgba(242, 241, 236, .62);
  --cream-38: rgba(242, 241, 236, .38);
  --hair: rgba(242, 241, 236, .14);
  --hair-soft: rgba(242, 241, 236, .08);
  --amber: #f7941d;
  --amber-soft: color-mix(in oklab, var(--amber) 24%, transparent);
  --amber-deep: oklch(0.62 0.15 60);
  --sb-thumb: #33312c;
  --serif: "Italiana", "Didot", Georgia, serif;
  --sans: "Jost", "Avenir Next", system-ui, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  /* spring approximation via linear() — July 2026 baseline */
  --spring: linear(0, 0.006, 0.025 2.8%, 0.101 6.1%, 0.539 18.9%, 0.721 25.3%, 0.849 31.5%,
    0.937 38.1%, 0.968 41.8%, 0.991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 100%);
  --pagew: min(1400px, 92vw);
  color-scheme: dark;
}

/* ── light mode: warm gallery paper, ink type, deepened amber ── */
:root[data-theme="light"] {
  --ink: #f2f1ec;
  --ink-2: #faf9f5;
  --ink-3: #e9e6dc;
  --cream: #161616;
  /* muted tones need more weight on paper than cream needs on ink */
  --cream-60: rgba(22, 22, 22, .78);
  --cream-38: rgba(22, 22, 22, .60);
  --hair: rgba(22, 22, 22, .20);
  --hair-soft: rgba(22, 22, 22, .10);
  --amber: #9c5a08;
  --sb-thumb: #cfccc2;
  color-scheme: light;
}

/* theme change = soft cross-fade, not the stage slide */
html.theming::view-transition-old(stage) { animation: vt-fade-o .4s ease both; }
html.theming::view-transition-new(stage) { animation: vt-fade-i .4s ease both; }
@keyframes vt-fade-o { to { opacity: 0; } }
@keyframes vt-fade-i { from { opacity: 0; } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
html, body { margin: 0; }
body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
::selection { background: var(--amber); color: var(--ink); }

img { max-width: 100%; display: block; }
a { color: inherit; }

.visually-hidden, .skip {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip:focus-visible {
  clip-path: none; width: auto; height: auto; z-index: 999;
  top: 12px; left: 12px; background: var(--amber); color: var(--ink);
  padding: 10px 18px; border-radius: 999px; font-weight: 500;
}
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

/* ── scrollbar ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--sb-thumb); border-radius: 8px; border: 2px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: var(--amber); }

/* ── film grain ── */
.grain {
  position: fixed; inset: -60px; z-index: 80; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 900ms steps(3) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(18px, -24px); }
  66% { transform: translate(-22px, 14px); }
}

/* ── scroll progress (scroll-driven animation) ── */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200;
  background: linear-gradient(90deg, var(--amber), #ffc86b);
  transform-origin: 0 50%; transform: scaleX(0);
}
@supports (animation-timeline: scroll()) {
  .progress { animation: prog linear both; animation-timeline: scroll(root); }
  @keyframes prog { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ═══════════════ header ═══════════════ */
.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 clamp(16px, 4vw, 48px); height: 76px;
  background: color-mix(in srgb, var(--ink) 62%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--hair-soft);
}
.mark { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.mark-n {
  width: 40px; height: 40px; display: grid; place-items: center;
  font-family: var(--serif); font-size: 24px; color: var(--amber);
  border: 1px solid var(--hair); transition: border-color .3s, transform .4s var(--spring);
}
.mark:hover .mark-n { border-color: var(--amber); transform: rotate(-6deg); }
.mark-word {
  font-family: var(--serif); font-size: 21px; letter-spacing: .26em;
  text-transform: uppercase; white-space: nowrap;
}

.tabs { position: relative; display: flex; align-items: center; gap: clamp(6px, 1.4vw, 22px); }
.tab {
  position: relative; text-decoration: none; font-size: 13px; font-weight: 400;
  letter-spacing: .18em; text-transform: uppercase; color: var(--cream-60);
  padding: 8px 2px; transition: color .25s;
}
.tab:hover { color: var(--cream); }
.tab.is-on { color: var(--cream); }
.tab-cta {
  color: var(--ink); background: var(--amber); padding: 9px 18px; border-radius: 999px;
  font-weight: 500; transition: transform .4s var(--spring), background .25s;
}
.tab-cta:hover { transform: translateY(-2px); color: var(--ink); background: color-mix(in srgb, var(--amber) 82%, white); }
.tab-cta.is-on { color: var(--ink); }

/* active-tab underline — CSS anchor positioning, with per-tab fallback */
.tab:not(.tab-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--amber); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .45s var(--ease-out);
}
.tab.is-on:not(.tab-cta)::after { transform: scaleX(1); }
@supports (anchor-name: --a) {
  .tab:not(.tab-cta)::after { content: none; }
  .tab.is-on:not(.tab-cta) { anchor-name: --tab-on; }
  .tabs::after {
    content: ""; position: absolute; height: 1px; background: var(--amber);
    top: anchor(--tab-on bottom); left: anchor(--tab-on left); right: anchor(--tab-on right);
    transition: left .45s var(--ease-out), right .45s var(--ease-out), top .45s;
  }
}

.head-actions { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }

/* theme toggle — shows the mode you'll switch to */
.theme-btn {
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--hair); background: transparent; color: var(--cream);
  font-size: 17px; line-height: 1; display: grid; place-items: center;
  transition: border-color .3s, color .3s, rotate .6s var(--spring), background .3s;
}
.theme-btn:hover { border-color: var(--amber); color: var(--amber); rotate: 25deg; }
.theme-btn .tb-moon { display: none; }
:root[data-theme="light"] .theme-btn .tb-sun { display: none; }
:root[data-theme="light"] .theme-btn .tb-moon { display: block; }

/* mobile popover menu */
.sheet-menu {
  position: fixed; inset: auto 12px 12px 12px; width: auto; margin: 0;
  background: color-mix(in srgb, var(--ink-2) 88%, transparent);
  backdrop-filter: blur(24px); border: 1px solid var(--hair); border-radius: 22px;
  padding: 18px; display: flex; flex-direction: column; gap: 2px;
  opacity: 0; transform: translateY(24px); transition: opacity .35s, transform .45s var(--spring), display .45s allow-discrete, overlay .45s allow-discrete;
}
.sheet-menu:popover-open { opacity: 1; transform: none; }
@starting-style { .sheet-menu:popover-open { opacity: 0; transform: translateY(24px); } }
.sheet-menu a {
  text-decoration: none; font-family: var(--serif); font-size: 26px; letter-spacing: .08em;
  padding: 10px 14px; border-radius: 12px; color: var(--cream);
}
.sheet-menu a:hover { background: var(--hair-soft); color: var(--amber); }
.sheet-menu::backdrop { background: rgba(8, 8, 8, .55); backdrop-filter: blur(4px); }

/* ═══════════════ view switching ═══════════════ */
.view { display: none; min-height: 100vh; }
.view.is-active { display: block; }
main { view-transition-name: stage; }
::view-transition-old(stage) {
  animation: vt-out .32s var(--ease-out) both;
}
::view-transition-new(stage) {
  animation: vt-in .55s .12s var(--ease-out) both;
}
@keyframes vt-out { to { opacity: 0; transform: translateY(-18px); filter: blur(6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(26px); filter: blur(10px); } }

/* ═══════════════ hero ═══════════════ */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; overflow: clip; }

/* ── site-wide silk backdrop ──
   Fixed behind everything (negative z paints above the body background).
   A veil keeps long-form text readable: transparent over the hero, easing
   in across the first viewport of scroll; steady on the inner views. */
.bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; }
.bg-veil {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: color-mix(in srgb, var(--ink) 60%, transparent);
}
body[data-view="overview"] .bg-veil { opacity: .5; }
@supports (animation-timeline: scroll()) {
  body[data-view="overview"] .bg-veil {
    opacity: 1; animation: veil-in linear both;
    animation-timeline: scroll(root); animation-range: 0 90svh;
  }
  @keyframes veil-in { from { opacity: 0; } to { opacity: 1; } }
}
body[data-view="neighborhood"] .bg-canvas,
body[data-view="neighborhood"] .bg-veil { display: none; }
.hero-veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 108%, color-mix(in srgb, var(--ink) 92%, transparent), transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--ink) 55%, transparent), transparent 30%);
}
.hero-inner {
  position: relative; z-index: 2; margin: auto; text-align: center;
  padding: 140px 20px 30px; max-width: 1100px;
}
.eyebrow {
  font-family: "Archivo", var(--sans); font-variation-settings: "wdth" 125;
  font-size: 11px; font-weight: 500; letter-spacing: .42em; text-transform: uppercase;
  color: var(--amber); margin: 0 0 18px;
}
.hero-title {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(64px, 14.5vw, 190px); line-height: .92; letter-spacing: .06em;
}
.hero-title .line { display: block; overflow: clip; }
.hero-title .w { display: inline-block; translate: 0 110%; animation: rise 1.1s .15s var(--ease-out) forwards; }
.hero-title .line:nth-child(2) .w { animation-delay: .3s; }
.hero-title .accent {
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--cream) 85%, transparent);
  background: linear-gradient(var(--ga), var(--amber), #ffd9a0 55%, var(--amber));
  -webkit-background-clip: text; background-clip: text;
  animation: rise 1.1s .3s var(--ease-out) forwards, ga-spin 9s linear infinite;
}
@keyframes rise { to { translate: 0 0; } }
@keyframes ga-spin { to { --ga: 495deg; } }
.hero-sub {
  max-width: 560px; margin: 26px auto 0; color: var(--cream-60);
  font-size: clamp(15px, 1.6vw, 18px); text-wrap: balance;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer;
  font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: .2em;
  text-transform: uppercase; padding: 16px 30px; border-radius: 999px; border: 0;
  transition: transform .5s var(--spring), background .25s, color .25s, border-color .25s;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn-amber { background: var(--amber); color: var(--ink); box-shadow: 0 12px 40px -12px var(--amber-soft); }
.btn-amber:hover { background: color-mix(in srgb, var(--amber) 82%, white); }
.btn-line { border: 1px solid var(--hair); color: var(--cream); background: transparent; }
.btn-line:hover { border-color: var(--amber); color: var(--amber); }

.hero-foot {
  position: relative; z-index: 2; display: flex; align-items: flex-end;
  justify-content: space-between; gap: 20px; padding: 0 clamp(18px, 4vw, 52px) 30px;
}
.hero-stats { display: flex; gap: clamp(20px, 4vw, 58px); flex-wrap: wrap; }
.hstat b {
  display: block; font-family: var(--serif); font-weight: 400;
  font-size: clamp(24px, 3vw, 38px); letter-spacing: .03em; font-variant-numeric: tabular-nums;
}
.hstat > span { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--cream-38); }
.scroll-cue { width: 1px; height: 64px; background: var(--hair); position: relative; overflow: clip; flex: 0 0 auto; }
.scroll-cue span {
  position: absolute; inset: 0; background: var(--amber);
  animation: cue 2.1s var(--ease-out) infinite;
}
@keyframes cue { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

/* ═══════════════ editorial blocks ═══════════════ */
.block {
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2.4fr);
  gap: clamp(24px, 5vw, 90px); width: var(--pagew); margin: 0 auto;
  padding: clamp(90px, 12vh, 160px) 0;
}
.block-rail { position: relative; }
.rail-label {
  position: sticky; top: 110px; display: inline-block;
  font-family: "Archivo", var(--sans); font-variation-settings: "wdth" 125;
  font-size: 11px; font-weight: 500; letter-spacing: .38em; text-transform: uppercase;
  color: var(--cream-38); writing-mode: vertical-rl; text-orientation: mixed;
  border-left: 1px solid var(--hair); padding-left: 14px; min-height: 190px;
}
.display {
  font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4.6vw, 64px);
  line-height: 1.08; letter-spacing: .015em; margin: 0 0 28px; text-wrap: balance;
}
.display em, .display-xl em { font-style: italic; color: var(--amber); }
.lede { max-width: 640px; color: var(--cream-60); font-size: clamp(15px, 1.5vw, 18px); text-wrap: pretty; }
.cred {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px; background: var(--hair-soft); border: 1px solid var(--hair-soft);
  margin: 44px 0 0; max-width: 760px;
}
.cred > div { background: var(--ink); padding: 20px 22px; }
.cred dt { font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--amber); margin-bottom: 6px; }
.cred dd { margin: 0; font-size: 15px; }

/* ═══════════════ gallery ═══════════════ */
.gallery { position: relative; padding: 10px 0 26px; }
.gallery-track {
  display: flex; gap: clamp(14px, 2vw, 28px); overflow-x: auto; padding: 8px clamp(18px, 4vw, 52px) 26px;
  scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; user-select: none;
}
.gimg img, .gcard { -webkit-user-drag: none; user-select: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track.dragging { cursor: grabbing; scroll-snap-type: none; }
.gcard { flex: 0 0 auto; width: min(560px, 78vw); margin: 0; scroll-snap-align: center; }
.gcard.tall { width: min(360px, 62vw); }
.gimg { overflow: clip; aspect-ratio: 3 / 2; }
.gcard.tall .gimg { aspect-ratio: 3 / 4.4; }
.gimg img {
  width: 100%; height: 100%; object-fit: cover; scale: 1.12;
  transition: scale 1.2s var(--ease-out), filter 1.2s;
  filter: saturate(.92) contrast(1.02);
}
.gcard:hover img { scale: 1.02; filter: saturate(1.05); }
@supports (animation-timeline: view()) {
  .gimg img {
    transition: none;
    animation: gpar linear both;
    animation-timeline: view(x);
    animation-range: entry 0% exit 100%;
  }
  @keyframes gpar { from { translate: 6% 0; scale: 1.16; } to { translate: -6% 0; scale: 1.16; } }
}
.gcard figcaption {
  margin-top: 12px; font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--cream-38);
}
.gallery-hint {
  text-align: center; margin: 4px 0 0; font-size: 10.5px; letter-spacing: .4em;
  text-transform: uppercase; color: var(--cream-38);
}
.gbtn {
  position: absolute; top: 50%; translate: 0 -70%; z-index: 5;
  width: 54px; height: 54px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--hair); color: var(--cream); font-size: 18px;
  background: color-mix(in srgb, var(--ink) 62%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: all .35s var(--ease-out);
}
.gbtn:hover { background: var(--amber); border-color: var(--amber); color: var(--ink); scale: 1.08; }
.gbtn:disabled { opacity: .22; pointer-events: none; }
.gprev { left: clamp(10px, 2vw, 30px); }
.gnext { right: clamp(10px, 2vw, 30px); }
@media (max-width: 940px) { .gbtn { width: 44px; height: 44px; font-size: 15px; } }

/* ═══════════════ marquee ═══════════════ */
.marquee {
  overflow: clip; border-block: 1px solid var(--hair-soft);
  padding: 22px 0; margin: clamp(50px, 8vh, 90px) 0;
  mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-row { display: flex; white-space: nowrap; width: max-content; animation: mq 34s linear infinite; }
.marquee:hover .marquee-row { animation-play-state: paused; }
.marquee-row span {
  font-family: var(--serif); font-size: clamp(30px, 5vw, 62px); letter-spacing: .1em;
  text-transform: uppercase; color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--cream) 45%, transparent);
}
@keyframes mq { to { transform: translateX(-50%); } }

/* ═══════════════ full-bleed image w/ parallax ═══════════════ */
.bleed { position: relative; height: clamp(420px, 78vh, 800px); overflow: clip; }
.bleed img { width: 100%; height: 120%; object-fit: cover; }
@supports (animation-timeline: view()) {
  .bleed img {
    animation: bpar linear both; animation-timeline: view();
    animation-range: entry 0% exit 100%;
  }
  @keyframes bpar { from { translate: 0 -10%; } to { translate: 0 4%; } }
}
.bleed-caption {
  position: absolute; left: clamp(18px, 4vw, 52px); bottom: 22px; margin: 0;
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--cream);
  background: color-mix(in srgb, var(--ink) 55%, transparent); backdrop-filter: blur(8px);
  padding: 10px 16px; border: 1px solid var(--hair-soft);
}

/* ═══════════════ next-view cta ═══════════════ */
.nextcta { border-top: 1px solid var(--hair-soft); margin-top: clamp(60px, 9vh, 110px); }
.nextcta-link {
  display: flex; align-items: baseline; gap: clamp(16px, 3vw, 40px);
  width: var(--pagew); margin: 0 auto; padding: clamp(44px, 8vh, 90px) 0;
  text-decoration: none; position: relative;
}
.nextcta-eyebrow { font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--cream-38); }
.nextcta-title {
  font-family: var(--serif); font-size: clamp(40px, 7vw, 96px); line-height: 1;
  letter-spacing: .04em; transition: color .3s, translate .6s var(--spring);
}
.nextcta-arrow {
  font-size: clamp(28px, 4vw, 52px); color: var(--amber);
  transition: translate .6s var(--spring); margin-left: auto;
}
.nextcta-link:hover .nextcta-title { color: var(--amber); translate: 10px 0; }
.nextcta-link:hover .nextcta-arrow { translate: 16px 0; }

/* ═══════════════ view headers ═══════════════ */
.view-head {
  width: var(--pagew); margin: 0 auto; padding: clamp(130px, 18vh, 200px) 0 clamp(30px, 5vh, 60px);
  max-width: 1000px; text-align: center;
}
.view-head.slim { padding-bottom: 16px; }
.display-xl {
  font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 7.4vw, 104px);
  line-height: 1.02; letter-spacing: .03em; margin: 8px 0 22px; text-wrap: balance;
}
.view-head .lede { margin-inline: auto; }

/* ═══════════════ residences ═══════════════ */
.res-toolbar {
  position: sticky; top: 76px; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  width: var(--pagew); margin: 10px auto 26px; padding: 12px 0;
  background: color-mix(in srgb, var(--ink) 78%, transparent); backdrop-filter: blur(14px);
}
.chips { display: flex; gap: 8px; border: 0; padding: 0; margin: 0; }
.chips label { position: relative; }
.chips input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.chips span {
  display: inline-block; padding: 9px 20px; border: 1px solid var(--hair); border-radius: 999px;
  font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--cream-60);
  transition: all .3s var(--ease-out); cursor: pointer;
}
.chips label:hover span { border-color: var(--cream-60); color: var(--cream); }
.chips input:checked + span { background: var(--amber); border-color: var(--amber); color: var(--ink); font-weight: 500; }
.chips input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
.res-count { font-size: 11.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--cream-38); margin: 0; }

.res-grid {
  width: var(--pagew); margin: 0 auto; display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  background: var(--hair-soft); border: 1px solid var(--hair-soft);
}
/* :has() bedroom filtering — no JS required for the visual filter */
#view-residences:has(input[value="2"]:checked) .res-card:not([data-bd="2"]),
#view-residences:has(input[value="3"]:checked) .res-card:not([data-bd="3"]),
#view-residences:has(input[value="4"]:checked) .res-card:not([data-bd="4"]) { display: none; }

.res-card {
  container-type: inline-size; background: var(--ink); padding: clamp(22px, 3cqw, 34px) clamp(20px, 3cqw, 30px);
  cursor: pointer; border: 0; text-align: left; color: var(--cream); font: inherit;
  position: relative; overflow: clip; transition: background .35s;
}
.res-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .4s;
  background: radial-gradient(140% 120% at 0% 100%, var(--amber-soft), transparent 55%);
}
.res-card:hover::before { opacity: 1; }
.res-card:hover { background: var(--ink-2); }
.res-num {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.res-num b {
  font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 15cqw, 64px);
  line-height: 1; letter-spacing: .02em;
}
.res-num small { font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--cream-38); }
.res-arrow {
  position: absolute; top: 22px; right: 20px; color: var(--amber); font-size: 20px;
  translate: -8px 8px; opacity: 0; transition: all .45s var(--spring);
}
.res-card:hover .res-arrow { translate: 0 0; opacity: 1; }
.res-meta { display: flex; gap: 18px; margin: 16px 0 14px; flex-wrap: wrap; }
.res-meta span { font-size: 13px; letter-spacing: .08em; color: var(--cream-60); }
.res-meta b { font-weight: 500; color: var(--cream); font-variant-numeric: tabular-nums; }
.res-bar { height: 2px; background: var(--hair-soft); overflow: clip; }
.res-bar i {
  display: block; height: 100%; background: linear-gradient(90deg, var(--amber-deep), var(--amber));
  scale: var(--w, .5) 1; transform-origin: 0 50%; transition: scale 1s var(--ease-out);
}
@container (max-width: 300px) { .res-meta { gap: 10px; } .res-meta span { font-size: 12px; } }

/* residence dialog */
.res-dialog {
  border: 1px solid var(--hair); background: var(--ink-2); color: var(--cream);
  width: min(680px, calc(100vw - 32px)); max-height: min(86vh, 900px);
  padding: 0; margin: auto; overflow: auto;
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .8);
  transition: opacity .3s, transform .45s var(--spring), display .45s allow-discrete, overlay .45s allow-discrete;
}
.res-dialog:not([open]) { opacity: 0; transform: translateY(30px) scale(.97); }
.res-dialog[open] { opacity: 1; transform: none; }
@starting-style { .res-dialog[open] { opacity: 0; transform: translateY(30px) scale(.97); } }
.res-dialog::backdrop { background: rgba(6, 6, 6, .66); backdrop-filter: blur(6px); }
.dialog-x {
  position: sticky; top: 14px; margin-left: calc(100% - 52px); z-index: 5;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--hair);
  background: color-mix(in srgb, var(--ink) 70%, transparent); color: var(--cream);
  cursor: pointer; font-size: 14px; transition: all .25s;
}
.dialog-x:hover { background: var(--amber); color: var(--ink); border-color: var(--amber); }
.dlg-pad { padding: 0 clamp(24px, 5vw, 48px) clamp(28px, 5vw, 44px); margin-top: -24px; }
.dlg-eyebrow { font-size: 10.5px; letter-spacing: .34em; text-transform: uppercase; color: var(--amber); margin: 0 0 8px; }
.dlg-title { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 7vw, 64px); margin: 0 0 18px; line-height: 1; }
.dlg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px; background: var(--hair-soft); border: 1px solid var(--hair-soft); margin-bottom: 22px; }
.dlg-stats div { background: var(--ink-2); padding: 14px 16px; }
.dlg-stats b { display: block; font-family: var(--serif); font-weight: 400; font-size: 26px; font-variant-numeric: tabular-nums; }
.dlg-stats span { font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--cream-38); }
.dlg-desc { color: var(--cream-60); font-size: 15px; }
.dlg-scale { margin: 20px 0 26px; }
.dlg-scale .lbl { display: flex; justify-content: space-between; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--cream-38); margin-bottom: 8px; }
.dlg-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ═══════════════ amenities levels ═══════════════ */
.levels { width: var(--pagew); margin: 30px auto 0; }
.level {
  display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 2.6fr);
  gap: clamp(20px, 4vw, 70px); padding: clamp(50px, 8vh, 90px) 0;
  border-top: 1px solid var(--hair-soft);
}
.level-rail { position: relative; }
.level-letter {
  position: sticky; top: 110px; display: block; font-family: var(--serif);
  font-size: clamp(90px, 14vw, 190px); line-height: .8; color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--amber) 60%, transparent);
}
.level-name {
  position: sticky; top: calc(110px + clamp(80px, 12vw, 165px)); display: inline-block;
  margin-top: 14px; font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--cream-60);
}
.level-img { margin: 0 0 34px; overflow: clip; height: clamp(300px, 52vh, 460px); }
.level-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.level-img.sunset img { object-position: 50% 62%; }
.amen { list-style: none; margin: 0; padding: 0; counter-reset: am; }
.amen li {
  counter-increment: am; display: grid; grid-template-columns: 54px 1fr; align-items: baseline;
  column-gap: 8px; padding: 18px 0; border-bottom: 1px solid var(--hair-soft); position: relative;
}
.amen li::before {
  content: counter(am, decimal-leading-zero); grid-row: span 2;
  font-family: "Archivo", var(--sans); font-variation-settings: "wdth" 120;
  font-size: 12px; color: var(--amber); letter-spacing: .1em;
}
.amen b { font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 2.6vw, 32px); letter-spacing: .02em; }
.amen span { grid-column: 2; color: var(--cream-38); font-size: 14px; }

/* ═══════════════ features ═══════════════ */
.brandstrip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 34px;
  width: var(--pagew); max-width: 900px; margin: 6px auto 44px;
  padding: 22px 10px; border-block: 1px solid var(--hair-soft);
}
.brandstrip span {
  font-family: "Archivo", var(--sans); font-variation-settings: "wdth" 122;
  font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--cream-38);
  transition: color .3s;
}
.brandstrip span:hover { color: var(--amber); }

.acc-wrap { width: var(--pagew); max-width: 900px; margin: 0 auto; }
.acc { border-top: 1px solid var(--hair); interpolate-size: allow-keywords; }
.acc:last-of-type { border-bottom: 1px solid var(--hair); }
.acc summary {
  display: flex; align-items: center; gap: 22px; list-style: none; cursor: pointer;
  padding: 26px 4px; font-family: var(--serif); font-size: clamp(24px, 3.4vw, 40px);
  letter-spacing: .03em; transition: color .3s, padding-left .4s var(--ease-out);
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary:hover { color: var(--amber); padding-left: 12px; }
.acc-i {
  font-family: "Archivo", var(--sans); font-variation-settings: "wdth" 120;
  font-size: 12px; color: var(--amber); letter-spacing: .12em;
}
.acc-chev { margin-left: auto; font-size: 20px; color: var(--cream-38); transition: rotate .45s var(--spring), color .3s; }
.acc[open] .acc-chev { rotate: 180deg; color: var(--amber); }
.acc::details-content {
  block-size: 0; overflow: clip; opacity: 0;
  transition: block-size .55s var(--ease-out), content-visibility .55s allow-discrete, opacity .4s;
}
.acc[open]::details-content { block-size: auto; opacity: 1; }
.acc-body ul { list-style: none; margin: 0; padding: 2px 4px 30px 58px; max-width: 720px; }
.acc-body li {
  padding: 11px 0; border-bottom: 1px solid var(--hair-soft);
  color: var(--cream-60); font-size: 15px; text-wrap: pretty;
}
.acc-body li:last-child { border-bottom: 0; }

/* ═══════════════ neighborhood map ═══════════════ */
.mapframe {
  position: relative; width: min(1600px, 96vw); margin: 26px auto clamp(60px, 8vh, 100px);
  height: max(560px, calc(100svh - 240px)); border: 1px solid var(--hair);
  overflow: clip; background: var(--ink-2);
}
.mapframe iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-full { position: absolute; right: 18px; bottom: 18px; padding: 12px 22px; }

/* ═══════════════ inquire ═══════════════ */
.inq {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(30px, 6vw, 100px); width: var(--pagew); margin: 0 auto;
  padding: clamp(130px, 18vh, 200px) 0 clamp(70px, 10vh, 120px);
}
.inq-facts { margin: 40px 0 0; display: grid; gap: 22px; }
.inq-facts dt { font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--amber); margin-bottom: 4px; }
.inq-facts dd { margin: 0; font-size: 16px; }
.inq-facts a { text-decoration-color: var(--amber); text-underline-offset: 4px; }

.inq-form { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.inq-form label { display: flex; flex-direction: column; gap: 7px; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--cream-38); }
.inq-form label em { font-style: normal; letter-spacing: .1em; }
.inq-form input[type="text"], .inq-form input[type="email"], .inq-form input[type="tel"], .inq-form textarea {
  background: transparent; border: 0; border-bottom: 1px solid var(--hair);
  color: var(--cream); font: 300 16px var(--sans); letter-spacing: .02em;
  padding: 8px 2px 12px; transition: border-color .3s; border-radius: 0;
}
.inq-form :is(input, textarea):focus { outline: none; border-bottom-color: var(--amber); }
.inq-form :is(input, textarea):user-invalid { border-bottom-color: #e0694f; }
.broker { border: 0; padding: 0; margin: 6px 0 0; display: flex; align-items: center; gap: 10px; }
.broker legend { float: left; margin-right: 16px; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--cream-38); padding: 0; }
.broker label { position: relative; flex-direction: row; }
.broker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.broker span {
  padding: 7px 18px; border: 1px solid var(--hair); border-radius: 999px;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-60); transition: all .3s;
}
.broker input:checked + span { background: var(--cream); border-color: var(--cream); color: var(--ink); }
.btn-send { align-self: flex-start; margin-top: 10px; }
.form-note { font-size: 12.5px; color: var(--cream-38); }
.form-note a { color: var(--cream-60); }

/* ═══════════════ footer ═══════════════ */
.site-foot {
  border-top: 1px solid var(--hair-soft); margin-top: 40px;
  padding: 54px clamp(18px, 4vw, 52px) 64px; text-align: center;
}
.foot-mark { font-family: var(--serif); font-size: 40px; color: var(--amber); margin-bottom: 22px; }
.foot-legal, .foot-credit {
  max-width: 880px; margin: 0 auto 14px; font-size: 11px; line-height: 1.8;
  letter-spacing: .06em; text-transform: uppercase; color: var(--cream-38);
}
.foot-credit a { color: var(--cream-60); }

/* ═══════════════ toast ═══════════════ */
.toast {
  position: fixed; left: 50%; bottom: 30px; translate: -50% 130%; z-index: 300;
  background: var(--cream); color: var(--ink); font-size: 14px; font-weight: 400;
  padding: 14px 26px; border-radius: 999px; box-shadow: 0 18px 50px rgba(0,0,0,.5);
  transition: translate .6s var(--spring); max-width: min(480px, 90vw); text-align: center;
}
.toast.show { translate: -50% 0; }

/* ═══════════════ reveals ═══════════════ */
.js .reveal { opacity: 0; translate: 0 34px; filter: blur(5px); }
.js .reveal.inview {
  opacity: 1; translate: 0 0; filter: blur(0);
  transition: opacity .9s var(--ease-out), translate .9s var(--ease-out), filter .9s;
}
/* stagger siblings */
.js .amen .reveal.inview { transition-delay: calc(var(--i, 0) * 60ms); }

/* ═══════════════ responsive ═══════════════ */
@media (max-width: 940px) {
  .tabs { display: none; }
  .menu-btn {
    display: grid; gap: 6px; place-content: center; width: 46px; height: 46px;
    background: transparent; border: 1px solid var(--hair); border-radius: 50%; cursor: pointer;
  }
  .menu-btn span { display: block; width: 18px; height: 1.5px; background: var(--cream); }
  .block, .level { grid-template-columns: 1fr; gap: 26px; }
  .rail-label { writing-mode: horizontal-tb; border-left: 0; border-top: 1px solid var(--hair); padding: 12px 0 0; min-height: 0; position: static; }
  .level-letter, .level-name { position: static; }
  .level-letter { font-size: 80px; display: inline-block; margin-right: 18px; }
  .inq { grid-template-columns: 1fr; }
  .res-toolbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .scroll-cue { display: none; }
  .frow { grid-template-columns: 1fr; }
}

/* ═══════════════ reduced motion ═══════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero-title .w { translate: 0 0; }
  .js .reveal { opacity: 1; translate: 0 0; filter: none; }
  html { scroll-behavior: auto; }
  .grain { display: none; }
}
