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

html { scroll-behavior: smooth; }

body {
  background: #0d0f0a;
  min-height: 100vh;
}

/* Letterhead / bureaucratic paper texture */
.paper-bg {
  background-color: #0d0f0a;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 28px, rgba(176,141,87,0.025) 28px, rgba(176,141,87,0.025) 29px),
    repeating-linear-gradient(90deg, rgba(58,63,43,0.15) 0, rgba(58,63,43,0.15) 1px, transparent 1px, transparent 40px),
    radial-gradient(circle at 20% 20%, rgba(58,63,43,0.35), transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(90,104,66,0.2), transparent 55%);
}

/* Subtle scanlines / fluorescent grain */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9998;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.04) 3px, rgba(0,0,0,0.04) 4px);
  opacity: 0.6;
}

/* Paper cards (stamped documents) */
.paper-card {
  background:
    repeating-linear-gradient(0deg, transparent, transparent 22px, rgba(176,141,87,0.04) 22px, rgba(176,141,87,0.04) 23px),
    linear-gradient(135deg, rgba(58,63,43,0.55), rgba(13,15,10,0.75));
  border: 1px solid rgba(176,141,87,0.35);
  border-radius: 4px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4), inset 0 0 30px rgba(0,0,0,0.25);
  position: relative;
}

/* Manila folder cards */
.folder-card {
  background:
    repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(176,141,87,0.03) 20px, rgba(176,141,87,0.03) 21px),
    linear-gradient(160deg, rgba(74,83,52,0.5), rgba(13,15,10,0.7));
  border: 1px solid rgba(176,141,87,0.3);
  border-radius: 3px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
}
.folder-card:hover {
  transform: translateY(-3px);
  border-color: rgba(201,169,97,0.6);
  box-shadow: 0 8px 22px rgba(0,0,0,0.5), 0 0 0 1px rgba(201,169,97,0.15);
  animation: fluorFlicker 0.5s;
}
.folder-tab {
  position: absolute; top: -12px; left: 16px;
  background: #b08d57; color: #0d0f0a;
  font-family: 'Oswald', sans-serif; font-weight: 600;
  font-size: 9px; letter-spacing: 2px;
  padding: 2px 12px; border-radius: 3px 3px 0 0;
}

.sector-featured {
  border: 2px solid #c9a961 !important;
  box-shadow: 0 0 22px rgba(201,169,97,0.18), inset 0 0 25px rgba(201,169,97,0.04) !important;
}

@keyframes fluorFlicker {
  0%,100% { filter: brightness(1); }
  30% { filter: brightness(1.25); }
  45% { filter: brightness(0.85); }
  60% { filter: brightness(1.15); }
}

/* Form fields — Space Mono, official */
.form-field {
  background: rgba(13,15,10,0.7);
  border: 1px solid rgba(176,141,87,0.3);
  color: #d4d0c0;
}
.form-field:focus { border-color: rgba(201,169,97,0.7); box-shadow: 0 0 0 1px rgba(201,169,97,0.3); }
.form-field::placeholder { color: rgba(212,208,192,0.25); }

/* Official seal */
.seal-svg { opacity: 0.9; }

/* Stamp corner on cards */
.stamp-corner {
  position: absolute; top: 8px; right: 8px; opacity: 0.5;
  transform: rotate(-12deg);
}

/* Ticket number blink */
.ticket-num { letter-spacing: 2px; box-shadow: inset 0 0 8px rgba(0,0,0,0.4); }

/* Odometer / hit counter */
.odometer {
  font-family: 'Space Mono', monospace; font-weight: 700;
  background: #0d0f0a; border: 2px inset #4a5334;
  padding: 4px 10px; color: #c9922e; letter-spacing: 4px;
  text-shadow: 0 0 6px rgba(201,146,46,0.5);
}

/* Megaphone marquee */
.megaphone-bar { height: 26px; }
@keyframes marquee { 0% { transform: translateX(100%);} 100% { transform: translateX(-100%);} }
.marquee-text { animation: marquee 26s linear infinite; white-space: nowrap; display: inline-block; }

