/* =========================================================
   Lost Ontario — base tokens, reset, typography
   ========================================================= */
:root {
  --bg:           #0c0b09;
  --bg-elev:      #15130f;
  --bg-card:      #1b1814;
  --line:         #2a2520;
  --line-soft:    #1f1c18;
  --ink:          #ece6dc;
  --ink-soft:     #b8ad9c;
  --ink-mute:     #7a7164;
  --accent:       #c98a4b;        /* weathered copper */
  --accent-hi:    #e0a467;
  --accent-soft:  rgba(201,138,75,.14);
  --radius:       14px;
  --radius-lg:    22px;
  --shadow:       0 10px 40px -10px rgba(0,0,0,.6);
  --maxw:         1280px;
  --pad:          clamp(20px, 4vw, 56px);
  --t-fast:       180ms cubic-bezier(.2,.7,.2,1);
  --t-med:        420ms cubic-bezier(.2,.7,.2,1);
  --font-sans:    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif:   "Cormorant Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--accent); color: #1a1410; }

/* =========================================================
   Nav
   ========================================================= */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: linear-gradient(to bottom, rgba(12,11,9,.85), rgba(12,11,9,.45));
  border-bottom: 1px solid var(--line-soft);
}
/* Brand wordmark — italic copper accent + hairline under-mark used in both
   nav and footer so the identity reads the same in either spot. */
.brand {
  display: inline-flex; align-items: center; gap: 0;
  position: relative; padding-bottom: 4px;
}
.brand::after {
  content: '';
  position: absolute; left: 0; right: 30%; bottom: 0;
  height: 1px;
  background: linear-gradient(to right, var(--accent) 0%, transparent 100%);
  opacity: .55;
}
.brand-mark {
  width: 32px; height: 32px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.brand-text {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.005em;
}
.brand-text-accent {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
  margin-left: 8px;
}

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 14px; color: var(--ink-soft);
  transition: color var(--t-fast);
}
.nav-links a:hover { color: var(--ink); }
/* CTA — solid copper-soft fill with copper border is the resting state; the
   hover state fills with full accent and inverts the label colour. */
.nav-cta {
  padding: 9px 16px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--ink) !important;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.nav-cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1410 !important;
}

/* Categories dropdown — built on <details>/<summary> so it works without
   JS on touch devices. A small IIFE in script.js closes the menu when the
   user clicks outside or follows a link inside it. */
.nav-dropdown { position: relative; }
.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 8px;
  transition: color var(--t-fast);
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
/* Chevron lives in the bottom-right of its 6×6 box (right+bottom borders only),
   so rotation must pivot around 75%/75% — the chevron's own visual centre —
   otherwise flipping it makes the shape jump position. margin-bottom lifts the
   whole glyph up by 2px so the chevron sits on the text baseline. */
.nav-dropdown summary::after {
  content: '';
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transform-origin: 75% 75%;
  margin-bottom: 2px;
  transition: transform var(--t-fast);
}
.nav-dropdown[open] summary::after { transform: rotate(-135deg); }
.nav-dropdown summary:hover { color: var(--ink); }

.nav-dropdown-menu {
  position: absolute; top: calc(100% + 14px); right: 0;
  background: rgba(12,11,9,.95);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  min-width: 220px;
  display: flex; flex-direction: column; gap: 2px;
  z-index: 100;
}
.nav-dropdown-menu a {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px; color: var(--ink-soft);
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-dropdown-menu a:hover { background: var(--accent-soft); color: var(--ink); }

@media (max-width: 720px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .nav-dropdown { display: none; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 140px var(--pad) 80px;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: -10% -5%;
  z-index: -2;
  overflow: hidden;
}
/* Dark gradient overlay sits above the crossfading layers. */
.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,11,9,.2) 0%, rgba(12,11,9,.6) 55%, var(--bg) 100%);
  z-index: 2; pointer-events: none;
}
/* Two stacked layers, opacity-toggled by JS for a slow crossfade. */
.hero-bg-layer {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: grayscale(.35) contrast(1.05) brightness(.7);
  opacity: 0;
  transition: opacity 1500ms ease;
  will-change: opacity;
}
.hero-bg-layer.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .hero-bg-layer { transition: none; }
}
.hero-grain {
  position: absolute; inset: 0; z-index: -1;
  opacity: .35; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
}

