:root {
  --bg: #000; --fg: #e8e8e8; --muted: #7a7a7a; --line: #2a2a2a; --danger: #ff3b3b;
  --pixel: "Silkscreen", "VT323", ui-monospace, monospace;
  --vhs: "VT323", ui-monospace, monospace;
  --sans: "Space Grotesk", "Pretendard", -apple-system, "Apple SD Gothic Neo", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
::selection { background: #fff; color: #000; }

#dust { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.scanlines { position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .35;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 3px); }
main, .top, .flash { position: relative; z-index: 1; }
main { max-width: 1440px; margin: 0 auto; padding: 0 28px 160px; }

.top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  padding: 22px 28px; background: linear-gradient(#000 40%, transparent); }
.logo { font-family: var(--pixel); font-size: 20px; letter-spacing: -.04em; }
.top nav { display: flex; gap: 18px; font-size: 12px; letter-spacing: .08em; }
.top nav a { color: var(--muted); transition: color .15s; }
.top nav a:hover { color: #fff; }

.code { font-family: var(--pixel); font-size: 10px; letter-spacing: .06em; color: #9a9a9a; text-transform: uppercase; }
.center { text-align: center; }

.flash { max-width: 1440px; margin: 0 auto; padding: 0 28px; }
.flash p { margin: 0 0 4px; font-family: var(--vhs); font-size: 18px; color: #9f9; }

.hero { padding: 40px 0 56px; }
.hero h1 { font-weight: 400; font-size: 15px; letter-spacing: .12em; margin: 0 0 10px; text-transform: uppercase; }
.hero .desc { color: #bbb; font-size: 14px; max-width: 560px; margin: 16px auto 0; white-space: pre-wrap; line-height: 1.6; }
.back { display: inline-block; margin-bottom: 18px; font-family: var(--pixel); font-size: 10px; color: var(--muted); }
.back:hover { color: #fff; }
.actions { display: flex; justify-content: center; gap: 16px; margin-top: 16px; font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.actions form { margin: 0; }
.actions a:hover { color: #fff; }
.placeholder { font-family: var(--vhs); font-size: 22px; color: var(--muted); }
.placeholder a { color: #fff; text-decoration: underline; }

/* scattered grid */
.scatter { display: grid; grid-template-columns: repeat(4, 1fr); column-gap: 5vw; row-gap: 40px; align-items: start; }
.item { display: block; width: var(--w); margin: var(--y) 0 0 var(--x); }
.frame { position: relative; overflow: hidden; background: #111; }
.frame img { width: 100%; display: block; filter: saturate(.92) contrast(1.03); transition: filter .3s, transform .6s; cursor: zoom-in; }
.item:hover .frame img { filter: saturate(1.1) contrast(1.08); transform: scale(1.025); }
.frame .empty { display: grid; place-items: center; aspect-ratio: 3/4; font-family: var(--pixel); font-size: 10px; color: #444;
  background: repeating-linear-gradient(90deg, #0b0b0b 0 2px, #141414 2px 4px); }
.item .code { display: block; margin-top: 8px; }
@media (max-width: 1000px) { .scatter { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 680px)  { .scatter { grid-template-columns: repeat(2, 1fr); column-gap: 18px; } .item { --y: 0px !important; } }

/* look tools */
.look { margin-bottom: 0; }
.look-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.look:hover .look-tools { opacity: 1; }
.look-tools form { margin: 0; }
.look-tools button { width: 26px; height: 26px; border: 1px solid #fff3; background: #000c; color: #fff; cursor: pointer; font-size: 12px; }
.look-tools button:hover { background: #fff; color: #000; }
@media (hover: none) { .look-tools { opacity: 1; } }

/* forms */
input, textarea { font: inherit; font-size: 13px; color: #fff; background: #0a0a0a; border: 1px solid var(--line); padding: 9px 11px; outline: none; }
input:focus, textarea:focus { border-color: #fff; }
.btn { background: #fff; color: #000; border: 0; padding: 9px 16px; font-family: var(--pixel); font-size: 11px; cursor: pointer; }
.btn:hover { background: #9f9; }
.btn:disabled { opacity: .5; }
button.link { background: none; border: 0; font: inherit; letter-spacing: inherit; cursor: pointer; padding: 0; color: inherit; }
.danger:hover { color: var(--danger); }

.panel { position: relative; z-index: 1; background: #000d; border: 1px solid var(--line); padding: 32px; }
.form { max-width: 460px; margin: 60px auto; display: flex; flex-direction: column; gap: 18px; }
.form h1 { margin: 0 0 6px; font-weight: 400; font-size: 14px; letter-spacing: .12em; text-align: center; }
.form label { display: flex; flex-direction: column; gap: 6px; font-family: var(--pixel); font-size: 10px; color: var(--muted); }
.form label > * { font-family: var(--sans); }
.row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.row a:hover { color: #fff; }

/* VHS counter — low-res canvas, upscaled 2x with hard pixels, then softened */
.vhs { position: fixed; right: 18px; bottom: 14px; z-index: 60; pointer-events: none;
  width: 152px; height: 52px; image-rendering: pixelated; image-rendering: crisp-edges;
  filter: blur(.45px) contrast(1.1); opacity: .8; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.96); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 86vw; max-height: 84vh; object-fit: contain; }
.lightbox figcaption { padding-top: 12px; font-size: 13px; color: #ccc; }
.lightbox button { position: absolute; background: none; border: 0; color: #aaa; font-family: var(--pixel); font-size: 22px; cursor: pointer; padding: 16px; }
.lightbox button:hover { color: #fff; }
.lb-close { top: 10px; right: 14px; font-size: 12px !important; }
.lb-prev { left: 10px; } .lb-next { right: 10px; }

/* upload: inline with the ARCHIVE title, full-page drop veil */
.upload-trigger { margin-left: 18px; padding: 0; background: none; border: 0; color: var(--muted); font: inherit;
  letter-spacing: inherit; cursor: pointer; transition: color .15s; }
.upload-trigger:hover { color: #fff; }
.upload-trigger:disabled { opacity: .4; cursor: wait; }
.drop-veil { position: fixed; inset: 12px; z-index: 90; display: grid; place-items: center; pointer-events: none;
  border: 1px dashed rgba(255,255,255,.5); background: rgba(0,0,0,.6); }
.drop-veil[hidden] { display: none; }
.drop-veil span { font-size: 15px; letter-spacing: .12em; }
