@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

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

:root {
  --red: #c0392b;
  --amber: #e67e22;
  --dim: #1a0a00;
  --dark: #0d0600;
  --text: #c8a882;
  --muted: #6b4f38;
}

html,
body {
  width: 100%;
  height: 100%;
  background: var(--dark);
  color: var(--text);
  font-family: "Press Start 2P", monospace;
  overflow: hidden;
  user-select: none;
}

/* panorama */
#pano {
  position: fixed;
  inset: 0;
  background-image: url("scene32bit.png");
  background-repeat: repeat-x;
  background-size: auto 140%;
  background-position: 0px 0px;
  image-rendering: pixelated;
  transform-origin: center center;
  transition:
    background-position-x 0.7s cubic-bezier(0.65, 0, 0.35, 1),
    background-position-y 0.9s cubic-bezier(0.65, 0, 0.35, 1),
    transform 0.9s cubic-bezier(0.65, 0, 0.35, 1);
}
#pano.instant {
  transition: none;
}

/* vignette overlay */
#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 38%,
    rgba(0, 0, 0, 0.72) 100%
  );
  z-index: 10;
}

/* safelight glow at the bottom */
#safelight {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: linear-gradient(
    to top,
    rgba(140, 20, 0, 0.25) 0%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 10;
}

/* left/right nav zones */
.nav-zone {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 28%;
  z-index: 35;
  cursor: pointer;
  display: flex;
  align-items: center;
}

#nav-left {
  left: 0;
  justify-content: flex-start;
}
#nav-right {
  right: 0;
  justify-content: flex-end;
}

.nav-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  opacity: 0.4;
  transition: opacity 0.25s;
}
.nav-zone:hover .nav-inner {
  opacity: 1;
}

/* edge glow on hover */
#nav-left::before,
#nav-right::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
#nav-left::before {
  background: linear-gradient(to right, rgba(192, 57, 43, 0.12), transparent);
  left: 0;
}
#nav-right::before {
  background: linear-gradient(to left, rgba(192, 57, 43, 0.12), transparent);
  right: 0;
}
#nav-left:hover::before,
#nav-right:hover::before {
  opacity: 1;
}

.nav-arrow {
  font-size: 14px;
  color: var(--text);
  line-height: 1;
}

.nav-label {
  font-size: 6px;
  color: var(--muted);
  letter-spacing: 1px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}
#nav-right .nav-label {
  transform: rotate(180deg);
}

/* top bar */
#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(
    to bottom,
    rgba(13, 6, 0, 0.88) 0%,
    transparent 100%
  );
  z-index: 40;
  pointer-events: none;
}

#back-btn {
  pointer-events: all;
  font-family: inherit;
  font-size: 7px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--muted);
  padding: 6px 10px;
  background: rgba(13, 6, 0, 0.7);
  transition:
    border-color 0.2s,
    color 0.2s;
  cursor: pointer;
}
#back-btn:hover {
  border-color: var(--amber);
  color: var(--amber);
}

#topbar-title {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text);
  opacity: 0.8;
}

#topbar-right {
  font-size: 6px;
  color: var(--muted);
  text-align: right;
  letter-spacing: 1px;
}

/* welcome section text */
#welcome-text {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  color: var(--text);
  text-align: center;
  line-height: 2.2;
  letter-spacing: 1px;
  padding: 0 15%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
  text-shadow: 0 0 20px rgba(200, 168, 130, 0.3);
}
#welcome-text.visible {
  opacity: 1;
}

/* portfolio section button */
#portfolio-btn {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: none;
  letter-spacing: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
  cursor: pointer;
  text-shadow: 0 0 24px rgba(200, 168, 130, 0.5);
}
#portfolio-btn.visible {
  opacity: 1;
  pointer-events: all;
}
#portfolio-btn:hover {
  color: var(--amber);
  text-shadow: 0 0 32px rgba(230, 126, 34, 0.6);
}

/* zines section button */
#zines-btn {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: none;
  letter-spacing: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
  cursor: pointer;
  text-shadow: 0 0 24px rgba(200, 168, 130, 0.5);
}
#zines-btn.visible {
  opacity: 1;
  pointer-events: all;
}
#zines-btn:hover {
  color: var(--amber);
  text-shadow: 0 0 32px rgba(230, 126, 34, 0.6);
}

