@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display/PlayfairDisplay-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ===========================================================================
   Tokens
   ========================================================================= */

:root,
[data-theme="dark"] {
  --bg: #0a0a0b;
  --bg-sunken: #060607;
  --surface: #131315;
  --surface-2: #1b1b1e;
  --text: #f4f3f1;
  --text-muted: #a1a09c;
  --text-faint: #6d6c68;
  --border: #26262a;
  --border-strong: #37373d;
  --accent: #d3bd9d;
  --accent-soft: rgba(211, 189, 157, 0.14);
  --accent-contrast: #17130d;

  --glass: rgba(16, 16, 18, 0.62);
  --glass-solid: rgba(10, 10, 11, 0.9);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border-strong: rgba(255, 255, 255, 0.14);
  --hover: rgba(255, 255, 255, 0.06);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -6px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.75);
  --shadow-header: 0 8px 24px -6px rgba(0, 0, 0, 0.6);
  --skeleton: linear-gradient(100deg, #16161a 20%, #212127 40%, #16161a 60%);

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #fbfaf8;
  --bg-sunken: #f2f0eb;
  --surface: #ffffff;
  --surface-2: #f6f4f0;
  --text: #161513;
  --text-muted: #61605b;
  --text-faint: #92908a;
  --border: #e6e3dc;
  --border-strong: #d3cfc5;
  --accent: #8a6d43;
  --accent-soft: rgba(138, 109, 67, 0.1);
  --accent-contrast: #ffffff;

  --glass: rgba(255, 255, 255, 0.82);
  --glass-solid: rgba(251, 250, 248, 0.94);
  --glass-border: rgba(20, 18, 15, 0.12);
  --glass-border-strong: rgba(20, 18, 15, 0.18);
  --hover: rgba(20, 18, 15, 0.05);

  --shadow-sm: 0 1px 2px rgba(30, 26, 20, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(30, 26, 20, 0.16);
  --shadow-lg: 0 24px 60px -16px rgba(30, 26, 20, 0.24);
  /* Light backgrounds need a firmer edge or the floating bar disappears. */
  --shadow-header: 0 2px 8px rgba(30, 26, 20, 0.06),
    0 12px 32px -12px rgba(30, 26, 20, 0.2);
  --skeleton: linear-gradient(100deg, #eeece7 20%, #f7f6f3 40%, #eeece7 60%);

  color-scheme: light;
}

:root {
  --font-display: "Playfair Display", "Times New Roman", Georgia, serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  --header-h: 4.5rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius-sm: 0.5rem;
  --radius: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.16s;
  --dur: 0.28s;
  --dur-slow: 0.6s;
}

/* ===========================================================================
   Base
   ========================================================================= */

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

[hidden] {
  display: none !important;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
}

/* Column layout keeps the footer at the bottom of the viewport on short pages
   instead of leaving a gap beneath it. */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

main {
  flex: 1 0 auto;
}

body.is-menu-open,
body.is-lightbox-open {
  overflow: hidden;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

h1,
h2,
h3 {
  font-weight: 500;
  line-height: 1.15;
  text-wrap: balance;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 300;
  transform: translate(-50%, -120%);
  padding: 0.65rem 1.1rem;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: transform var(--dur) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
}

/* ===========================================================================
   Header
   ========================================================================= */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 0.75rem var(--gutter);
  transition: padding var(--dur) var(--ease);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 3vw, 2rem);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.55rem 0.65rem 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  transition: background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    backdrop-filter var(--dur) var(--ease);
}

/* Frosted pill appears once the page scrolls, or immediately on inner pages
   that have no full-bleed hero behind the header. */
.site-header.is-stuck .site-header__inner,
.page-gallery .site-header__inner,
.page-contact .site-header__inner {
  background: var(--glass);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-header);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}

/* Scrim so the transparent header stays legible over a bright hero. */
.page-home .site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 11rem;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.62) 0%,
    rgba(0, 0, 0, 0.28) 45%,
    rgba(0, 0, 0, 0) 100%
  );
  opacity: 1;
  transition: opacity var(--dur) var(--ease);
}

.page-home .site-header.is-stuck::before {
  opacity: 0;
}

