/* ============================================================
   THE BLACK TENT — field researcher's evidence board
   No frameworks. No polish. Assembled in the dark.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=Caveat:wght@400;600&display=swap');

/* --- RESET & BASE --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #0a0a0a;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(30, 20, 10, 0.4) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(20, 15, 10, 0.3) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='400' height='400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  color: #c8b89a;
  font-family: 'Courier Prime', 'Courier New', monospace;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: default;
}

::selection {
  background: rgba(139, 69, 19, 0.5);
  color: #e8d8c0;
}

/* --- TYPEWRITER TEXT --- */
.typewriter {
  font-family: 'Special Elite', 'Courier New', monospace;
  letter-spacing: 0.5px;
}

.typewriter-heading {
  font-family: 'Special Elite', 'Courier New', monospace;
  font-size: 3.2rem;
  color: #d4c4a0;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  letter-spacing: 1px;
  line-height: 1.3;
}

/* --- HANDWRITTEN NOTES --- */
.handwritten {
  font-family: 'Caveat', cursive;
  font-size: 1.15rem;
  color: #a09070;
  line-height: 1.4;
}

.margin-note {
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  color: #8a7a5a;
  position: absolute;
  transform: rotate(-3deg);
  max-width: 200px;
  line-height: 1.3;
  opacity: 0.75;
}

.margin-note::before {
  content: '';
  display: block;
  width: 30px;
  height: 2px;
  background: #5a4a3a;
  margin-bottom: 4px;
}

.margin-note-right {
  transform: rotate(2deg);
}

.margin-note-steep {
  transform: rotate(-7deg);
}

/* --- TEXT FLICKER (subtle instability) --- */
@keyframes textFlicker {
  0%, 95%, 100% { opacity: 1; }
  96% { opacity: 0.8; }
  97% { opacity: 0.95; }
  98% { opacity: 0.7; }
  99% { opacity: 0.9; }
}

@keyframes subtleFlicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: 0.92; }
  94% { opacity: 0.97; }
  95% { opacity: 0.88; }
  96% { opacity: 0.95; }
}

.flicker {
  animation: textFlicker 8s infinite;
}

.flicker-slow {
  animation: subtleFlicker 12s infinite;
}

@keyframes gentlePulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.85; }
}

.pulse-dim {
  animation: gentlePulse 6s ease-in-out infinite;
}

/* --- REDACTED TEXT --- */
.redacted {
  background-color: #1a1a1a;
  color: #1a1a1a;
  padding: 0 4px;
  position: relative;
  cursor: pointer;
  transition: color 0.4s ease, background-color 0.4s ease;
  border-bottom: 1px solid #333;
  user-select: none;
}

.redacted::after {
  content: '[REDACTED]';
  position: absolute;
  left: 0;
  top: -18px;
  font-size: 0.6rem;
  color: #444;
  letter-spacing: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.redacted:hover {
  background-color: rgba(30, 25, 20, 0.6);
  color: #a09080;
}

.redacted:hover::after {
  opacity: 1;
}

/* --- PINNED ITEMS / TAPE / PAPERCLIPS --- */
.pinned {
  position: relative;
  background: rgba(20, 18, 14, 0.9);
  border: 1px solid #2a2520;
  padding: 20px;
  box-shadow:
    2px 3px 12px rgba(0,0,0,0.6),
    inset 0 0 30px rgba(0,0,0,0.3);
}

.pinned::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, #554433 30%, #332211 70%);
  border-radius: 50%;
  border: 1px solid #665544;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  z-index: 2;
}

.taped {
  position: relative;
}

.taped::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 80px;
  height: 22px;
  background: rgba(200, 180, 140, 0.15);
  border: 1px solid rgba(200, 180, 140, 0.08);
  z-index: 2;
  pointer-events: none;
}

.taped-corner::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 10px;
  width: 60px;
  height: 18px;
  background: rgba(200, 180, 140, 0.1);
  transform: rotate(3deg);
  z-index: 2;
  pointer-events: none;
}

.paperclip {
  position: relative;
}

.paperclip::after {
  content: '';
  position: absolute;
  top: -8px;
  right: 15px;
  width: 16px;
  height: 40px;
  border: 2px solid #777;
  border-radius: 8px 8px 0 0;
  border-bottom: none;
  z-index: 2;
}