/* shared label border for clickable overlay buttons */
#portfolio-btn span,
#gear-btn span,
#zines-btn span,
#leave-btn span {
  border: 1px solid rgba(200, 168, 130, 0.4);
  padding: 14px 22px;
  transition: border-color 0.2s;
}
#portfolio-btn:hover span,
#gear-btn:hover span,
#leave-btn:hover span {
  border-color: rgba(230, 126, 34, 0.7);
}

/* gear section button */
#gear-btn {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: none;
  letter-spacing: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
  cursor: pointer;
  text-shadow: 0 0 24px rgba(200, 168, 130, 0.5);
}
#gear-btn.visible {
  opacity: 1;
  pointer-events: all;
}
#gear-btn:hover {
  color: var(--amber);
  text-shadow: 0 0 32px rgba(230, 126, 34, 0.6);
}

/* gear modal */
#gear-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 6, 0, 0.82);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#gear-modal.visible {
  opacity: 1;
  pointer-events: all;
}
#gear-modal-box {
  position: relative;
  background: #130a00;
  border: 1px solid var(--muted);
  padding: 48px 48px 44px;
  max-width: 720px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
}
#gear-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 22px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
#gear-modal-close:hover {
  color: var(--text);
}
#gear-modal-content {
  font-family: "Courier New", monospace;
  font-size: 15px;
  color: var(--text);
  line-height: 1.9;
}
#gear-modal-content p {
  margin-bottom: 1.4em;
}
#gear-modal-content p:last-child {
  margin-bottom: 0;
}

/* leave darkroom button */
#leave-btn {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  background: transparent;
  border: none;
  letter-spacing: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
  cursor: pointer;
  text-shadow: 0 0 24px rgba(200, 168, 130, 0.5);
}
#leave-btn.visible {
  opacity: 1;
  pointer-events: all;
}
#leave-btn:hover {
  color: var(--amber);
  text-shadow: 0 0 32px rgba(230, 126, 34, 0.6);
}

/* section info at the bottom */
#section-info {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 20px 18px;
  background: linear-gradient(to top, rgba(13, 6, 0, 0.9) 0%, transparent 100%);
  z-index: 30;
  pointer-events: none;
  transition: opacity 0.35s;
}
#section-info.fading {
  opacity: 0;
}

/* section dots */
#section-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dot {
  width: 5px;
  height: 5px;
  background: var(--muted);
  border-radius: 0; /* square = pixel art */
  transition: background 0.3s;
}
.dot.active {
  background: var(--amber);
}

#section-name {
  font-size: 10px;
  color: var(--text);
  letter-spacing: 2px;
}

#section-desc {
  font-size: 6px;
  color: var(--muted);
  letter-spacing: 1px;
}

/* cta button */
#section-cta {
  font-size: 7px;
  color: var(--amber);
  border: 1px solid var(--amber);
  padding: 8px 14px;
  background: rgba(13, 6, 0, 0.75);
  cursor: pointer;
  letter-spacing: 1px;
  pointer-events: all;
  transition:
    background 0.2s,
    color 0.2s;
  animation: ctaPulse 2.5s ease-in-out infinite;
}
#section-cta:hover {
  background: rgba(230, 126, 34, 0.15);
}
#section-cta:empty {
  display: none;
  pointer-events: none;
  animation: none;
}
@keyframes ctaPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(230, 126, 34, 0);
  }
  50% {
    box-shadow: 0 0 12px 3px rgba(230, 126, 34, 0.28);
  }
}

/* loading screen */
#loader {
  position: fixed;
  inset: 0;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  z-index: 100;
  transition: opacity 0.8s ease;
}
#loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

#loader-icon {
  font-size: 28px;
  animation: flicker 2s infinite;
}

@keyframes flicker {
  0%,
  90%,
  100% {
    opacity: 1;
  }
  92% {
    opacity: 0.3;
  }
  94% {
    opacity: 1;
  }
  96% {
    opacity: 0.2;
  }
  98% {
    opacity: 1;
  }
}

