/* ==========================================================================
   Unbranded listing film page: cinematic dark
   Type:  Bodoni Moda (display, self-hosted) + Instrument Sans (labels, UI)
   Color: one dark theme. Near-black ground, warm white text, a single pale
          "golden hour" accent used only for small details and focus.
   Shape: controls are full pills or circles; photos and video are square.
   ========================================================================== */

@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/bodoni-moda-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --bg-raised: #131315;
  --text: #f3efe8;
  --soft: #cfcac1;
  --muted: #a39e95;
  --line: rgba(243, 239, 232, 0.14);
  --line-strong: rgba(243, 239, 232, 0.4);
  --accent: #ecc998;

  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Instrument Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --wrap: 1480px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --bar-h: 64px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--bar-h);
  background: var(--bg);
}

body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Film grain: one fixed layer above the page, never on a scrolling element. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 400;
  color: var(--text);
  font-optical-sizing: auto;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
  fill: currentColor;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}

.skip:focus {
  top: 1rem;
}

.sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 70vh;
  pointer-events: none;
}

.eyebrow {
  display: block;
  font-family: var(--sans);
  line-height: 1.6;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 54px;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.975rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease),
    border-color 0.35s var(--ease), transform 0.2s var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-solid {
  background: var(--text);
  color: #0a0a0b;
}

.btn-solid:hover {
  background: #ffffff;
}

.btn-meta {
  padding-left: 0.7rem;
  border-left: 1px solid rgba(10, 10, 11, 0.25);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.btn-line {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(10, 10, 11, 0.3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.btn-line:hover {
  border-color: var(--text);
  background: rgba(10, 10, 11, 0.55);
}

.btn-small {
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
}

/* ---------- Top bar (appears after the hero) ---------- */
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-inline: var(--gutter);
  background: rgba(10, 10, 11, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 0.5s var(--ease), visibility 0s linear 0.5s;
}

.bar.is-shown {
  transform: none;
  visibility: visible;
  transition: transform 0.5s var(--ease), visibility 0s;
}

.bar-title {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--text);
  white-space: nowrap;
}

.bar-nav {
  display: flex;
  gap: 0.25rem;
}

.bar-nav a {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--soft);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

.bar-nav a:hover {
  background: rgba(243, 239, 232, 0.1);
  color: var(--text);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #0a0a0b;
}

.hero-media {
  position: absolute;
  inset: 0;
  background: #0a0a0b url("../img/hero-poster.webp") center / cover no-repeat;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(10, 10, 11, 0.94) 0%, rgba(10, 10, 11, 0.62) 34%, rgba(10, 10, 11, 0.16) 68%, rgba(10, 10, 11, 0.32) 100%);
}

/* Letterbox bars that open like the start of a film. */
.hero-bars span {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  height: 50%;
  background: #0a0a0b;
  transform: scaleY(0);
}

.hero-bars span:first-child {
  top: 0;
  transform-origin: top;
}

.hero-bars span:last-child {
  bottom: 0;
  transform-origin: bottom;
}

.hero-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 0 var(--gutter) clamp(2rem, 6vh, 4.5rem);
}

/* The h1 holds the whole address. In the markup the street comes first and the
   city second; on screen the city sits above the street. */
.hero-heading {
  display: flex;
  flex-direction: column-reverse;
}

.hero-title {
  display: block;
  margin-top: 0.9rem;
  /* Sized so the street address spans the hero on one line. The optical size
     is held low so the hairlines stay readable over moving footage. */
  font-size: min(calc((100vw - 2 * var(--gutter)) * var(--fit, 0.11)), 11.5rem);
  font-weight: 500;
  font-variation-settings: "opsz" 36;
  line-height: 1;
  letter-spacing: -0.015em;
  white-space: nowrap;
  color: var(--text);
  text-shadow: 0 2px 40px rgba(10, 10, 11, 0.45);
}

.mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-block: 0.06em 0.14em;
  margin-bottom: -0.14em;
}

.mask > span {
  display: inline-block;
}

