:root {
  --bg-0: #070304;
  --bg-1: #0c0506;
  --bg-2: #140708;
  --surface: rgba(18, 8, 9, 0.62);
  --surface-hi: rgba(28, 12, 13, 0.74);
  --border: rgba(225, 30, 43, 0.12);
  --border-hi: rgba(225, 30, 43, 0.34);

  --ink: #d9cdc6;
  --ink-dim: #9a8a85;
  --ink-faint: #6a5b57;

  --blood: #8b0000;
  --blood-hi: #c1121f;
  --blood-bright: #e01e2b;
  --ok: #e01e2b;
  --warn: #c79a3a;
  --err: #ff3b30;

  --grad: linear-gradient(135deg, #6a0d12 0%, #b1101c 50%, #e8313d 100%);
  --grad-soft: linear-gradient(135deg, rgba(139,0,0,0.22), rgba(224,30,43,0.18));

  --shadow-sm: 0 1px 0 rgba(255,255,255,0.03) inset, 0 1px 2px rgba(0,0,0,0.6);
  --shadow-md: 0 14px 40px rgba(0,0,0,0.7), 0 2px 8px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 0 1px rgba(193,18,31,0.35), 0 0 50px rgba(193,18,31,0.22);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --fs-body: 15px;
  --fs-small: 13px;

  --font-display: 'Creepster', 'Impact', system-ui, cursive;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 80% -8%, rgba(139,0,0,0.30), transparent 60%),
    radial-gradient(1000px 600px at 12% 112%, rgba(80,0,4,0.34), transparent 62%),
    radial-gradient(600px 600px at 50% 50%, rgba(40,0,2,0.18), transparent 70%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 45%, #050203 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 600ms steps(2) infinite, flicker 7s linear infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); }
  100% { transform: translate(-2%, 1%); }
}
@keyframes flicker {
  0%, 92%, 100% { opacity: 0.05; }
  93% { opacity: 0.10; }
  94% { opacity: 0.02; }
  96% { opacity: 0.12; }
  97% { opacity: 0.04; }
}

.bg-orbs { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg-orbs::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 100% at 50% 45%, transparent 48%, rgba(0,0,0,0.55) 86%, rgba(0,0,0,0.85) 100%);
}
.bg-orbs::after {
  content: ""; position: absolute; inset: 0; opacity: 0.5;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,0.16) 3px);
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4;
  animation: drift 26s ease-in-out infinite;
}
.orb-1 { width: 540px; height: 540px; background: radial-gradient(circle, var(--blood), transparent 65%); top: -140px; right: -140px; }
.orb-2 { width: 460px; height: 460px; background: radial-gradient(circle, #4a0006, transparent 65%); bottom: -120px; left: -100px; animation-delay: -9s; }
.orb-3 { width: 380px; height: 380px; background: radial-gradient(circle, var(--blood-hi), transparent 68%); top: 42%; left: 50%; transform: translate(-50%, -50%); animation-delay: -16s; opacity: 0.18; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(34px, -26px) scale(1.06); }
}

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(7, 3, 4, 0.66);
  border-bottom: 1px solid var(--border-hi);
  box-shadow: 0 1px 0 rgba(225,30,43,0.10), 0 8px 24px rgba(0,0,0,0.5);
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 32px; height: 32px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #2a0608, #0a0203 75%);
  display: inline-grid; place-items: center;
  color: var(--blood-bright);
  box-shadow: 0 0 0 1px rgba(225,30,43,0.35), 0 0 18px rgba(193,18,31,0.45);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 400; letter-spacing: 0.10em; font-size: 24px; line-height: 1;
  color: #e6ded8;
  text-shadow: 0 0 10px rgba(193,18,31,0.55), 0 0 2px rgba(0,0,0,0.8);
}
.brand-name small {
  font-family: var(--font-mono);
  font-weight: 500; letter-spacing: 0.16em; font-size: 11px;
  color: var(--ink-dim); margin-left: 3px; text-shadow: none;
}
.navlinks { display: flex; gap: 18px; }
.navlinks a {
  color: var(--ink-dim); text-decoration: none; font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase; transition: color 160ms ease, text-shadow 160ms ease;
}
.navlinks a:hover { color: var(--blood-bright); text-shadow: 0 0 8px rgba(224,30,43,0.6); }

