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

body {
  font-family: 'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  background: #fff;
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  background: transparent;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

.nav a {
  text-decoration: none;
  color: #1a1a1a;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 20px;
}

.nav a:hover {
  opacity: 0.6;
}

/* Hamburger (hidden on desktop) */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  z-index: 60;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #1a1a1a;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.logo-text {
  font-size: 32px;
  font-weight: 900;
  line-height: 0.9;
  text-align: center;
  letter-spacing: 0.05em;
}

.logo-img {
  height: 64px;
  width: auto;
  display: block;
}

/* Gallery View — Infinite Canvas */
.gallery-hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  cursor: grab;
  user-select: none;
}

.gallery-hero:active {
  cursor: grabbing;
}

.gallery-canvas {
  position: absolute;
  width: 3600px;
  height: 5000px;
  top: -500px;
  left: -1000px;
  will-change: transform;
}

.gallery-card {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  cursor: pointer;
}

.gallery-card-img {
  width: 100%;
  height: var(--h);
  background-size: cover;
  background-position: center;
  border-radius: 2px;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-card:hover .gallery-card-img {
  transform: scale(1.03);
}

a.gallery-card,
.gallery-card a {
  text-decoration: none;
  color: inherit;
}

.gallery-card-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1a1a1a;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-card:hover .gallery-card-label {
  opacity: 1;
  transform: translateY(0);
}

.gallery-card-type {
  font-weight: 400;
  color: #999;
  white-space: nowrap;
}

.gallery-hint {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #aaa;
  pointer-events: none;
  animation: hintFade 3s ease forwards 2s;
}

@keyframes hintFade {
  to { opacity: 0; }
}

/* List View */
.list-view {
  padding: 120px 20px 80px;
  width: 100%;
  padding-left: calc(45vw + 160px);
}

.list-year-group {
  margin-bottom: 40px;
}

.list-year {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  position: relative;
  z-index: 3;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 8px;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.list-row::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: background-color 0.2s;
}

.list-row:hover,
.list-row.active {
  color: #fff;
}

.list-row:hover::before,
.list-row.active::before {
  background-color: #1a1a1a;
}

.list-row:hover .list-type,
.list-row.active .list-type {
  color: #fff;
}

.list-name {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 3;
}

.list-type {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 3;
}

/* Hover image for list view */
.hover-image {
  position: fixed;
  left: 40px;
  top: 120px;
  bottom: 70px;
  width: 45vw;
  max-width: none;
  background-size: cover;
  background-position: center;
  pointer-events: none;
  opacity: 0;
  clip-path: inset(100% 0 0 0);
  z-index: 2;
}

.hover-image.visible {
  opacity: 1;
}

/* View Toggle */
.view-toggle {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 4px;
}

.toggle-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #999;
  font-family: inherit;
  padding: 0;
}

.toggle-btn.active {
  color: #1a1a1a;
  font-weight: 700;
}

.toggle-divider {
  color: #ccc;
  font-size: 16px;
}

/* Utility */
.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .nav {
    padding: 16px 20px;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    z-index: 55;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 24px;
  }

  .gallery-hero {
    height: auto;
    overflow: visible;
    cursor: default;
    user-select: auto;
  }

  .gallery-hero:active {
    cursor: default;
  }

  .gallery-canvas {
    position: static;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 80px 20px 80px;
  }

  .gallery-card {
    position: static !important;
    width: 100% !important;
    will-change: auto;
    transform: none !important;
  }

  .gallery-card-img {
    height: 60vw !important;
    border-radius: 4px;
  }

  .gallery-card-label {
    font-size: 13px;
    margin-top: 8px;
    opacity: 1;
    transform: translateY(0);
  }

  .logo-text {
    font-size: 24px;
  }

  .gallery-hint {
    display: none;
  }

  .list-view {
    padding: 120px 20px 80px;
    padding-left: 20px;
  }

  .list-year {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .list-row {
    padding: 10px 4px;
  }

  .list-name {
    font-size: 14px;
  }

  .list-type {
    font-size: 12px;
  }

  .hover-image {
    display: none;
  }

  .view-toggle {
    padding: 6px 10px;
  }

  .toggle-btn {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .nav-links a {
    font-size: 18px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .list-view {
    padding-left: calc(35vw + 40px);
  }

  .hover-image {
    width: 35vw;
  }

  .list-name {
    font-size: 16px;
  }

  .list-type {
    font-size: 14px;
  }
}

.site-credit {
  position: fixed;
  bottom: 8px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.3);
  pointer-events: auto;
  z-index: 1;
}

.site-credit a {
  color: inherit;
  text-decoration: none;
}