/* --- COFFEE RING STAIN --- */
.coffee-ring {
  position: absolute;
  width: 95px;
  height: 85px;
  border-radius: 48% 52% 45% 55% / 52% 46% 54% 48%;
  border: 3px solid rgba(101, 67, 33, 0.14);
  border-top-width: 2px;
  border-right-width: 4px;
  border-bottom-width: 2.5px;
  border-left-width: 3px;
  box-shadow:
    inset 0 0 15px rgba(101, 67, 33, 0.06),
    0 0 8px rgba(101, 67, 33, 0.04),
    3px 2px 6px rgba(101, 67, 33, 0.03);
  transform: rotate(-8deg);
  z-index: 1;
  text-decoration: none;
  display: block;
}

a.coffee-ring,
a.coffee-ring-sm {
  pointer-events: auto;
  cursor: default;
  transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

a.coffee-ring:hover,
a.coffee-ring-sm:hover {
  border-color: rgba(101, 67, 33, 0.3);
  box-shadow:
    inset 0 0 20px rgba(101, 67, 33, 0.1),
    0 0 12px rgba(101, 67, 33, 0.08);
}

.coffee-ring-sm {
  width: 65px;
  height: 55px;
  border-radius: 52% 48% 55% 45% / 46% 54% 48% 52%;
  border-top-width: 2.5px;
  border-right-width: 1.5px;
  border-bottom-width: 3px;
  border-left-width: 2px;
  transform: rotate(12deg);
}

/* --- RED STRING CONNECTIONS --- */
.red-string-svg path {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.red-string {
  position: absolute;
  height: 1px;
  background: #8b2020;
  transform-origin: left center;
  opacity: 0.5;
  z-index: 0;
  box-shadow: 0 0 3px rgba(139, 32, 32, 0.3);
}

.red-string-vertical {
  width: 1px;
  height: auto;
  background: #8b2020;
}

/* --- DOCUMENT / PHOTO THUMBNAILS --- */
.doc-thumb {
  display: block;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 3/4;
  background-color: #1a1714;
  border: 1px solid #2a2520;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.75rem;
  color: #5a5040;
  padding: 15px;
  text-decoration: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  position: relative;
}

.doc-thumb:hover {
  border-color: #4a4030;
  box-shadow: 0 0 20px rgba(100, 80, 40, 0.15);
}

.doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.doc-thumb .placeholder-label {
  position: relative;
  z-index: 1;
  font-family: 'Courier Prime', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #5a5040;
  border: 1px dashed #3a3530;
  padding: 10px;
}

/* --- EVIDENCE WALL (index) --- */
.evidence-wall {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 40px;
  overflow: hidden;
}

.wall-item {
  position: absolute;
}

/* --- INCIDENT PAGE LAYOUT --- */
.incident-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 30px 100px;
  position: relative;
}

.incident-page h1 {
  font-family: 'Special Elite', monospace;
  font-size: 1.6rem;
  color: #c8b89a;
  margin-bottom: 30px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

.incident-page .classification {
  font-size: 0.7rem;
  color: #665544;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

.incident-page .doc-image {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 3/4;
  background: #1a1714;
  border: 1px solid #2a2520;
  margin: 30px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.incident-page .doc-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.incident-page .doc-image .placeholder-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #4a4030;
  border: 1px dashed #3a3530;
  padding: 15px 25px;
}

.metadata {
  font-size: 0.8rem;
  color: #887860;
  margin: 6px 0;
  font-family: 'Courier Prime', monospace;
}

.metadata span {
  color: #a09070;
}

.divider {
  border: none;
  border-top: 1px solid #1a1714;
  margin: 30px 0;
  opacity: 0.5;
}

.translation-block {
  background: rgba(15, 13, 10, 0.7);
  border-left: 2px solid #3a3020;
  padding: 25px 30px;
  margin: 30px 0;
  font-size: 0.95rem;
  line-height: 1.8;
  color: #b0a080;
}

.translation-block p {
  margin-bottom: 16px;
}

.translation-block p:last-child {
  margin-bottom: 0;
}

.translation-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #554433;
  margin-bottom: 15px;
  display: block;
}

/* --- AUDIO PLAYER --- */
.audio-container {
  margin: 30px 0;
  padding: 20px;
  background: rgba(15, 12, 8, 0.8);
  border: 1px solid #2a2218;
}

.audio-container .audio-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #554433;
  margin-bottom: 12px;
  display: block;
}

.audio-container audio {
  width: 100%;
  height: 36px;
  opacity: 0.7;
  filter: sepia(0.3) brightness(0.8);
}

.audio-note {
  font-size: 0.7rem;
  color: #554433;
  margin-top: 8px;
  font-style: italic;
}

/* --- COORDINATES --- */
.coordinates {
  font-family: 'Courier Prime', monospace;
  font-size: 0.75rem;
  color: #554840;
  letter-spacing: 1px;
  margin: 15px 0;
}

.coordinates a {
  color: #554840;
  text-decoration: none;
  border-bottom: 1px dotted #3a3530;
  transition: color 0.3s ease;
}

.coordinates a:hover {
  color: #887860;
}

/* --- HIDDEN PAGE LAYOUT --- */
.hidden-page {
  max-width: 650px;
  margin: 0 auto;
  padding: 80px 30px 120px;
  position: relative;
}

.hidden-page h1 {
  font-family: 'Caveat', cursive;
  font-size: 1.8rem;
  color: #a09070;
  margin-bottom: 10px;
}

.hidden-page .photo-frame {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 4/3;
  background: #1a1714;
  border: 1px solid #2a2520;
  margin: 30px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 3px 4px 15px rgba(0,0,0,0.5);
}

.hidden-page .photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hidden-page .photo-frame .placeholder-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #4a4030;
  border: 1px dashed #3a3530;
  padding: 15px 25px;
}