.page {
  position: relative; z-index: 1;
  max-width: 1180px; margin: 0 auto;
  padding: 40px 28px 80px;
}

.hero { padding: 36px 0 56px; text-align: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; margin-bottom: 20px;
  border-radius: 999px;
  background: rgba(139,0,0,0.12);
  color: var(--blood-bright);
  font-size: 12px; font-weight: 600; letter-spacing: 0.20em;
  text-transform: uppercase;
  border: 1px solid rgba(225,30,43,0.30);
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--blood-bright);
  box-shadow: 0 0 0 0 rgba(224,30,43,0.7);
  animation: heartbeat 1.6s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 60%, 100% { box-shadow: 0 0 0 0 rgba(224,30,43,0); transform: scale(1); }
  15% { box-shadow: 0 0 0 7px rgba(224,30,43,0); transform: scale(1.5); }
  30% { transform: scale(1); }
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 78px);
  font-weight: 400; line-height: 1.02; letter-spacing: 0.01em;
  margin: 0 auto 16px; max-width: 18ch;
  color: #ece4de;
  text-shadow: 0 0 18px rgba(193,18,31,0.4), 0 2px 0 rgba(0,0,0,0.6);
}
.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 26px rgba(224,30,43,0.45);
}
.hero-sub {
  color: var(--ink-dim);
  max-width: 56ch; margin: 0 auto 26px;
  font-size: 16px;
}
.hero-cta { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border-radius: 11px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform 140ms ease, box-shadow 200ms ease, background 200ms ease, color 200ms ease;
}
.btn svg { width: 16px; height: 16px; }
.btn.primary {
  color: #fdecec;
  background: var(--grad);
  box-shadow: 0 8px 26px rgba(139,0,0,0.45), 0 0 18px rgba(224,30,43,0.30);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 34px rgba(193,18,31,0.55), 0 0 26px rgba(224,30,43,0.45); }
.btn.primary.big { padding: 14px 22px; font-size: 14px; border-radius: 13px; }
.btn.ghost {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--border-hi);
  backdrop-filter: blur(8px);
}
.btn.ghost:hover { background: var(--surface-hi); border-color: rgba(225,30,43,0.5); color: var(--blood-bright); }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 30px 0 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.section-head h2 {
  font-size: 13px; font-weight: 700; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--blood-bright); margin: 0;
  text-shadow: 0 0 10px rgba(193,18,31,0.4);
}
.muted { color: var(--ink-faint); font-size: 12px; letter-spacing: 0.06em; }
.small { font-size: var(--fs-small); }
.mono { font-family: var(--font-mono); }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.video-card {
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.video-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--grad);
  opacity: 0; transition: opacity 220ms ease;
  mix-blend-mode: overlay;
}
.video-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hi);
  box-shadow: var(--shadow-md), 0 12px 40px rgba(139,0,0,0.30);
}
.video-card:hover::before { opacity: 0.16; }

.video-wrap {
  position: relative;
  width: 100%; aspect-ratio: 1 / 1;
  background: #000;
}
.video-wrap video {
  width: 100%; height: 100%; display: block; object-fit: cover;
  background: #000;
  filter: saturate(0.85) contrast(1.05);
}
.video-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(130% 100% at 50% 50%, transparent 55%, rgba(0,0,0,0.55) 100%),
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,0.10) 3px);
}

.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: rgba(5, 2, 3, 0.55);
}
.card-foot .mono { color: var(--ink-dim); word-break: break-all; }

