/* NEO DETROIT // CORE STYLES V4.0 */

/* ----------------------------
   0) TOKENS
----------------------------- */
:root {
  --bg: #020308;
  --bg-soft: rgba(2, 3, 8, 0.78);
  --ink: #d7f7ff;
  --ink-dim: #93a8b8;

  --neon1: #00f5ff;
  --neon2: #b300ff;
  --neon3: #ff2a6d;
  --warn: #ffcc00;

  --panel: rgba(5, 7, 12, 0.88);
  --border: rgba(0, 245, 255, 0.3);
  --border-soft: rgba(255, 255, 255, 0.06);

  --shadow:
    0 0 20px rgba(0, 245, 255, 0.10),
    0 0 40px rgba(179, 0, 255, 0.10);

  --glow: 0 0 12px var(--neon1);
  --glow-purple: 0 0 12px var(--neon2);

  --glass: blur(15px) brightness(1.08) contrast(1.08);
}

/* ----------------------------
   1) GLOBAL BASE
----------------------------- */
* {
  box-sizing: border-box;
}

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

body,
button,
input,
textarea,
select {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 800px at 70% 10%, rgba(179, 0, 255, 0.18), transparent 60%),
    radial-gradient(900px 700px at 20% 80%, rgba(0, 245, 255, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(3, 4, 10, 0.85), rgba(5, 6, 10, 0.7) 40%, rgba(2, 3, 10, 0.82)),
    url("/NeoDominion/images/RetroArcade.jpg");
  background-size: auto, auto, auto, cover;
  background-position: center, center, center, center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ----------------------------
   2) OVERLAY FX
----------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}

.scanlines,
.vignette {
  position: absolute;
  inset: 0;
}

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0px,
    rgba(255, 255, 255, 0) 2px,
    rgba(255, 255, 255, 0.03) 3px,
    rgba(0, 0, 0, 0) 6px
  );
  opacity: 0.35;
}

.vignette {
  background: radial-gradient(circle, transparent 42%, rgba(0, 0, 0, 0.88) 135%);
  opacity: 0.95;
}

.scanlines::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 245, 255, 0.08) 50%,
    transparent 50.5%
  );
  background-size: 100% 200%;
  animation: scan-move 6s linear infinite;
  pointer-events: none;
}

@keyframes scan-move {
  0% { background-position: 0 100%; }
  100% { background-position: 0 0%; }
}

/* ----------------------------
   3) GRID FLOOR
----------------------------- */
.grid {
  position: fixed;
  inset: auto 0 -10vh 0;
  height: 60vh;
  transform: perspective(700px) rotateX(65deg);
  transform-origin: bottom;
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: linear-gradient(to top, transparent, black 40%);
  opacity: 0.9;
  z-index: 0;
}

/* ----------------------------
   4) LAYOUT
----------------------------- */
.wrap {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.shell {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1.45fr 0.62fr;
  gap: 22px;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------
   5) PANELS
----------------------------- */
.panel {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-left: 4px solid var(--neon1);
  box-shadow: var(--shadow);
  transition:
    transform 0.3s cubic-bezier(0.2, 1, 0.3, 1),
    box-shadow 0.3s cubic-bezier(0.2, 1, 0.3, 1),
    border-color 0.3s ease;

  clip-path: polygon(0 0, 95% 0, 100% 5%, 100% 100%, 5% 100%, 0 95%);
}

.panel::before {
  content: "DET_SYS_v2.2";
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--neon1);
  opacity: 0.55;
  user-select: none;
  z-index: 2;
}

.panel:hover {
  border-color: rgba(0, 245, 255, 0.55);
  box-shadow:
    0 0 30px rgba(0, 245, 255, 0.18),
    0 0 55px rgba(179, 0, 255, 0.12);
  transform: scale(1.004);
}

/* ----------------------------
   6) HEADER + BADGE
----------------------------- */
header,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(0, 245, 255, 0.10), transparent);
}

.badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--neon1);
  box-shadow: 0 0 10px var(--neon1);
  animation: pulse 2s infinite;
  flex: 0 0 auto;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

#clock {
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 14px;
  color: var(--neon1);
  text-shadow: 0 0 10px var(--neon1);
  white-space: nowrap;
}

/* ----------------------------
   7) MAIN CONTENT
----------------------------- */
.content {
  padding: 30px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(215, 247, 255, 0.72);
}

