/* default theme */
body {
  background:#000;
  transition: background-color 0.7s ease; /* smooth fade */
}

/* when toggled */
body.theme-warm {
  background:#e20b01;
}


:root {
  --bg: #000;
  --fg: #ffffff;
  --accent: #e20b01;
  --meta-bg: rgba(0,0,0,0.4);
  --gap: 1.5rem;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

.archive-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.75rem 1rem;
  .archive-header {
    background:none; /* remove gradient */
}
  font-size: 0.9rem;
}

.logo {
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* FLOATY SPACE INSTEAD OF GRID */
.archive-grid {
  position: relative;
  padding: 4rem 0 6rem;
  min-height: 600vh;           /* big vertical canvas for chaos */
  overflow: hidden;
}

/* each item is absolutely positioned in this "sky" */
.archive-item {
  position: absolute;
  cursor: pointer;
  overflow: hidden;
}

/* base thumbnail behaviour */
.archive-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease-out;
}

.archive-item:hover img {
  transform: scale(1.03);
}



/* NEW CORRECTED MEANING
   scale=1 → background layer (largest, behind)
   scale=2 → midground
   scale=3 → foreground (small crisp details)
*/

.archive-item[data-scale="1"] {
  position: absolute;
  left: 50vw !important;
  transform: translateX(-50%) !important;
  width: 95vw;
  opacity: 0.95;
}


.archive-item[data-scale="2"] {
  z-index: 2;
  width: 26vw;
  opacity: 0.8;
}

.archive-item[data-scale="3"] {
  z-index: 3;
  width: 18vw;         /* crisp sharp detail */
  opacity: 1;
}


/* Fallback for items without scale (treat as midground) */
.archive-item:not([data-scale]) {
  z-index: 2;
  width: 24vw;
}

/* small screens: make sure things aren't microscopic */
@media (max-width: 768px) {
  .archive-item[data-scale="3"] {
    width: 80vw;
  }
  .archive-item[data-scale="2"] {
    width: 60vw;
  }
  .archive-item[data-scale="1"] {
    width: 50vw;
  }
  .archive-item:not([data-scale]) {
    width: 55vw;
  }

  .archive-grid {
    min-height: 220vh;
  }
}

/* Optional atmospheric movement */
.archive-item[data-scale="1"] {
  animation: drift1 45s infinite alternate ease-in-out;
}

.archive-item[data-scale="2"] {
  animation: drift2 30s infinite alternate ease-in-out;
}

.archive-item[data-scale="3"] {
  animation: drift3 20s infinite alternate ease-in-out;
}

@keyframes drift1 {
  from { margin-top:-2vh; }
  to   { margin-top:2vh; }
}
@keyframes drift2 {
  from { margin-left:-1vw; }
  to   { margin-left:1vw; }
}
@keyframes drift3 { from {transform:scale(1);} to {transform:scale(1.05);} }


/* Overlay focus (unchanged) */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  display: none; /* JS -> flex */
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.overlay-inner {
  position: relative;
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
}

#overlay-image {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
}

.overlay-meta {
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: var(--meta-bg);
  font-size: 0.8rem;
}

.overlay-close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  border: none;
  background: var(--accent);
  color: #fff;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1.75rem;
}

:root { --scroll-offset: 0px; }

.archive-item {
    transform: translateY(var(--scroll-offset));
}

.archive-button {
  position: fixed;
  top: 22px;
  right: 42px;
  width: 42px;
  height: 42px;
  background:#r/db0000;
  border-radius: 50%;
  cursor: pointer;
  z-index: 9999;
  transition: transform .25s ease, box-shadow .35s ease;
}

.archive-button:hover {
  transform: scale(1.12);
  box-shadow: 0px 0px 18px rgba(226, 11, 1, .6);
}

body.theme-warm {
  background:#r/db0000!important;
  transition: background 0.5s ease;
}

body.theme-warm .archive-button {
  background:#fff !important;
}

.now-playing-text {
  color: #ffffff80;
  font-size: 14px;
  font-family: monospace;
  letter-spacing: .5px;
  opacity: 0;
  transition: opacity .6s ease;
}


/* Wrap = keeps skip dot attached to text dynamically */
.now-playing-wrap {
  position: fixed;
  top: 32px;
  right: 110px;
  display: flex;
  align-items: center;
  gap: 8px;               /* space between dot + text */
  z-index: 99999;
  pointer-events: none;   /* ensures layout doesn't block clicks elsewhere */
}

/* children restore pointer events */
.now-playing-text,
.skip-sound-btn {
  pointer-events: auto;
}

/* Small radio skip sphere */
.skip-sound-btn {
  width:14px;
  height:14px;
  border-radius:50%;
  background:#fff;        /* force visible for debugging */
  opacity:0;
  cursor:pointer;
  z-index:999999;         /* ensure above header/images */
}

/* when sound is ON: show text + dot */
body.theme-warm .now-playing-text {
  opacity: 1;
  color:#fff;
}

body.theme-warm .skip-sound-btn {
  opacity: 1;
}


.skip-sound-btn:hover {
  transform: scale(1.25);
}

/* ⚡ Skip feedback text */
.skip-notice {
  position: fixed;
  top: 65px;
  right: 110px;
  color:#fff;
  font-size:13px;
  opacity:0;
  transition: opacity .5s ease;
  pointer-events:none;
}

.show-skip {
  opacity:1;
}


/* Fix big main button color when OFF */
.archive-button {
  background:#e20b01; /* red as default instead of black */
}
body.theme-warm .archive-button { background:#fff !important; }

/* ⵙ Reset archive button */
.reset-archive {
  position: fixed;
  top: 72px;
  right: 56px;
  font-size:18px;
  color:#ffffff80;
  cursor:pointer;
  opacity:0;
  transition:opacity .4s,color .3s;
  z-index:9999;
}

/* only visible when sound ON (optional aesthetic) */
/* Reset button visible always */
.reset-archive {
  animation:pulse 3.6s ease-in-out infinite;
}
@keyframes pulse {
  0%,100%{opacity:0.85;}
  50%{opacity:1;}
}


/* Warmer + brighter when sound ON */
body.theme-warm .reset-archive {
  color:#fff;
  text-shadow:0 0 6px rgba(255,255,255,0.6);
}


.reset-archive:hover {
  color:#fff;
  transform:scale(1.1);
}

/* Improve scroll/transform smoothness */
.archive-item {
    will-change: transform;
    contain: layout paint style; /* isolates items → less reflow */
    transform: translate3d(0,0,0); /* forces GPU layer */
}

#archive-grid {
    contain: layout paint size;
    perspective: 1000px; /* tiny perf gain for GPU transforms */
}

.archive-grid, .archive-item {
    backface-visibility: hidden;
}


html,body {
    overscroll-behavior: none;
    scroll-behavior: auto !important;
}

