/* =========================================================
   cityform v2 — editorial polish layer
   Sits on top of styles.css. Adds:
   · Motion utilities (reveal-on-scroll, parallax)
   · Display-scale type (oversized editorial)
   · OS-map signature device (contour lines, coord grid)
   · Cinematic hero rhythm
   · Refined controls + cards
   ========================================================= */

/* ── Display sizes (above h1) ─────────────────────────── */
.display-hero {
  font-family: 'Inter', sans-serif;
  font-variation-settings: 'opsz' 32;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.92;
  text-wrap: balance;
}
.display-section {
  font-family: 'Inter', sans-serif;
  font-variation-settings: 'opsz' 32;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 0.96;
  text-wrap: balance;
}
.serif-accent {
  font-family: 'Inter', sans-serif;
  font-style: italic;
  font-weight: 400;
  font-feature-settings: 'cv11', 'ss01';
}

/* ── Tighter, more refined buttons ────────────────────── */
.btn-v2 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 52px;
  padding: 0 26px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  border-radius: 0;
  background: var(--ink);
  color: var(--mist);
  transition: transform .25s cubic-bezier(.2,.6,.2,1), background .2s;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.btn-v2:hover { background: #000; transform: translateY(-1px); }
.btn-v2 .btn-arrow { transition: transform .25s cubic-bezier(.2,.6,.2,1); }
.btn-v2:hover .btn-arrow { transform: translateX(3px); }

.btn-v2-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-v2-ghost:hover { background: var(--ink); color: var(--mist); }

/* ── Tracked labels ───────────────────────────────────── */
.eyebrow {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--stone);
  text-transform: uppercase;
}
.eyebrow-ink { color: var(--ink); }

/* ── Reveal on scroll ─────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s cubic-bezier(.2,.6,.2,1), transform 1s cubic-bezier(.2,.6,.2,1);
  transition-delay: var(--rd, 0ms);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: translateY(0); }

.reveal-fade {
  opacity: 0;
  transition: opacity 1.4s cubic-bezier(.2,.6,.2,1);
  transition-delay: var(--rd, 0ms);
}
.reveal-fade.in { opacity: 1; }

.reveal-clip {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.2s cubic-bezier(.2,.6,.2,1);
  transition-delay: var(--rd, 0ms);
}
.reveal-clip.in { clip-path: inset(0 0 0 0); }
/* Safety net: a never-revealed clip must not hide content forever. The JS
   fail-open (~1.2s) normally wins first and drives the real .in transition;
   this 3s-delayed keyframe only matters if JS is disabled/broken. .in
   cancels it; data-motion="off" zeroes its duration (rule below). */
@keyframes reveal-clip-failopen { to { clip-path: inset(0 0 0 0); } }
.reveal-clip:not(.in) {
  animation: reveal-clip-failopen 1.2s cubic-bezier(.2,.6,.2,1) 3s forwards;
}
.reveal-clip.in { animation: none; }

.reveal-rise {
  display: inline-block;
  overflow: hidden;
}
.reveal-rise > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s cubic-bezier(.2,.7,.15,1);
  transition-delay: var(--rd, 0ms);
}
.reveal-rise.in > span { transform: translateY(0); }

/* ── OS-map signature device ──────────────────────────── */
.contour-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
}
.contour-bg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.coord-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(26,31,38,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(26,31,38,0.06) 1px, transparent 1px);
  background-size: 80px 80px;
  background-position: -1px -1px;
  z-index: 0;
}

.corner-mark {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ink);
  opacity: 0.6;
}
.corner-mark.tl { top: 24px; left: 24px; border-right: 0; border-bottom: 0; }
.corner-mark.tr { top: 24px; right: 24px; border-left: 0; border-bottom: 0; }
.corner-mark.bl { bottom: 24px; left: 24px; border-right: 0; border-top: 0; }
.corner-mark.br { bottom: 24px; right: 24px; border-left: 0; border-top: 0; }

