:root {
  color-scheme: dark;
  --bg: #04080b;
  --bg-deep: #020405;
  --surface: #0a1015;
  --surface-soft: rgba(10, 16, 21, 0.72);
  --line: rgba(220, 241, 246, 0.16);
  --line-strong: rgba(220, 241, 246, 0.28);
  --text: #f5f8f8;
  --soft: #d8e2e4;
  --muted: #a5b5ba;
  --accent: #43dbe7;
  --accent-strong: #20bfd0;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #050a0d 0%, var(--bg) 48%, #071014 100%);
  color: var(--text);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid transparent;
  padding: 24px clamp(22px, 4vw, 54px);
  background: linear-gradient(180deg, rgba(4, 8, 11, 0.88), rgba(4, 8, 11, 0));
}

.gallery-header {
  position: sticky;
  background: rgba(5, 9, 12, 0.94);
  border-bottom-color: var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

body[data-page="home"] .brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.95rem);
  font-weight: 500;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 5vw, 72px);
  color: var(--soft);
  font-size: 0.92rem;
  font-weight: 500;
}

.site-nav a {
  position: relative;
  text-decoration: none;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: -13px;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}

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

.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a[aria-current="page"]::after {
  background: var(--accent);
}

.hero {
  position: relative;
  min-height: 68vh;
  display: flex;
  align-items: center;
  padding: 130px clamp(22px, 6vw, 96px) 96px;
  overflow: hidden;
}

.hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 28vh;
  background: linear-gradient(180deg, transparent, var(--bg-deep));
  content: "";
  pointer-events: none;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: #071017;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.78;
}

.hero-media::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 6, 8, 0.86), rgba(3, 6, 8, 0.28) 54%, rgba(3, 6, 8, 0.5)),
    linear-gradient(180deg, rgba(3, 6, 8, 0.08), rgba(3, 6, 8, 0.7));
  content: "";
}

.hero-empty {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0b1a21, #020405 72%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
}

.hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4.6rem, 12vw, 10rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-content p {
  max-width: 520px;
  margin-top: 28px;
  color: var(--soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  line-height: 1.25;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 40px;
}

.button-link,
.text-link,
.tag-button,
.lightbox-close {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 12px 24px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
}

.button-link,
.tag-button[aria-pressed="true"] {
  border-color: rgba(67, 219, 231, 0.78);
  background: var(--accent-strong);
  color: #031012;
}

.text-link,
.tag-button,
.lightbox-close {
  background: rgba(6, 12, 16, 0.46);
  color: var(--text);
}

.home-gallery {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 82px);
  align-items: start;
  border-top: 1px solid rgba(220, 241, 246, 0.08);
  padding: 40px clamp(22px, 4vw, 54px) 88px;
  background: var(--bg-deep);
}

.section-label {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.home-gallery h2,
.about-hero h1 {
  margin-top: 28px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: 0;
}

.section-rule {
  width: 84px;
  height: 2px;
  display: block;
  margin: 30px 0 34px;
  background: var(--accent);
}

.home-gallery-copy > p:not(.section-label),
.about-hero p,
.about-copy p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-top: 42px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
}

.arrow-link::after {
  content: "->";
  font-size: 1.1rem;
  letter-spacing: 0;
}

.home-feature-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.35fr) repeat(2, minmax(220px, 1fr));
  gap: 16px;
}

.feature-card {
  min-width: 0;
  min-height: 360px;
  position: relative;
  display: block;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: var(--surface);
  color: inherit;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.feature-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 320ms ease, opacity 320ms ease;
}

.feature-card::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(2, 4, 5, 0.88));
  content: "";
}

.feature-card:hover img,
.feature-card:focus-visible img,
.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.025);
  opacity: 0.9;
}

.feature-card-copy {
  position: absolute;
  right: 22px;
  bottom: 24px;
  left: 22px;
  z-index: 2;
  display: block;
}

.feature-card h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-weight: 500;
}

.feature-card p {
  margin-top: 8px;
  color: rgba(216, 226, 228, 0.7);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.5;
  text-transform: uppercase;
}