/* A gradient alone cannot guarantee contrast against an unknown photo, so the
   header content carries its own shadow while it sits over the hero. */
.page-home .site-header:not(.is-stuck) .site-header__inner {
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.65);
}

.page-home .site-header:not(.is-stuck) .brand__mark svg,
.page-home .site-header:not(.is-stuck) .icon-btn svg {
  filter: drop-shadow(0 1px 5px rgba(0, 0, 0, 0.7));
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  color: var(--accent);
  transition: transform var(--dur) var(--ease-out);
}

.brand:hover .brand__mark {
  transform: scale(1.08);
}

.brand__mark svg {
  width: 100%;
  height: 100%;
}

/* The monogram matches the wordmark beside it. Sized in user units against the
   24x24 viewBox. */
.brand__mark text {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
}

.brand__text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.page-home .site-header:not(.is-stuck) .brand,
.page-home .site-header:not(.is-stuck) .nav a {
  color: #fff;
}

.page-home .site-header:not(.is-stuck) .brand__mark {
  color: #fff;
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav a {
  position: relative;
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  transition: color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease);
}

.nav a:hover {
  color: var(--text);
  background: var(--hover);
}

.nav a[aria-current="page"] {
  color: var(--text);
}

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.05rem;
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

.page-home .site-header:not(.is-stuck) .nav a:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  background: var(--hover);
  border-color: var(--glass-border);
}

.icon-btn svg {
  width: 1.05rem;
  height: 1.05rem;
}

.page-home .site-header:not(.is-stuck) .icon-btn {
  color: #fff;
}

.page-home .site-header:not(.is-stuck) .icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

#lang-label {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
}

/* Theme icon crossfade */
#theme-toggle svg {
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-out);
}

[data-theme="dark"] .icon-sun,
[data-theme="light"] .icon-moon {
  display: none;
}

/* Hamburger */
.nav-toggle {
  display: none;
}

.nav-toggle__bars {
  position: relative;
  width: 1.05rem;
  height: 0.7rem;
}

.nav-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--dur) var(--ease-out),
    opacity var(--dur-fast) var(--ease);
}

.nav-toggle__bars span:first-child {
  top: 0;
}

.nav-toggle__bars span:last-child {
  bottom: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:first-child {
  transform: translateY(0.345rem) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:last-child {
  transform: translateY(-0.345rem) rotate(-45deg);
}

@media (max-width: 719px) {
  .nav {
    display: none;
  }

  .nav-toggle {
    display: inline-grid;
  }
}

/* ===========================================================================
   Mobile menu
   ========================================================================= */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2.5rem;
  padding: calc(var(--header-h) + 2rem) var(--gutter) 3rem;
  background: var(--glass-solid);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  animation: menu-in var(--dur) var(--ease-out);
}

@keyframes menu-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-menu__nav a {
  padding: 0.6rem 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 11vw, 2.75rem);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  transition: color var(--dur-fast) var(--ease),
    padding-left var(--dur) var(--ease-out);
}

.mobile-menu__nav a:hover,
.mobile-menu__nav a[aria-current="page"] {
  color: var(--text);
  padding-left: 0.5rem;
}

.mobile-menu__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.mobile-menu__meta a:hover {
  color: var(--accent);
}

/* ===========================================================================
   Home hero
   ========================================================================= */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--bg-sunken);
  isolation: isolate;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.1s var(--ease), transform 12s linear;
}

.hero-image.is-loaded {
  opacity: 1;
  transform: scale(1);
}

/* Vignette: darkens top and bottom so the header and title stay readable. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.28) 0%,
      rgba(0, 0, 0, 0.05) 30%,
      rgba(0, 0, 0, 0.12) 60%,
      rgba(0, 0, 0, 0.72) 100%
    ),
    radial-gradient(
      120% 90% at 50% 45%,
      rgba(0, 0, 0, 0) 40%,
      rgba(0, 0, 0, 0.45) 100%
    );
}

.hero-overlay {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  color: #fff;
}

.hero-eyebrow {
  margin: 0 0 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.hero-eyebrow::before,
.hero-eyebrow::after {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: rgba(255, 255, 255, 0.4);
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 12vw, 7rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.5);
}

.hero-tagline {
  margin: 1.25rem 0 0;
  max-width: 30ch;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2.25rem;
  padding: 0.8rem 1.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #12100d;
  background: #fff;
  border-radius: var(--radius-pill);
  transition: transform var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.hero-cta svg {
  width: 0.9rem;
  height: 0.9rem;
  transition: transform var(--dur) var(--ease-out);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.6);
}

.hero-cta:hover svg {
  transform: translateX(3px);
}

/* Bottom bar inside the hero — replaces a footer on the single-screen home. */
.hero-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--gutter);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}

