:root {
  --forest: #10281d;
  --paper: #efece1;
  --ink: #161815;
  --acid: #d7ad55;
  --line: rgba(231, 230, 220, 0.18);
  --sans: "Manrope", "Noto Sans JP", sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: #0c1712;
  color: #e7e6dc;
  font-family: var(--sans);
}

button {
  font: inherit;
}

p,
h1,
h2,
figure {
  margin: 0;
}

.grain {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
  padding: 0 3.2vw;
  border-bottom: 1px solid rgba(238, 236, 226, 0.2);
  background:
    linear-gradient(rgba(5, 14, 9, 0.88), rgba(5, 14, 9, 0.88)),
    url("../images/sepilok-forest-no-animals-v3.png") center top / cover;
  color: #eeece2;
}

.logo {
  color: inherit;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.06em;
  text-decoration: none;
}

.page-name,
.section-number,
.filter-note,
.card-meta,
.gallery-footer {
  font-family: var(--mono);
}

.page-name {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.gallery-hero {
  min-height: calc(100svh - 92px);
  padding: 8vw 3.2vw 4vw;
  background:
    linear-gradient(90deg, rgba(9, 16, 12, 0.64), rgba(9, 16, 12, 0.04) 55%, rgba(9, 16, 12, 0.24)),
    url("../images/sepilok-forest-no-animals-v3.png") center / cover;
  color: var(--paper);
}

.gallery-hero h1 {
  position: relative;
  z-index: 2;
  font-size: clamp(4.5rem, 13vw, 13rem);
  font-weight: 500;
  line-height: 0.73;
  letter-spacing: -0.075em;
}

.title-line {
  display: flex;
  align-items: baseline;
  gap: 0.12em;
}

.title-line-second {
  margin-left: 11vw;
}

.photo-word {
  display: inline-block;
  color: transparent;
  background-repeat: no-repeat;
  background-size: cover;
  background-clip: text;
  filter: saturate(1.15) contrast(1.05);
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  -webkit-text-stroke: 1px rgba(247, 245, 235, 0.18);
}

.word-look,
.word-wild {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03), rgba(6, 15, 10, 0.08)),
    url("../images/nepenthes-red.jpg");
}

.word-look {
  background-position: 34% 45%;
}

.word-into {
  margin-right: -0.09em;
  padding-right: 0.09em;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03), rgba(6, 15, 10, 0.08)),
    url("../images/nepenthes-field.jpg");
  background-position: 58% 46%;
}

.word-the {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03), rgba(6, 15, 10, 0.08)),
    url("../images/nepenthes-green.jpg");
  background-position: 27% 48%;
}

.word-wild {
  background-position: 67% 64%;
}

.hero-meta {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 4rem;
  margin-top: 8vh;
  font-size: 0.78rem;
  line-height: 1.9;
}

.original-credit {
  min-width: min(25rem, 42vw);
  margin-left: auto;
  padding-right: 1.2rem;
  border-right: 1px solid rgba(255, 255, 255, 0.55);
  text-align: right;
  text-transform: uppercase;
}

.original-credit span,
.original-credit small {
  display: block;
  font: 400 0.52rem/1.6 var(--mono);
  letter-spacing: 0.12em;
}

