@import url("https://fonts.cdnfonts.com/css/thegoodmonolith");
@import url("https://fonts.googleapis.com/css?family=Jura:400");

@font-face {
  font-family: "PPNeueMontreal";
  src: url("https://assets.codepen.io/7558/PPNeueMontreal-Variable.woff2")
    format("woff2");
  font-weight: 100 900;
  font-style: normal;
}

:root {
  --spacing-base: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --color-text: #ffffff;
  --color-text-dim: 0.6;
  --transition-medium: 0.3s ease;
  --font-size-base: 36px;

  /* Accent colour — change here to retheme the whole site */
  --color-accent: var(--color-accent);
  --accent-rgb: 166, 75, 35;   /* used inside rgba() */

  /* Borders */
  --color-border: var(--color-border);
  --color-border-hover: var(--color-border-hover);
}

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

body {
  font-family: "PPNeueMontreal", sans-serif;
  background: #000;
  overflow: hidden;
  height: 100vh;
  cursor: grab;
}

body.dragging {
  cursor: grabbing;
}

body.zoom-mode {
  cursor: default;
}

body.zoom-mode .header > *,
body.zoom-mode .footer > * {
  pointer-events: none;
}

body.zoom-mode #activeCategoryLabel {
  pointer-events: auto;
  cursor: pointer;
}

/* Header and Footer */
.header,
.footer {
  position: fixed;
  left: 0;
  width: 100vw;
  padding: 1.5rem;
  z-index: 10000;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--spacing-base);
  pointer-events: none;
  opacity: 0;
}

.header > *,
.footer > * {
  pointer-events: auto;
}

.header {
  top: 0;
}

.footer {
  bottom: 0;
  padding-bottom: 1.25em;
}

/* Grid column assignments */

/* ===== LANGUAGE TOGGLE ===== */
.lang-toggle {
  grid-column: 1 / span 1;
  align-self: start;
  justify-self: start;
  font-family: 'TheGoodMonolith', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  border-radius: 0.4em;
  color: var(--color-text);
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.2s;
}

.lang-flag {
  display: inline-block;
  vertical-align: -3px;
  font-size: 1.1em;
  line-height: 1;
}

/* Inside mobile menu */
.lang-toggle--menu {
  grid-column: unset;
  align-self: unset;
  justify-self: unset;
  position: static;
  display: inline-block;
  margin-top: 2rem;
}

/* Inside category index footer */
.lang-toggle--index {
  grid-column: unset;
  align-self: unset;
  justify-self: unset;
  position: static;
  display: inline-block;
}

/* ===== HAMBURGER BUTTON (mobile only) ===== */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10002;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 0.4em;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
}

.hamburger-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-btn.open .hamburger-line:first-child {
  transform: translateY(4px) rotate(45deg);
}

.hamburger-btn.open .hamburger-line:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* ===== MOBILE MENU OVERLAY ===== */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.mobile-menu-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  height: 100%;
  padding: 4rem 2rem 2rem;
}

.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: auto;
  margin-top: auto;
}

.mobile-menu-link {
  font-family: 'PPNeueMontreal', sans-serif;
  font-size: 36px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(20px);
}


.footer-right {
  grid-column: 7 / span 6;
  justify-self: end;
  align-self: end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-section {
  text-align: right;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 0.4em;
  padding: 5px 10px;
}

/* On desktop the lang toggle lives in the footer; hide the header one */
@media (min-width: 769px) {
  #langToggle { display: none; }
}

/* Lang toggle sitting beside the coords in the footer */
.lang-toggle--footer {
  grid-column: unset;
  align-self: unset;
  justify-self: unset;
  position: static;
  font-size: inherit;
}

/* Footer text styling */
.footer p {
  font-family: "TheGoodMonolith", monospace;
}


/* Global link styling */
a {
  position: relative;
  cursor: pointer;
  color: var(--color-text);
  padding: 0;
  display: inline-block;
  z-index: 1;
  text-decoration: none;
  font-size: var(--font-size-base);
  opacity: 1;
  transition: color var(--transition-medium);
  font-weight: 700;
}

a::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: var(--color-text);
  z-index: -1;
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

a:hover::after {
  width: 100%;
}

a:hover {
  color: black;
  mix-blend-mode: difference;
  opacity: 1;
}

p {
  display: block;
  text-decoration: none;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01rem;
  -webkit-font-smoothing: antialiased;
}

ul {
  list-style: none;
}

h3 {
  font-size: 36px;
  margin-bottom: var(--spacing-base);
  font-weight: 600;
  color: #fff;
}

.viewport {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
  opacity: 0;
  touch-action: none;
}

.canvas-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
  isolation: isolate;
  touch-action: none;
}

.grid-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.grid-item {
  position: absolute;
  width: 400px;
  height: 300px;
  background: transparent;
  cursor: pointer;
  z-index: 1;
  opacity: 1;
  transition: opacity 0.5s ease;
  border-radius: 12px;
  overflow: hidden;
}