.hero-footer a:hover {
  color: #fff;
}

.hero-social {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

@media (max-width: 559px) {
  .hero-footer {
    justify-content: center;
  }

  .hero-footer .hero-copy {
    display: none;
  }
}

/* Entrance animation */
.hero-overlay > * {
  animation: rise var(--dur-slow) var(--ease-out) backwards;
}

.hero-eyebrow {
  animation-delay: 0.1s;
}
.hero-title {
  animation-delay: 0.2s;
}
.hero-tagline {
  animation-delay: 0.32s;
}
.hero-cta {
  animation-delay: 0.44s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================================================================
   Content pages
   ========================================================================= */

.content {
  max-width: 1280px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 3.5rem) var(--gutter) 5rem;
}

.content-narrow {
  max-width: 620px;
}

.page-header {
  margin-bottom: 3rem;
}

.page-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  letter-spacing: 0.02em;
}

.page-header .eyebrow {
  display: block;
  margin-bottom: 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  margin: 1rem 0 0;
  max-width: 50ch;
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.gallery-count {
  margin: 1rem 0 0;
  color: var(--text-faint);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* ===========================================================================
   Gallery filters
   ========================================================================= */

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: -1.25rem 0 2.25rem;
}

.filter-label {
  margin-right: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.tag-chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.tag-chip[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tag-chip__count {
  font-size: 0.7rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.tag-chip[aria-pressed="true"] .tag-chip__count {
  color: var(--accent);
}

.tag-chip.tag-clear {
  border-style: dashed;
  background: none;
}

/* ===========================================================================
   Gallery grid (CSS masonry columns, real image aspect ratios)
   ========================================================================= */

.gallery-grid {
  columns: 1;
  column-gap: 1rem;
}

@media (min-width: 600px) {
  .gallery-grid {
    columns: 2;
  }
}

@media (min-width: 1000px) {
  .gallery-grid {
    columns: 3;
    column-gap: 1.25rem;
  }
}

/* The card takes its height from the image inside it. Putting the ratio on the
   button instead would need `height: 100%` on the image, which is unreliable
   inside a <button> because the UA wraps button content in an anonymous
   centering box — portrait photos then overflowed and were clipped. */
.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  cursor: zoom-in;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  transition: transform var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease);
}

@media (min-width: 1000px) {
  .gallery-item {
    margin-bottom: 1.25rem;
  }
}

/* Shimmer placeholder until the photo decodes. */
.gallery-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--skeleton);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
  transition: opacity var(--dur) var(--ease);
}

.gallery-item.is-loaded::before {
  opacity: 0;
  animation: none;
}

@keyframes shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

.gallery-item img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  /* Placeholder ratio only; replaced per-image from the manifest, or from the
     image's natural size once it loads. object-fit guards against a manifest
     whose dimensions disagree with the file, cropping instead of distorting. */
  aspect-ratio: 4 / 3;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease),
    transform var(--dur-slow) var(--ease-out);
}

.gallery-item.is-loaded img {
  opacity: 1;
}

.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.gallery-item:hover img {
  transform: scale(1.04);
}

/* Hover scrim + zoom affordance */
.gallery-item__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.1) 45%,
    rgba(0, 0, 0, 0) 100%
  );
  transition: opacity var(--dur) var(--ease);
}

.gallery-item:hover .gallery-item__veil,
.gallery-item:focus-visible .gallery-item__veil {
  opacity: 1;
}

.gallery-item-tags {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(0.4rem);
  transition: opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease-out);
}

.gallery-item:hover .gallery-item-tags,
.gallery-item:focus-visible .gallery-item-tags {
  opacity: 1;
  transform: translateY(0);
}