/* Flicker title (failing fluorescent) */
@keyframes flicker {
  0%,100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.4; }
  94% { opacity: 1; }
  96% { opacity: 0.7; }
  97% { opacity: 1; }
}
.flicker-title { animation: flicker 6s infinite; text-shadow: 0 0 12px rgba(176,141,87,0.3); }

/* Motto slow scroll fade */
.motto-scroll { opacity: 0.8; }

/* Stamp slots */
.stamp-circle {
  width: 54px; height: 54px; border-radius: 50%;
  border: 3px solid; display: flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 22px;
  transform: rotate(-8deg);
}
.stamp-granted .stamp-circle { animation: stampSlam 0.4s ease-out; }
.stamp-granted { box-shadow: 0 0 18px rgba(176,141,87,0.2); }
@keyframes stampSlam {
  0% { transform: rotate(-8deg) scale(2.2); opacity: 0; }
  60% { transform: rotate(-8deg) scale(0.9); opacity: 1; }
  100% { transform: rotate(-8deg) scale(1); }
}

.final-approval { animation: stampSlam 0.5s ease-out; }

/* Stamp drop loading */
.stamp-drop { font-size: 32px; animation: stampDrop 0.7s ease-in-out infinite; }
@keyframes stampDrop {
  0% { transform: translateY(-14px) scale(0.9); opacity: 0.5; }
  50% { transform: translateY(0) scale(1.15); opacity: 1; }
  100% { transform: translateY(-14px) scale(0.9); opacity: 0.5; }
}

/* Wet stamp overlay on generated text */
.wet-stamp {
  position: absolute; top: -6px; right: 0; opacity: 0.35;
  transform: rotate(9deg); pointer-events: none; z-index: 1;
}

/* Loading bar */
@keyframes loadingBar { 0%{width:0}20%{width:18%}45%{width:40%}70%{width:70%}100%{width:100%} }
.loading-bar-anim { animation: loadingBar 3s ease-in-out; }

/* Typewriter cursor */
@keyframes blink { 0%,100%{opacity:1}50%{opacity:0} }
.typewriter-cursor::after { content:'▊'; animation: blink 0.8s step-end infinite; color:#c9922e; }

/* Poll bar */
@keyframes pollGrow { from { width:0; } }
.poll-bar { animation: pollGrow 0.9s ease-out; border-radius: 3px; }

/* Habitability stars */
.hab-star { cursor: pointer; transition: transform 0.15s, color 0.15s; }
.hab-star:hover { transform: scale(1.3); }

/* Map */
.map-frame {
  background:
    repeating-linear-gradient(0deg, rgba(90,104,66,0.15) 0, rgba(90,104,66,0.15) 1px, transparent 1px, transparent 30px),
    repeating-linear-gradient(90deg, rgba(90,104,66,0.15) 0, rgba(90,104,66,0.15) 1px, transparent 1px, transparent 30px),
    linear-gradient(135deg, #2a2f1f, #1a1d12);
  border: 2px solid rgba(176,141,87,0.4);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}
.map-pin {
  position: absolute; transform: translate(-50%,-50%);
  display: flex; flex-direction: column; align-items: center; cursor: pointer;
}
.pin-dot {
  width: 10px; height: 10px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 8px currentColor; animation: pinPulse 2.5s ease-in-out infinite;
}
@keyframes pinPulse { 0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.4);opacity:0.7} }
.pin-label { margin-top: 2px; color: currentColor; background: rgba(13,15,10,0.7); padding: 0 2px; border-radius: 2px; }

/* Drawer tabs */
.drawer-tab { border: 1px solid rgba(176,141,87,0.3); border-radius: 3px 3px 0 0; transition: background 0.2s; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(13,15,10,0.85); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

/* Fade in up */
@keyframes fadeInUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
.fade-in-up { animation: fadeInUp 0.5s ease-out forwards; opacity: 0; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

/* Masonry */
.masonry-grid { column-count: 1; column-gap: 16px; }
@media (min-width: 640px) { .masonry-grid { column-count: 2; } }
@media (min-width: 1024px) { .masonry-grid { column-count: 3; } }
.masonry-grid > * { break-inside: avoid; margin-bottom: 16px; }

/* Reg note */
.reg-note { font-style: italic; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0d0f0a; }
::-webkit-scrollbar-thumb { background: #4a5334; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #b08d57; }