/* ============================================================
   NIGHTOWL marketing site — dark "ops dashboard" theme, matches
   the desktop panel's own palette (see panel.py's C dict).
   ============================================================ */

:root {
  --bg: #0a0a0c;
  --bg-alt: #0d0d10;
  --card: #141416;
  --card-alt: #1b1b1e;
  --card-hover: #1a1a1d;
  --border: #232327;
  --border-hover: #333338;
  --text: #e8e8ea;
  --muted: #8b8b93;
  --muted-dim: #5c5c63;
  --accent: #ff3b3b;
  --accent-hover: #e02d2d;
  --accent-glow: rgba(255, 59, 59, 0.35);
  --green: #22c55e;
  --amber: #eab308;
  --red: #ef4444;
  --mono: 'JetBrains Mono', 'Consolas', monospace;
  --sans: 'Space Grotesk', 'Segoe UI', sans-serif;
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-glow); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

a { color: inherit; text-decoration: none; }

/* ---------- custom icon set (replaces emoji everywhere on the site -
   see icon-sprite.txt, inlined near the top of <body> on every page) ---------- */
.icon {
  stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  display: inline-block; vertical-align: middle; flex-shrink: 0;
}
.owl-icon { display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- background ambience ---------- */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(650px circle at 15% 8%, rgba(255, 59, 59, 0.12), transparent 60%),
    radial-gradient(500px circle at 85% 18%, rgba(234, 179, 8, 0.06), transparent 55%),
    radial-gradient(800px circle at 50% 100%, rgba(255, 59, 59, 0.05), transparent 60%);
  pointer-events: none;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.025;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- nav ---------- */
/* Scoped to #nav (index.html's marketing navbar) specifically, not a bare
   `nav` element selector - dashboard.html's sidebar is also a <nav> (.app-nav)
   and was inheriting this fixed/full-width positioning by accident, which
   pinned it across the whole viewport instead of staying inside the sidebar. */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 13px 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 700; font-size: 17px; letter-spacing: 0.5px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(145deg, #1c1c1f, #0f0f11);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  box-shadow: 0 0 0 1px rgba(255,59,59,0.08), 0 4px 14px rgba(255,59,59,0.12);
}
.nav-links { display: flex; gap: 34px; font-size: 14px; color: var(--muted); }
.nav-links a { position: relative; padding: 4px 0; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-links a:hover::after { transform: scaleX(1); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.status-pill {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 100px; padding: 6px 12px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.4} }

.btn {
  font-family: var(--sans); font-weight: 600; font-size: 14px;
  padding: 11px 20px; border-radius: 9px; border: 1px solid transparent;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(180deg, #ff4b4b, var(--accent));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 8px 24px -8px rgba(255,59,59,0.65);
}
.btn-primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 10px 30px -6px rgba(255,59,59,0.8); transform: translateY(-1px); }
.btn-ghost {
  background: var(--card-alt); color: var(--text); border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--border-hover); background: var(--card-hover); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

.burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; }
.burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 190px 0 120px; overflow: hidden; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12.5px; color: var(--accent);
  background: rgba(255,59,59,0.08); border: 1px solid rgba(255,59,59,0.25);
  padding: 6px 14px; border-radius: 100px; margin-bottom: 26px;
  animation: fade-up 0.7s ease both;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 74px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -1.5px;
  max-width: 880px;
  animation: fade-up 0.7s ease .08s both;
}
.hero h1 .grad {
  background: linear-gradient(100deg, #fff 20%, #ff8a8a 55%, var(--accent) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead {
  margin-top: 26px; max-width: 620px; font-size: 18px; color: var(--muted); line-height: 1.65;
  animation: fade-up 0.7s ease .16s both;
}
.hero-cta { margin-top: 40px; display: flex; gap: 14px; flex-wrap: wrap; animation: fade-up 0.7s ease .24s both; }
.hero-note { margin-top: 18px; font-family: var(--mono); font-size: 12.5px; color: var(--muted-dim); animation: fade-up 0.7s ease .3s both; }

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

/* ---------- dashboard mockup ---------- */
.mockup-wrap { margin-top: 84px; }
.mockup {
  border-radius: 16px; border: 1px solid var(--border); background: var(--bg-alt);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.02) inset;
  overflow: hidden;
  transform: perspective(1400px) rotateX(2deg);
}
.mockup-titlebar {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); background: var(--card);
}
.tb-dot { width: 10px; height: 10px; border-radius: 50%; }
.mockup-titlebar span { margin-left: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.mockup-body { display: grid; grid-template-columns: 210px 1fr; min-height: 420px; }
.mockup-side { border-right: 1px solid var(--border); padding: 18px 12px; background: var(--bg-alt); }
.mockup-brand { font-family: var(--mono); font-weight: 700; font-size: 13px; padding: 6px 10px 20px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.mockup-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  font-size: 12.5px; color: var(--muted); margin-bottom: 3px;
}
.mockup-nav-item.active { background: var(--card-alt); color: var(--text); border-left: 2px solid var(--accent); }
.mockup-main { padding: 24px; }
.mockup-h { font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; margin-bottom: 18px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.stat-card .lbl { font-size: 10.5px; color: var(--muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: .5px; }
.stat-card .val { font-size: 20px; font-weight: 700; margin-top: 6px; font-family: var(--mono); }
.stat-card .val.g { color: var(--green); }
.stat-card .val.r { color: var(--accent); }
.log-panel { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; font-family: var(--mono); font-size: 12px; color: var(--muted); height: 190px; overflow: hidden; }
.log-line { margin-bottom: 7px; opacity: 0; animation: log-in 0.4s ease forwards; white-space: nowrap; }
.log-line .g { color: var(--green); } .log-line .y { color: var(--amber); } .log-line .r { color: var(--accent); } .log-line .m { color: #7dd3fc; }
.log-emoji { height: 15px; width: 15px; vertical-align: -3px; object-fit: contain; margin: 0 1px; }
@keyframes log-in { to { opacity: 1; } }

/* ---------- sections ---------- */
/* Scoped to the marketing page's body, not a bare `section` selector -
   dashboard.html's view panels are also <section> elements and don't want
   this vertical padding. */
body.marketing-body section { position: relative; padding: 120px 0; }
.section-tag {
  font-family: var(--mono); font-size: 12.5px; color: var(--accent); letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 14px; display: block;
}
.section-title { font-size: clamp(28px, 4vw, 42px); font-weight: 700; letter-spacing: -1px; max-width: 640px; }
.section-sub { margin-top: 16px; color: var(--muted); font-size: 16.5px; max-width: 560px; line-height: 1.65; }
.section-head { margin-bottom: 60px; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-head.center .section-title, .section-head.center .section-sub { margin-left: auto; margin-right: auto; }

/* opacity/transform are driven every frame by script.js's scroll-linked
   render loop, not a CSS transition - a transition here would fight the
   continuous per-frame updates and stutter instead of scrubbing smoothly. */
.reveal { opacity: 0; }
.mockup { opacity: 0; will-change: transform, opacity; }

/* ---------- feature grid ---------- */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
  position: relative; overflow: hidden;
}
.feat-card::before {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(240px circle at var(--mx,50%) var(--my,0%), rgba(255,59,59,0.09), transparent 70%);
}
.feat-card:hover::before { opacity: 1; }
.feat-card:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.feat-icon {
  width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--card-alt); border: 1px solid var(--border); font-size: 19px; margin-bottom: 18px;
}
.feat-card h3 { font-size: 16.5px; font-weight: 600; margin-bottom: 9px; }
.feat-card p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.tier-strip { display: flex; gap: 6px; margin-top: 14px; }
.tier-strip img { width: 20px; height: 20px; object-fit: contain; opacity: 0.9; transition: transform .15s ease; }
.tier-strip img:hover { transform: scale(1.25); opacity: 1; }

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; padding: 28px 22px 22px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  border: 1px solid rgba(255,59,59,0.3); background: rgba(255,59,59,0.08);
  width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.step h4 { font-size: 15px; margin-bottom: 8px; }
.step p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }

/* ---------- pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: stretch; }
.price-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 24px; display: flex; flex-direction: column; transition: border-color .25s, transform .25s;
}
.price-card:hover { transform: translateY(-3px); border-color: var(--border-hover); }
.price-card.featured {
  border-color: rgba(255,59,59,0.4);
  background: linear-gradient(180deg, rgba(255,59,59,0.06), var(--card) 60%);
  position: relative;
}
.price-badge {
  position: absolute; top: -12px; left: 24px; background: var(--accent); color: #fff;
  font-family: var(--mono); font-size: 10.5px; padding: 4px 10px; border-radius: 100px; letter-spacing: .5px;
}
.price-card .tier-name { font-family: var(--mono); font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.price-card .tier-price { font-size: 34px; font-weight: 700; margin: 12px 0 4px; }
.price-card .tier-price span { font-size: 14px; color: var(--muted); font-weight: 500; }
.price-card .tier-desc { font-size: 13.5px; color: var(--muted); margin-bottom: 22px; min-height: 36px; }
.price-list { list-style: none; margin-bottom: 26px; flex: 1; }
.price-list li { font-size: 13.5px; color: var(--text); padding: 7px 0; display: flex; gap: 9px; align-items: flex-start; border-top: 1px solid var(--border); }
.price-list li:first-child { border-top: none; }
.price-list li .ck { color: var(--green); flex-shrink: 0; }
.price-footnote { text-align: center; margin-top: 28px; font-size: 13px; color: var(--muted-dim); font-family: var(--mono); }

/* ---------- shop / marketplace ---------- */
.shop-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.shop-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 22px; text-align: center; transition: border-color .25s, transform .25s;
}
.shop-card:hover { transform: translateY(-3px); border-color: var(--border-hover); }
.shop-icon { width: 48px; height: 48px; object-fit: contain; margin-bottom: 14px; }
.shop-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.shop-sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.shop-prices { list-style: none; margin-top: 16px; }
.shop-prices li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 13px;
}
.shop-prices li:first-child { border-top: none; }
.shop-prices li > span:first-child { color: var(--muted); }
.shop-price { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-weight: 600; }
.shop-cta { text-align: center; margin-top: 34px; }
.shop-cta .hint { margin-top: 12px; }
.shop-card { cursor: pointer; }
.shop-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.shop-hint {
  display: block; font-size: 10.5px; font-family: var(--mono); color: var(--muted-dim);
  margin-top: 4px; opacity: 0; transition: opacity .2s ease;
}
.shop-card:hover .shop-hint { opacity: 1; }
@media (max-width: 980px) { .shop-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .shop-grid { grid-template-columns: 1fr; } }

