
:root {
  --bg: #000;
  --text: #f5f5f5;
  --muted: #8f8f8f;
  --line: rgba(255,255,255,.16);
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

a { color: inherit; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.back-home {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 20;
  text-decoration: none;
  font-family: "Courier New", Courier, monospace;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .13em;
  opacity: .82;
  transition: opacity .18s ease, transform .18s ease;
}

.back-home:hover {
  opacity: 1;
  transform: translateX(-3px);
}

/* ----- LOCK ----- */

.lock-screen {
  min-height: 100svh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.lock-eye {
  width: 100%;
  height: min(52vw, 560px);
  min-height: 320px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
}

.lock-eye img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
  pointer-events: none;
  user-select: none;
}

.lock-panel {
  width: min(100% - 40px, 650px);
  margin-top: -48px;
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 0 70px;
}

.system-line {
  margin: 0 0 14px;
  color: #777;
  font-family: "Courier New", Courier, monospace;
  font-size: .72rem;
  letter-spacing: .16em;
}

.lock-panel h1,
.archive-header h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: .92;
  letter-spacing: -.04em;
  font-weight: 900;
}

.lock-panel h1 {
  margin-bottom: 26px;
}

.archive-header h1 {
  margin-bottom: 0;
}

.lock-copy {
  max-width: 510px;
  margin: 22px auto 30px;
  color: #aaa;
  line-height: 1.55;
}

.password-form {
  width: min(100%, 560px);
  min-height: 68px;
  margin: 0 auto;
  padding: 7px;
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(10,10,10,.88);
}

.password-form input {
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  padding: 0 18px;
  font-family: "Courier New", Courier, monospace;
  letter-spacing: .05em;
}

.password-form input::placeholder { color: #555; }

.password-form button {
  min-width: 145px;
  border: 0;
  border-radius: 12px;
  background: #f2f2f2;
  color: #111;
  font-weight: 900;
  cursor: pointer;
}

.lock-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: #888;
  font-family: "Courier New", Courier, monospace;
  font-size: .76rem;
}

.lock-message.is-error {
  color: #cfcfcf;
  animation: shake .28s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ----- ARCHIVE ----- */

.archive-page {
  min-height: 100svh;
  padding: 26px 26px 42px;
}

.archive-header {
  min-height: 150px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 20px;
  padding: 20px 0 30px;
  border-bottom: 1px solid var(--line);
}

.archive-header .archive-back {
  position: static;
  align-self: start;
  justify-self: start;
}

.archive-header > div:nth-child(2) {
  text-align: center;
}

.archive-header h1 {
  max-width: 760px;
  font-size: clamp(2.8rem, 6vw, 6rem);
  line-height: .92;
}

.archive-meta {
  align-self: start;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 11px;
  color: #777;
  font-family: "Courier New", Courier, monospace;
  font-size: .7rem;
  letter-spacing: .1em;
}

.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #777;
  font-family: "Courier New", Courier, monospace;
  font-size: .7rem;
  letter-spacing: .1em;
  cursor: pointer;
}

.text-button:hover { color: #fff; }

.gallery-shell {
  padding: 8px 0 10px;
}

.loading-state,
.gallery-error {
  padding: 80px 0;
  text-align: center;
  color: #777;
  font-family: "Courier New", Courier, monospace;
  font-size: .75rem;
  letter-spacing: .09em;
}

.loading-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 9px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%,100% { opacity: .2; }
  50% { opacity: 1; }
}

.gallery {
  column-count: 9;
  column-gap: 4px;
}

.gallery-item {
  position: relative;
  margin: 0 0 4px;
  break-inside: avoid;
  overflow: hidden;
  background: #0a0a0a;
  cursor: zoom-in;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity .45s ease, transform .5s ease, filter .22s ease;
}

.gallery-item img.is-loaded {
  opacity: 1;
  transform: scale(1);
}

.gallery-item:hover img {
  filter: brightness(.82);
}

.gallery-index {
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 4px 5px;
  background: rgba(0,0,0,.62);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  color: #d4d4d4;
  font-family: "Courier New", Courier, monospace;
  font-size: .5rem;
  letter-spacing: .08em;
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
}

.gallery-item:hover .gallery-index { opacity: 1; }

.gallery-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 34px 0 10px;
  border-top: 1px solid var(--line);
  color: #666;
  font-family: "Courier New", Courier, monospace;
  font-size: .7rem;
  letter-spacing: .08em;
}

