:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --ink: #101014;
  --line: #dedfe3;
  --accent: #0f766e;
  --shadow: 0 18px 45px rgba(16, 16, 20, 0.08);
  --radius: 8px;
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.42);
  outline-offset: 3px;
}

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.gallery-section {
  padding: clamp(40px, 7vw, 80px) 0;
}

.section-heading {
  margin-bottom: 28px;
  padding-top: 1px;
  border-top: 1px solid var(--line);
}

.eyebrow {
  margin: 92px 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.gallery-root {
  display: grid;
  gap: clamp(28px, 5vw, 56px);
}

.project-group {
  display: grid;
  gap: 16px;
}

.project-title {
  margin: 0;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.2;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.gallery-card {
  grid-column: span 4;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.gallery-card:nth-child(1),
.gallery-card:nth-child(2) {
  grid-column: span 6;
}

.gallery-card:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: var(--shadow);
}

.gallery-card button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #eef0f3;
  object-fit: contain;
}

.empty-state {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.gallery-card:nth-child(3n) .thumb {
  aspect-ratio: 4 / 3;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 12px;
  padding: 72px 22px 28px;
  background: rgba(10, 10, 12, 0.88);
}

.lightbox.is-open {
  display: grid;
}

.lightbox-content {
  min-width: 0;
  margin: 0;
}

.lightbox img {
  max-height: calc(100dvh - 120px);
  width: auto;
  margin: 0 auto;
  border-radius: var(--radius);
  background: #ffffff;
  object-fit: contain;
}

.lightbox-close,
.lightbox-nav {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  transition: background 180ms ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 34px;
  line-height: 1;
}

.lightbox-nav {
  font-size: 36px;
}

@media (max-width: 860px) {
  .eyebrow {
    margin-top: 48px;
  }

  .gallery-card,
  .gallery-card:nth-child(1),
  .gallery-card:nth-child(2) {
    grid-column: span 6;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 28px, 1180px);
  }

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

  .gallery-card,
  .gallery-card:nth-child(1),
  .gallery-card:nth-child(2) {
    grid-column: auto;
  }

  .lightbox {
    grid-template-columns: 1fr;
    padding: 76px 14px 18px;
  }

  .lightbox-nav {
    position: fixed;
    bottom: 18px;
  }

  .lightbox-nav.prev {
    left: 18px;
  }

  .lightbox-nav.next {
    right: 18px;
  }

  .lightbox img {
    max-height: calc(100dvh - 150px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