.grid-item.out-of-view {
  opacity: 0;
  content-visibility: hidden;
}

.grid-item.selected {
  z-index: 2 !important;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.grid-item img.loaded {
  opacity: 1;
}

/* Split Screen Layout */
.split-screen-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.split-screen-container.active {
  opacity: 1;
  pointer-events: all;
}

.split-left {
  position: relative;
  width: 65vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
  cursor: pointer;
  padding: 3rem 5.5rem;
}

.split-right {
  position: relative;
  width: 35vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  z-index: 1;
  cursor: pointer;
  padding: 3rem 2.5rem;
}

/* Image target - BEHIND the scaling image */
.zoom-target {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}



/* Hide placeholder when active */
.split-screen-container.active .zoom-target::before {
  display: none;
}

.zoom-target::before {
  content: "IMAGE TARGET";
  color: rgba(255, 255, 255, 0.5);
  font-family: "TheGoodMonolith", monospace;
  font-size: 0.75em;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.controls-container {
  position: fixed;
  bottom: 1.25em;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5em;
  align-items: center;
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: left 1.2s cubic-bezier(0.87, 0, 0.13, 1);
}

.controls-container.visible {
  opacity: 1;
  pointer-events: auto;
}

.controls-container.split-mode {
  left: 82.5%;
}

.controls-container.split-mode .percentage-indicator,
.controls-container.split-mode #controls {
  display: none;
}

.percentage-indicator {
  background-color: #f0f0f0;
  background-image: radial-gradient(rgba(0, 0, 0, 0.015) 1px, transparent 0);
  background-size: 0.44em 0.44em;
  background-position: -0.06em -0.06em;
  padding: 0.625em 1.25em;
  border-radius: 0.25em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "TheGoodMonolith", monospace;
  font-size: 0.75em;
  font-weight: 400;
  text-transform: uppercase;
  color: #333;
  min-width: 5em;
  white-space: nowrap;
}

.switch {
  display: flex;
  gap: 0;
  align-items: center;
  position: relative;
  background-color: #1a1a1a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
  background-size: 0.44em 0.44em;
  background-position: -0.06em -0.06em;
  border-radius: 0.3em;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sound-toggle {
  background-color: #f0f0f0;
  background-image: radial-gradient(rgba(0, 0, 0, 0.015) 1px, transparent 0);
  background-size: 0.44em 0.44em;
  background-position: -0.06em -0.06em;
  padding: 0.5em 0.75em;
  border-radius: 0.25em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 3.75em;
  position: relative;
  border-color: transparent;
}

.sound-wave-canvas {
  width: 2em;
  height: 1em;
  border: none !important;
  outline: none !important;
  background: none !important;
}

.sound-toggle.active .sound-wave-canvas {
  opacity: 1;
}

.sound-toggle:hover .sound-wave-canvas {
  opacity: 0.8;
}

.switch-button {
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.35);
  font-family: "TheGoodMonolith", monospace;
  font-size: 0.7em;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding: 0 1em;
  height: 40px;
  transition: color 0.18s ease;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.switch-button:last-child { border-right: none; }

.switch-button:hover { color: rgba(255, 255, 255, 0.7); }

.switch-button-current {
  color: rgb(var(--accent-rgb));
  box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb), 0.55);
}


/* Scaling image overlay */
.scaling-image-overlay {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 3;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(var(--accent-rgb), 0.7);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.4), 0 0 48px rgba(var(--accent-rgb), 0.2), 0 0 80px rgba(var(--accent-rgb), 0.1), inset 0 0 12px rgba(var(--accent-rgb), 0.08);
  pointer-events: none;
  will-change: transform, opacity;
}

.scaling-image-overlay img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ===== IMAGE NAVIGATION BUTTONS ===== */
.image-nav-btn {
  position: fixed;
  top: clamp(30%, 50%, 70%);
  transform: translateY(-50%);
  z-index: 10001;
  width: 64px;
  height: 64px;
  background: var(--color-border);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.image-nav-prev {
  left: 1.25rem;
}

.image-nav-next {
  left: calc(65vw - 1.25rem - 64px);
}

.image-nav-btn.active {
  pointer-events: all;
}

.image-nav-btn:hover {
  background: rgba(var(--accent-rgb), 0.2);
  border-color: rgba(var(--accent-rgb), 0.5);
}

.image-nav-btn:active {
  transform: translateY(-50%) scale(0.92);
}

.image-nav-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.image-nav-prev:hover svg {
  transform: translateX(-2px);
}

.image-nav-next:hover svg {
  transform: translateX(2px);
}


/* ===== FULLSCREEN MODE OVERRIDES ===== */
body.fullscreen-mode .split-left  { width: 100vw; padding-bottom: 4.5rem; }
body.fullscreen-mode .split-right { display: none; }
body.fullscreen-mode .image-nav-prev { left: 1.25rem; }
body.fullscreen-mode .image-nav-next { left: auto; right: 1.25rem; }
body.fullscreen-mode .controls-container .percentage-indicator,
body.fullscreen-mode .controls-container #controls { display: none; }
body.fullscreen-mode .controls-container { left: 50%; }



/* ===== VIEW MODE PICKER ===== */

.vm-group {
  display: flex;
  gap: 0;
  align-items: center;
  position: relative;
  background-color: #1a1a1a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
  background-size: 0.44em 0.44em;
  background-position: -0.06em -0.06em;
  border-radius: 0.3em;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  overflow: visible;
}

/* Sliding active indicator */
.vm-group::before {
  content: '';
  position: absolute;
  inset: 0;
  width: 33.333%;
  background: rgba(var(--accent-rgb), 0.18);
  transform: translateX(calc(var(--vm-active, 0) * 100%));
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 0;
}

.vm-btn {
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.35);
  transition: color 0.18s ease;
  padding: 0;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.vm-btn:first-child { border-radius: 0.3em 0 0 0.3em; }
.vm-btn:last-child  { border-right: none; border-radius: 0 0.3em 0.3em 0; }

.vm-btn:hover { color: rgba(255, 255, 255, 0.7); }

.vm-btn.vm-active {
  color: rgb(var(--accent-rgb));
  box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb), 0.55);
}