@media (max-width: 640px) {
  .hero-title {
    font-size: calc((100vw - 2 * var(--gutter)) * var(--fit-phone, 0.17));
    line-height: 0.98;
  }

  .mask {
    display: block;
  }
}

.hero-actions {
  margin-top: clamp(1.75rem, 4vh, 2.75rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.loop-toggle {
  position: absolute;
  z-index: 3;
  right: var(--gutter);
  bottom: clamp(2rem, 6vh, 4.5rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 10, 11, 0.3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.loop-toggle:hover {
  border-color: var(--text);
  background: rgba(10, 10, 11, 0.55);
}

.loop-toggle .icon {
  width: 16px;
  height: 16px;
}

.loop-toggle .icon-play,
.loop-toggle[aria-pressed="true"] .icon-pause {
  display: none;
}

.loop-toggle[aria-pressed="true"] .icon-play {
  display: block;
}

.loop-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .loop-toggle {
    top: max(1rem, env(safe-area-inset-top));
    bottom: auto;
    width: 46px;
    height: 46px;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
  }
}

/* Opening sequence */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-bars span {
    animation: bars-open 1.5s var(--ease) 0.15s both;
  }

  .js .hero-video,
  .js .hero-media {
    animation: settle 2.6s var(--ease) both;
  }

  .js .mask > span {
    animation: line-up 1.25s var(--ease) 0.75s both;
  }

  .js .mask + .mask > span {
    animation-delay: 0.85s;
  }

  .js .rise {
    animation: rise 1.1s var(--ease) 1.15s both;
  }

  .js .hero-actions.rise {
    animation-delay: 1.35s;
  }
}

@keyframes bars-open {
  from { transform: scaleY(1); }
  to { transform: scaleY(0); }
}

@keyframes settle {
  from { transform: scale(1.08); }
  to { transform: none; }
}

@keyframes line-up {
  from { transform: translateY(110%); }
  to { transform: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Section headings ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  font-size: clamp(2.4rem, 5.4vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.section-meta {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.section-lede {
  margin-top: 1.25rem;
  max-width: 62ch;
  color: var(--muted);
}

/* ---------- Film ---------- */
.film {
  --pad-top: clamp(4rem, 9vw, 7rem);
  padding-block: var(--pad-top) clamp(3rem, 7vw, 5.5rem);
  /* Land with the heading just under the top bar, not at the section's padding. */
  scroll-margin-top: calc(1.5rem - var(--pad-top));
}

.player {
  position: relative;
  /* Never taller than the screen: the whole frame and its controls stay in view. */
  width: min(100%, calc((100svh - var(--bar-h) - 16.5rem) * 16 / 9));
  min-width: min(100%, 320px);
  margin: clamp(1.5rem, 3vw, 2.5rem) auto 0;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player-start {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: none;
  background: linear-gradient(to top, rgba(10, 10, 11, 0.55), rgba(10, 10, 11, 0.15));
  cursor: pointer;
  transition: opacity 0.5s var(--ease), background-color 0.4s var(--ease);
}

.player-start[hidden],
html:not(.js) .player-start {
  display: none;
}

.player-ring {
  display: grid;
  place-items: center;
  width: clamp(84px, 11vw, 148px);
  height: clamp(84px, 11vw, 148px);
  border-radius: 50%;
  border: 1px solid rgba(243, 239, 232, 0.75);
  background: rgba(10, 10, 11, 0.28);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--text);
  transition: transform 0.6s var(--ease), background-color 0.4s var(--ease), color 0.4s var(--ease);
}

.player-ring .icon {
  width: 30%;
  height: 30%;
  transform: translateX(6%);
}

.player-start:hover .player-ring,
.player-start:focus-visible .player-ring {
  transform: scale(1.08);
  background: var(--text);
  color: #0a0a0b;
}

.player-start:focus-visible {
  outline-offset: -4px;
}

/* Phone held sideways while the film is active: the player fills the screen.
   This is the fallback for browsers that will not go full screen on their own
   (js/site.js asks for real full screen first). */
.player-exit {
  display: none;
  position: absolute;
  z-index: 2;
  top: max(0.6rem, env(safe-area-inset-top));
  right: max(0.6rem, env(safe-area-inset-right));
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(10, 10, 11, 0.6);
  color: var(--text);
  cursor: pointer;
}

.player-exit .icon {
  width: 16px;
  height: 16px;
}

@media (orientation: landscape) and (max-height: 540px) and (hover: none) and (pointer: coarse) {
  .player.is-active {
    position: fixed;
    inset: 0;
    z-index: 80;
    width: 100vw;
    height: 100dvh;
    min-width: 0;
    margin: 0;
    aspect-ratio: auto;
  }

  .player.is-active .player-exit {
    display: inline-grid;
  }
}

/* ---------- Photographs ---------- */
.photos {
  padding-bottom: clamp(4rem, 9vw, 7rem);
  scroll-margin-top: 1.5rem;
}

.photos-note {
  margin-top: 1.25rem;
  max-width: 62ch;
  color: var(--muted);
}

.grid {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(6px, 0.8vw, 12px);
  padding-inline: clamp(6px, 0.8vw, 12px);
}

.tile {
  position: relative;
  overflow: hidden;
  background: var(--bg-raised);
}

.tile-link {
  display: block;
  height: 100%;
  cursor: zoom-in;
}

.tile img {
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 1.1s var(--ease), filter 0.5s var(--ease);
}

.tile-link:hover img,
.tile-link:focus-visible img {
  transform: scale(1.035);
  filter: brightness(1.08);
}

.tile-link:focus-visible {
  outline-offset: -3px;
}

/* Disclosure marker on altered photos. Kept readable on purpose. */
.tile-flag {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(10, 10, 11, 0.82);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tile {
    grid-area: auto !important;
  }

  .tile:nth-child(3n + 1) {
    grid-column: 1 / -1 !important;
  }
}

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  padding-bottom: max(clamp(2.5rem, 6vw, 4rem), env(safe-area-inset-bottom));
}

.foot-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 2rem clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.foot-address {
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.15;
  color: var(--text);
}

.foot-notes {
  display: grid;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 68ch;
}

@media (max-width: 760px) {
  .foot-inner {
    grid-template-columns: 1fr;
  }
}

/* ---------- Photo viewer ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  background: #050506;
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: contain;
}

.lightbox::backdrop {
  background: #050506;
}

.lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] {
    animation: fade 0.35s ease both;
  }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(0.75rem, env(safe-area-inset-top)) var(--gutter) 0.75rem;
}

.lb-count {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

.lb-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(10, 10, 11, 0.5);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.lb-btn:hover {
  background: var(--text);
  border-color: var(--text);
  color: #0a0a0b;
}

.lb-btn .icon {
  width: 18px;
  height: 18px;
}

.lb-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
}

/* Absolutely filled so the photo can never push past the stage and cover the
   disclosure bar underneath it. */
.lb-stage img {
  position: absolute;
  inset: 0 clamp(0px, 6vw, 5.5rem);
  width: calc(100% - 2 * clamp(0px, 6vw, 5.5rem));
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.lb-stage img.is-loading {
  opacity: 0.25;
}

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.lb-prev { left: clamp(0.5rem, 1.5vw, 1.25rem); }
.lb-next { right: clamp(0.5rem, 1.5vw, 1.25rem); }

.lb-note {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem var(--gutter) max(0.9rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--soft);
  text-align: center;
}

.lb-note[hidden] {
  display: none;
}

.lb-note strong {
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 760px) {
  /* Arrows sit at the sides of the photo, clear of the disclosure text.
     Swiping left or right also works. */
  .lb-prev,
  .lb-next {
    width: 42px;
    height: 42px;
    top: 44%;
  }

  .lb-prev { left: 0.4rem; }
  .lb-next { right: 0.4rem; }

  .lb-stage img {
    inset: 0;
    width: 100%;
  }
}

/* ---------- Scroll reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal,
  .js .tile {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  }

  .js .reveal.is-in,
  .js .tile.is-in {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