.gallery-footer a {
  text-decoration: none;
}

.gallery-footer a:hover { color: #fff; }

/* ----- LIGHTBOX ----- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.96);
  backdrop-filter: blur(8px);
}

.lightbox img {
  display: block;
  max-width: min(90vw, 1500px);
  max-height: 88vh;
  object-fit: contain;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: .72;
}

.lightbox-close:hover,
.lightbox-nav:hover { opacity: 1; }

.lightbox-close {
  top: 18px;
  right: 24px;
  font-size: 2rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-count {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  color: #777;
  font-family: "Courier New", Courier, monospace;
  font-size: .7rem;
  letter-spacing: .1em;
}

/* ----- RESPONSIVE ----- */

@media (max-width: 1500px) {
  .gallery { column-count: 8; }
}

@media (max-width: 1280px) {
  .gallery { column-count: 7; }
}

@media (max-width: 1080px) {
  .gallery { column-count: 6; }
}

@media (max-width: 900px) {
  .gallery { column-count: 5; }
}

@media (max-width: 720px) {
  .back-home {
    top: 16px;
    left: 16px;
  }

  .lock-eye {
    height: 59vw;
    min-height: 280px;
  }

  .lock-eye img {
    width: 138%;
    max-width: none;
    object-position: 49% 18%;
    flex: 0 0 auto;
  }

  .lock-panel {
    width: min(100% - 28px, 580px);
    margin-top: -18px;
  }

  .password-form {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .password-form input {
    min-height: 54px;
  }

  .password-form button {
    min-height: 52px;
  }

  .archive-page {
    padding: 16px 12px 30px;
  }

  .archive-header {
    grid-template-columns: 1fr auto;
    min-height: 128px;
    align-items: start;
  }

  .archive-header > div:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: left;
  }

  .archive-header .archive-back {
    grid-column: 1;
    grid-row: 1;
  }

  .archive-meta {
    grid-column: 2;
    grid-row: 1;
  }

  .gallery { column-count: 4; column-gap: 4px; }
  .gallery-item { margin-bottom: 4px; }

  .gallery-index { display: none; }

  .gallery-footer {
    flex-direction: column;
    gap: 8px;
  }

  .lightbox-nav {
    top: auto;
    bottom: 14px;
    transform: none;
    font-size: 1.65rem;
  }

  .lightbox-prev { left: 18px; }
  .lightbox-next { right: 18px; }
}

@media (max-width: 520px) {
  .gallery { column-count: 3; }
}

@media (max-width: 420px) {
  .lock-eye {
    height: 71vw;
    min-height: 255px;
  }

  .lock-eye img {
    width: 168%;
    object-position: 48.5% 16%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}


.archive-loader {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #666;
  font-family: "Courier New", Courier, monospace;
  font-size: .7rem;
  letter-spacing: .09em;
  text-align: center;
  flex-wrap: wrap;
}

.archive-load-more {
  border: 0;
  padding: 0;
  background: transparent;
  color: #d7d7d7;
  font-family: "Courier New", Courier, monospace;
  font-size: .74rem;
  letter-spacing: .11em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.24em;
}

.archive-load-more:hover {
  color: #ffffff;
}

.archive-loader.is-finished .loading-dot {
  display: none;
}

.archive-sentinel {
  width: 100%;
  height: 1px;
}

@media (max-width: 720px) {
  .archive-loader {
    min-height: 100px;
    font-size: .64rem;
    flex-direction: column;
    gap: 10px;
  }

  .archive-load-more {
    font-size: .68rem;
  }
}