.original-credit strong {
  display: block;
  margin: 0.45rem 0;
  font-size: clamp(0.9rem, 1.35vw, 1.25rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.04em;
}

.original-credit small {
  max-width: 28rem;
  margin-left: auto;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.04em;
  text-transform: none;
}

.archive {
  display: grid;
  grid-template-columns: minmax(250px, 27vw) 1fr;
  min-height: 100vh;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(rgba(8, 18, 13, 0.88), rgba(8, 18, 13, 0.8)),
    url("../images/sepilok-forest-no-animals-v3.png") 54% center / cover fixed;
}

.filter-panel {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 4vw 3.2vw;
  border-right: 1px solid var(--line);
  background: rgba(7, 17, 12, 0.72);
  backdrop-filter: blur(12px);
}

.section-number,
.filter-note {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
}

.filter-panel h2 {
  margin-top: 0.5rem;
  font-size: clamp(2.7rem, 4.4vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.06em;
}

.filters {
  display: flex;
  flex-direction: column;
  margin-top: 3rem;
}

.filter {
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.filter:last-child {
  border-bottom: 1px solid var(--line);
}

.filter b {
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.filter:hover,
.filter.is-active {
  color: var(--acid);
}

.filter.is-active::before {
  width: 0.65rem;
  height: 1px;
  margin-right: 0.7rem;
  background: currentColor;
  content: "";
}

.filter-note {
  margin-top: auto;
  padding-top: 3rem;
  line-height: 1.8;
}

.filter-note span {
  color: var(--acid);
}

.filter-note p {
  margin-top: 0.65rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 3vw 1.4vw;
  padding: 4vw 3.2vw;
  background: linear-gradient(115deg, rgba(19, 46, 33, 0.45), rgba(7, 17, 12, 0.2));
}

.gallery-card {
  min-width: 0;
  outline: none;
  cursor: zoom-in;
}

.gallery-card.is-hidden {
  display: none;
}

.placeholder {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #07100c;
}

.image-watermark {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  color: rgba(255, 255, 255, 0.52);
  font: 500 clamp(0.62rem, 1vw, 0.9rem)/1 var(--sans);
  letter-spacing: 0.22em;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.72);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  transform: translate(-50%, -50%);
}

.placeholder img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  transition: transform 0.8s ease, filter 0.5s ease;
  -webkit-user-drag: none;
}

.gallery-card:hover .placeholder img,
.gallery-card:focus .placeholder img {
  filter: brightness(1.06);
  transform: scale(1.035);
}

.gallery-card:focus-visible .placeholder {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(231, 230, 220, 0.2);
  font-size: 0.55rem;
}

.card-meta span:last-child {
  opacity: 0.58;
}

.gallery-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 3.2vw;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(rgba(5, 14, 9, 0.9), rgba(5, 14, 9, 0.96)),
    url("../images/sepilok-forest-no-animals-v3.png") center 85% / cover;
  color: #d7d7ce;
  font-size: 0.55rem;
  line-height: 1.7;
}

.gallery-footer strong {
  font-weight: 500;
  letter-spacing: 0.1em;
}

.audio-toggle {
  position: fixed;
  z-index: 30;
  right: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: rgba(17, 25, 18, 0.82);
  box-shadow: 0 0.35rem 1.25rem rgba(0, 0, 0, 0.2);
  color: #f4f0e6;
  font: 500 0.72rem/1 "Noto Sans JP", sans-serif;
  letter-spacing: 0.08em;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.audio-toggle:hover,
.audio-toggle:focus-visible {
  background: rgba(45, 65, 47, 0.94);
}

.audio-toggle-icon {
  font-size: 1rem;
}

.audio-toggle.is-playing .audio-toggle-icon {
  animation: audio-pulse 1.4s ease-in-out infinite;
}

@keyframes audio-pulse {
  50% {
    opacity: 0.45;
  }
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: none;
  grid-template-columns: minmax(52px, 1fr) minmax(0, calc(100vw - 144px)) minmax(52px, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  padding: 32px 18px;
  background: rgba(3, 8, 5, 0.94);
  color: #f1f0eb;
}

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

.lightbox-figure {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  width: 100%;
  min-width: 0;
}

.lightbox-image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: calc(100vh - 100px);
  overflow: hidden;
}

.image-watermark-lightbox {
  font-size: clamp(0.72rem, 1.3vw, 1.1rem);
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 100px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-caption {
  padding-top: 12px;
  text-align: center;
  font: 400 0.62rem var(--mono);
  letter-spacing: 0.08em;
}

.lightbox-close,
.lightbox-nav {
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(5, 14, 9, 0.55);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.06);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.7rem;
}

.lightbox-nav {
  width: 48px;
  height: 64px;
  font-size: 1.4rem;
  justify-self: center;
}

.lightbox-prev {
  grid-column: 1;
  grid-row: 1;
}

.lightbox-next {
  grid-column: 3;
  grid-row: 1;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .photo-word {
    color: #f1f0eb;
    -webkit-text-fill-color: #f1f0eb;
  }
}

@media (max-width: 1100px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .site-header {
    height: 72px;
    padding-inline: 5vw;
  }

  .gallery-hero {
    min-height: calc(100svh - 72px);
    padding: 14vw 5vw 10vw;
    background-position: 57% center;
  }

  .gallery-hero h1 {
    margin-top: 12vh;
    font-size: 20vw;
  }

  .title-line {
    gap: 0.1em;
  }

  .title-line-second {
    margin-left: 0;
  }

  .photo-word {
    -webkit-text-stroke: 0.5px rgba(247, 245, 235, 0.24);
  }

  .hero-meta {
    display: block;
    width: 90%;
    margin-top: 8vh;
  }

  .original-credit {
    min-width: 0;
    margin: 2rem 0 0;
    padding: 0 0 0 1rem;
    border-right: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.55);
    text-align: left;
  }

  .original-credit small {
    margin-left: 0;
  }

  .archive {
    display: block;
    background-attachment: scroll;
    background-position: 62% center;
  }

  .filter-panel {
    position: relative;
    min-height: 0;
    padding: 14vw 5vw;
    border-right: 0;
    background: rgba(7, 17, 12, 0.88);
  }

  .filters {
    margin-top: 2rem;
  }

  .filter {
    min-height: 64px;
  }

  .filter-note {
    margin-top: 2rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9vw 3vw;
    padding: 10vw 5vw;
  }

  .gallery-footer {
    display: block;
    padding: 2rem 5vw;
  }

  .gallery-footer p:last-child {
    margin-top: 1.5rem;
  }

  .lightbox {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    padding: 70px 6px 24px;
  }

  .lightbox-image-wrap,
  .lightbox-image {
    max-height: calc(100svh - 145px);
  }

  .lightbox-nav {
    width: 42px;
    height: 56px;
  }
}

@media (max-width: 520px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .audio-toggle.is-playing .audio-toggle-icon {
    animation: none;
  }
}
