/* ===================================================
   SECURE EVIDENCE PLATFORM — Design System
   Aesthetic: Institutional Authority × Legal Precision
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* Background Tones — Noir / Surveillance */
  --bg:             #050505;
  --surface:        #0d0d0d;
  --surface-dim:    #090909;

  /* Typography */
  --text-primary:   #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted:     #525252;

  /* Borders */
  --border:         #222222;
  --border-strong:  #444444;

  /* Authority Dark */
  --authority:      transparent;
  --authority-2:    #050505;

  /* Accents */
  --accent:         #e04b3f;
  --accent-hover:   #ff5544;
  --amber:          #c9a15a;

  /* Status Colors */
  --red:            #e04b3f;
  --red-bg:         rgba(224, 75, 63, 0.1);
  --red-border:     #e04b3f;
  --green:          #059669;
  --green-bg:       rgba(5, 150, 105, 0.1);
  --green-border:   #059669;
  --amber-bg:       rgba(201, 161, 90, 0.1);
  --amber-border:   #c9a15a;
  --blue:           #3b82f6;
  --blue-bg:        rgba(59, 130, 246, 0.1);
  --blue-border:    #3b82f6;
  --purple:         #8b5cf6;
  --purple-bg:      rgba(139, 92, 246, 0.1);
  --purple-border:  #8b5cf6;

  /* Typography Families */
  --font-serif: 'IBM Plex Mono', 'JetBrains Mono', monospace;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:  'IBM Plex Mono', 'JetBrains Mono', monospace;

  /* Spacing / Corners (No rounded corners) */
  --radius-sm:  0px;
  --radius:     0px;
  --radius-lg:  0px;
  --radius-pill: 0px;

  /* Shadows (No soft drop shadows) */
  --shadow-sm:  none;
  --shadow-md:  none;
  --shadow-lg:  none;
}

/* ===================================================
   UTILITY — hidden state (avoids inline style CSP block)
   =================================================== */
.js-hidden { display: none !important; }

/* ===================================================
   RESET & BASE
   =================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.65;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* Faint, slow-drifting noise overlay (No JS required) */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  animation: drift 10s infinite linear;
}
@keyframes drift {
  from { background-position: 0 0; }
  to { background-position: 100px 100px; }
}
@media (prefers-reduced-motion) {
  body::before { animation: none; }
}

main {
  flex: 1;
  padding: 3rem 0 5rem;
}

a {
  color: inherit;
}

/* ===================================================
   LAYOUT
   =================================================== */

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===================================================
   HEADER — The Ministry
   =================================================== */

.site-header {
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  padding: 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s ease;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-transform: uppercase;
}

.site-logo .highlight {
  color: var(--accent);
}

.site-logo::after {
  content: "█";
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.4rem 0;
  position: relative;
  transition: color 0.2s;
}

.site-nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--amber);
  transition: width 0.3s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text-primary);
}

.site-nav a:hover::after,
.site-nav a.active::after {
  width: 100%;
}

/* ===================================================
   FOOTER
   =================================================== */

.site-footer {
  background: var(--authority);
  color: #78716C;
  padding: 2rem 0;
  border-top: 2px solid #292524;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-footer p {
  margin: 0;
}

/* ===================================================
   HERO / TYPEWRITER (Noir Redesign)
   =================================================== */

.hero {
  text-align: center;
  padding: 4rem 1rem 2rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero-logo {
  width: min(95vw, 900px);
  height: auto;
  margin: 0 auto;
  display: block;
  filter: drop-shadow(0 0 30px rgba(224, 75, 63, 0.4));
  position: relative;
  z-index: 2;
}

.chevron-down {
  width: 32px;
  height: 32px;
  margin: 3rem auto 0;
  display: block;
  fill: var(--text-muted);
  animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* ===================================================
   CARDS & SURFACES
   =================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2.5rem;
  transition: border-color 0.3s ease;
  position: relative;
}

.card:hover {
  border-color: var(--border-strong);
}

.card-inset {
  background: var(--surface-dim);
  border: 1px solid var(--border);
  padding: 1.5rem;
}

/* ===================================================
   ACTION / ARCHIVE CARDS (Noir Redesign)
   =================================================== */

.action-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 2rem;
  padding: 5rem 1rem;
  max-width: 1040px;
  margin: 0 auto;
}

.action-card {
  background: var(--surface);
  padding: 2.5rem 2rem;
  text-align: left;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: visible;
}

/* Four Corner Brackets */
.action-card::before, .action-card::after,
.action-card .corner-bl, .action-card .corner-br {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  transition: all 0.3s ease;
  pointer-events: none;
}

.action-card::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.action-card::after { top: 0; right: 0; border-left: none; border-bottom: none; }
.action-card .corner-bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.action-card .corner-br { bottom: 0; right: 0; border-left: none; border-top: none; }

.action-card:hover {
  transform: translateY(-4px);
  background: #111;
}

.action-card:hover::before, .action-card:hover::after,
.action-card:hover .corner-bl, .action-card:hover .corner-br {
  border-color: var(--accent);
  width: 24px; height: 24px;
}

.action-card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text-primary);
  text-transform: uppercase;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.action-card:hover h3 {
  color: var(--accent);
}

