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

html, body {
  background-color: #0D0D0D;
  height: 100%;
  overflow: hidden;
  transition: background-color 0.5s ease;
}

body.photo-hovered {
  background-color: #080808;
}

/* ── Sidebar ─────────────────────────────────────── */

.hamburger {
  position: fixed;
  top: 40px;
  right: 52px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 8;
  filter: blur(0.5px);
  transition: filter 0.5s ease;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #818181;
  transition: background-color 0.5s ease, transform 0.35s ease, opacity 0.35s ease;
}

.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

body.photo-hovered .hamburger {
  filter: blur(1.5px);
}

body.photo-hovered .hamburger span {
  background-color: #878787;
}

.sidebar-svg {
  position: fixed;
  top: 120px;
  right: 40px;
  z-index: 8;
  color: #8A4730;
  filter: blur(0.5px);
  transition: filter 0.5s ease, color 0.5s ease, opacity 1.65s ease, transform 0.9s ease;
}

.sidebar-svg svg {
  width: 36px;
  height: auto;
}

body.photo-hovered .sidebar-svg {
  filter: blur(1.5px);
  color: #878787;
}

.sidebar-name {
  position: fixed;
  bottom: 6vh;
  right: 30px;
  width: 36px;
  z-index: 8;
  filter: blur(0.5px);
  transition: filter 0.5s ease, opacity 1.65s ease, transform 0.9s ease;
}

body.photo-hovered .sidebar-name {
  filter: blur(1.5px);
}

.author-name {
  display: block;
  font-family: 'Kode Mono', monospace;
  font-weight: 400;
  font-size: 22px;
  color: rgba(138, 71, 48, 0.6);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: color 0.5s ease;
}

body.photo-hovered .author-name {
  color: #878787;
}

.sidebar-name:hover .author-name {
  color: rgba(138, 71, 48, 0.8);
}

/* ── Nav menu ────────────────────────────────────── */

.nav-menu {
  position: fixed;
  top: 120px;
  right: 112px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.nav-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nav-link {
  font-family: 'Kode Mono', monospace;
  font-size: 22px;
  color: #818181;
  text-decoration: none;
}

.nav-link.is-current {
  color: rgba(138, 71, 48, 0.7);
}

.nav-link:hover {
  text-decoration: underline;
}

/* ── Photo Feed ──────────────────────────────────── */

.photo-feed {
  position: fixed;
  top: 0;
  left: 8vw;
  right: 0;
  bottom: 0;
  z-index: 10;
  pointer-events: none;
}

/* ── Photo Card ──────────────────────────────────── */

.photo-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 24vw;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 8vh 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.65s ease, transform 0.9s ease, filter 0.5s ease;
  will-change: opacity, transform;
}

.photo-feed.is-menu-open .photo-card.is-active {
  opacity: 0.15;
  filter: blur(20px);
  transition: opacity 0.5s ease, filter 0.5s ease;
}

.photo-card.is-portrait {
  justify-content: center;
}

.photo-card.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.photo-card.is-exiting-up {
  opacity: 0;
  transform: translateY(-100vh);
}

.photo-card.is-exiting-down {
  opacity: 0;
  transform: translateY(100vh);
}

.photo-wrapper {
  position: relative;
  display: inline-block;
}

.photo-wrapper img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 84vh;
}

/* ── Photo Meta ──────────────────────────────────── */

.photo-meta {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(100% + 8px);
  width: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
}

.meta-date,
.meta-location {
  font-family: 'Inconsolata', monospace;
  font-weight: 600;
  font-size: 14px;
  color: #BFBFBF;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.meta-spacer {
  flex: 1;
}

.meta-separator {
  width: 12px;
  height: 1px;
  background-color: #BFBFBF;
  flex-shrink: 0;
}

/* ── Film grain ──────────────────────────────────── */

#grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9;
  image-rendering: pixelated;
}

.sidebar-index {
  position: fixed;
  bottom: 44vh;
  right: 30px;
  width: 36px;
  z-index: 8;
  filter: blur(0.5px);
  transition: filter 0.5s ease, opacity 0.4s ease, transform 0.9s ease;
}

.hamburger.is-open ~ .sidebar-index {
  opacity: 0;
  pointer-events: none;
}

body.photo-hovered .sidebar-index {
  filter: blur(1.5px);
}

.sidebar-index.is-scroll-hint:hover .photo-index {
  color: rgba(138, 71, 48, 0.8);
}

.sidebar-index.is-scroll-hint {
  cursor: pointer;
}

.photo-index {
  display: block;
  font-family: 'Kode Mono', monospace;
  font-weight: 400;
  font-size: 22px;
  color: rgba(138, 71, 48, 0.6);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color 0.5s ease;
}

body.photo-hovered .photo-index {
  color: #878787;
}

/* ── Film border transition ──────────────────────── */

