:root {
  --bg: #050505;
  --surface: #0A0F14;
  --cyan: #00F0FF;
  --cyan-dim: rgba(0, 240, 255, 0.1);
  --cyan-glow: rgba(0, 240, 255, 0.5);
  --amber: #FF9F1C;
  --amber-dim: rgba(255, 159, 28, 0.2);
  --text: #E0E0E0;
  --muted: #64748B;
  --deep-blue: #003366;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Share Tech Mono', monospace;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--cyan-dim);
  color: var(--cyan);
}

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--cyan-dim);
  border-radius: 2px;
}

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

.container {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========================================
   BACKGROUND LAYERS
   ======================================== */

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-grid {
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
}

.bg-radial {
  background: radial-gradient(ellipse at center, rgba(0, 51, 102, 0.12) 0%, transparent 65%);
}

.bg-vignette {
  background: radial-gradient(circle at center, transparent 0%, rgba(5, 5, 5, 0.85) 100%);
}

.bg-noise {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
}

.bg-scanlines {
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%);
  background-size: 100% 2px;
}

/* ========================================
   HUD CORNERS
   ======================================== */

.hud-corner {
  position: fixed;
  width: 50px;
  height: 50px;
  z-index: 100;
  opacity: 0;
  animation: fadeIn 1.2s ease-out forwards;
}

.hud-corner svg {
  width: 100%;
  height: 100%;
}

.hud-corner.tl {
  top: 20px;
  left: 20px;
  animation-delay: 0.2s;
}

.hud-corner.tr {
  top: 20px;
  right: 20px;
  transform: rotate(90deg);
  animation-delay: 0.3s;
}

.hud-corner.bl {
  bottom: 20px;
  left: 20px;
  transform: rotate(-90deg);
  animation-delay: 0.4s;
}

.hud-corner.br {
  bottom: 20px;
  right: 20px;
  transform: rotate(180deg);
  animation-delay: 0.5s;
}

/* ========================================
   HEADER
   ======================================== */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  animation: fadeIn 1s ease-out 0.5s forwards;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber);
  animation: pulse 2.5s ease-in-out infinite;
}

.status-dot.active {
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.status-dot.amber {
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber);
}

.time-display {
  text-align: right;
}

.time-display .time {
  font-size: 0.85rem;
  color: var(--cyan);
  letter-spacing: 0.25em;
}

.time-display .date {
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  margin-top: 2px;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  position: relative;
  z-index: 10;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  max-width: 1400px;
  width: 100%;
}

@media (min-width: 1024px) {
  .main-grid {
    grid-template-columns: 260px 1fr 260px;
    align-items: center;
  }
}

/* ========================================
   PANELS
   ======================================== */

.panel {
  background: rgba(10, 15, 20, 0.5);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 240, 255, 0.12);
  padding: 20px;
  opacity: 0;
  transform: translateX(-30px);
  animation: slideIn 0.8s ease-out forwards;
}

.panel.right {
  transform: translateX(30px);
  animation-name: slideInRight;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.08);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.side-panel {
  display: none;
}

@media (min-width: 1024px) {
  .side-panel {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }
}

/* ========================================
   DATA STREAM
   ======================================== */

.data-stream {
  font-size: 0.6rem;
  line-height: 1.7;
  max-height: 180px;
  overflow: hidden;
}

.data-stream .line {
  color: rgba(0, 240, 255, 0.6);
  white-space: nowrap;
  animation: streamFade 0.5s ease-out;
}

.data-stream .line span {
  color: var(--muted);
  margin-right: 8px;
}

/* ========================================
   RADAR
   ======================================== */

.radar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.radar-canvas {
  opacity: 0.75;
}

.radar-label {
  font-size: 0.55rem;
  color: rgba(0, 240, 255, 0.5);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

/* ========================================
   CENTER CONTENT
   ======================================== */

.center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  opacity: 0;
  animation: fadeIn 1s ease-out 0.6s forwards;
}

/* ========================================
   TITLE SECTION
   ======================================== */

.title-section {
  text-align: center;
}

.subtitle {
  font-size: 0.6rem;
  color: rgba(0, 240, 255, 0.5);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.main-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 0 40px var(--cyan-glow), 0 0 80px rgba(0, 240, 255, 0.2);
}

.tagline {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-top: 16px;
}

/* ========================================
   SCANNER FRAME
   ======================================== */

.scanner-frame {
  position: relative;
  width: 100%;
  max-width: 380px;
}

