:root {
  color-scheme: dark;
  --bg: #07080b;
  --text: #f7f1e8;
  --muted: rgba(255, 255, 255, 0.68);
  --line: rgba(255, 255, 255, 0.16);
  --surface: rgba(0, 0, 0, 0.32);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(227, 106, 91, 0.18), transparent 28rem),
    radial-gradient(circle at 92% 14%, rgba(76, 201, 176, 0.14), transparent 30rem),
    linear-gradient(135deg, #05060a 0%, #101116 48%, #050608 100%);
}

body.is-locked {
  overflow: hidden;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.files-shell {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: 0;
  display: block;
  transition: filter 420ms ease, opacity 420ms ease, transform 420ms ease;
}

.is-locked .files-shell {
  filter: blur(8px);
  opacity: 0.28;
  transform: scale(0.985);
  pointer-events: none;
}

.files-header {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 3;
  max-width: min(64vw, 360px);
  pointer-events: none;
}

.files-header h1,
.files-header p,
.file-slide {
  margin: 0;
}

.files-header h1 {
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.18);
}

.files-header p {
  display: none;
  margin-top: 5px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
}

.files-viewer {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.files-slider {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  outline: none;
}

.files-slider::-webkit-scrollbar {
  display: none;
}

.file-slide {
  width: 100%;
  height: 100%;
  padding: 0;
  display: grid;
  place-items: center;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.file-slide img {
  --pan-x: 0px;
  --pan-y: 0px;
  --zoom: 1;
  display: block;
  width: auto;
  max-width: 100vw;
  height: auto;
  max-height: 100vh;
  max-height: 100dvh;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: var(--surface);
  object-fit: contain;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
  cursor: zoom-in;
  transform: translate3d(var(--pan-x), var(--pan-y), 0) scale(var(--zoom));
  transform-origin: center;
  transition: transform 160ms ease;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

.file-slide img.is-zoomed {
  cursor: grab;
}

.files-slider:active .file-slide img.is-zoomed {
  cursor: grabbing;
}

.slider-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 38px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(0, 0, 0, 0.34);
  font: inherit;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(3px);
  transform: translateY(-50%);
  transition: box-shadow 180ms ease, opacity 180ms ease;
}

.slider-button--prev {
  left: 8px;
}

.slider-button--next {
  right: 8px;
}

.slider-button:hover {
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.2);
}

.slider-button:disabled {
  opacity: 0.28;
  cursor: default;
}

.zoom-controls {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: inline-flex;
  gap: 6px;
}

.zoom-button {
  min-width: 38px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(0, 0, 0, 0.38);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(3px);
}

.zoom-button--reset {
  min-width: 58px;
  font-size: 0.72rem;
}

.zoom-button:disabled {
  opacity: 0.34;
  cursor: default;
}

.is-zoomed .slider-button {
  opacity: 0.26;
  pointer-events: none;
}

.files-footer {
  position: fixed;
  right: 10px;
  bottom: 8px;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 6px;
  opacity: 0.36;
  transition: opacity 180ms ease;
}

.files-footer:hover,
.files-footer:focus-within {
  opacity: 1;
}

.slide-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.slide-dots {
  width: min(56vw, 520px);
  display: flex;
  justify-content: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: thin;
}

.slide-dots button {
  width: 22px;
  height: 5px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: width 180ms ease, background 180ms ease;
}

.slide-dots button.is-active {
  width: 38px;
  background: rgba(255, 255, 255, 0.92);
}

.unlock-panel {
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 0;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  font: inherit;
  cursor: pointer;
  backdrop-filter: blur(1px);
  transition: opacity 360ms ease, visibility 360ms ease;
}

.unlock-panel span {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 0.95;
  text-shadow: 0 0 28px rgba(255, 255, 255, 0.28);
}

.unlock-panel strong {
  width: min(92vw, 520px);
  color: rgba(255, 255, 255, 0.76);
  font-size: 1rem;
  line-height: 1.45;
}

body:not(.is-locked) .unlock-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 680px) {
  .files-shell {
    padding: 0;
  }

  .files-header {
    top: 8px;
    left: 8px;
  }

  .files-header h1 {
    font-size: 0.82rem;
  }

  .files-header p {
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .unlock-panel span {
    font-size: 2.8rem;
  }

  .unlock-panel strong {
    font-size: 0.92rem;
  }

  .files-footer {
    right: 8px;
    bottom: 6px;
  }

  .zoom-controls {
    top: 8px;
    right: 8px;
    gap: 4px;
  }

  .zoom-button {
    min-width: 32px;
    height: 30px;
  }

  .zoom-button--reset {
    min-width: 48px;
    font-size: 0.66rem;
  }

  .slide-dots {
    display: none;
  }

  .slider-button {
    width: 30px;
    height: 48px;
    background: rgba(0, 0, 0, 0.28);
    font-size: 2rem;
  }

  .slider-button--prev {
    left: 4px;
  }

  .slider-button--next {
    right: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