.hero-inner { max-width: 880px; }
.hero-eyebrow {
  text-transform: uppercase; letter-spacing: .3em;
  font-size: 11px; color: var(--accent);
  margin: 0 0 24px;
}
.hero-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(48px, 9vw, 124px);
  line-height: .95; letter-spacing: -0.02em;
  margin: 0 0 28px;
}
.hero-title em { color: var(--accent); font-style: italic; }
.hero-sub {
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--ink-soft);
  max-width: 60ch; margin: 0 0 36px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 64px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 500; letter-spacing: .02em;
  transition: transform var(--t-fast), background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #1a1410; }
.btn-primary:hover { background: var(--accent-hi); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); }


/* Hero slideshow nav — prev / counter / next */
.hero-nav {
  position: absolute; bottom: 28px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  z-index: 1;
}
.hero-nav-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  padding: 0;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.hero-nav-btn:hover,
.hero-nav-btn:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}
.hero-nav-icon {
  display: block;
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero-counter {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--ink-soft);
  letter-spacing: .08em;
  min-width: 6ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   Counts strip — small dateline between hero and map that
   signals scale ("X sites · Y provinces · Z categories")
   without taking up a full editorial section.
   ========================================================= */
.counts {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 28px var(--pad);
  background: var(--bg-elev);
}
.counts-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: 4px 0;
}
.count-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px clamp(20px, 4vw, 48px);
}
.count-num {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(26px, 3vw, 34px);
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.count-label {
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--ink-mute);
}
.count-divider {
  width: 1px; height: 36px;
  background: var(--line);
}
@media (max-width: 720px) {
  .count-divider { display: none; }
  .count-item { padding: 6px 20px; }
}

/* =========================================================
   Featured site — full-bleed band that pulls one site to the
   front so the home page has actual *content* before users
   have to drill into geography or category.
   ========================================================= */
.featured {
  border-top: 1px solid var(--line-soft);
  padding: clamp(80px, 12vw, 140px) var(--pad);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-elev) 100%);
}
.featured-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.featured-image {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  position: relative;
  box-shadow: var(--shadow);
}
.featured-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 900ms cubic-bezier(.2,.7,.2,1), filter 400ms;
  filter: grayscale(.15) brightness(.95);
}
.featured-image:hover img { transform: scale(1.03); filter: none; }
.featured-body .section-title { margin: 6px 0 22px; }
.featured-meta {
  font-size: 11px; text-transform: uppercase; letter-spacing: .28em;
  color: var(--ink-mute);
  display: flex; gap: 14px; align-items: center;
  margin: 0 0 18px;
}
.featured-meta-dot {
  width: 4px; height: 4px; border-radius: 999px;
  background: var(--accent);
  display: inline-block;
}
.featured-intro {
  color: var(--ink-soft); font-size: 17px; line-height: 1.6;
  margin: 0 0 28px;
  max-width: 52ch;
}
@media (max-width: 820px) {
  .featured-inner { grid-template-columns: 1fr; }
}

/* =========================================================
   Atlas — small editorial cards, one per category, with cover
   + count. The thematic counterpart to the geographic map.
   ========================================================= */
.atlas {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(80px, 12vw, 140px) var(--pad);
}
.atlas-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 14px;
  margin-top: 48px;
}
.atlas-card { grid-column: span 2; }
/* Second row: three cards offset by one column so they sit centered
   under the four above, each one straddling the gap between two top
   cards (a brick layout — keeps every card the same width and on the
   same grid, so nothing floats between rails). */
