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

:root {
  --blue-900: #000d1a;
  --blue-800: #001529;
  --blue-700: #00254d;
  --blue-500: #0057b8;
  --blue-400: #0a84ff;
  --blue-300: #38b6ff;
  --blue-100: #b3e0ff;
  --cyan:      #00e5ff;
  --white:     #e8f4ff;
  --muted:     #4a7fa5;
  --dim:       #1a3a52;

  --font-mono: 'Share Tech Mono', monospace;
  --font-display: 'Orbitron', sans-serif;
}

/* ============================================================
   BASE
   ============================================================ */
html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--blue-900);
  color: var(--white);
  font-family: var(--font-mono);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

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

/* Grid */
.grid-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 132, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 132, 255, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Radial vignette / glow */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 30%,
    rgba(0, 87, 184, 0.18) 0%,
    transparent 70%);
}

/* Scan line */
.scan-line {
  position: fixed; left: 0; right: 0; z-index: 1;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 229, 255, 0.4) 50%, transparent 100%);
  animation: scan 6s linear infinite;
  pointer-events: none;
}
@keyframes scan {
  0%   { top: -4px; opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { top: 100vh; opacity: 0; }
}

/* Noise overlay */
.noise-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

/* Particle canvas */
#particleCanvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

/* ============================================================
   CORNER BRACKETS
   ============================================================ */
.corner {
  position: fixed; z-index: 10; width: 28px; height: 28px; pointer-events: none;
  border-color: var(--blue-300); border-style: solid; opacity: 0.5;
}
.corner--tl { top: 16px; left: 16px;  border-width: 2px 0 0 2px; }
.corner--tr { top: 16px; right: 16px; border-width: 2px 2px 0 0; }
.corner--bl { bottom: 16px; left: 16px;  border-width: 0 0 2px 2px; }
.corner--br { bottom: 16px; right: 16px; border-width: 0 2px 2px 0; }

/* ============================================================
   HEADER BAR
   ============================================================ */
.header-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px;
  background: rgba(0, 21, 41, 0.8);
  border-bottom: 1px solid var(--dim);
  backdrop-filter: blur(8px);
}

.header-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.header-dots { display: flex; gap: 6px; }
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}
.dot--red    { background: #ff4d4d; animation-delay: 0s; }
.dot--yellow { background: #ffd700; animation-delay: .3s; }
.dot--green  { background: #00ff88; animation-delay: .6s; }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main {
  position: relative; z-index: 5;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 100px 24px 80px;
  gap: 32px;
  max-width: 760px;
  margin: 0 auto;
}

/* ============================================================
   BADGE
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px;
  border: 1px solid var(--blue-500);
  color: var(--blue-300);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  background: rgba(0, 87, 184, 0.1);
  animation: fade-up 0.8s ease both;
}

.badge-icon {
  color: var(--cyan);
  animation: spin 4s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   TITLE
   ============================================================ */
.title {
  font-family: var(--font-display);
  text-align: center;
  line-height: 1.05;
  display: flex; flex-direction: column;
  animation: fade-up 0.8s 0.15s ease both;
}

.title-line--1 {
  font-size: clamp(2.8rem, 9vw, 6rem);
  font-weight: 400;
  color: var(--white);
  letter-spacing: 0.12em;
}

.title-line--2 {
  font-size: clamp(3.4rem, 11vw, 7.5rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--blue-400);
  text-shadow: 0 0 40px rgba(10, 132, 255, 0.6), 0 0 80px rgba(10, 132, 255, 0.3);
}
.title-line--2 em {
  font-style: normal;
  color: var(--cyan);
  text-shadow: 0 0 30px rgba(0, 229, 255, 0.8);
}

/* ============================================================
   SUBTITLE / TYPEWRITER
   ============================================================ */
.subtitle-wrap {
  display: flex; align-items: center; gap: 4px;
  animation: fade-up 0.8s 0.3s ease both;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.cursor {
  color: var(--cyan);
  font-size: 0.9rem;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  animation: fade-up 0.8s 0.4s ease both;
}
.divider-line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--dim), transparent);
}
.divider-icon {
  color: var(--blue-500); font-size: 1.1rem;
  animation: pulse-glow 2.5s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { text-shadow: none; color: var(--blue-500); }
  50%       { text-shadow: 0 0 12px var(--cyan); color: var(--cyan); }
}

/* ============================================================
   COUNTDOWN
   ============================================================ */