.scanner-inner {
  position: relative;
  padding: 4px;
}

/* Brackets */
.bracket {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--cyan);
  opacity: 0.7;
}

.bracket.tl {
  top: 0;
  left: 0;
  border-top: 2px solid;
  border-left: 2px solid;
}

.bracket.tr {
  top: 0;
  right: 0;
  border-top: 2px solid;
  border-right: 2px solid;
}

.bracket.bl {
  bottom: 0;
  left: 0;
  border-bottom: 2px solid;
  border-left: 2px solid;
}

.bracket.br {
  bottom: 0;
  right: 0;
  border-bottom: 2px solid;
  border-right: 2px solid;
}

.bracket-ext {
  position: absolute;
  background: rgba(0, 240, 255, 0.3);
}

.bracket-ext.h {
  height: 1px;
  width: 20px;
}

.bracket-ext.v {
  width: 1px;
  height: 20px;
}

.bracket-ext.t-l { top: 0; left: 36px; }
.bracket-ext.t-r { top: 0; right: 36px; }
.bracket-ext.b-l { bottom: 0; left: 36px; }
.bracket-ext.b-r { bottom: 0; right: 36px; }
.bracket-ext.l-t { left: 0; top: 36px; }
.bracket-ext.l-b { left: 0; bottom: 36px; }
.bracket-ext.r-t { right: 0; top: 36px; }
.bracket-ext.r-b { right: 0; bottom: 36px; }

/* Image container */
.image-container {
  position: relative;
  margin: 18px;
  overflow: hidden;
  background: var(--surface);
}

.subject-image {
  width: 100%;
  display: block;
  filter: grayscale(100%) brightness(0.7) contrast(1.1);
  transition: filter 1.2s ease-out, box-shadow 1.2s ease-out;
}

.subject-image.scanned {
  filter: grayscale(0%) brightness(1) contrast(1);
  box-shadow: 0 0 60px var(--amber-dim);
}

/* Scan line */
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to bottom, transparent, var(--cyan), transparent);
  box-shadow: 0 0 30px var(--cyan), 0 0 60px var(--cyan);
  opacity: 0;
  top: 0;
  pointer-events: none;
}

.scan-line.active {
  opacity: 1;
  animation: scanMove 2.8s ease-in-out forwards;
}

/* Image overlays */
.image-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.image-overlay.grid {
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.4) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.08;
}

.image-overlay.scanlines {
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%);
  background-size: 100% 2px;
  opacity: 0.4;
}

.image-overlay.glow {
  background: radial-gradient(circle at center, rgba(255, 159, 28, 0.25) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 1.2s ease-out;
}

.image-overlay.glow.active {
  opacity: 1;
}

/* Scanner status */
.scanner-status {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 20px;
  background: var(--bg);
  border: 1px solid rgba(0, 240, 255, 0.25);
  font-size: 0.6rem;
  color: var(--cyan);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

/* Progress bar */
.progress-bar {
  position: absolute;
  bottom: -6px;
  left: 18px;
  right: 18px;
  height: 2px;
  background: rgba(0, 240, 255, 0.15);
  opacity: 0;
}

.progress-bar.active {
  opacity: 1;
}

.progress-fill {
  height: 100%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  width: 0%;
  transition: width 0.05s linear;
}

/* ========================================
   BUTTON
   ======================================== */

.holo-btn {
  position: relative;
  padding: 18px 56px;
  background: transparent;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.holo-btn:hover {
  color: #fff;
  border-color: var(--cyan);
  box-shadow: 0 0 30px var(--cyan-glow), 0 0 60px rgba(0, 240, 255, 0.15);
}

.holo-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.holo-btn:disabled:hover {
  color: var(--cyan);
  box-shadow: none;
}

.holo-btn .btn-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--cyan);
  opacity: 0.5;
}

.holo-btn .btn-corner.tl { top: -1px; left: -1px; border-top: 1px solid; border-left: 1px solid; }
.holo-btn .btn-corner.tr { top: -1px; right: -1px; border-top: 1px solid; border-right: 1px solid; }
.holo-btn .btn-corner.bl { bottom: -1px; left: -1px; border-bottom: 1px solid; border-left: 1px solid; }
.holo-btn .btn-corner.br { bottom: -1px; right: -1px; border-bottom: 1px solid; border-right: 1px solid; }

.holo-btn .btn-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--cyan-dim), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.holo-btn:hover .btn-shine {
  transform: translateX(100%);
}