/* ---------- shop item modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 6, 8, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; padding: 24px;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 34px 30px; max-width: 380px; width: 100%; text-align: center; position: relative;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,0.8);
  transform: translateY(14px) scale(0.97); transition: transform .2s ease;
}
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }
.modal-close {
  position: absolute; top: 14px; right: 14px; background: var(--card-alt); border: 1px solid var(--border);
  color: var(--muted); width: 30px; height: 30px; border-radius: 8px; font-size: 18px; line-height: 1;
  cursor: pointer; transition: color .2s, border-color .2s;
}
.modal-close:hover { color: var(--text); border-color: var(--border-hover); }
.modal-icon { width: 56px; height: 56px; object-fit: contain; margin-bottom: 16px; }
.modal-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.modal-box p { font-size: 14px; color: var(--muted); line-height: 1.65; }

/* ---------- CTA banner ---------- */
.cta-banner {
  border-radius: 22px; border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255,59,59,0.1), var(--card) 55%);
  padding: 64px 56px; text-align: center; position: relative; overflow: hidden;
}
.cta-banner::before {
  content: ''; position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,59,59,0.16), transparent 70%);
  top: -250px; left: 50%; transform: translateX(-50%);
}
.cta-banner h2 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 700; letter-spacing: -1px; position: relative; }
.cta-banner p { color: var(--muted); margin: 16px 0 32px; font-size: 16px; position: relative; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; position: relative; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); padding: 56px 0 34px; }
.footer-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; margin-bottom: 40px; }
.footer-brand p { color: var(--muted); font-size: 13.5px; margin-top: 12px; max-width: 260px; line-height: 1.6; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col h5 { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 13.5px; color: var(--text); opacity: 0.75; margin-bottom: 10px; transition: opacity .2s; }
.footer-col a:hover { opacity: 1; color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 26px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted-dim); font-family: var(--mono); flex-wrap: wrap; gap: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .price-grid { grid-template-columns: repeat(2, 1fr); }
  .mockup-body { grid-template-columns: 1fr; }
  .mockup-side { display: none; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; gap: 18px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(10, 10, 12, 0.97); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border); padding: 22px 28px;
  }
  .burger { display: flex; }
  .hero { padding: 150px 0 80px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .feat-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; }
  .cta-banner { padding: 44px 24px; }
}
