:root {
  --surface: rgba(35, 26, 16, 0.06);
  --surface-hover: rgba(35, 26, 16, 0.1);
  --header-toggle-bg: var(--surface);
  --header-toggle-bg-hover: var(--surface-hover);
  --text-main: #2f2a25;
  --text-muted: #60564e;
  --text-soft: #7e7368;
  --shadow-strong: 0 32px 64px rgba(33, 26, 20, 0.28);
  --shadow-soft: 0 14px 28px rgba(33, 26, 20, 0.14);
  --focus-ring: rgba(124, 95, 66, 0.4);
  --overlay-wash: rgba(7, 10, 16, 0);
  --lightbox-atmosphere-open-opacity: 0.0;
  --lightbox-caption-color: rgba(42, 34, 28, 0.88);
  --lightbox-control-text: #f7f2ea;
  --lightbox-control-bg: rgba(34, 27, 20, 0.34);
  --lightbox-control-bg-hover: rgba(34, 27, 20, 0.46);
  --radius-frame: 0px;
  --theme-switch-duration: 600ms;
  --ease-standard: cubic-bezier(0.2, 0.75, 0.2, 1);
  --content-width: min(1400px, 92vw);
  --gallery-gap: clamp(0.85rem, 1.2vw, 1.2rem);
}

html[data-theme="dark"] {
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --header-toggle-bg: rgba(240, 246, 255, 0.11);
  --header-toggle-bg-hover: rgba(240, 246, 255, 0.18);
  --text-main: #e8ecf5;
  --text-muted: #a9b2c6;
  --text-soft: #7d8698;
  --shadow-strong: 0 36px 70px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 16px 35px rgba(0, 0, 0, 0.35);
  --focus-ring: rgba(180, 206, 255, 0.42);
  --overlay-wash: rgba(7, 10, 16, 0);
  --lightbox-atmosphere-open-opacity: 0.0;
  --lightbox-caption-color: rgba(225, 232, 245, 0.88);
  --lightbox-control-text: #e8edf8;
  --lightbox-control-bg: rgba(255, 255, 255, 0.12);
  --lightbox-control-bg-hover: rgba(255, 255, 255, 0.2);
}

html.theme-animating body,
html.theme-animating h1,
html.theme-animating .intro,
html.theme-animating .gallery-status,
html.theme-animating .theme-toggle,
html.theme-animating .gallery-load-more,
html.theme-animating .scroll-top-button,
html.theme-animating .lightbox-atmosphere,
html.theme-animating .lightbox-close,
html.theme-animating .lightbox-nav,
html.theme-animating .lightbox-caption {
  transition:
    color var(--theme-switch-duration) var(--ease-standard),
    background-color var(--theme-switch-duration) var(--ease-standard),
    background var(--theme-switch-duration) var(--ease-standard),
    box-shadow var(--theme-switch-duration) var(--ease-standard),
    border-color var(--theme-switch-duration) var(--ease-standard),
    opacity var(--theme-switch-duration) var(--ease-standard);
}

html.language-animating .i18n-text,
html.language-animating #language-toggle,
html.language-animating #language-toggle-overlay {
  animation: language-crossfade 340ms var(--ease-standard);
}

@keyframes language-crossfade {
  0% {
    opacity: 1;
  }

  45% {
    opacity: 0.26;
  }

  100% {
    opacity: 1;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text-main);
  background: none;
  position: relative;
  isolation: isolate;
  line-height: 1.45;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  transition: opacity var(--theme-switch-duration) var(--ease-standard);
}

