/* ==========================================================================
   CYBER-8 — shared stylesheet
   Design language: a real terminal, not a "hacker vibe" wallpaper.
   Every panel is framed like a shell window; headings are shell prompts;
   the type pairing is a CRT display face (VT323) against a clean
   monospace workhorse (JetBrains Mono) for everything you have to read.
   ========================================================================== */

:root {
  --bg: #05080a;
  --bg-panel: #0b120e;
  --bg-panel-2: #0e1a14;
  --line: #1c3126;
  --green: #3dff9a;
  --green-dim: #1f8a5a;
  --cyan: #4dd8e0;
  --amber: #ffb454;
  --red: #ff5f6d;
  --text: #cdf5df;
  --text-dim: #6f9483;
  --text-faint: #3f5c4f;
  --radius: 3px;
  --mono: 'JetBrains Mono', 'Fira Code', ui-monospace, Consolas, monospace;
  --display: 'VT323', 'Courier New', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

/* Subtle scanline + vignette overlay across the whole site */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.018) 0px,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  mix-blend-mode: overlay;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--green); color: #04140a; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; letter-spacing: 0.5px; margin: 0 0 0.4em; }
h1 { font-size: 2.6rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; color: var(--text); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Prompt-style eyebrow used before section headings, e.g.
   root@cyber8:~$ ./about_us  — encodes real navigation, not decoration */
.prompt {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--green-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.prompt::before { content: '❯'; color: var(--green); }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--mono);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--green-dim);
  border-radius: var(--radius);
  background: transparent;
  color: var(--green);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn:hover { background: rgba(61, 255, 154, 0.1); border-color: var(--green); text-decoration: none; }