/* ── Marquee — slow, brand ────────────────────────────── */
.marquee-track {
  display: flex;
  gap: 64px;
  animation: marquee 80s linear infinite;
  white-space: nowrap;
  width: max-content;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-row {
  display: flex;
  align-items: center;
  gap: 64px;
}

/* ── Pull quote ───────────────────────────────────────── */
.pull-quote {
  font-family: 'Inter', sans-serif;
  font-variation-settings: 'opsz' 32;
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.06;
  text-wrap: balance;
}
.pull-quote em {
  font-style: italic;
  font-weight: 400;
}

/* ── Tabular numerics for all measurement readouts ────── */
.tnum { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* ── Subtle card hover (no shadow blooms) ─────────────── */
.card-lift {
  transition: transform .35s cubic-bezier(.2,.6,.2,1), border-color .2s;
}
.card-lift:hover { transform: translateY(-3px); }

/* ── Image filter standardisation ─────────────────────── */
.img-editorial {
  filter: grayscale(0.45) contrast(1.05);
}
.img-cinema {
  filter: grayscale(0.6) contrast(1.07) brightness(0.94);
}

/* ── Scroll-driven scene shell ────────────────────────── */
.scene-pin {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow: hidden;
}

/* ── Atlas / Leaflet styling — desaturate to brand ────── */
.cf-atlas-leaflet {
  background: #ECEFEB !important;
}
.cf-atlas-leaflet .leaflet-tile-pane {
  filter: grayscale(1) brightness(1.02) contrast(0.94) sepia(0.05);
}
.leaflet-container { font-family: 'Inter', sans-serif !important; }
.leaflet-control-attribution {
  background: rgba(247, 248, 246, 0.85) !important;
  border-left: 1px solid var(--line) !important;
  border-top: 1px solid var(--line) !important;
  font-size: 9px !important;
  letter-spacing: 0.06em !important;
  color: var(--stone) !important;
}
.leaflet-popup-content-wrapper {
  background: var(--bone) !important;
  border: 1px solid var(--ink) !important;
  border-radius: 0 !important;
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.25) !important;
  padding: 0 !important;
}
.leaflet-popup-content { margin: 0 !important; min-width: 240px; }
.leaflet-popup-tip-container { display: none !important; }
.leaflet-popup-close-button { display: none !important; }
.cf-pin {
  position: relative;
}
.cf-pin .cf-pin-dot {
  width: 12px; height: 12px;
  background: var(--ink);
  border: 1px solid var(--ink);
  transition: transform .2s;
}
.cf-pin .cf-pin-dot.hollow {
  background: var(--bone);
}
.cf-pin .cf-pin-ring {
  position: absolute;
  inset: -6px;
  border: 1px solid currentColor;
  opacity: 0;
  transition: opacity .2s;
}
.cf-pin:hover .cf-pin-ring { opacity: 0.5; }
.cf-pin:hover .cf-pin-dot { transform: scale(1.2); }

/* ── Sticky context bar shadow ────────────────────────── */
.context-bar {
  position: sticky;
  top: 72px;
  z-index: 40;
  background: rgba(225, 229, 224, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

/* ── A vertical rule (used for hero callout dividers) ── */
.v-rule { display: inline-block; width: 1px; height: 14px; background: currentColor; opacity: 0.3; }

/* ── Hairline animated rule ───────────────────────────── */
.hairline-anim {
  height: 1px;
  background: var(--ink);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 1.2s cubic-bezier(.2,.6,.2,1);
  transition-delay: var(--rd, 0ms);
}
.hairline-anim.in { transform: scaleX(1); }

/* ── Cursor when picking ──────────────────────────────── */
.pick-cursor { cursor: crosshair; }

/* ── Atlas pin card popup look ────────────────────────── */
.cf-pop {
  background: var(--bone);
  padding: 16px 18px;
  min-width: 260px;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
}

/* ── Reduced motion respect ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-fade, .reveal-clip, .reveal-rise > span,
  .hairline-anim { transition: none; }
  .marquee-track { animation: none; }
}

/* ── Motion density tweak ─────────────────────────────── */
/* Off: kill nearly everything — keep hover state changes but no
   reveals, marquees, or parallax. */
html[data-motion="off"] .reveal,
html[data-motion="off"] .reveal-fade,
html[data-motion="off"] .reveal-clip,
html[data-motion="off"] .reveal-rise > span {
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
  transition: none !important;
}
html[data-motion="off"] .marquee-track { animation: none !important; }
html[data-motion="off"] * {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
}

/* Confident: bump marquee speed + reveal travel for a more lively feel. */
html[data-motion="confident"] .marquee-track { animation-duration: 60s; }
html[data-motion="confident"] .reveal { transform: translateY(36px); }