body::before {
  background:
    radial-gradient(circle at 14% 18%, rgba(182, 176, 164, 0.08), transparent 48%),
    radial-gradient(circle at 84% 28%, rgba(172, 166, 155, 0.06), transparent 38%),
    linear-gradient(162deg, #fbfaf7, #f2f0eb);
  opacity: 1;
  z-index: -2;
}

body::after {
  background:
    radial-gradient(circle at 14% 18%, rgba(44, 74, 118, 0.12), transparent 48%),
    radial-gradient(circle at 84% 28%, rgba(86, 53, 104, 0.09), transparent 38%),
    linear-gradient(162deg, #06080d, #0f131b);
  opacity: 0;
  z-index: -1;
}

html[data-theme="dark"] body::before {
  opacity: 0;
}

html[data-theme="dark"] body::after {
  opacity: 1;
}

.page-shell {
  width: var(--content-width);
  margin: 0 auto;
  padding: clamp(2.3rem, 5vw, 4.4rem) 0 clamp(3rem, 7vw, 5rem);
  transition: opacity 240ms var(--ease-standard);
}

.site-header {
  margin-bottom: clamp(1.7rem, 2.5vw, 2.6rem);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.header-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  border: 0;
  border-radius: 999px;
  min-width: 54px;
  padding: 0.39rem 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  background: var(--header-toggle-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background-color 260ms ease,
    transform 260ms ease;
}

.language-toggle {
  border: 0;
  border-radius: 999px;
  min-width: 54px;
  padding: 0.39rem 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--header-toggle-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background-color 260ms ease,
    transform 260ms ease;
}

.language-toggle:hover,
.language-toggle:focus-visible {
  background: var(--header-toggle-bg-hover);
  transform: translateY(-1px);
}

.language-toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.language-toggle-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--header-toggle-bg-hover);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.theme-toggle-icon {
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.96;
}

.theme-toggle-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0.45rem 0 0;
  font-family: "Cormorant Garamond", "Iowan Old Style", serif;
  font-size: clamp(2.45rem, 5.8vw, 5rem);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.intro {
  max-width: 58ch;
  margin: 0.4rem 0 0;
  margin-left: 0.60rem;
  color: var(--text-soft);
  font-size: clamp(0.92rem, 1.16vw, 1.03rem);
  line-height: 1.62;
  font-style: italic;
}

.intro-emphasis {
  color: var(--text-muted);
  font-weight: 450;
  letter-spacing: 0.006em;
}

.gallery-grid {
  display: grid;
  position: relative;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gallery-gap);
  align-items: start;
}

.photo-card {
  position: relative;
  margin: 0;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 260ms var(--ease-standard),
    transform 260ms var(--ease-standard);
}

.photo-card.is-positioned {
  opacity: 1;
  transform: translateY(0);
}

.photo-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-frame);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transform: translateY(0) scale(1);
  transition:
    transform 380ms var(--ease-standard),
    box-shadow 380ms var(--ease-standard),
    background-color 380ms var(--ease-standard);
  box-shadow: var(--shadow-soft);
  outline: none;
}

.photo-button:focus-visible {
  box-shadow:
    0 0 0 2px var(--focus-ring),
    var(--shadow-soft);
}

.photo-button:hover {
  transform: translateY(-4px) scale(1.018);
  background: var(--surface-hover);
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.46);
}

.photo-thumb {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(1.05) contrast(1.02);
  transform: scale(1.002);
  transition:
    transform 550ms var(--ease-standard),
    filter 550ms var(--ease-standard),
    opacity 350ms ease;
  opacity: 0;
}

.photo-thumb.is-loaded {
  opacity: 1;
}

.photo-button:hover .photo-thumb {
  transform: scale(1.035);
  filter: saturate(1.08) contrast(1.05);
}

.gallery-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.7rem;
}

.gallery-load-more {
  border: 0;
  border-radius: 999px;
  padding: 0.39rem 0.82rem;
  min-height: 34px;
  background: var(--header-toggle-bg);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color 260ms ease,
    color 260ms ease,
    transform 260ms ease,
    opacity 260ms ease;
}

.gallery-load-more:hover,
.gallery-load-more:focus-visible {
  background: var(--header-toggle-bg-hover);
  transform: translateY(-1px);
}

.gallery-load-more:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.gallery-load-more[hidden] {
  display: none;
}

.gallery-status {
  min-height: 1.3rem;
  margin: 0.9rem 0 0;
  color: var(--text-soft);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-footer {
  margin-top: clamp(2.1rem, 5vw, 3.2rem);
  display: flex;
  justify-content: flex-end;
}

.copyright {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.82;
}

.scroll-top-button {
  position: fixed;
  right: clamp(1rem, 2.2vw, 1.7rem);
  bottom: clamp(1rem, 2.2vw, 1.7rem);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--header-toggle-bg);
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  z-index: 20;
  transition:
    opacity 260ms var(--ease-standard),
    transform 260ms var(--ease-standard),
    background-color 260ms ease,
    color 260ms ease;
}

.scroll-top-button:hover,
.scroll-top-button:focus-visible {
  background: var(--header-toggle-bg-hover);
  transform: translateY(0);
}

.scroll-top-button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.scroll-top-button.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms var(--ease-standard);
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-atmosphere {
  position: absolute;
  inset: 0;
  background: var(--overlay-wash);
  overflow: hidden;
}