.iconbtn {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  color: var(--ink-dim);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.iconbtn svg { width: 16px; height: 16px; }
.iconbtn:hover { color: var(--blood-bright); background: var(--surface-hi); border-color: var(--border-hi); }
.iconbtn.copied { color: var(--ok); border-color: rgba(224,30,43,0.5); }

.empty {
  color: var(--ink-faint); font-style: italic;
  padding: 28px; text-align: center;
  border: 1px dashed var(--border-hi); border-radius: var(--radius);
}

.upload-card {
  display: grid; grid-template-columns: 1fr auto;
  gap: 14px; align-items: stretch;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@media (max-width: 640px) { .upload-card { grid-template-columns: 1fr; } }

.dropzone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 32px 18px;
  text-align: center;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(139,0,0,0.10), transparent 60%),
    rgba(5,2,3,0.4);
  border: 1.5px dashed rgba(225,30,43,0.22);
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
  color: var(--ink-dim);
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--blood-hi);
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(193,18,31,0.18), transparent 60%),
    rgba(5,2,3,0.6);
}
.dropzone.has-file { border-style: solid; border-color: var(--blood-bright); color: var(--ink); }
.dz-icon { width: 32px; height: 32px; color: var(--blood-bright); margin-bottom: 4px; }
.dz-title { font-weight: 600; font-size: 15px; color: var(--ink); }
.dz-sub { font-size: 12px; }
.dz-file { font-family: var(--font-mono); font-size: 12px; color: var(--blood-bright); margin-top: 8px; }
.dropzone input[type=file] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}

.result-page {
  min-height: 56vh;
  display: grid; place-items: center;
}
.result-card {
  width: 100%; max-width: 600px;
  padding: 38px 32px;
  text-align: center;
  border-radius: var(--radius-lg);
}
.result-card.ok    { border-color: rgba(224,30,43,0.5);  box-shadow: var(--shadow-md), 0 0 60px rgba(193,18,31,0.35); }
.result-card.warn  { border-color: rgba(199,154,58,0.34); }
.result-card.err   { border-color: rgba(255,59,48,0.34); }
.result-card h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 400; margin: 14px 0 10px; letter-spacing: 0.01em;
  color: #ece4de;
  text-shadow: 0 0 16px rgba(193,18,31,0.35);
}
.result-card p { color: var(--ink-dim); margin: 0 0 18px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase;
}
.badge svg { width: 14px; height: 14px; }
.badge.ok   { background: rgba(224,30,43,0.12);  color: var(--ok);   border: 1px solid rgba(224,30,43,0.4); }
.badge.warn { background: rgba(199,154,58,0.10); color: var(--warn); border: 1px solid rgba(199,154,58,0.35); }
.badge.err  { background: rgba(255,59,48,0.10);  color: var(--err);  border: 1px solid rgba(255,59,48,0.35); }

.flag-box {
  display: flex; align-items: center; gap: 10px;
  margin: 22px auto 8px; padding: 14px 16px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(224,30,43,0.5);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(193,18,31,0.12) inset, 0 0 34px rgba(193,18,31,0.30);
  max-width: 520px;
}
.flag {
  flex: 1; text-align: left;
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 500;
  color: var(--blood-bright); word-break: break-all;
  text-shadow: 0 0 10px rgba(224,30,43,0.5);
}
.result-actions { margin-top: 22px; }

.footnote {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between;
  padding: 20px 28px 36px;
  color: var(--ink-faint); font-size: 12px;
  letter-spacing: 0.06em;
}
.footnote .muted { font-style: italic; }

::selection { background: rgba(224,30,43,0.4); color: #fff; }
a:focus-visible, button:focus-visible, .dropzone:focus-within {
  outline: 2px solid var(--blood-bright);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
  .orb { animation: none; }
  .pulse { animation: none; }
}

@media (max-width: 520px) {
  .topbar { padding: 12px 16px; }
  .page { padding: 24px 16px 56px; }
  .navlinks { display: none; }
  .footnote { padding: 16px 16px 28px; flex-direction: column; gap: 6px; }
}