.action-hint {
  font-size: 0.55rem;
  color: var(--muted);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-top: 20px;
  text-align: center;
}

/* ========================================
   PROFILE CARD
   ======================================== */

.profile-card {
  width: 100%;
  max-width: 380px;
  opacity: 0;
  transform: translateY(30px);
  pointer-events: none;
  display: none;
}

.profile-card.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  animation: slideUp 0.7s ease-out forwards;
}

.profile-identity {
  text-align: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(0, 240, 255, 0.08);
}

.profile-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 30px var(--amber-dim);
}

.profile-codename {
  font-size: 0.6rem;
  color: rgba(0, 240, 255, 0.5);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin-top: 6px;
}

.profile-data {
  margin-top: 16px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 240, 255, 0.06);
  font-size: 0.7rem;
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-row .label {
  color: var(--muted);
  letter-spacing: 0.15em;
}

.profile-row .value {
  letter-spacing: 0.1em;
}

.profile-row .value.highlight {
  color: var(--amber);
}

.profile-access {
  display: block;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 240, 255, 0.08);
  text-align: center;
  color: rgba(0, 240, 255, 0.5);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.3s ease;
}

.profile-access:hover {
  color: var(--amber);
}

.profile-access span {
  opacity: 0.5;
  margin-left: 8px;
}

/* ========================================
   STATUS PANEL ROWS
   ======================================== */

.status-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 240, 255, 0.06);
  font-size: 0.7rem;
}

.status-row:last-child {
  border-bottom: none;
}

.status-row .label {
  color: var(--muted);
  letter-spacing: 0.1em;
}

.status-row .value {
  color: var(--cyan);
}

.status-row .value.warning {
  color: var(--amber);
}

.verified-badge {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 240, 255, 0.15);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.verified-badge.visible {
  opacity: 1;
}

.verified-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.6rem;
  color: var(--cyan);
  letter-spacing: 0.2em;
}

.clearance-text {
  margin-top: 8px;
  font-size: 0.6rem;
  color: var(--amber);
  letter-spacing: 0.2em;
}

/* ========================================
   WAVEFORM
   ======================================== */

.waveform-container {
  padding: 16px 0;
}

/* ========================================
   ARCHIVE ROWS
   ======================================== */

.archive-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  padding: 6px 0;
}

.archive-row .label {
  color: var(--muted);
}

.archive-row .value {
  color: var(--cyan);
}

.archive-row .value.amber {
  color: var(--amber);
}

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

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 20px 40px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  opacity: 0;
  animation: fadeIn 1s ease-out 0.5s forwards;
}

.footer-text {
  text-align: right;
}

.footer-text .line1 {
  font-size: 0.55rem;
  color: var(--muted);
  letter-spacing: 0.2em;
}

.footer-text .line2 {
  font-size: 0.5rem;
  color: rgba(0, 240, 255, 0.3);
  letter-spacing: 0.15em;
  margin-top: 4px;
}

/* ========================================
   MOBILE STATS
   ======================================== */

.mobile-stats {
  display: none;
  position: fixed;
  bottom: 70px;
  left: 20px;
  right: 20px;
  z-index: 40;
}

.mobile-stats.visible {
  display: block;
  animation: slideUp 0.6s ease-out forwards;
}

.mobile-stats-inner {
  background: rgba(10, 15, 20, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 240, 255, 0.1);
  padding: 16px;
}

.mobile-stats-grid {
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.mobile-stat {
  font-size: 0.6rem;
}

.mobile-stat .value {
  font-size: 0.9rem;
  margin-bottom: 6px;
  font-family: 'Share Tech Mono', monospace;
}

.mobile-stat .value.cyan {
  color: var(--cyan);
}

.mobile-stat .value.amber {
  color: var(--amber);
}

.mobile-stat .label {
  color: var(--muted);
  letter-spacing: 0.15em;
}

@media (max-width: 1023px) {
  .mobile-stats.visible {
    display: block;
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 12px currentColor;
  }
  50% {
    opacity: 0.5;
    box-shadow: 0 0 20px currentColor;
  }
}

@keyframes scanMove {
  0% { top: 0; opacity: 1; }
  100% { top: calc(100% - 3px); opacity: 0.5; }
}

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

/* ========================================
   FOCUS STYLES
   ======================================== */

button:focus-visible,
a:focus-visible {
  outline: 1px solid var(--cyan);
  outline-offset: 3px;
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