.hidden-page .field-note {
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  color: #a09070;
  line-height: 1.5;
  margin: 25px 0;
  padding-left: 15px;
  border-left: 2px solid #3a3020;
}

.hidden-page .fragment {
  font-family: 'Special Elite', monospace;
  font-size: 1.8rem;
  color: #665544;
  margin: 50px 0;
  text-align: center;
  letter-spacing: 4px;
  opacity: 0.6;
}

/* --- TALLY / COUNTER --- */
.tally {
  font-family: 'Courier Prime', monospace;
  font-size: 0.8rem;
  color: #665544;
  letter-spacing: 1px;
}

.tally .count {
  color: #a09070;
  font-weight: bold;
}

/* --- BACK LINK (barely visible) --- */
.back-link {
  display: inline-block;
  margin-top: 50px;
  font-size: 0.7rem;
  color: #333;
  text-decoration: none;
  letter-spacing: 2px;
  transition: color 0.4s ease;
}

.back-link:hover {
  color: #665544;
}

/* --- SUBTLE SCANLINES OVERLAY --- */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* --- RESPONSIVE (intentionally rough) --- */
@media (max-width: 768px) {
  .evidence-wall {
    padding: 20px 15px;
    min-height: auto;
  }

  .wall-item {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin-bottom: 30px;
    transform: none !important;
  }

  .evidence-wall {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .red-string,
  .red-string-svg {
    opacity: 0.3;
  }

  .coffee-ring {
    opacity: 0.4;
    width: 60px;
    height: 60px;
  }

  .margin-note {
    position: relative;
    margin: 15px 0;
  }

  .incident-page {
    padding: 40px 20px 80px;
  }

  .hidden-page {
    padding: 50px 20px 80px;
  }

  .typewriter-heading {
    font-size: 2.2rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .typewriter-heading {
    font-size: 1.8rem;
  }

  .doc-thumb {
    max-width: 200px;
  }
}

/* --- UNDERLINE ANIMATION FOR LINKS --- */
a.evidence-link {
  color: #887860;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, color 0.3s ease;
}

a.evidence-link:hover {
  color: #b0a080;
  border-bottom-color: #665544;
}

/* --- STAMP / CLASSIFICATION MARK --- */
.stamp {
  display: inline-block;
  border: 2px solid #5a2020;
  color: #5a2020;
  padding: 4px 12px;
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  transform: rotate(-3deg);
  opacity: 0.6;
}

/* --- GLITCH EFFECT (for special text) --- */
@keyframes glitch {
  0%, 90%, 100% { transform: translate(0); }
  91% { transform: translate(-1px, 1px); }
  93% { transform: translate(1px, -1px); }
  95% { transform: translate(-1px, 0); }
  97% { transform: translate(1px, 1px); }
}

.glitch {
  animation: glitch 10s infinite;
}

/* --- FADED TIMESTAMP --- */
.timestamp {
  font-size: 0.75rem;
  color: #6a5f50;
  font-family: 'Courier Prime', monospace;
  letter-spacing: 1px;
}

/* --- SCROLL FADE-IN --- */
@keyframes fadeInSlow {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeInSlow 1.5s ease forwards;
}

.fade-in-delay-1 { animation-delay: 0.3s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.6s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.9s; opacity: 0; }
.fade-in-delay-4 { animation-delay: 1.2s; opacity: 0; }
.fade-in-delay-5 { animation-delay: 1.5s; opacity: 0; }