.atlas-card:nth-child(5) { grid-column: 2 / span 2; }
@media (max-width: 980px) {
  .atlas-grid { grid-template-columns: repeat(4, 1fr); }
  .atlas-card,
  .atlas-card:nth-child(5) { grid-column: span 2; }
}
@media (max-width: 560px) {
  .atlas-grid { grid-template-columns: 1fr; }
  .atlas-card,
  .atlas-card:nth-child(5) { grid-column: auto; }
}
.atlas-card {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  color: inherit; text-decoration: none;
  display: block;
}
.atlas-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 700ms cubic-bezier(.2,.7,.2,1);
}
.atlas-card:hover img { transform: scale(1.05); }
.atlas-card-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 18px 16px;
  background: linear-gradient(to top, rgba(0,0,0,.9), transparent 90%);
}
.atlas-card-name {
  font-family: var(--font-serif); font-weight: 500; font-size: 22px;
  display: block; line-height: 1.1;
  color: var(--ink);
}
.atlas-card-count {
  font-size: 10px; letter-spacing: .25em; text-transform: uppercase;
  color: var(--accent-hi); display: block; margin-top: 6px;
}
.atlas-card.is-empty {
  pointer-events: none;
}
.atlas-card.is-empty .empty-fill {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, #1f1b15 0 6px, #2a2520 6px 12px);
  opacity: .6;
}
.atlas-card.is-empty .atlas-card-count { color: var(--ink-mute); }

/* =========================================================
   Site detail — horizontal scroll carousel of photographs.
   Replaces the dense 3-col grid so a site with 20+ photos
   doesn't drown the page.
   ========================================================= */
.site-carousel {
  position: relative;
  margin-inline: calc(var(--pad) * -1);
}
.carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 8px var(--pad) 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.carousel-track::-webkit-scrollbar { height: 6px; }
.carousel-track::-webkit-scrollbar-track { background: transparent; }
.carousel-track::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }
.carousel-slide {
  flex: 0 0 min(78%, 880px);
  aspect-ratio: 4 / 3;
  scroll-snap-align: center;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow);
}
.carousel-slide img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(12, 11, 9, .82);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  z-index: 10;
  backdrop-filter: blur(6px);
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.carousel-btn:hover,
.carousel-btn:focus-visible {
  background: var(--accent); border-color: var(--accent); color: #1a1410;
  outline: none;
}
.carousel-btn svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.carousel-prev { left: clamp(8px, 2vw, 32px); }
.carousel-next { right: clamp(8px, 2vw, 32px); }
.carousel-counter {
  text-align: center; margin: 14px 0 0;
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
  .carousel-slide { flex-basis: 88%; }
  .carousel-btn { display: none; }
}


/* =========================================================
   Map of Canada — gold-on-parchment, hover-to-recolor
   ========================================================= */