#loader-title {
  font-size: 11px;
  color: var(--red);
  letter-spacing: 3px;
}
#loader-sub {
  font-size: 7px;
  color: var(--muted);
  letter-spacing: 2px;
}

#loader-bar-wrap {
  width: 180px;
  height: 3px;
  background: var(--dim);
  border: 1px solid var(--muted);
}
#loader-bar {
  height: 100%;
  width: 0%;
  background: var(--red);
  transition: width 0.8s ease;
}

/* hide nav zones and topbar back btn when the carousel is open */
body.carousel-active .nav-zone,
body.carousel-active #back-btn {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

/* mobile */
@media (max-width: 600px) {
  #topbar-title {
    display: none;
  }
  #topbar-right {
    display: none;
  }
  .nav-arrow {
    font-size: 18px;
  }
  #section-name {
    font-size: 8px;
  }

  #welcome-text {
    font-size: 7px;
    padding: 0 10%;
  }
  #portfolio-btn,
  #gear-btn,
  #zines-btn,
  #leave-btn {
    font-size: 8px;
    letter-spacing: 1px;
    padding: 0 10%;
    text-align: center;
  }
}

/* zine carousel — injected by zine-carousel.js */

/* hide the CTA while the carousel is up */
#section-info.carousel-mode #section-cta {
  display: none;
}

/* carousel back button */
#zc-back {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  color: var(--text);
  border: 1px solid rgba(200, 168, 130, 0.4);
  padding: 12px 22px;
  background: rgba(13, 6, 0, 0.7);
  cursor: pointer;
  letter-spacing: 2px;
  pointer-events: all;
  margin-top: 18px;
  transition:
    border-color 0.2s,
    color 0.2s;
}
#zc-back:hover {
  border-color: rgba(230, 126, 34, 0.7);
  color: var(--amber);
}

/* when carousel is hidden, block all pointer events inside it */
#zc-overlay:not(.visible) * {
  pointer-events: none;
}

/* overlay that fades in over the panorama */
#zc-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
  /* Subtle dark radial behind carousel so cards pop */
  background: radial-gradient(
    ellipse 70% 65% at 50% 52%,
    rgba(13, 6, 0, 0.78) 0%,
    transparent 100%
  );
}
#zc-overlay.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Push content slightly above centre to clear section-info bar */
#zc-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 90px;
}

#zc-label {
  font-size: 6px;
  color: var(--muted);
  letter-spacing: 3px;
  pointer-events: none;
}

/* carousel */
:root {
  --zc-step: 190px;
}

#zc-nav {
  display: flex;
  align-items: center;
  pointer-events: none;
}

#zc-track {
  position: relative;
  width: calc(var(--zc-step) * 2 + 220px);
  height: 380px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Arrow buttons */
.zc-btn {
  font-size: 22px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 14px 12px;
  flex-shrink: 0;
  pointer-events: all;
  transition:
    color 0.2s,
    transform 0.15s;
  user-select: none;
}
.zc-btn:hover {
  color: var(--amber);
  transform: scale(1.25);
}
.zc-btn:active {
  transform: scale(0.9);
}

/* dots */
#zc-dots {
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.zc-dot {
  width: 5px;
  height: 5px;
  border-radius: 0;
  background: var(--muted);
  border: none;
  cursor: pointer;
  padding: 0;
  pointer-events: all;
  transition: background 0.3s;
}
.zc-dot--active {
  background: var(--amber);
}

/* zine cards */
.zc-card {
  position: absolute;
  width: 210px;
  cursor: pointer;
  pointer-events: all;
  transform: translateX(calc(var(--off, 0) * var(--zc-step)))
    scale(var(--sc, 1)) rotate(var(--rot, 0deg));
  opacity: var(--op, 1);
  z-index: var(--zi, 1);
  transition:
    transform 0.5s cubic-bezier(0.34, 1.1, 0.64, 1),
    opacity 0.45s ease;
  outline: none;
}
.zc-card.zc-center {
  transform: translateX(0) scale(1) rotate(0deg);
}
.zc-card.zc-hidden {
  pointer-events: none;
}