.btn-solid { background: var(--green); color: #04140a; border-color: var(--green); font-weight: 600; }
.btn-solid:hover { background: #58ffae; }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: rgba(255, 95, 109, 0.1); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* ---------- Terminal window panel — the recurring frame ---------- */
.term {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 20px 60px -20px rgba(0, 0, 0, 0.8);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-panel-2);
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--text-dim);
}
.term-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.term-dot.r { background: #ff5f56; }
.term-dot.y { background: #ffbd2e; }
.term-dot.g { background: #27c93f; }
.term-title { margin-left: 6px; }
.term-body { padding: 24px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 8, 10, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; max-width: 1120px; margin: 0 auto; }
.brand { font-family: var(--display); font-size: 1.6rem; color: var(--green); display: flex; align-items: center; gap: 6px; }
.brand .cursor { display: inline-block; width: 10px; height: 1.2rem; background: var(--green); animation: blink 1s steps(1) infinite; }
.nav-links { display: flex; gap: 22px; align-items: center; font-size: 0.9rem; }
.nav-links a { color: var(--text-dim); }
.nav-links a:hover, .nav-links a.active { color: var(--green); text-decoration: none; }
.nav-links .badge { background: var(--green); color: #04140a; border-radius: 999px; font-size: 0.7rem; padding: 1px 7px; margin-left: 4px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--green); padding: 6px 10px; border-radius: var(--radius); cursor: pointer; }

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.35; }
.hero-inner { position: relative; z-index: 2; padding: 120px 24px 100px; max-width: 1120px; margin: 0 auto; }
.hero h1 { font-size: 4.2rem; line-height: 1.05; color: var(--green); text-shadow: 0 0 24px rgba(61, 255, 154, 0.35); }
.hero .lede { max-width: 560px; color: var(--text-dim); font-size: 1.05rem; }
.hero-cta { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.typed { border-right: 2px solid var(--green); white-space: nowrap; overflow: hidden; }

/* ---------- Stat strip ---------- */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 22px 24px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat .n { font-family: var(--display); font-size: 2.1rem; color: var(--cyan); }
.stat .l { color: var(--text-dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.section-head { margin-bottom: 36px; }
.section-head p { color: var(--text-dim); max-width: 620px; }

/* ---------- Product grid ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.chip {
  font-family: var(--mono); font-size: 0.8rem; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--text-dim);
  cursor: pointer; background: transparent;
}
.chip.active, .chip:hover { border-color: var(--green); color: var(--green); }

.search-row { display: flex; gap: 10px; margin-bottom: 24px; }
.search-row input {
  flex: 1; background: var(--bg-panel); border: 1px solid var(--line); color: var(--text);
  font-family: var(--mono); padding: 10px 14px; border-radius: var(--radius);
}
.search-row input:focus { outline: none; border-color: var(--green); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }

.card {
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--green-dim); transform: translateY(-2px); }
.card .icon-wrap {
  width: 100%; aspect-ratio: 4 / 3; background: var(--bg-panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
}
.card .icon-wrap svg { width: 46%; height: 46%; stroke: var(--green); }
.card .sku { color: var(--text-faint); font-size: 0.72rem; }
.card h3 { font-size: 1.15rem; color: var(--text); margin: 0; }
.card .cat { color: var(--cyan); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; }
.card .desc { color: var(--text-dim); font-size: 0.85rem; flex: 1; }
.card .price-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.card .price { font-family: var(--display); font-size: 1.5rem; color: var(--amber); }
.card .stock { font-size: 0.72rem; color: var(--text-faint); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.about-art { aspect-ratio: 1; }
.founder-card { display: flex; gap: 18px; align-items: center; margin-top: 20px; }
.founder-avatar { width: 78px; height: 78px; border-radius: 50%; border: 1px solid var(--green-dim); flex-shrink: 0; }
.founder-name { color: var(--green); font-family: var(--display); font-size: 1.3rem; }
.founder-role { color: var(--text-dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }

.value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 20px; }
.value-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--bg-panel); }
.value-card .tag { color: var(--green); font-size: 0.75rem; }
.value-card h4 { margin: 8px 0 6px; }
.value-card p { color: var(--text-dim); font-size: 0.85rem; margin: 0; }

.timeline { border-left: 1px solid var(--line); padding-left: 24px; margin-top: 20px; }
.timeline .entry { position: relative; padding-bottom: 26px; }
.timeline .entry::before {
  content: ''; position: absolute; left: -29px; top: 4px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green);
}
.timeline .yr { color: var(--cyan); font-family: var(--display); font-size: 1.2rem; }

/* ---------- Forms ---------- */
.auth-wrap { max-width: 420px; margin: 60px auto; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 6px; }
.field input {
  width: 100%; background: var(--bg-panel-2); border: 1px solid var(--line); color: var(--text);
  font-family: var(--mono); padding: 11px 12px; border-radius: var(--radius); font-size: 0.95rem;
}
.field input:focus { outline: none; border-color: var(--green); }
.field .hint { color: var(--text-faint); font-size: 0.72rem; margin-top: 4px; }
.form-msg { font-size: 0.85rem; padding: 10px 12px; border-radius: var(--radius); margin-bottom: 16px; display: none; }
.form-msg.error { display: block; background: rgba(255, 95, 109, 0.1); border: 1px solid var(--red); color: var(--red); }
.form-msg.success { display: block; background: rgba(61, 255, 154, 0.1); border: 1px solid var(--green); color: var(--green); }
.auth-switch { text-align: center; margin-top: 18px; color: var(--text-dim); font-size: 0.85rem; }

/* ---------- Cart drawer ---------- */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 90; display: none; }
.cart-overlay.open { display: block; }
.cart-drawer {
  position: fixed; top: 0; right: -420px; width: 400px; max-width: 92vw; height: 100%;
  background: var(--bg-panel); border-left: 1px solid var(--line); z-index: 91;
  transition: right 0.25s ease; display: flex; flex-direction: column;
}
.cart-drawer.open { right: 0; }
.cart-head { padding: 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.cart-items { flex: 1; overflow-y: auto; padding: 12px 18px; }
.cart-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-item .ci-name { font-size: 0.9rem; flex: 1; }
.cart-item .ci-qty { display: flex; align-items: center; gap: 6px; }
.cart-item .ci-qty button { width: 22px; height: 22px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; border-radius: 3px; }
.cart-foot { padding: 18px; border-top: 1px solid var(--line); }
.cart-total { display: flex; justify-content: space-between; margin-bottom: 14px; font-family: var(--display); font-size: 1.4rem; color: var(--amber); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 40px 0; margin-top: 60px; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; color: var(--text-faint); font-size: 0.8rem; }
.footer-inner a { color: var(--text-dim); }

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.loader { color: var(--green-dim); font-size: 0.85rem; padding: 20px 0; }

/* ---------- Tabs (admin panel) ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; flex-wrap: wrap; }
.tab-btn {
  font-family: var(--mono); font-size: 0.85rem; padding: 10px 18px; background: transparent;
  border: none; border-bottom: 2px solid transparent; color: var(--text-dim); cursor: pointer;
}
.tab-btn.active { color: var(--green); border-color: var(--green); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Data table ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th {
  text-align: left; padding: 10px 12px; color: var(--text-dim); text-transform: uppercase;
  font-size: 0.72rem; letter-spacing: 0.5px; border-bottom: 1px solid var(--line);
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:hover td { background: rgba(61, 255, 154, 0.03); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-panel); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.72rem; border: 1px solid var(--line); }
.pill.on { color: var(--green); border-color: var(--green-dim); }
.pill.off { color: var(--text-faint); }
.row-actions { display: flex; gap: 6px; }
.mini-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: var(--bg-panel-2); }

/* ---------- Stat cards (admin dashboard) ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--bg-panel); }
.stat-card .n { font-family: var(--display); font-size: 2rem; color: var(--cyan); }
.stat-card .l { color: var(--text-dim); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Avatar uploader (profile page) ---------- */
.avatar-uploader { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; }
.avatar-preview {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 2px solid var(--green-dim);
  background: var(--bg-panel-2); display: flex; align-items: center; justify-content: center; color: var(--text-faint);
  font-family: var(--display); font-size: 2rem;
}
.avatar-actions input[type="file"] { display: none; }

/* ---------- Modal (add/edit product) ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 95; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { width: 100%; max-width: 480px; }
.modal .term-body { max-height: 80vh; overflow-y: auto; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }


/* ---------- Tickets ---------- */
.ticket-row { cursor: pointer; }
.ticket-thread { display: flex; flex-direction: column; gap: 14px; max-height: 460px; overflow-y: auto; padding: 4px; margin-bottom: 16px; }
.msg-bubble { max-width: 78%; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); font-size: 0.88rem; }
.msg-bubble .meta { font-size: 0.68rem; color: var(--text-faint); margin-bottom: 6px; }
.msg-bubble.from-user { align-self: flex-start; background: var(--bg-panel-2); }
.msg-bubble.from-admin { align-self: flex-end; background: rgba(61, 255, 154, 0.07); border-color: var(--green-dim); }
.reason-tag { color: var(--cyan); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; }
.status-pill.open { color: var(--amber); border-color: var(--amber); }
.status-pill.answered { color: var(--green); border-color: var(--green-dim); }
.status-pill.closed { color: var(--text-faint); }
.unread-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 6px var(--red); margin-right: 8px;
}

/* ---------- Free tools ---------- */
.free-card .price { color: var(--green); font-size: 1.1rem; }
.upload-form { border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; background: var(--bg-panel); }

/* ---------- Profile page ---------- */
.profile-hero {
  position: relative;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  overflow: hidden;
  padding: 32px 28px;
  margin-bottom: 24px;
}
.profile-hero.vibe-active {
  border-color: var(--vibe-color, var(--green-dim));
  box-shadow: 0 0 0 1px var(--vibe-color, transparent), 0 30px 80px -30px var(--vibe-color, transparent);
}
.profile-hero.vibe-active::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 240px;
  background: radial-gradient(ellipse at top, color-mix(in srgb, var(--vibe-color, var(--green)) 35%, transparent), transparent 70%);
  pointer-events: none;
}
.profile-hero-row { position: relative; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-avatar-lg {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--bg-panel-2); display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 2.4rem; color: var(--text-faint);
  border: 3px solid var(--line);
}
.vibe-active .profile-avatar-lg { border-color: var(--vibe-color, var(--green)); box-shadow: 0 0 22px color-mix(in srgb, var(--vibe-color, var(--green)) 55%, transparent); }
.profile-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-name-row h1 { margin: 0; font-size: 2rem; }
.profile-tagline { color: var(--text-dim); font-size: 0.9rem; margin-top: 6px; }
.profile-meta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 0.78rem; color: var(--text-faint); }
.admin-badge { color: var(--cyan); border: 1px solid var(--cyan); border-radius: 999px; padding: 1px 9px; font-size: 0.7rem; }
.status-flag { border-radius: 999px; padding: 1px 9px; font-size: 0.7rem; border: 1px solid var(--line); }
.status-flag.banned { color: var(--red); border-color: var(--red); }
.status-flag.muted { color: var(--amber); border-color: var(--amber); }

.wallet-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1px solid var(--amber); border-radius: var(--radius); padding: 18px 22px;
  background: rgba(255, 180, 84, 0.06); margin-bottom: 24px;
}
.wallet-card .amount { font-family: var(--display); font-size: 2.2rem; color: var(--amber); }
.wallet-card .label { color: var(--text-dim); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; }

.admin-view-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.admin-view-box .stat-card { padding: 14px; }
.admin-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.grant-coin-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.grant-coin-row input {
  width: 120px; background: var(--bg-panel-2); border: 1px solid var(--line); color: var(--text);
  font-family: var(--mono); padding: 8px 10px; border-radius: var(--radius);
}

@media (max-width: 860px) {
  .admin-view-box { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .value-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links { position: fixed; top: 60px; left: 0; right: 0; background: var(--bg-panel); flex-direction: column; align-items: flex-start; padding: 16px 24px; border-bottom: 1px solid var(--line); display: none; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .hero h1 { font-size: 2.6rem; }
  .hero-inner { padding: 80px 20px 60px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---- Verified badge (green checkmark) ---- */
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #22c55e;
  color: #fff;
  border-radius: 50%;
  font-size: .65rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

/* ---- Chat nav link ---- */
nav a[href="/chat.html"] { }