.vm-btn .fp {
  opacity: 0;
  transition: opacity 0.18s ease;
}
.vm-btn.vm-active .fp {
  opacity: 1;
}

@media (hover: hover) {
  .vm-btn,
  .sound-toggle {
    position: relative;
  }

  .vm-btn::after,
  .sound-toggle::after {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(20, 20, 20, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.85);
    font-family: "TheGoodMonolith", monospace;
    font-size: 0.75em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 0.5em 1em;
    border-radius: 0.3em;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
  }

  .vm-btn::after {
    content: attr(aria-label);
  }

  .sound-toggle::after { content: attr(data-tooltip); }

  .vm-btn:hover::after,
  .sound-toggle:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ===== ACTIVE CATEGORY INDICATOR ===== */
.active-category-indicator {
  grid-column: 11 / span 2;
  justify-self: end;
  align-self: start;
  display: inline-block;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 0.4em;
  padding: 5px 10px;
  font-family: "TheGoodMonolith", monospace;
  font-size: 32px;
  line-height: 1;
  text-box: trim-both cap alphabetic;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  margin: 0;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  text-shadow:
    0 0 18px rgba(0, 0, 0, 0.9),
    0 0 6px rgba(0, 0, 0, 0.7),
    0 2px 4px rgba(0, 0, 0, 0.6);
}

.active-category-indicator:hover {
  color: rgba(255, 255, 255, 1);
  text-shadow:
    0 0 22px rgba(0, 0, 0, 1),
    0 0 8px rgba(0, 0, 0, 0.8),
    0 2px 4px rgba(0, 0, 0, 0.7);
}

/* ===== CATEGORY INDEX OVERLAY ===== */
/* ---- Category Index overlay ---- */
.category-index {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* dvh accounts for mobile browser address bar */
  background: rgba(0, 0, 0, 0.97);
  z-index: 15000;
  /* Grid gives .category-index-inner a guaranteed definite height */
  display: grid;
  grid-template-rows: 1fr auto;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.category-index-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.3s ease, transform 0.3s ease;
}

.category-index-close svg {
  width: 32px;
  height: 32px;
}

.category-index-close:hover {
  color: #fff;
  transform: rotate(90deg);
}

.category-index-inner {
  min-height: 0;
  display: flex;
  padding: 0 4rem;
  gap: 2rem;
  overflow: hidden;
  position: relative;
}

/* ---- Category list ---- */
.category-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-width: 60%;
  overflow-y: auto;
  padding: 2.5rem 0;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 22%, black 58%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 22%, black 58%, transparent 100%);
}

.category-list::-webkit-scrollbar {
  display: none;
}

.category-list.at-top {
  -webkit-mask-image: linear-gradient(to bottom, black 58%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 58%, transparent 100%);
}

.category-list.at-bottom {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 22%, black 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 22%, black 100%);
}

.category-list.at-top.at-bottom {
  -webkit-mask-image: none;
  mask-image: none;
}

/* ---- Category rows — new design ---- */
.category-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 0.5rem 1rem 1rem;
  cursor: pointer;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: padding-left 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease;
}

.category-row:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.category-row:hover {
  padding-left: 2rem;
  border-color: var(--color-border-hover);
}