.mini-tag {
  padding: 0.2rem 0.55rem;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Touch devices have no hover: keep the tags visible. */
@media (hover: none) {
  .gallery-item__veil,
  .gallery-item-tags {
    opacity: 1;
    transform: none;
  }
}

/* Staggered reveal as cards render. */
.gallery-item {
  animation: card-in var(--dur-slow) var(--ease-out) backwards;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================================================================
   Pagination
   ========================================================================= */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 3.5rem;
}

.pagination button {
  display: inline-grid;
  place-items: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.7rem;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease);
}

.pagination button svg {
  width: 1rem;
  height: 1rem;
}

.pagination button:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-strong);
}

.pagination button[aria-current="page"] {
  color: var(--accent-contrast);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pagination .ellipsis {
  min-width: 1.5rem;
  color: var(--text-faint);
  text-align: center;
  user-select: none;
}

/* ===========================================================================
   Empty / error states
   ========================================================================= */

.empty-state {
  margin: 5rem auto;
  max-width: 34ch;
  text-align: center;
  color: var(--text-muted);
}

/* ===========================================================================
   Lightbox
   ========================================================================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  /* minmax(0, 1fr) lets the stage row shrink; a bare 1fr has an automatic
     min-content floor, so a tall photo could push the row past the viewport. */
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: rgba(6, 6, 7, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  touch-action: pan-y;
  animation: fade-in var(--dur) var(--ease);
}

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

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter);
  color: rgba(255, 255, 255, 0.75);
}

.lightbox-counter {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}

/* Flex, not grid: a grid row is auto-sized, so the image's `max-height: 100%`
   resolved against an indefinite height and was dropped, letting portrait
   photos overflow the viewport. A flex container has a definite height here,
   so the percentage resolves. */
.lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 clamp(0.5rem, 4vw, 4.5rem);
}

.lightbox-image {
  /* Flex items refuse to shrink below their intrinsic size unless these are
     zeroed, which would reintroduce the overflow for large photos. */
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.lightbox-image.is-loaded {
  opacity: 1;
}

.lightbox-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem var(--gutter) 1.5rem;
  text-align: center;
}

.lightbox-caption {
  margin: 0;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.9);
}

.lightbox-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.lightbox-tag {
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
}

/* Lightbox controls sit on a dark backdrop, so they are always light. */
.lightbox .icon-btn {
  color: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.14);
}

.lightbox .icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  background: rgba(255, 255, 255, 0.06);
}

.lightbox-nav svg {
  width: 1.35rem;
  height: 1.35rem;
}

.lightbox-prev {
  left: clamp(0.25rem, 2vw, 1.25rem);
}

.lightbox-next {
  right: clamp(0.25rem, 2vw, 1.25rem);
}

@media (max-width: 559px) {
  .lightbox-nav {
    width: 2.5rem;
    height: 2.5rem;
  }
}

/* ===========================================================================
   Contact
   ========================================================================= */

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease);
}

.contact-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.contact-card__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}

.contact-card__icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.contact-card__body {
  min-width: 0;
}

.contact-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.15rem;
}

.contact-card__value {
  display: inline-block;
  font-size: 1.0625rem;
  color: var(--text);
  word-break: break-word;
  transition: color var(--dur-fast) var(--ease);
}

.contact-card:hover .contact-card__value {
  color: var(--accent);
}

.contact-card__arrow {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--text-faint);
  transition: transform var(--dur) var(--ease-out),
    color var(--dur-fast) var(--ease);
}

.contact-card__arrow svg {
  width: 1rem;
  height: 1rem;
}

.contact-card:hover .contact-card__arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ===========================================================================
   Footer
   ========================================================================= */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.25rem var(--gutter);
  font-size: 0.8125rem;
  color: var(--text-faint);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-nav a {
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease);
}

.footer-nav a:hover {
  color: var(--accent);
}

.footer-copy {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* ===========================================================================
   Motion preferences
   ========================================================================= */

@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;
    scroll-behavior: auto !important;
  }

  .hero-image {
    transform: none;
  }

  .hero-image.is-loaded {
    transform: none;
  }
}