.open-mark {
  width: 38px;
  height: 38px;
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(5, 9, 12, 0.58);
  color: var(--text);
}

.open-mark svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.8;
}

.gallery-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(180deg, #071014 0%, #060b0e 100%);
  background-size: 96px 96px, 96px 96px, auto;
}

.gallery-archive {
  width: min(1510px, calc(100% - 72px));
  margin: 0 auto;
  padding: 56px 0 92px;
}

.archive-heading {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 560px);
  gap: 40px;
  align-items: end;
  margin-bottom: 32px;
}

.archive-heading h1 {
  font-size: clamp(3.4rem, 7vw, 5.2rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0;
}

.archive-heading p {
  max-width: 460px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.archive-search {
  display: block;
}

.archive-search span,
.sort-control span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.archive-search input,
.sort-control select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(8, 14, 18, 0.64);
  color: var(--text);
  outline: none;
}

.archive-search input {
  padding: 0 18px;
}

.archive-search input:focus,
.sort-control select:focus {
  border-color: var(--accent);
}

.archive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.tag-filters {
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tag-button {
  min-height: 38px;
  border-radius: 5px;
  padding: 8px 18px;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.sort-control {
  width: min(210px, 100%);
  flex: 0 0 auto;
}

.sort-control select {
  appearance: none;
  padding: 0 40px 0 16px;
  background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 18px 16px;
}

.gallery-item {
  width: 100%;
  display: grid;
  gap: 10px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.gallery-item.is-tall {
  grid-row: span 2;
}

.gallery-item figure {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  background: var(--surface);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  aspect-ratio: var(--ratio, 4 / 3);
  object-fit: cover;
  transition: transform 260ms ease, opacity 260ms ease;
}

.gallery-item.is-tall img {
  aspect-ratio: 3 / 4.6;
}

.gallery-caption {
  display: grid;
  gap: 5px;
  padding: 0 2px 4px;
}

.gallery-caption h2 {
  font-size: 0.96rem;
  font-weight: 500;
}

.gallery-tags,
.lightbox-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.gallery-tag {
  color: rgba(67, 219, 231, 0.7);
  font-size: 0.78rem;
  line-height: 1.5;
}

.gallery-empty {
  display: none;
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 20px;
  color: var(--muted);
}

.gallery-empty.is-visible {
  display: block;
}

.lightbox {
  width: min(1180px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 8, 11, 0.96);
  color: var(--text);
  padding: 0;
  box-shadow: var(--shadow);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.lightbox img {
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  background: #020405;
}

.lightbox-copy {
  padding: 22px;
}

.lightbox-copy h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 500;
}

.lightbox-copy p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.lightbox-tags {
  margin-top: 14px;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  border-radius: 5px;
  cursor: pointer;
}

.about-page {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
  padding: 150px 0 92px;
}

.about-hero {
  min-height: 42vh;
  display: grid;
  align-content: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 36px;
}

.about-hero h1 {
  margin-top: 0;
}

.about-hero p {
  max-width: 620px;
  margin-top: 18px;
}

.about-copy {
  display: grid;
  gap: 20px;
  padding-top: 34px;
}

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

  .feature-card {
    min-height: 300px;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .site-header {
    position: absolute;
  }

  .gallery-header {
    position: sticky;
  }

  .hero {
    min-height: 76vh;
    padding-top: 120px;
  }

  .home-gallery,
  .archive-heading {
    grid-template-columns: 1fr;
  }

  .home-feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: 360px;
  }

  .archive-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sort-control {
    width: 100%;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .site-nav {
    gap: 22px;
    font-size: 0.86rem;
  }

  .hero {
    min-height: auto;
    padding: 150px 20px 78px;
  }

  .hero h1 {
    font-size: clamp(4rem, 24vw, 6.2rem);
  }

  .hero-content p {
    font-size: 1.25rem;
  }

  .button-link,
  .text-link {
    width: 100%;
  }

  .home-gallery,
  .gallery-archive {
    width: auto;
    padding-right: 20px;
    padding-left: 20px;
  }

  .feature-card {
    min-height: 300px;
  }

  .archive-heading h1 {
    font-size: 3.2rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

}