/* Vertical accent bar on left */
.category-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 2px;
  background: var(--color-accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-row:hover::before,
.category-row.category-row-active::before {
  transform: scaleY(1);
}

.category-row.category-row-active {
  padding-left: 2rem;
}

.category-number {
  font-family: "TheGoodMonolith", monospace;
  font-size: 1.0rem;
  color: rgba(255, 255, 255, 0.15);
  letter-spacing: 0.15em;
  min-width: 2rem;
  flex-shrink: 0;
  transition: color 0.25s ease;
}

.category-name {
  font-family: "PPNeueMontreal", sans-serif;
  font-size: clamp(1.4rem, 2.2vw, 2.4rem);
  font-weight: 450;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: -0.025em;
  line-height: 1;
  flex: 1;
  transition: color 0.25s ease;
  white-space: nowrap;
}


.category-count {
  font-family: "TheGoodMonolith", monospace;
  font-size: 1.0rem;
  color: rgba(255, 255, 255, 0.1);
  letter-spacing: 0.1em;
  flex-shrink: 0;
  text-align: right;
  transition: color 0.25s ease;
}

.category-row:hover .category-number { color: rgba(var(--accent-rgb), 0.9); }
.category-row:hover .category-name   { color: #ffffff; }
.category-row:hover .category-count  { color: rgba(255, 255, 255, 0.3); }

.category-row.category-row-active .category-number { color: var(--color-accent); }
.category-row.category-row-active .category-name   { color: #ffffff; }
.category-row.category-row-active .category-count  { color: rgba(255, 255, 255, 0.3); }

/* ---- Preview area ---- */
.category-preview {
  width: 35%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.category-preview-letter {
  font-family: "PPNeueMontreal", sans-serif;
  font-size: clamp(120px, 15vw, 220px);
  font-weight: 600;
  color: rgba(var(--accent-rgb), 0.25);
  user-select: none;
  transition: all 0.4s ease;
  line-height: 1;
}

.category-preview-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75%;
  height: 70%;
  object-fit: contain;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.88);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.category-preview-img.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ---- Footer ---- */
.category-index-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 4rem;
  border-top: 1px solid var(--color-border);
}

.category-index-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.category-index-nav a {
  font-family: "TheGoodMonolith", monospace;
  font-size: 1.3rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: color 0.3s ease;
  padding: 0;
  display: inline;
}

.category-index-nav a::after {
  display: none;
}

.category-index-nav a:hover {
  color: var(--color-accent);
  mix-blend-mode: normal;
  opacity: 1;
}

.category-index-sep {
  color: rgba(255, 255, 255, 0.15);
  font-size: 1.3rem;
}

.category-index-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.category-index-coords {
  font-family: "TheGoodMonolith", monospace;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.05em;
}

/* Inline About / Contact panels */
.index-panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 1rem 2rem 2rem;
  scrollbar-width: none;
}

.index-panel.active {
  display: block;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 82%, transparent 100%);
}

.index-panel-content {
  max-width: 640px;
  margin: 0 auto;
  user-select: text;
}

/* ══════════════════════════════════════════════════
   ABOUT DOSSIER — SCI-FI REDESIGN
   ══════════════════════════════════════════════════ */

/* ── H1 title ────────────────────────────────────── */
.index-panel-content .ab-h1 {
  font-family: "TheGoodMonolith", monospace;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  -webkit-text-stroke: 0.5px rgba(255, 255, 255, 0.7);
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 8rem;
  margin-bottom: 2.5rem;
  position: relative;
  display: inline-block;
  animation: abH1Glitch 7s infinite;
}

.index-panel-content .ab-h1::before,
.index-panel-content .ab-h1::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}
.index-panel-content .ab-h1::before {
  color: rgba(166, 75, 35, 0.55);
  clip-path: polygon(0 18%, 100% 18%, 100% 42%, 0 42%);
  animation: abGlitchA 7s infinite;
}
.index-panel-content .ab-h1::after {
  color: rgba(80, 160, 255, 0.35);
  clip-path: polygon(0 58%, 100% 58%, 100% 76%, 0 76%);
  animation: abGlitchB 7s infinite;
}

/* Pause glitch animations when panel is not visible */
#indexPanelAbout:not(.active) .ab-h1,
#indexPanelAbout:not(.active) .ab-h1::before,
#indexPanelAbout:not(.active) .ab-h1::after {
  animation-play-state: paused;
}

@keyframes abH1Glitch {
  0%, 85%, 100% { transform: none; }
  87%  { transform: translateX(-2px); }
  89%  { transform: translateX(3px); }
  91%  { transform: translateX(-1px); }
}
@keyframes abGlitchA {
  0%, 85%, 100% { transform: none; opacity: 0; }
  87%  { transform: translateX(5px);  opacity: 1; }
  89%  { transform: translateX(-4px); opacity: 0.7; }
  91%  { transform: translateX(2px);  opacity: 0; }
}
@keyframes abGlitchB {
  0%, 85%, 100% { transform: none; opacity: 0; }
  87%  { transform: translateX(-6px); opacity: 1; }
  89%  { transform: translateX(4px);  opacity: 0.6; }
  91%  { transform: translateX(-1px); opacity: 0; }
}

/* ── Dossier layout ──────────────────────────────── */
.ab-dossier {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 3rem;
}

/* ── Portrait frame ──────────────────────────────── */
.ab-portrait-frame {
  position: relative;
  flex-shrink: 0;
  width: 180px;
  height: 180px;
}

.ab-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}




/* ── Identity info ───────────────────────────────── */
.about-intro {
  flex: 1;
}

