/* ============================================================
   FWO Fotoarchiv — "Dispatch archive" aesthetic
   Industrial / utilitarian. Warm charcoal canvas, signal red,
   confident verdict green/red. Archivo + JetBrains Mono.
   ============================================================ */

:root {
  --bg:        #131110;
  --bg-2:      #0d0b0a;
  --panel:     #1d1916;
  --panel-2:   #25201c;
  --text:      #f4ede2;
  --muted:     #9c9085;
  --faint:     #6b625a;
  --accent:     #e11d29;
  --accent-dim: #9c1019;
  --yes:       #34d977;
  --no:        #ff5247;
  --line:      rgba(244, 237, 226, 0.10);
  --line-2:    rgba(244, 237, 226, 0.18);

  --font-display: "Archivo", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --shadow-card: 0 1px 1px rgba(0,0,0,.4), 0 18px 50px rgba(0,0,0,.55);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-optical-sizing: auto;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  position: relative;
  /* warm vignette + radial glow from top */
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(225,29,41,0.08), transparent 55%),
    radial-gradient(140% 120% at 50% 120%, rgba(0,0,0,0.6), transparent 60%),
    var(--bg);
}

/* film grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }

/* mono micro-labels */
.tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

/* registration / corner marks for the archive feel */
.corner-marks { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.corner-marks span {
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--line-2);
}
.corner-marks span:nth-child(1) { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.corner-marks span:nth-child(2) { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }
.corner-marks span:nth-child(3) { bottom: 14px; left: 14px; border-right: 0; border-top: 0; }
.corner-marks span:nth-child(4) { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }

/* ============================================================
   Centered screens (entry / done)
   ============================================================ */
.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 32px 28px calc(32px + env(safe-area-inset-bottom));
  text-align: center;
  position: relative;
  z-index: 2;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.brand .tag { animation: rise .6s both; }

.center h1 {
  font-size: clamp(2.6rem, 13vw, 4.2rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin: 0;
  text-transform: uppercase;
  animation: rise .6s .05s both;
}
.center h1 em {
  font-style: normal;
  color: var(--accent);
  display: block;
}
.center p {
  color: var(--muted);
  margin: 0;
  max-width: 30ch;
  line-height: 1.5;
  font-size: 1rem;
  animation: rise .6s .1s both;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  width: min(340px, 84vw);
  animation: rise .6s .15s both;
}
.field > .tag { color: var(--faint); }

input[type="text"] {
  width: 100%;
  padding: 16px 18px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  border-radius: 0;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent);
  background: var(--panel);
  color: var(--text);
  transition: border-color .2s, background .2s;
}
input[type="text"]::placeholder { color: var(--faint); font-weight: 500; }
input[type="text"]:focus {
  outline: none;
  background: var(--panel-2);
  border-color: var(--line-2);
  border-left-color: var(--accent);
}

.btn {
  position: relative;
  padding: 16px 34px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 0;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform .08s, box-shadow .2s, background .2s;
  box-shadow: 0 0 0 rgba(225,29,41,0);
  animation: rise .6s .2s both;
}
.btn:hover { box-shadow: 0 8px 30px rgba(225,29,41,0.28); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line-2);
  box-shadow: none;
}
.btn.secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   Swipe screen
   ============================================================ */
#swipe-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  min-height: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 10px;
}
.topbar .meter {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.topbar .meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}
.progress {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}
.progress b { color: var(--accent); }
.progress-bar {
  height: 4px;
  background: var(--panel-2);
  overflow: hidden;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  width: 0;
  transition: width .35s cubic-bezier(.22,1,.36,1);
}

.icon-btn {
  flex: none;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, border-color .15s, transform .08s;
}
.icon-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.icon-btn:active:not(:disabled) { transform: scale(0.92); }
.icon-btn:disabled { opacity: 0.28; cursor: default; }

.card-area {
  position: relative;
  flex: 1;
  margin: 6px 16px 0;
  min-height: 0;
}

.card {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
  will-change: transform;
  touch-action: pan-y;
  user-select: none;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}
.card.behind { transform: scale(0.93) translateY(18px); filter: brightness(0.55) saturate(0.85); }

/* frame caption strip on the active card */
.card .frame-id {
  position: absolute;
  left: 0; bottom: 0;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  background: linear-gradient(0deg, rgba(0,0,0,0.75), transparent);
  width: 100%;
  pointer-events: none;
}

/* drag verdict overlays */
.overlay {
  position: absolute;
  top: 26px;
  padding: 8px 20px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-stretch: 125%;
  text-transform: uppercase;
  border: 3px solid;
  opacity: 0;
  pointer-events: none;
}
.overlay.yes { right: 22px; color: var(--yes); border-color: var(--yes); transform: rotate(11deg); text-shadow: 0 0 24px rgba(52,217,119,0.5); }
.overlay.no  { left: 22px;  color: var(--no);  border-color: var(--no);  transform: rotate(-11deg); text-shadow: 0 0 24px rgba(255,82,71,0.5); }

/* action buttons */
.actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  padding: 22px 16px 8px;
}
.action {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  background: var(--panel);
  color: var(--text);
  font-size: 1.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .1s, background .15s, border-color .15s, box-shadow .2s, color .15s;
}
.action:active { transform: scale(0.88); }
.action.no  { color: var(--no); }
.action.no:hover  { border-color: var(--no);  background: rgba(255,82,71,0.12);  box-shadow: 0 8px 28px rgba(255,82,71,0.22); }
.action.yes { color: var(--yes); }
.action.yes:hover { border-color: var(--yes); background: rgba(52,217,119,0.12); box-shadow: 0 8px 28px rgba(52,217,119,0.22); }

.hint {
  text-align: center;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
.hint b { color: var(--muted); }

/* ============================================================
   Animations
   ============================================================ */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