.title {
  position: relative;
  margin: 0;
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: clamp(2.7rem, 6vw, 4.4rem);
  line-height: 0.95;
  text-transform: uppercase;
  background: linear-gradient(to bottom, #ffffff, var(--neon1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 15px rgba(0, 245, 255, 0.40));
  text-shadow:
    -2px -1px 0 rgba(255, 42, 109, 0.65),
     2px  1px 0 rgba(0, 245, 255, 0.65);
  animation: title-glitch 4s step-end infinite;
}

@keyframes title-glitch {
  0%, 95% {
    transform: translate(0);
    filter: drop-shadow(0 0 15px rgba(0, 245, 255, 0.40));
  }
  96% {
    transform: translate(3px, -2px);
    filter: drop-shadow(0 0 15px rgba(255, 42, 109, 0.30)) hue-rotate(45deg);
  }
  97% {
    transform: translate(-3px, 2px);
  }
  98%, 100% {
    transform: translate(0);
    filter: drop-shadow(0 0 15px rgba(0, 245, 255, 0.40));
  }
}

.subhead {
  max-width: 52ch;
  margin: 14px 0 0;
  color: rgba(215, 247, 255, 0.78);
  font-size: 1rem;
  line-height: 1.5;
}

/* ----------------------------
   8) TERMINAL
----------------------------- */
.sys-log {
  margin: 22px 0;
  padding: 15px 16px;
  height: 138px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.52);
  border: 1px solid rgba(179, 0, 255, 0.16);
  border-left: 3px solid var(--neon2);
  box-shadow: inset 0 0 22px rgba(179, 0, 255, 0.10);
  color: #a8b7c7;
  font-size: 13px;
  line-height: 1.55;
  scrollbar-width: thin;
  scrollbar-color: var(--neon1) transparent;
}

.sys-log::-webkit-scrollbar {
  width: 4px;
}

.sys-log::-webkit-scrollbar-thumb {
  background: var(--neon1);
  box-shadow: var(--glow);
}

.sys-log::after {
  content: "▌";
  display: inline-block;
  margin-left: 6px;
  color: var(--neon1);
  opacity: 0.85;
  animation: cursor 1s steps(2, end) infinite;
}

@keyframes cursor {
  0%, 50% { opacity: 0; }
  51%, 100% { opacity: 0.85; }
}

.log-accent {
  color: var(--neon1);
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.45);
}

/* ----------------------------
   9) BUTTONS
----------------------------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.btn {
  padding: 12px 24px;
  border: 1px solid var(--neon1);
  background: rgba(0, 245, 255, 0.05);
  color: var(--neon1);
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: var(--glow);
  cursor: pointer;
  overflow: hidden;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease,
    border-color 0.25s ease;

  clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
}

.btn:hover {
  background: var(--neon1);
  color: var(--bg);
  box-shadow: 0 0 20px var(--neon1);
  transform: translateY(-2px);
  animation: btn-glitch 0.2s infinite;
}

.btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@keyframes btn-glitch {
  0% { transform: translateY(-2px) translate(0); }
  25% { transform: translateY(-2px) translate(-2px, 2px); }
  50% { transform: translateY(-2px) translate(2px, -2px); }
  75% { transform: translateY(-2px) translate(-2px, -2px); }
  100% { transform: translateY(-2px) translate(0); }
}

.btn-alert {
  border-color: var(--neon2);
  color: var(--neon2);
  text-shadow: var(--glow-purple);
  background: rgba(179, 0, 255, 0.06);
}

.btn-alert:hover {
  background: var(--neon2);
  color: var(--bg);
  box-shadow: 0 0 20px var(--neon2);
}

/* ----------------------------
   10) TICKER
----------------------------- */
.ticker-wrap {
  width: 100%;
  margin-top: 22px;
  padding: 10px 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
}

.ticker {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
  animation: ticker 30s linear infinite;
}

.ticker span {
  display: inline-block;
  padding: 0 30px;
  font-size: 13px;
  color: var(--neon1);
  border-right: 1px solid rgba(0, 245, 255, 0.1);
}

.ticker b {
  color: var(--neon3);
}

.ticker i {
  color: var(--warn);
  font-style: normal;
}

.ticker-wrap:hover .ticker {
  animation-play-state: paused;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ----------------------------
   11) SIDEBAR
----------------------------- */
.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar-widget {
  padding: 20px;
  border-bottom: 1px solid var(--border-soft);
}

.sidebar-widget:last-child {
  border-bottom: none;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stat-bar {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.10);
}

.stat-fill {
  width: 44%;
  height: 100%;
  border-radius: 2px;
  background: var(--neon1);
  box-shadow: 0 0 10px var(--neon1);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-fill-secondary {
  background: var(--neon2);
  box-shadow: 0 0 10px var(--neon2);
}

.widget-title {
  margin: 0 0 12px;
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon1);
}

.feed-list {
  margin: 0;
  padding-left: 18px;
  color: rgba(215, 247, 255, 0.74);
  font-size: 0.84rem;
  line-height: 1.6;
}

.feed-list li + li {
  margin-top: 8px;
}

.sidebar-warning p {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(215, 247, 255, 0.52);
}

/* ----------------------------
   12) RESPONSIVE TUNING
----------------------------- */
@media (max-width: 900px) {
  .content {
    padding: 24px;
  }

  .sidebar-widget {
    padding: 18px;
  }

  .title {
    font-size: clamp(2.3rem, 10vw, 3.6rem);
  }
}

@media (max-width: 560px) {
  .wrap {
    padding: 20px 12px;
  }

  .content {
    padding: 20px;
  }

  header,
  .panel-header {
    padding: 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .ticker span {
    padding: 0 20px;
  }
}