.countdown {
  display: flex; align-items: center; gap: 8px;
  animation: fade-up 0.8s 0.5s ease both;
}

.countdown-unit {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(0, 37, 77, 0.6);
  border: 1px solid var(--dim);
  padding: 14px 18px 10px;
  min-width: 80px;
  position: relative;
  overflow: hidden;
}
.countdown-unit::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-400), transparent);
}

.countdown-value {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  color: var(--blue-300);
  text-shadow: 0 0 20px rgba(56, 182, 255, 0.6);
  line-height: 1;
  transition: transform 0.15s ease;
}
.countdown-value.flip {
  transform: scale(1.15);
  color: var(--cyan);
}

.countdown-label {
  font-size: 0.6rem; letter-spacing: 0.2em;
  color: var(--muted); margin-top: 6px;
}

.countdown-sep {
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 700;
  color: var(--blue-500);
  padding-bottom: 16px;
  animation: blink 1.5s step-end infinite;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-wrap {
  width: 100%;
  animation: fade-up 0.8s 0.65s ease both;
}

.progress-label {
  display: flex; justify-content: space-between;
  font-size: 0.7rem; letter-spacing: 0.12em;
  color: var(--muted); margin-bottom: 8px;
}

.progress-track {
  width: 100%; height: 6px;
  background: var(--dim);
  position: relative; overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-500), var(--cyan));
  width: 0%;
  transition: width 0.4s ease;
}

.progress-glow {
  position: absolute; top: -4px; height: 14px; width: 20px;
  background: radial-gradient(ellipse, rgba(0, 229, 255, 0.9) 0%, transparent 70%);
  transition: left 0.4s ease;
  pointer-events: none;
}

/* ============================================================
   NOTIFY FORM
   ============================================================ */
.notify-wrap {
  width: 100%;
  animation: fade-up 0.8s 0.75s ease both;
}

.notify-form {
  display: flex; gap: 0;
  border: 1px solid var(--dim);
  overflow: hidden;
  transition: border-color 0.2s;
}
.notify-form:focus-within { border-color: var(--blue-400); }

.notify-input {
  flex: 1;
  background: rgba(0, 21, 41, 0.7);
  border: none; outline: none;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  padding: 14px 16px;
}
.notify-input::placeholder { color: var(--muted); }

.notify-btn {
  background: var(--blue-500);
  color: var(--white);
  border: none; cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 14px 22px;
  transition: background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.notify-btn:hover {
  background: var(--blue-400);
  box-shadow: 0 0 20px rgba(10, 132, 255, 0.5);
}
.notify-btn:active { transform: scale(0.97); }

.notify-msg {
  margin-top: 8px;
  font-size: 0.75rem; letter-spacing: 0.08em;
  min-height: 1.2em;
  color: var(--cyan);
  opacity: 0;
  transition: opacity 0.4s;
}
.notify-msg.visible { opacity: 1; }
.notify-msg.error { color: #ff6b6b; }

/* ============================================================
   LOG FEED
   ============================================================ */
.feed {
  width: 100%;
  background: rgba(0, 13, 26, 0.7);
  border: 1px solid var(--dim);
  animation: fade-up 0.8s 0.9s ease both;
}

.feed-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--dim);
  font-size: 0.7rem; letter-spacing: 0.15em;
  color: var(--muted);
}

.feed-led {
  width: 8px; height: 8px; border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 8px #00ff88;
  animation: pulse-dot 1s ease-in-out infinite;
}

.feed-body {
  padding: 10px 14px;
  max-height: 120px;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 3px;
}

.feed-line {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  animation: slide-in 0.3s ease both;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feed-line span { color: var(--blue-300); margin-right: 8px; }
.feed-line.ok  span { color: #00ff88; }
.feed-line.err span { color: #ff6b6b; }
.feed-line.warn span { color: #ffd700; }

@keyframes slide-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between;
  padding: 10px 24px;
  font-size: 0.65rem; letter-spacing: 0.12em;
  color: var(--muted);
  background: rgba(0, 21, 41, 0.8);
  border-top: 1px solid var(--dim);
  backdrop-filter: blur(8px);
}

.footer-version { color: var(--blue-500); }

/* ============================================================
   ENTRY ANIMATIONS
   ============================================================ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 540px) {
  .countdown-unit { min-width: 60px; padding: 10px 10px 8px; }
  .countdown-value { font-size: 1.6rem; }
  .notify-form { flex-direction: column; }
  .notify-btn { border-top: 1px solid var(--dim); }
}