.map {
  position: relative;
  width: 100%;
  padding: clamp(60px, 9vw, 110px) var(--pad) clamp(40px, 6vw, 80px);
  background: linear-gradient(180deg, #14110d 0%, #0c0b09 100%);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}
.map-grid {
  position: relative; z-index: 1;
  max-width: var(--maxw); margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.map-text { min-width: 0; }
.map-head {
  position: relative; z-index: 1;
  margin: 0 0 18px;
}
.map-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02; letter-spacing: -.01em;
  margin: 6px 0 14px;
  color: var(--ink);
}
.map-title em { color: var(--accent); font-style: italic; }
.map-sub { color: var(--ink-soft); font-size: 16px; margin: 0; }

.map-stage {
  position: relative; z-index: 1;
  width: 100%;
  margin: 0;
  display: block;
  overflow: hidden;
  /* Soft, multi-stop fade applied to the wrapper (so it stays vertical
     in screen space regardless of the inner tilt). Only the northern
     edge dissolves — the territories' Arctic islands ease into the
     background instead of being chopped. */
  -webkit-mask-image: linear-gradient(to bottom,
    transparent 0%,
    rgba(0,0,0,.25) 18%,
    rgba(0,0,0,.65) 30%,
    #000 44%,
    #000 100%);
          mask-image: linear-gradient(to bottom,
    transparent 0%,
    rgba(0,0,0,.25) 18%,
    rgba(0,0,0,.65) 30%,
    #000 44%,
    #000 100%);
}
@media (max-width: 880px) {
  .map-grid { grid-template-columns: 1fr; }
}
.map-loading {
  text-align: center; color: var(--ink-mute);
  font-size: 12px; letter-spacing: .25em; text-transform: uppercase;
  padding: 60px 0;
}
/* Counter-clockwise tilt of ~6° so NS/NB/NL no longer hang lower than
   BC — the visible bottom edge of the country reads as a level horizon.
   Slight scale-down keeps the rotated extents inside the wrapper so no
   provinces get clipped at the corners. */
.canada-svg {
  width: 100%; height: auto;
  display: block;
  overflow: visible;
  transform: rotate(-6deg) scale(.93);
  transform-origin: center center;
}

/* Province paths — solid accent fill */
.canada-svg .province,
.canada-svg .province path {
  fill: var(--accent);
  stroke: #4a2810;
  stroke-width: .55;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill var(--t-fast);
}
.canada-svg .province { outline: none; }
.canada-svg .province:hover,
.canada-svg .province:focus-visible {
  fill: var(--accent-hi);
}
.canada-svg .province:hover path,
.canada-svg .province:focus-visible path {
  fill: var(--accent-hi);
}

/* Provinces without a documented archive yet — muted, striped, non-interactive. */
.canada-svg .province-disabled,
.canada-svg .province-disabled path {
  fill: url(#disabledStripes);
  stroke: #3a3024;
  stroke-width: .55;
  stroke-linejoin: round;
  cursor: default;
  pointer-events: none;
}

.map-readout {
  position: relative; z-index: 1;
  margin: 28px 0 0;
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--ink);
  min-height: 1.6em;
}
/* =========================================================
   Province page
   ========================================================= */
.province-hero {
  position: relative;
  min-height: 70vh;
  display: grid; place-items: center;
  padding: 140px var(--pad) 80px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(201,138,75,.12), transparent 60%),
    linear-gradient(180deg, #14110d 0%, var(--bg) 100%);
}
.province-hero-inner { max-width: 720px; position: relative; z-index: 1; }
.province-hero .hero-cta { justify-content: center; }

/* =========================================================
   Section primitives
   ========================================================= */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(80px, 12vw, 160px) var(--pad);
}
.section-head { max-width: 720px; margin-bottom: 64px; }
.section-eyebrow {
  text-transform: uppercase; letter-spacing: .3em;
  font-size: 11px; color: var(--accent);
  margin: 0 0 18px;
}
.section-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(34px, 5.4vw, 68px);
  line-height: 1.02; letter-spacing: -0.01em;
  margin: 0 0 18px;
}
.section-title em { color: var(--accent); font-style: italic; }
.section-sub { color: var(--ink-soft); font-size: 17px; margin: 0; max-width: 60ch; }

/* =========================================================
   Filters
   ========================================================= */
.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 32px;
}
.filters-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .25em;
  color: var(--ink-mute);
  margin-right: 4px;
}
.chip {
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-soft);
  transition: all var(--t-fast);
}
.chip:hover { color: var(--ink); border-color: var(--ink-mute); }
.chip.is-active {
  background: var(--accent); color: #1a1410; border-color: var(--accent);
}


/* =========================================================
   Gallery — fixed 3×3 grid of rectangular tiles
   - uniform aspect ratio keeps the layout calm and editorial
   - content-visibility offloads offscreen items
   ========================================================= */
/* The grid breaks out of the section's horizontal padding so the tiles
   take the full section width while the section-head above stays in its
   normal editorial column. Keeps the section box unchanged. */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-inline: calc(var(--pad) * -1);
}