.about-name {
  font-size: 1.6em;
  font-weight: 600;
  letter-spacing: -0.02em;
}


/* ── File sections ───────────────────────────────── */
.ab-file {
  margin-bottom: 2.5rem;
  padding-left: 1.25rem;
  border-left: 1px solid rgba(166, 75, 35, 0.2);
  position: relative;
}

.ab-file::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  width: 1px;
  height: 0;
  background: rgba(166, 75, 35, 0.8);
  animation: abFileLine 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.ab-file:nth-child(1)::before { animation-delay: 0s; }
.ab-file:nth-child(2)::before { animation-delay: 0.15s; }
.ab-file:nth-child(3)::before { animation-delay: 0.3s; }

@keyframes abFileLine {
  from { height: 0; }
  to   { height: 100%; }
}

.ab-file-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ab-file-id {
  font-family: "TheGoodMonolith", monospace;
  font-size: 0.58rem;
  color: rgba(166, 75, 35, 0.7);
  letter-spacing: 0.18em;
  flex-shrink: 0;
}

.ab-file-title {
  font-family: "PPNeueMontreal", sans-serif;
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.ab-file-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(166,75,35,0.3), transparent);
  transform-origin: left;
  transform: scaleX(0);
  animation: abLineExpand 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

@keyframes abLineExpand {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.ab-body {
  font-family: "PPNeueMontreal", sans-serif;
  font-size: clamp(0.88rem, 1.1vw, 1rem);
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.8;
  margin: 0;
}

/* ── Gear tags ───────────────────────────────────── */
.ab-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.ab-tag {
  font-family: "TheGoodMonolith", monospace;
  font-size: 0.6rem;
  color: rgba(166, 75, 35, 0.8);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(166, 75, 35, 0.3);
  padding: 0.3rem 0.65rem;
  background: rgba(166, 75, 35, 0.05);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.ab-tag:hover {
  border-color: rgba(166, 75, 35, 0.7);
  background: rgba(166, 75, 35, 0.1);
}

/* ── Signature ───────────────────────────────────── */
.ab-sig {
  font-family: "PPNeueMontreal", sans-serif;
  font-style: italic;
  color: rgba(166, 75, 35, 0.6);
  margin-top: 0.5rem;
  margin-bottom: 2.5rem;
}

/* ── Archive card ────────────────────────────────── */
.arc {
  display: block;
  text-decoration: none;
  color: inherit;
  mix-blend-mode: normal;
  margin-top: 1.5rem;
  transition: opacity 0.25s ease;
}
.arc:hover { opacity: 0.85; mix-blend-mode: normal; }
.arc:hover::after { width: 0; }

.arc-thumb {
  width: 72px;
  height: 56px;
  object-fit: cover;
  flex-shrink: 0;
  filter: grayscale(0.5) brightness(0.75);
  transition: filter 0.3s ease;
}
.arc:hover .arc-thumb { filter: grayscale(0) brightness(1); }

.arc-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}
.arc-title {
  font-family: "PPNeueMontreal", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
}
.arc-desc {
  font-family: "PPNeueMontreal", sans-serif;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  line-height: 1.5;
}

.arc-3 {
  position: relative;
  padding: 1.25rem 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  overflow: hidden;
}
.arc-3-year {
  position: absolute;
  right: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: "TheGoodMonolith", monospace;
  font-size: 5rem;
  font-weight: 700;
  color: rgba(166,75,35,0.07);
  letter-spacing: -0.04em;
  pointer-events: none;
  line-height: 1;
  user-select: none;
}
.arc-3-content {
  display: flex;
  gap: 1rem;
  align-items: center;
  position: relative;
}
.arc-3 .arc-thumb { border-radius: 4px; }
.arc-3-link {
  font-family: "TheGoodMonolith", monospace;
  font-size: 0.65rem;
  color: rgba(166,75,35,0.75);
  letter-spacing: 0.1em;
  margin-top: 0.4rem;
}

/* ── Mobile ──────────────────────────────────────── */
@media (max-width: 600px) {
  .index-panel-content h1 {
    text-align: center;
  }
  .index-panel-content .ab-h1 {
    display: block;
    text-align: center;
  }
  .ab-dossier {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }
  .ab-portrait-frame {
    width: 130px;
    height: 130px;
  }
  .about-intro {
    text-align: center;
  }
}

.index-panel-content h1 {
  font-family: "PPNeueMontreal", sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 600;
  margin-top: 8rem;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

/* ── Contact title sci-fi treatment ─────────────── */
.index-panel-content .ct-h1 {
  font-family: "TheGoodMonolith", monospace;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 8rem;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
  animation: ctH1Glitch 6s infinite;
}

/* chromatic aberration ghost layers */
.ct-h1::before,
.ct-h1::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}

.ct-h1::before {
  color: rgba(166, 75, 35, 0.55);
  animation: ctGlitchRed 6s infinite;
  clip-path: polygon(0 20%, 100% 20%, 100% 45%, 0 45%);
}

.ct-h1::after {
  color: rgba(100, 180, 255, 0.35);
  animation: ctGlitchBlue 6s infinite;
  clip-path: polygon(0 55%, 100% 55%, 100% 75%, 0 75%);
}

/* Pause glitch animations when panel is not visible */
#indexPanelContact:not(.active) .ct-h1,
#indexPanelContact:not(.active) .ct-h1::before,
#indexPanelContact:not(.active) .ct-h1::after {
  animation-play-state: paused;
}

