* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f2f2f7;
  --surface: rgba(255, 255, 255, 0.92);
  --text: #111114;
  --muted: #6b6b73;
  --border: rgba(17, 17, 20, 0.08);
  --accent: #0a84ff;
  --gallery-canvas: #e8ebf2;
  --gallery-tile: #dfe4ec;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 18px 40px rgba(25, 28, 35, 0.08);
}

[data-theme="dark"] {
  --bg: #0a0a0d;
  --surface: rgba(28, 28, 30, 0.9);
  --text: #f5f5f7;
  --muted: #a1a1aa;
  --border: rgba(245, 245, 247, 0.12);
  --accent: #64d2ff;
  --gallery-canvas: #1f2024;
  --gallery-tile: #2a2b30;
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.42);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: var(--bg-custom, var(--bg));
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-custom, var(--bg)) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1160px;
  margin: 0 auto;
}

.logo {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: 1rem;
  letter-spacing: 0;
  font-weight: 600;
  text-transform: lowercase;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1rem;
  align-items: center;
}

.nav-links a,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.1rem;
  padding: 0 0.72rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 0.85rem;
  transition: 180ms ease;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

.nav-links a:hover,
.theme-toggle:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 3rem 1rem 4rem;
}

.hero-section {
  padding: 1.6rem 1.6rem 1.5rem;
  margin-bottom: 1.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.hero-section h1 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-weight: 650;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: none;
  white-space: nowrap;
}

.hero-copy {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-cta {
  margin-top: 1rem;
  display: inline-flex;
  font-weight: 600;
  font-size: 0.88rem;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
}

.hero-cta:hover {
  opacity: 0.9;
}

.gallery-section {
  margin-bottom: 2.8rem;
}

.category-filter {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  transition: 180ms ease;
}

.filter-btn:hover {
  color: var(--text);
}

.filter-btn.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.bw-toggle-btn,
.film-toggle-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  transition: 180ms ease;
}

.bw-toggle-btn {
  margin-left: auto;
}

.film-toggle-btn {
  margin-left: 0.35rem;
}

.bw-toggle-btn:hover,
.film-toggle-btn:hover {
  color: var(--text);
}

.bw-toggle-btn[aria-pressed="true"],
.film-toggle-btn[aria-pressed="true"] {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.gallery-grid {
  --row-unit: 46px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: var(--row-unit);
  grid-auto-flow: dense;
  gap: 0.72rem;
  padding: 0.72rem;
  border-radius: 20px;
  background: var(--gallery-canvas);
  border: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
}

.gallery-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 0 0.3rem;
}

.gallery-progress {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gallery-load-more {
  min-height: 2.6rem;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: 180ms ease;
}

.gallery-load-more:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.gallery-item {
  position: relative;
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
  background: var(--gallery-tile);
  animation: rise-in 520ms ease both;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease, filter 220ms ease;
}

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

.gallery-item .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 58%);
  opacity: 0;
  transition: opacity 200ms ease;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 1rem;
}

.gallery-item:hover .overlay {
  opacity: 1;
}

.gallery-item .overlay-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.gallery-item .overlay-title {
  color: #fff;
  font-weight: 400;
  font-size: 0.82rem;
  line-height: 1.2;
}

.gallery-item .overlay-film {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 400;
  font-size: 0.72rem;
  line-height: 1.2;
}

.gallery-item .like-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.44);
  color: #fff;
  padding: 0.32rem 0.56rem;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 400;
  z-index: 10;
  transition: 180ms ease;
  opacity: 0;
  pointer-events: none;
}

.gallery-item .like-btn:hover {
  background: rgba(0, 0, 0, 0.62);
}

.gallery-item:hover .like-btn,
.gallery-item:focus-within .like-btn {
  opacity: 1;
  pointer-events: auto;
}

.gallery-item .like-btn.liked {
  border-color: rgba(255, 255, 255, 0.75);
  color: #fff;
}

.about-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.about-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 35%);
}

[data-theme="dark"] .about-section::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 35%);
}

.about-heading {
  font-size: 0.75rem;
  font-weight: 550;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.95rem;
  position: relative;
  z-index: 1;
}

.about-text {
  max-width: 82ch;
  margin: 0;
  padding-left: 50px;
  text-align: left;
  position: relative;
  z-index: 1;
}

