:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  color: #334155;
  background: #fff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body { margin: 0; min-width: 280px; font-size: 16px; line-height: 1.6; }
img { display: block; max-width: 100%; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid #336ca0; outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.skip-link {
  position: absolute;
  z-index: 100;
  top: -80px;
  left: 12px;
  padding: 8px 12px;
  background: #fff;
  color: #1d4f7a;
}
.skip-link:focus { top: 12px; }

.site-header { border-bottom: 1px solid #e5e7eb; }
.header-inner {
  max-width: 1280px;
  min-height: 86px;
  margin: 0 auto;
  padding: 12px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.identity { display: flex; align-items: center; gap: 14px; min-width: 0; text-decoration: none; }
.identity img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.site-name { display: block; color: #29323f; font-size: 26px; line-height: 1.2; font-weight: 600; }
.tagline { display: block; color: #3d4653; font-size: 15px; line-height: 1.35; }
.site-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 32px; }
.site-nav a { font-size: 16px; text-decoration: none; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #1f4f7e; }

.main { width: min(100% - 80px, 1200px); min-height: 40vh; margin: 0 auto; }
.hero-image { width: min(100%, 1024px); height: auto; }
.living-room-heading { margin: 26px 0 0; font-size: 30px; line-height: 1.3; font-weight: 600; color: #29323f; }
.photo-lab { padding-top: 54px; }
.photo-lab h1, .not-found h1 { margin: 0 0 18px; color: #29323f; font-size: 30px; line-height: 1.3; font-weight: 600; }
.photo-lab-intro { margin: 0 0 26px; }

.gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.gallery figure { grid-column: span 3; margin: 0; overflow: hidden; }
.gallery a { display: block; height: 100%; cursor: zoom-in; }
.gallery img { width: 100%; height: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.gallery figure:nth-last-child(-n + 6) { grid-column: span 4; }
.gallery figure:nth-last-child(-n + 6) img { aspect-ratio: 5 / 7; }

.site-footer { max-width: 1280px; margin: 0 auto; padding: 38px 40px 44px; text-align: center; font-size: 14px; }
.not-found { padding-top: 54px; }

.viewer {
  width: min(100vw - 32px, 1100px);
  max-width: none;
  max-height: calc(100dvh - 32px);
  border: 0;
  padding: 0;
  background: #111;
  color: #fff;
}
.viewer::backdrop { background: rgb(0 0 0 / 90%); }
.viewer-inner { height: min(90dvh, 950px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 12px; }
.viewer button { border: 0; border-radius: 2px; padding: 8px 12px; background: #303030; color: #fff; font: inherit; cursor: pointer; }
.viewer button:hover { background: #505050; }
.viewer-image-wrap { display: flex; align-items: center; justify-content: center; min-height: 0; }
.viewer-image { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.viewer-controls { display: flex; justify-content: center; gap: 16px; padding: 10px; }

@media (max-width: 760px) {
  .header-inner { padding: 12px 24px; align-items: flex-start; flex-direction: column; gap: 10px; }
  .site-nav { width: 100%; justify-content: center; padding-left: 0; column-gap: 18px; row-gap: 4px; }
  .main { width: calc(100% - 48px); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery figure, .gallery figure:nth-last-child(-n + 6) { grid-column: auto; }
  .gallery figure:nth-last-child(-n + 6) img { aspect-ratio: 4 / 5; }
  .photo-lab { padding-top: 38px; }
}

@media (max-width: 420px) {
  .header-inner { padding: 12px 16px; }
  .identity img { width: 46px; height: 46px; }
  .identity { gap: 10px; }
  .site-name { font-size: 23px; }
  .tagline { font-size: 12px; }
  .site-nav { column-gap: 14px; }
  .site-nav a { font-size: 14px; }
  .main { width: calc(100% - 32px); }
  .gallery img, .gallery figure:nth-last-child(-n + 6) img { aspect-ratio: 3 / 4; }
  .site-footer { padding-inline: 16px; }
}

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