@keyframes ctH1Glitch {
  0%, 88%, 100% { transform: none; }
  90%            { transform: translateX(-2px); }
  92%            { transform: translateX(2px); }
  94%            { transform: translateX(-1px); }
}

@keyframes ctGlitchRed {
  0%, 88%, 100% { transform: none; opacity: 0; }
  90%            { transform: translateX(4px);  opacity: 1; }
  92%            { transform: translateX(-3px); opacity: 0.8; }
  94%            { transform: translateX(2px);  opacity: 0; }
}

@keyframes ctGlitchBlue {
  0%, 88%, 100% { transform: none; opacity: 0; }
  90%            { transform: translateX(-5px); opacity: 1; }
  92%            { transform: translateX(3px);  opacity: 0.7; }
  94%            { transform: translateX(-1px); opacity: 0; }
}

.index-panel-content .lead {
  font-family: "PPNeueMontreal", sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.index-panel-content p {
  font-family: "PPNeueMontreal", sans-serif;
  font-size: clamp(0.88rem, 1.1vw, 1rem);
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}


/* ══════════════════════════════════════════════════
   CONTACT TERMINAL — SCI-FI REDESIGN
   ══════════════════════════════════════════════════ */

.ct-terminal {
  position: relative;
  margin-top: 2rem;
  padding: 1.75rem;
  border: 1px solid rgba(166, 75, 35, 0.3);
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(166, 75, 35, 0.018) 3px,
      rgba(166, 75, 35, 0.018) 4px
    ),
    linear-gradient(rgba(166, 75, 35, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(166, 75, 35, 0.04) 1px, transparent 1px),
    transparent;
  background-size: auto, 48px 48px, 48px 48px;
}

/* Corner reticle brackets */
.ct-terminal::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 18px;
  height: 18px;
  border-top: 2px solid rgba(166, 75, 35, 0.9);
  border-left: 2px solid rgba(166, 75, 35, 0.9);
  pointer-events: none;
}
.ct-terminal::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 18px;
  height: 18px;
  border-bottom: 2px solid rgba(166, 75, 35, 0.9);
  border-right: 2px solid rgba(166, 75, 35, 0.9);
  pointer-events: none;
}

/* ── Header ─────────────────────────────────────── */
.ct-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(166, 75, 35, 0.2);
}

.ct-tag {
  font-family: "TheGoodMonolith", monospace;
  font-size: 0.68rem;
  color: rgba(166, 75, 35, 0.85);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ct-status {
  font-family: "TheGoodMonolith", monospace;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.ct-blink {
  color: #5dffaa;
  animation: ctBlink 1.1s step-end infinite;
}

@keyframes ctBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Intro line ──────────────────────────────────── */
.ct-intro {
  font-family: "TheGoodMonolith", monospace;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.04em;
  margin-bottom: 2rem;
}

/* ── Channels ────────────────────────────────────── */
.ct-channels {
  display: flex;
  flex-direction: column;
}

.ct-channel {
  display: block;
  text-decoration: none;
  padding: 1.15rem 0 1.15rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
  transition: padding-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* animated left accent bar */
.ct-channel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, rgba(166, 75, 35, 0.9) 40%, rgba(166, 75, 35, 0.9) 60%, transparent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ct-channel:hover {
  padding-left: 1.1rem;
  color: inherit;
  mix-blend-mode: normal;
}

.ct-channel:hover::after {
  width: 0;
}

.ct-channel:hover::before {
  transform: scaleY(1);
}

.ct-channel-id {
  font-family: "TheGoodMonolith", monospace;
  font-size: 0.62rem;
  color: rgba(166, 75, 35, 0.65);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.ct-channel-value {
  font-family: "PPNeueMontreal", sans-serif;
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.3s ease;
  position: relative;
  display: inline-block;
}

.ct-channel:hover .ct-channel-value {
  color: #fff;
}

/* glitch slice on hover */
.ct-channel:hover .ct-channel-value::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  color: rgba(166, 75, 35, 0.7);
  clip-path: polygon(0 28%, 100% 28%, 100% 46%, 0 46%);
  animation: ctGlitch 0.45s steps(3) forwards;
  pointer-events: none;
}

@keyframes ctGlitch {
  0%   { transform: translateX(0px);  opacity: 0.7; }
  20%  { transform: translateX(-4px); opacity: 0.5; }
  40%  { transform: translateX(3px);  opacity: 0.6; }
  60%  { transform: translateX(-2px); opacity: 0.4; }
  80%  { transform: translateX(1px);  opacity: 0.3; }
  100% { transform: translateX(0px);  opacity: 0;   }
}

/* signal bar */
.ct-channel-bar {
  margin-top: 0.6rem;
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  position: relative;
  overflow: hidden;
}

.ct-channel-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(166, 75, 35, 0.9), rgba(166, 75, 35, 0.2));
  transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.ct-channel:hover .ct-channel-bar span {
  width: 100%;
}

/* ── Sector coordinates ──────────────────────────── */
.ct-sector {
  margin-top: 2.5rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid rgba(166, 75, 35, 0.18);
  background: rgba(166, 75, 35, 0.04);
  position: relative;
}

.ct-sector::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 10px;
  height: 10px;
  border-top: 1px solid rgba(166, 75, 35, 0.8);
  border-left: 1px solid rgba(166, 75, 35, 0.8);
}

.ct-sector-label {
  font-family: "TheGoodMonolith", monospace;
  font-size: 0.58rem;
  color: rgba(166, 75, 35, 0.55);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}

.ct-sector-data {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 0.5rem;
}

.ct-coord {
  font-family: "TheGoodMonolith", monospace;
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.05em;
}

.ct-coord-sep {
  font-family: "TheGoodMonolith", monospace;
  font-size: 0.7rem;
  color: rgba(166, 75, 35, 0.45);
}

.ct-sector-name {
  font-family: "PPNeueMontreal", sans-serif;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 0.06em;
}

/* ── Footer line ─────────────────────────────────── */
.ct-footer-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(166, 75, 35, 0.15);
  font-family: "TheGoodMonolith", monospace;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.13);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ct-blink-slow {
  color: rgba(166, 75, 35, 0.5);
  animation: ctBlink 1.6s step-end infinite;
}