.sidebar-svg.is-film-exiting-up,
.sidebar-name.is-film-exiting-up,
.sidebar-index.is-film-exiting-up {
  transform: translateY(-100vh);
  opacity: 0;
}

.sidebar-svg.is-film-exiting-down,
.sidebar-name.is-film-exiting-down,
.sidebar-index.is-film-exiting-down {
  transform: translateY(100vh);
  opacity: 0;
}

/* ── Hover state ─────────────────────────────────── */

.photo-meta {
  transition: opacity 0.5s ease;
}

.photo-card.is-hovered .photo-meta {
  opacity: 0.3;
}

/* ── Author link ─────────────────────────────────── */

.author-link {
  display: block;
  text-decoration: none;
}

/* ── About page ──────────────────────────────────── */

.about-content {
  position: fixed;
  top: 0;
  left: 8vw;
  right: 24vw;
  bottom: 0;
  z-index: 10;
  transition: opacity 0.5s ease, filter 0.5s ease;
}

.sidebar:has(.hamburger.is-open) ~ .about-content {
  opacity: 0.25;
  filter: blur(5px);
  pointer-events: none;
}

.about-title {
  position: absolute;
  top: 120px;
  left: 0;
  font-family: 'Kode Mono', monospace;
  font-weight: 600;
  font-size: 40px;
  color: rgba(191, 191, 191, 0.8);
  letter-spacing: 0.02em;
}

.about-para {
  position: absolute;
  font-family: 'Inconsolata', monospace;
  font-weight: 300;
  font-size: 22px;
  line-height: 1.7;
  color: #BFBFBF;
}

.about-para--left {
  top: 225px;
  left: 0;
  width: 32vw;
}

.about-para--right {
  top: 225px;
  left: 40vw;
  width: 32vw;
  color: rgba(191, 191, 191, 0.5);
}

.about-para--left em {
  color: rgba(191, 191, 191, 0.5);
}

/* ── Mobile (≤450px) ─────────────────────────────── */

@media (max-width: 450px), (max-width: 900px) and (orientation: landscape) {
  html, body {
    overflow: auto;
    height: auto;
  }

  /* SVG: top-left, center aligned to left viewport edge */
  .sidebar-svg {
    top: 0;
    right: auto;
    left: -18px;
  }

  /* Author name: left side, same vertical position as desktop */
  .sidebar-name {
    right: auto;
    left: -6px;
    bottom: 6vh;
  }

  /* Hide photo index */
  .sidebar-index {
    display: none;
  }

  /* Hamburger: 20px from top-right corner, above all content */
  .hamburger {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
  }

  /* Nav menu: 40px from left edge, below hamburger */
  .nav-menu {
    top: 60px;
    right: auto;
    left: 40px;
    z-index: 20;
  }

  /* Photo feed: normal document flow, all photos stacked */
  .photo-feed {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 80px 16px 80px 35px;
  }

  /* All photo cards visible and stacked */
  .photo-card {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
    display: block !important;
    height: auto !important;
    padding: 0 !important;
  }

  /* Blur all cards and disable touches when nav menu is open */
  .photo-feed.is-menu-open .photo-card {
    opacity: 0.15 !important;
    filter: blur(20px) !important;
    pointer-events: none !important;
    transition: opacity 0.5s ease, filter 0.5s ease !important;
  }

  .photo-wrapper {
    display: block;
    width: 100%;
  }

  .photo-wrapper img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
  }

  /* Hide per-photo metadata */
  .photo-meta {
    display: none;
  }

  /* ── About page ──────────────────────────────────── */

  .about-content {
    position: relative;
    top: auto;
    left: 0;
    right: 0;
    bottom: auto;
    padding: 80px 42px 80px 50px;
  }

  .about-title {
    position: relative;
    top: auto;
    left: auto;
    font-size: 28px;
    margin-bottom: 32px;
  }

  .about-para {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    font-size: 16px;
  }

  .about-para--left {
    top: auto;
    left: auto;
    width: 100%;
  }

  .about-para--right {
    top: auto;
    left: auto;
    width: 100%;
    margin-top: 32px;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .photo-feed {
    padding-top: 24px;
    padding-left: 60px;
  }

  .hamburger {
    position: fixed;
  }

  .photo-wrapper img {
    height: calc(100vh - 48px);
    width: auto;
    max-width: 100%;
  }

  .sidebar-name {
    left: auto;
    right: 12px;
  }

  .about-content {
    position: relative;
    top: auto;
    left: 0;
    right: 0;
    bottom: auto;
    padding: 80px 220px 80px 50px
  }

  .about-title {
    position: relative;
    top: auto;
    left: auto;
    font-size: 28px;
    margin-bottom: 32px;
  }

  .about-para {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    font-size: 16px;
  }

  .about-para--left {
    top: auto;
    left: auto;
    width: 100%;
  }

  .about-para--right {
    top: auto;
    left: auto;
    width: 100%;
    margin-top: 32px;
  }
}