.action-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.6;
}

.action-card-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  opacity: 0.8;
}

/* ===================================================
   TYPOGRAPHY
   =================================================== */

h1 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

h4 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ===================================================
   FORM ELEMENTS
   =================================================== */

.form-group {
  margin-bottom: 1.75rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.help-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
  appearance: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

input[type="file"] {
  display: block;
  width: 100%;
  padding: 1.5rem 1rem;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background-color: var(--surface-dim);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

input[type="file"]:hover {
  border-color: var(--text-primary);
  background-color: var(--surface);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 4px rgba(28, 25, 23, 0.08);
  background-color: #fff;
}

textarea {
  resize: vertical;
  min-height: 140px;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2344403C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* ===================================================
   BUTTONS
   =================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 0.95rem;
}

.btn-md {
  padding: 0.6rem 1.5rem;
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  clip-path: polygon(10px 0, 10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  position: relative;
  border: none;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px; right: 2px; bottom: 2px;
  border: 1px dashed transparent;
  clip-path: inherit;
  transition: border-color 0.3s ease;
  pointer-events: none;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
}

.btn-primary:hover::before {
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-dim);
  border-color: var(--text-primary);
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-border);
}

.btn-danger:hover {
  background: #FECACA;
  border-color: var(--red);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ===================================================
   STATUS BADGES
   =================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.badge-pending    { background: var(--amber-bg);  color: var(--amber);  border-color: var(--amber-border); }
.badge-clean      { background: var(--green-bg);  color: var(--green);  border-color: var(--green-border); }
.badge-quarantined{ background: var(--red-bg);    color: var(--red);    border-color: var(--red-border);   }
.badge-scanning   { background: var(--blue-bg);   color: var(--blue);   border-color: var(--blue-border);  }
.badge-rejected   { background: var(--red-bg);    color: var(--red);    border-color: var(--red-border);   }
.badge-published  { background: var(--purple-bg); color: var(--purple); border-color: var(--purple-border);}

/* Rating badges */
.rating-confirmed     { color: var(--green); font-weight: 700; }
.rating-false         { color: var(--red); font-weight: 700;   }
.rating-disputed      { color: var(--amber); font-weight: 700; }
.rating-missing-context { color: var(--amber); font-weight: 700; }
.rating-could_not_verify { color: var(--text-muted); font-weight: 700; }

/* ===================================================
   ALERT BOXES
   =================================================== */

.alert, .success-box, .error-box, .warning-box {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.95rem;
  line-height: 1.55;
  box-shadow: var(--shadow-sm);
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-success, .success-box  { background: var(--green-bg);  color: var(--green);  border-color: var(--green-border);  }
.alert-error, .error-box    { background: var(--red-bg);    color: var(--red);    border-color: var(--red-border);    }
.alert-warning, .warning-box  { background: var(--amber-bg);  color: var(--amber);  border-color: var(--amber-border);  }
.alert-info     { background: var(--blue-bg);   color: var(--blue);   border-color: var(--blue-border);   }

/* ===================================================
   TABLES
   =================================================== */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead tr {
  border-bottom: 2px solid var(--border-strong);
  background: var(--surface-dim);
}

th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}

td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
  transition: background 0.15s ease;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--surface-dim);
}

/* ===================================================
   MEDIA CONTAINERS
   =================================================== */

.media-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-strong);
}

.media-wrap video,
.media-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ===================================================
   PROGRESS BAR
   =================================================== */

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 1.25rem 0;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-pill);
}

/* ===================================================
   PRIVACY NOTICE
   =================================================== */

.privacy-notice {
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: var(--surface-dim);
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--border-strong);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 2.5rem;
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
}

/* ===================================================
   REF CODE
   =================================================== */

.ref-code, #ref-code {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  background: var(--green-bg);
  color: var(--green);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--green-border);
  display: inline-block;
}

/* ===================================================
   UTILITY
   =================================================== */

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-gap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-asym {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 2.5rem;
}

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ===================================================
   BACK LINK
   =================================================== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 2rem;
  letter-spacing: 0.02em;
  transition: color 0.2s, transform 0.2s;
}

.back-link:hover {
  color: var(--text-primary);
  transform: translateX(-4px);
}

/* ===================================================
   ARCHIVE CARD
   =================================================== */

.archive-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.archive-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.archive-card-thumb {
  height: 160px;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  font-size: 2.5rem;
}

.archive-card-body {
  padding: 1.5rem;
}

.archive-card-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.archive-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

/* ===================================================
   RESPONSIVE
   =================================================== */

@media (max-width: 768px) {
  body { font-size: 14px; }
  main { padding: 1.5rem 0 3rem; }

  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.45rem; }

  .card { padding: 1.5rem; }

  .grid-2,
  .grid-asym {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .flex-between {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .site-header-inner {
    height: auto;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .site-nav a {
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
  }

  th, td { padding: 0.85rem 1rem; }
}

@media (max-width: 600px) {
  .hero {
    padding: 1.5rem 1rem; /* tighter overall padding */
  }
  .hero-logo {
    width: min(95vw, 900px);
    margin: 0 auto;
  }
  .chevron-down {
    margin: 1.5rem auto 0; /* less space above chevron */
  }
}