/* ── Mobile ──────────────────────────────────────── */
@media (max-width: 600px) {
  .index-panel-content .ct-h1 {
    display: block;
    text-align: center;
  }
  .ct-terminal {
    padding: 1.25rem;
  }
  .ct-sector-data {
    flex-direction: column;
    gap: 0.25rem;
  }
  .ct-coord-sep {
    display: none;
  }
}

/* Active nav link highlight */
.category-index-nav a.panel-active {
  color: var(--color-accent);
}

/* Hide default scrollbar on panels */
.index-panel::-webkit-scrollbar {
  width: 0;
  display: none;
}

.index-panel {
  -ms-overflow-style: none;
}

/* ===== PANEL SCROLL (throttle-up) BUTTON ===== */
.panel-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.2rem;
  gap: 1rem;
  position: absolute;
  bottom: 2rem;
  right: 3rem;
  cursor: pointer;
  text-decoration: none;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.panel-scroll.visible {
  opacity: 1;
  pointer-events: auto;
}

.panel-scroll::after {
  display: none;
}

.panel-scroll:hover {
  color: inherit;
  mix-blend-mode: normal;
}

.panel-scroll-text {
  text-shadow: 0 0 20px rgba(var(--accent-rgb), 1);
  color: rgb(166, 75, 35);
  font-family: "Jura", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.panel-scroll-container {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.5rem;
}

.panel-rect {
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(20px);
  box-shadow: 0 0 30px 2px rgba(var(--accent-rgb), 0.4), 0 0 8px 1px rgba(var(--accent-rgb), 0.2);
}

.panel-rect:first-child {
  opacity: 1;
  transform: translateY(0);
  background-color: rgba(var(--accent-rgb), 1);
}

.panel-scroll .panel-rect:not(:first-child) {
  /* keep hidden by default; hover reveal is enabled only on hover-capable devices below */
}

@media (hover: hover) {
  .panel-scroll:hover .panel-rect:not(:first-child) {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-rect:nth-child(1) { width: 100px; height: 15px; }
.panel-rect:nth-child(2) { width: 70px; height: 12px; transition-delay: 0.05s; background-color: rgba(var(--accent-rgb), 0.9); }
.panel-rect:nth-child(3) { width: 50px; height: 9px; transition-delay: 0.1s; background-color: rgba(var(--accent-rgb), 0.8); }
.panel-rect:nth-child(4) { width: 40px; height: 7px; transition-delay: 0.15s; background-color: rgba(var(--accent-rgb), 0.7); }
.panel-rect:nth-child(5) { width: 32px; height: 6px; transition-delay: 0.2s; background-color: rgba(var(--accent-rgb), 0.6); }
.panel-rect:nth-child(6) { width: 28px; height: 5px; transition-delay: 0.25s; background-color: rgba(var(--accent-rgb), 0.5); }
.panel-rect:nth-child(7) { width: 25px; height: 4px; transition-delay: 0.3s; background-color: rgba(var(--accent-rgb), 0.4); }
.panel-rect:nth-child(8) { width: 22px; height: 3px; transition-delay: 0.35s; background-color: rgba(var(--accent-rgb), 0.3); }

/* reverse delays on hover-out */
.panel-scroll:not(:hover) .panel-rect:nth-child(2) { transition-delay: 0.35s; }
.panel-scroll:not(:hover) .panel-rect:nth-child(3) { transition-delay: 0.3s; }
.panel-scroll:not(:hover) .panel-rect:nth-child(4) { transition-delay: 0.25s; }
.panel-scroll:not(:hover) .panel-rect:nth-child(5) { transition-delay: 0.2s; }
.panel-scroll:not(:hover) .panel-rect:nth-child(6) { transition-delay: 0.15s; }
.panel-scroll:not(:hover) .panel-rect:nth-child(7) { transition-delay: 0.05s; }
.panel-scroll:not(:hover) .panel-rect:nth-child(8) { transition-delay: 0s; }

@media (max-width: 768px) {
  /* Progressive lines as you scroll down */
  .panel-scroll[data-lines] .panel-rect {
    opacity: 0;
    transform: translateY(20px);
  }
  .panel-scroll[data-lines] .panel-rect.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .header {
    display: none;
  }

  .lang-toggle {
    display: block;
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.6);
  }

  .lang-toggle--menu,
  .lang-toggle--index {
    position: static;
    z-index: auto;
    background: none;
    top: auto;
    left: auto;
  }

  .hamburger-btn {
    display: flex;
  }

  .mobile-menu-overlay {
    display: block;
  }

  /* Footer: hide on mobile to avoid blocking controls */
  .footer {
    display: none;
  }

  .info-section {
    text-align: center;
  }

  .info-section p {
    font-size: 11px;
  }

  /* Split screen: text at top, image fitted in middle above controls */
  .split-screen-container {
    flex-direction: column;
  }

  .split-left {
    width: 100vw;
    height: auto;
    flex: 1;
    order: 2;
    padding: 0.5rem 1rem 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .split-right {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: auto;
    padding: 1rem 1.25rem 3.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 70%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    z-index: 10;
  }


  /* Zoom target: contain the image, don't crop */
  .zoom-target {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Scaling overlay: fit image on mobile */
  .scaling-image-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .scaling-image-overlay img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }


  /* Controls: compact for mobile */
  .controls-container {
    bottom: 0.75em;
    gap: 0.25em;
    flex-wrap: nowrap;
    max-width: 100vw;
    padding: 0 0.5em;
  }

  .controls-container.split-mode {
    left: 50%;
    bottom: 0.75em;
  }

  .percentage-indicator {
    padding: 0.5em 0.75em;
    font-size: 0.65em;
    min-width: 3.5em;
  }

  /* Hide zoom/vm controls on gallery home; show only when viewing a photo */
  .controls-container .switch,
  .controls-container .vm-group,
  .controls-container .percentage-indicator {
    display: none;
  }

  body.zoom-mode .controls-container .switch,
  body.zoom-mode .controls-container .vm-group,
  body.zoom-mode .controls-container .percentage-indicator {
    display: flex;
  }

  .switch-button {
    font-size: 0.6em;
    padding: 0 0.75em;
    height: 36px;
  }

  .sound-toggle {
    padding: 0.4em 0.5em;
    min-width: 2.75em;
  }

  .sound-wave-canvas {
    width: 1.5em;
    height: 0.75em;
  }


  /* Image nav buttons on mobile — bottom row, inline with mute */
  .image-nav-btn {
    width: 52px;
    height: 52px;
    top: auto;
    bottom: 0.75em;
    transform: none;
  }

  .image-nav-prev {
    left: 1rem;
  }

  .image-nav-next {
    left: auto;
    right: 1rem;
  }

  .image-nav-btn:active {
    transform: scale(0.92);
  }

  .image-nav-btn svg {
    width: 18px;
    height: 18px;
  }

  /* Grid items on mobile */
  .grid-item {
    cursor: default;
  }

  /* Ensure body allows touch on canvas */
  body {
    cursor: default;
    touch-action: none;
    -webkit-overflow-scrolling: touch;
  }

  body.dragging {
    cursor: default;
  }

  /* Category Index — mobile */
  .category-index-inner {
    padding: 0 1.5rem;
    flex-direction: column;
  }

  .category-list {
    max-width: 100%;
    padding: 4rem 0 1.5rem;
  }

  .category-row:hover,
  .category-row.category-row-active {
    padding-left: 1.6rem;
  }

  .category-preview {
    display: none;
  }

  .category-name {
    font-size: 1.4rem;
  }

  .category-number {
    font-size: 1.0rem;
    min-width: 2.5rem;
  }

  .category-row {
    padding: 0.5rem 0;
  }

  .category-index-footer {
    padding: 1rem 1.5rem;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .category-index-close {
    display: block;
    top: 1rem;
    right: 1rem;
    z-index: 15001;
  }

  .index-panel {
    padding: 1rem 1.5rem 2rem;
  }

  .index-panel-content {
    max-width: 100%;
  }

  .panel-scroll {
    bottom: 1.5rem;
    right: 1.5rem;
  }

  .active-category-indicator {
    font-size: 24px;
  }
}