.lightbox-atmosphere img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14);
  filter: blur(42px) brightness(0.72) saturate(0.9);
  opacity: 0.42;
  transition: opacity 240ms var(--ease-standard);
}

.lightbox-content {
  position: relative;
  z-index: 2;
  width: min(1690px, 90vw);
  display: grid;
  grid-template-columns: minmax(34px, 0.09fr) minmax(0, 1fr) minmax(34px, 0.09fr);
  align-items: center;
  gap: clamp(0.6rem, 1vw, 1.2rem);
}

.lightbox-figure {
  margin: 0;
  display: grid;
  justify-items: center;
  position: relative;
  width: fit-content;
  max-width: min(86vw, 1510px);
  justify-self: center;
}

.lightbox-image {
  max-height: min(81vh, 1170px);
  max-width: min(86vw, 1510px);
  border-radius: 0;
  display: block;
  box-shadow: var(--shadow-strong);
  transform: translateY(12px) scale(0.986);
  opacity: 0;
  transition:
    transform 520ms var(--ease-standard),
    opacity 520ms var(--ease-standard);
}

.lightbox-image.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.lightbox-caption {
  position: absolute;
  left: 0;
  top: calc(100% + 0.95rem);
  width: 100%;
  min-height: 0;
  color: var(--lightbox-caption-color);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1rem, 1.7vw, 1.32rem);
  letter-spacing: 0.03em;
  text-align: left;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 980ms var(--ease-standard),
    transform 980ms var(--ease-standard);
}

.lightbox-caption.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.lightbox-caption.is-empty {
  opacity: 0;
}

.lightbox-caption.is-preparing {
  opacity: 0;
  transform: translateY(18px);
  transition: none;
}

.lightbox-top-controls {
  position: absolute;
  top: clamp(1rem, 2vw, 1.6rem);
  right: clamp(1rem, 2vw, 1.6rem);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.lightbox-nav,
.lightbox-close {
  border: 0;
  color: var(--lightbox-control-text);
  background: var(--lightbox-control-bg);
  cursor: pointer;
  transition:
    background-color 300ms ease,
    transform 300ms ease;
}

.lightbox-nav {
  width: 48px;
  height: 108px;
  border-radius: 999px;
  justify-self: center;
  backdrop-filter: blur(8px);
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible,
.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: var(--lightbox-control-bg-hover);
  transform: translateY(-2px);
}

.lightbox-close {
  border-radius: 999px;
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1.56rem;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}

.lightbox-language-toggle {
  min-width: 42px;
  height: 42px;
  padding: 0 0.9rem;
  color: var(--lightbox-control-text);
  background: var(--lightbox-control-bg);
  border-radius: 999px;
}

.lightbox-theme-toggle {
  min-width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--lightbox-control-text);
  background: var(--lightbox-control-bg);
  border-radius: 999px;
}

.lightbox-top-controls .language-toggle:hover,
.lightbox-top-controls .language-toggle:focus-visible,
.lightbox-top-controls .theme-toggle:hover,
.lightbox-top-controls .theme-toggle:focus-visible {
  background: var(--lightbox-control-bg-hover);
}

.lightbox-top-controls .language-toggle-label {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}

.lightbox-top-controls .theme-toggle-label {
  display: none;
}

body.no-scroll {
  overflow: hidden;
}

body.no-scroll .page-shell {
  opacity: 0;
  pointer-events: none;
}

body.no-scroll .scroll-top-button {
  opacity: 0;
  pointer-events: none;
}

body.no-scroll .lightbox-atmosphere img {
  opacity: var(--lightbox-atmosphere-open-opacity);
}

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

  .lightbox-content {
    width: min(1690px, 98vw);
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 0.5rem;
  }

  .lightbox-nav {
    width: 36px;
    height: 84px;
  }

  .lightbox-figure,
  .lightbox-image {
    max-height: 76vh;
    max-width: min(80vw, calc(98vw - 92px));
  }
}

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

  .page-shell {
    padding-top: 1.75rem;
  }

  .lightbox-close {
    width: 38px;
    height: 38px;
    font-size: 1.4rem;
  }

  .lightbox-language-toggle {
    height: 38px;
    min-width: 38px;
    padding: 0 0.72rem;
  }

  .lightbox-top-controls {
    top: 0.75rem;
    right: 0.75rem;
  }

  .lightbox-caption {
    max-width: 88vw;
  }

  .theme-toggle-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {

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