.gallery-item {
  /* `figure` has a UA default of `margin: 0 40px` — without zeroing it
     the tiles render 80px narrower than their grid column and the extra
     space reads as a wide horizontal channel between tiles. */
  margin: 0;
  aspect-ratio: 4 / 3;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
  content-visibility: auto;
  contain-intrinsic-size: 1px 400px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.gallery-item.is-in { opacity: 1; transform: none; }

/* Each tile is wrapped in an <a> so the whole cover is clickable; the link
   fills the figure and inherits color so default browser link styling
   (gold underline) doesn't leak into the caption text. */
.gallery-link {
  display: block;
  width: 100%; height: 100%;
  color: inherit; text-decoration: none;
  position: relative;
}
.gallery-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #1a1714, #25201b);
  transition: transform 900ms cubic-bezier(.2,.7,.2,1), filter 400ms;
  filter: grayscale(.15) brightness(.95);
}
.gallery-item:hover img { transform: scale(1.04); filter: none; }

.gallery-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 16px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.85), transparent);
  color: var(--ink);
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px;
  opacity: 0; transform: translateY(6px);
  transition: opacity var(--t-med), transform var(--t-med);
}
.gallery-item:hover figcaption { opacity: 1; transform: none; }
.gallery-item figcaption strong {
  font-family: var(--font-serif); font-weight: 500; font-size: 18px;
  display: block; line-height: 1.15;
}
.gallery-item figcaption span {
  font-size: 11px; text-transform: uppercase; letter-spacing: .2em;
  color: var(--accent-hi);
}
.gallery-item .tag {
  flex-shrink: 0;
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px;
  background: rgba(255,255,255,.08); color: var(--ink-soft);
  backdrop-filter: blur(4px);
}

/* Interior-map / sketch on a site detail page. Full-width within the
   section, slightly rounded, with a subtle border so a plain sketch on
   a light background still reads against the dark page. */
.site-map-img {
  display: block;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: #1a1714;
}

.gallery-sentinel { height: 1px; }
.gallery-status {
  text-align: center; color: var(--ink-mute);
  font-size: 12px; letter-spacing: .25em; text-transform: uppercase;
  margin: 48px 0 0;
}

/* =========================================================
   About
   ========================================================= */
.about { border-top: 1px solid var(--line-soft); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
}
.about-body p { color: var(--ink-soft); font-size: 17px; margin: 0 0 18px; }
.about-body .btn { margin-top: 12px; }

/* =========================================================
   Contact page
   ========================================================= */
.contact {
  max-width: 720px;
  margin: 0 auto;
  padding: 160px var(--pad) 120px;
}
.contact-head { margin-bottom: 56px; }
.contact-head .section-title { margin-bottom: 24px; }
.contact-intro {
  color: var(--ink-soft); font-size: 17px; margin: 0;
  max-width: 56ch;
}
.contact-form { display: grid; gap: 22px; }
.contact-field { display: flex; flex-direction: column; gap: 8px; }
.contact-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .25em;
  color: var(--ink-mute);
}
.contact-field input,
.contact-field select,
.contact-field textarea {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 16px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev);
}
.contact-field textarea { resize: vertical; min-height: 180px; line-height: 1.55; }
.contact-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.contact-status {
  font-size: 13px; color: var(--ink-mute);
  min-height: 1.2em;
}
.contact-status.is-ok { color: var(--accent); }


/* =========================================================
   Footer
   ========================================================= */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 56px var(--pad);
  background: var(--bg-elev);
}
/* No max-width here — keeps the brand flush against the page's left padding
   so it lines up with the nav wordmark on wide screens. */
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
  justify-content: space-between;
}
.footer p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.footer-meta { color: var(--ink-mute) !important; }

/* =========================================================
   Back-to-top — injected by script.js on every page
   ========================================================= */
.back-to-top {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  width: 48px; height: 48px;
  display: grid; place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1410;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  /* visibility transition delayed on hide so the fade can finish first */
  transition: opacity 220ms ease, transform 220ms ease,
              background var(--t-fast), visibility 0s linear 220ms;
  z-index: 50;
  box-shadow: 0 8px 20px rgba(0,0,0,.4);
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 220ms ease, transform 220ms ease,
              background var(--t-fast), visibility 0s;
}
.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--accent-hi);
  outline: none;
}
.back-to-top-icon {
  display: block;
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================
   Motion / accessibility
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .gallery-item { opacity: 1; transform: none; }
}
