:root {
  --ink: #1a1a1a;
  --muted: #8c8c8c;
  --faint: #bdbdbd;
  --border: #e6e6e6;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

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

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 40px;
  z-index: 20;
  background: transparent;
  backdrop-filter: none;
}

.contact-btn {
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: all 0.3s cubic-bezier(0.2, 0, 0.8, 1);
}

.contact-btn:hover {
  border-bottom-color: var(--ink);
  opacity: 0.7;
}

.site-name {
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: #FF2CBE;
}

.home-btn {
  font-size: 17px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: all 0.3s cubic-bezier(0.2, 0, 0.8, 1);
}

.home-btn:hover {
  border-bottom-color: var(--ink);
  opacity: 0.7;
}

/* ---------- gallery ---------- */

.gallery {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 100px 60px 20px;
  min-height: 0;
  z-index: 1;
  overflow: visible;
}

.gallery-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 620px;
  width: 100%;
  overflow: visible;
  z-index: 10;
}

.gallery-figure img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.2, 0, 0.8, 1);
}

.gallery-figure img.is-loaded {
  opacity: 1;
}

.gallery-figure figcaption {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  text-align: left;
  letter-spacing: 0.03em;
  min-height: 1.4em;
  transition: opacity 0.3s ease;
  align-self: flex-start;
}

.nav-arrow {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 40px;
  line-height: 1;
  color: var(--faint);
  padding: 12px 16px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: all 0.3s cubic-bezier(0.2, 0, 0.8, 1);
  opacity: 0.6;
}

.nav-arrow:hover {
  color: var(--ink);
  opacity: 1;
}

.nav-prev {
  left: 18px;
}

.nav-next {
  right: 18px;
}

/* ---------- contact page ---------- */

.contact-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 150px 40px 100px;
}

.contact-grid {
  width: 100%;
  max-width: 700px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 60px 50px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 60px 0;
}

.contact-item {
  text-align: center;
}

.contact-item h2 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 16px;
  text-transform: lowercase;
}

.contact-item p {
  margin: 6px 0;
  font-size: 16px;
}

.contact-item a {
  border-bottom: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.2, 0, 0.8, 1);
}

.contact-item a:hover {
  border-bottom-color: var(--ink);
  opacity: 0.7;
}

/* ---------- footer ---------- */

.site-footer {
  padding: 32px 40px;
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
}

.site-footer p {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--faint);
  display: none;
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .topbar {
    padding: 16px 20px;
    background: transparent;
    display: block;
    position: fixed;
  }

  .site-name {
    font-size: 14px;
    position: absolute;
    left: 20px;
    top: 16px;
  }

  .contact-btn {
    position: absolute;
    right: 20px;
    top: 16px;
    font-size: 11px;
  }

  .gallery {
    padding: 40px 16px 30px;
  }

  .gallery-figure img {
    max-height: 95vh;
  }

  .gallery-figure figcaption {
    font-size: 11px;
    margin-top: 12px;
  }

  .nav-arrow {
    display: none;
  }

  .contact-main {
    padding: 80px 24px 40px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px 0;
  }

  .site-footer {
    padding: 20px;
  }
}
