@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: 'DM Sans', sans-serif; }

/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --cyan: #00E5CC;
  --cyan-dark: #00B8A3;
  --cyan-dim: #00E5CC22;
  --cyan-glow: #00E5CC44;
  --black: #000000;
  --surface: #0A0A0A;
  --card: #111111;
  --card-hover: #161616;
  --border: #1A1A1A;
  --border-active: #2A2A2A;
  --border-cyan: #00E5CC33;
  --light: #F0F0F0;
  --body: #A0A0A0;
  --muted: #606060;
  --dim: #404040;
  --error: #FF4444;
  --warning: #FFB800;
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --transition: 150ms ease;
}

/* ── Typography ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-family: 'Syne', sans-serif; color: var(--light); }
p { color: var(--body); line-height: 1.6; }
a { color: var(--cyan); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }
code, pre, .mono { font-family: 'JetBrains Mono', monospace; }

/* ── Scan-line texture ──────────────────────────────────────────────────── */
.scanline {
  background-image: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    #00E5CC04 2px, #00E5CC04 4px
  );
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 20px var(--cyan-glow);
}
.btn-primary:hover { background: var(--cyan-dark); box-shadow: 0 0 30px var(--cyan-glow); }

.btn-outline {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--border-cyan);
}
.btn-outline:hover { border-color: var(--cyan); background: var(--cyan-dim); }

.btn-ghost {
  background: transparent;
  color: var(--body);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-active); color: var(--light); }

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1px solid #FF444433;
}
.btn-danger:hover { background: #FF444411; border-color: var(--error); }

.btn-sm { padding: 6px 14px; font-size: 11px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Inputs ─────────────────────────────────────────────────────────────── */
.input, .textarea, .select {
  width: 100%;
  background: var(--surface);
  color: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  transition: border-color var(--transition);
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--cyan); }
.textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.select { appearance: none; cursor: pointer; }
.label {
  display: block;
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--border-active); }

/* ── Tags / Pills ───────────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid var(--border-cyan);
  border-radius: 4px;
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag-remove {
  background: none;
  border: none;
  color: var(--cyan);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  opacity: 0.6;
}
.tag-remove:hover { opacity: 1; }

/* ── Sliders ────────────────────────────────────────────────────────────── */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: var(--border-active);
  border-radius: 2px;
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
  box-shadow: 0 0 8px var(--cyan-glow);
}
.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px var(--cyan-glow);
}

/* ── Progress bar ───────────────────────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--cyan);
  border-radius: 2px;
  transition: width 300ms ease;
  background-image: repeating-linear-gradient(
    90deg, transparent, transparent 4px,
    #00E5CC44 4px, #00E5CC44 8px
  );
}

/* ── Badge ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 3px;
}
.badge-cyan { background: var(--cyan-dim); color: var(--cyan); border: 1px solid var(--border-cyan); }
.badge-amber { background: #FFB80022; color: var(--warning); border: 1px solid #FFB80033; }
.badge-red { background: #FF444422; color: var(--error); border: 1px solid #FF444433; }
.badge-muted { background: #1A1A1A; color: var(--muted); border: 1px solid var(--border); }

/* ── Ghost watermark ────────────────────────────────────────────────────── */
.ghost-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.05;
  pointer-events: none;
  width: 200px;
}

/* ── Ghost Toast ────────────────────────────────────────────────────────── */
#ghost-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  box-shadow: 0 0 20px #00E5CC22;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 260px;
  pointer-events: none;
  transform: translateY(80px);
  opacity: 0;
  background-image: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    #00E5CC04 2px, #00E5CC04 4px
  );
}
#ghost-toast.visible {
  transform: translateY(0);
  opacity: 1;
  animation: toastAppear 300ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
#ghost-toast.hiding {
  animation: toastDisappear 250ms ease-in forwards;
}
#ghost-toast.error {
  border-color: #FF444444;
  box-shadow: 0 0 20px #FF444422;
}
#ghost-toast .ghost-icon { flex-shrink: 0; width: 40px; }
#ghost-toast .ghost-label {
  font-family: 'Syne', sans-serif;
  font-size: 9px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
#ghost-toast.error .ghost-label { color: var(--error); }
#ghost-toast .ghost-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--body);
  line-height: 1.4;
}

/* ── Ghost animations ───────────────────────────────────────────────────── */
@keyframes ghostBob {
  from { transform: translateY(-4px); }
  to { transform: translateY(4px); }
}
@keyframes ghostSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes ghostGlitch {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
@keyframes toastAppear {
  from { transform: translateY(80px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes toastDisappear {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(80px); opacity: 0; }
}
@keyframes eyePulse {
  0%, 100% { r: 3; }
  50% { r: 4; }
}

.ghost-bob { animation: ghostBob 2s ease-in-out infinite alternate; }
.ghost-spin { animation: ghostSpin 600ms ease; }
.ghost-glitch { animation: ghostGlitch 300ms steps(1); }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  position: relative;
}
.modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--light);
  margin-bottom: 12px;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.modal-close:hover { color: var(--light); }

/* ── Eyebrow label ──────────────────────────────────────────────────────── */
.eyebrow {
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--cyan);
  flex-shrink: 0;
}

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 20px;
  transition: all var(--transition);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--light); }
.tab-btn.active { color: var(--cyan); border-bottom-color: var(--cyan); }

/* ── Drag & Drop Upload Zone ────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-cyan);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--cyan);
  background: var(--cyan-dim);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-zone .upload-icon { color: var(--cyan); margin-bottom: 12px; opacity: 0.6; }
.upload-zone .upload-text { color: var(--muted); font-size: 13px; }
.upload-zone .upload-hint { color: var(--dim); font-size: 11px; margin-top: 6px; }

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--dim); }

/* ── Utilities ──────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #ghost-toast {
    bottom: 80px;
    right: 50%;
    transform: translateX(50%) translateY(80px);
    width: calc(100% - 40px);
    max-width: 320px;
  }
  #ghost-toast.visible {
    transform: translateX(50%) translateY(0);
    animation: toastAppearMobile 300ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  }
  #ghost-toast.hiding {
    animation: toastDisappearMobile 250ms ease-in forwards;
  }
  #ghost-toast .ghost-icon { width: 32px; }
}

@keyframes toastAppearMobile {
  from { transform: translateX(50%) translateY(80px); opacity: 0; }
  to { transform: translateX(50%) translateY(0); opacity: 1; }
}
@keyframes toastDisappearMobile {
  from { transform: translateX(50%) translateY(0); opacity: 1; }
  to { transform: translateX(50%) translateY(80px); opacity: 0; }
}