/* Physical print border */
.zc-card-inner {
  background: #100800;
  border: 1px solid rgba(200, 168, 130, 0.09);
  box-shadow: 8px 14px 40px rgba(0, 0, 0, 0.72);
  overflow: hidden;
  transition:
    border-color 0.3s ease,
    box-shadow 0.4s ease;
}
.zc-card.zc-center:hover .zc-card-inner,
.zc-card.zc-center:focus-visible .zc-card-inner {
  border-color: rgba(230, 126, 34, 0.35);
  box-shadow:
    20px 30px 60px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(230, 126, 34, 0.18);
}

/* Cover image */
.zc-card-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #0e0800;
}
.zc-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.85) saturate(0.82);
  transition:
    transform 0.5s ease,
    filter 0.4s ease;
}
.zc-card.zc-center:hover .zc-card-cover img {
  transform: scale(1.05);
  filter: brightness(1) saturate(1);
}

/* Label bar */
.zc-card-meta {
  padding: 10px 12px 13px;
  border-top: 1px solid rgba(200, 168, 130, 0.07);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.zc-card-title {
  font-size: 7px;
  color: var(--text);
  letter-spacing: 1px;
}
.zc-card-sub {
  font-size: 8px;
  color: var(--muted);
  font-family: "Courier New", monospace;
}
.zc-card-open {
  font-size: 6px;
  color: var(--amber);
  letter-spacing: 1px;
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}
.zc-card.zc-center:hover .zc-card-open,
.zc-card.zc-center:focus-visible .zc-card-open {
  opacity: 1;
}

/* reader — full screen zine view */
#zc-reader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #0a0600;
  color: var(--text);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  overflow: hidden;
}
#zc-reader.active {
  opacity: 1;
  pointer-events: all;
}

#zc-reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(200, 168, 130, 0.09);
  flex-shrink: 0;
  background: rgba(10, 6, 0, 0.96);
}
#zc-reader-title {
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 2px;
}
#zc-reader-close {
  font-size: 24px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}
#zc-reader-close:hover {
  color: var(--text);
}

#zc-reader-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

/* editorial scroll layout inside the reader */
#zc-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 64px 32px 120px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.zcr-block {
  width: 100%;
  margin-left: max(0px, var(--shift, 0px));
  margin-right: max(0px, calc(-1 * var(--shift, 0px)));
}
.zcr-duo-offset {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 12px;
  align-items: center;
}
.zcr-solo-left {
  display: flex;
}
.zcr-solo-left .zcr-wrap {
  width: 56%;
}
.zcr-trio {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  align-items: center;
}
.zcr-solo-right {
  display: flex;
  justify-content: flex-end;
}
.zcr-solo-right .zcr-wrap {
  width: 56%;
}
.zcr-duo-even {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
}

/* Scroll-reveal image wrapper */
.zcr-wrap {
  background: #111;
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 1.7s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 1.7s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.zcr-wrap.visible {
  opacity: 1;
  transform: translateY(0);
}
.zcr-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* large screen tweaks for the carousel */
@media (min-width: 1600px) {
  :root {
    --zc-step: 250px;
  }
  #zc-track {
    width: calc(var(--zc-step) * 2 + 300px);
    height: 490px;
  }
  .zc-card {
    width: 280px;
  }
}

@media (min-width: 2200px) {
  :root {
    --zc-step: 330px;
  }
  #zc-track {
    width: calc(var(--zc-step) * 2 + 390px);
    height: 640px;
  }
  .zc-card {
    width: 370px;
  }
}

/* mobile tweaks for the carousel */
@media (max-width: 600px) {
  :root {
    --zc-step: 165px;
  }
  #zc-track {
    width: calc(var(--zc-step) * 2 + 180px);
    height: 320px;
  }
  .zc-card {
    width: 170px;
  }
  .zc-btn {
    display: none;
  }
  #zc-inner {
    margin-bottom: 70px;
  }

  #zc-content {
    padding: 32px 20px 80px;
  }
  .zcr-block {
    margin-left: max(0px, calc(var(--shift, 0px) * 0.25));
    margin-right: max(0px, calc(-1 * var(--shift, 0px) * 0.25));
  }
  .zcr-duo-offset {
    grid-template-columns: 3fr 2fr;
  }
  .zcr-solo-left .zcr-wrap,
  .zcr-solo-right .zcr-wrap {
    width: 60%;
  }
}