.about-text p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.68;
  margin-bottom: 0.85rem;
  max-width: 78ch;
  margin-left: 0;
  margin-right: 0;
}

.email-link {
  display: inline-flex;
  margin-top: 1.1rem;
  align-items: center;
  color: var(--text);
  font-weight: 600;
  font-size: 0.86rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  position: relative;
  z-index: 1;
}

.about-section .email-link::before {
  content: "";
  position: absolute;
  top: -1.25rem;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--border);
}

.email-link:hover {
  transform: translateY(-1px);
}

.footer {
  text-align: center;
  padding: 2.4rem 0.6rem 1.6rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms ease;
  padding: 1rem;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 12;
  opacity: 0.75;
}

.lightbox-prev {
  left: max(0.6rem, calc(50% - (min(1080px, 94vw) / 2) - 3.3rem));
}

.lightbox-next {
  right: max(0.6rem, calc(50% - (min(1080px, 94vw) / 2) - 3.3rem));
}

.lightbox-nav[disabled] {
  opacity: 0;
  pointer-events: none;
}

.lightbox-img {
  max-width: min(1080px, 94vw);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 0.7rem;
  transition: filter 220ms ease;
}

body.bw-enabled .gallery-item img,
body.bw-enabled .lightbox-img {
  filter: grayscale(1) contrast(1.1);
}

body.iso400-enabled .gallery-item img,
body.iso400-enabled .lightbox-img {
  filter: contrast(1.08) saturate(1.14) sepia(0.2) brightness(0.95) hue-rotate(-7deg);
}

body.iso400-enabled .gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 34%, rgba(0, 0, 0, 0.24) 100%),
    repeating-radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.08) 0 0.8px, rgba(0, 0, 0, 0.07) 0.8px 1.6px);
  mix-blend-mode: soft-light;
  opacity: 0.72;
}

body.iso400-enabled .lightbox.active::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.5) 100%),
    repeating-radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.09) 0 0.8px, rgba(0, 0, 0, 0.08) 0.8px 1.7px);
  mix-blend-mode: soft-light;
  opacity: 0.66;
}

.lightbox-title {
  color: #c9ced6;
  margin-top: 0.85rem;
  font-size: 0.84rem;
  text-align: center;
  opacity: 0.78;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.lightbox-title-main {
  font-size: 0.84rem;
  font-weight: 400;
}

.lightbox-title-sub {
  font-size: 0.74rem;
  color: #a7afb9;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 840px) {
  main {
    padding-top: 1.35rem;
  }

  .nav-links {
    gap: 0.5rem;
  }

  .nav-links a {
    min-height: 1.95rem;
    padding: 0 0.65rem;
    font-size: 0.8rem;
  }

  .hero-section {
    margin-bottom: 1.5rem;
  }

  .category-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 0.15rem 0.35rem;
    margin-inline: -0.15rem;
    scroll-snap-type: x proximity;
    mask-image: linear-gradient(to right, transparent 0, black 14px, black calc(100% - 14px), transparent 100%);
  }

  .category-filter::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    white-space: nowrap;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .bw-toggle-btn {
    margin-left: 0;
    flex: 0 0 auto;
  }

  .film-toggle-btn {
    margin-left: 0;
    flex: 0 0 auto;
  }

  .gallery-grid {
    gap: 0.55rem;
    padding: 0.55rem;
  }

  .lightbox-nav {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 1rem;
  }

  .lightbox-prev {
    left: max(0.35rem, calc(50% - (min(1080px, 94vw) / 2) - 2.8rem));
  }

  .lightbox-next {
    right: max(0.35rem, calc(50% - (min(1080px, 94vw) / 2) - 2.8rem));
  }
}

@media (max-width: 520px) {
  .header {
    padding: 0.6rem 0.75rem;
  }

  .logo {
    font-size: 1.1rem;
  }

  main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-bottom: 2.6rem;
  }

  .hero-section h1 {
    white-space: normal;
  }

  .category-filter {
    padding-bottom: 0.3rem;
  }

  .gallery-grid {
    border-radius: 16px;
    gap: 0.45rem;
    padding: 0.45rem;
  }

  .about-section {
    padding: 1.1rem;
  }

  .about-text {
    padding-left: 24px;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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