/* =========================================================================
   MarketTech BluePrint — Shared design system
   Futuristic enterprise SaaS. Dark-first, light-aware. Cyan + violet glow.
   ========================================================================= */

/* ---------- Theme tokens ---------- */
:root,
[data-theme="dark"] {
  --bg:        #06070d;
  --bg-2:      #0b0c14;
  --elev:      #10121b;
  --card:      #14161f;
  --card-2:    #1c1f2c;
  --card-glass: rgba(20, 22, 31, 0.72);
  --border:        rgba(70, 76, 96, 0.45);
  --border-strong: rgba(90, 96, 118, 0.7);
  --text:    #e8eaf2;
  --text-2:  #c5c8d4;
  --muted:   #969aac;
  --faint:   #6b6f80;

  --cyan:      #22d3ee;
  --cyan-deep: #06b6d4;
  --cyan-ink:  #5fe6f7;   /* readable cyan as text */
  --violet:    #a855f7;
  --violet-ink:#c4a3ff;
  --indigo:    #818cf8;
  --emerald:   #34d399;
  --emerald-ink:#6ee7b7;
  --amber:     #fbbf24;
  --rose:      #fb7185;

  --grad: linear-gradient(135deg, #22d3ee 0%, #818cf8 48%, #a855f7 100%);
  --grad-soft: linear-gradient(135deg, rgba(34,211,238,0.16), rgba(168,85,247,0.16));

  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 18px 40px -22px rgba(0,0,0,0.9);
  --ring-cyan: 0 0 0 1px rgba(34,211,238,0.4), 0 0 22px rgba(34,211,238,0.22);

  --nav-bg: rgba(8, 9, 16, 0.72);
  --grid-line: rgba(120,140,255,0.05);
  --code-bg: rgba(6,7,13,0.7);

  color-scheme: dark;
}

[data-theme="light"] {
  --bg:        #f4f7fc;
  --bg-2:      #eef2f9;
  --elev:      #ffffff;
  --card:      #ffffff;
  --card-2:    #f2f6fc;
  --card-glass: rgba(255, 255, 255, 0.78);
  --border:        rgba(18, 38, 78, 0.12);
  --border-strong: rgba(18, 38, 78, 0.22);
  --text:    #0a1322;
  --text-2:  #2c3850;
  --muted:   #5a6884;
  --faint:   #8a96ad;

  --cyan:      #0891b2;
  --cyan-deep: #0e7490;
  --cyan-ink:  #0e7490;
  --violet:    #7c3aed;
  --violet-ink:#6d28d9;
  --indigo:    #4f46e5;
  --emerald:   #059669;
  --emerald-ink:#047857;
  --amber:     #b45309;
  --rose:      #e11d48;

  --grad: linear-gradient(135deg, #0891b2 0%, #4f46e5 48%, #7c3aed 100%);
  --grad-soft: linear-gradient(135deg, rgba(8,145,178,0.12), rgba(124,58,237,0.12));

  --shadow-card: 0 1px 0 rgba(255,255,255,0.8) inset, 0 18px 44px -26px rgba(20,40,90,0.45);
  --ring-cyan: 0 0 0 1px rgba(8,145,178,0.35), 0 6px 22px -8px rgba(8,145,178,0.4);

  --nav-bg: rgba(255, 255, 255, 0.8);
  --grid-line: rgba(40,70,140,0.06);
  --code-bg: rgba(14,30,60,0.04);

  color-scheme: light;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}
h1,h2,h3,h4 { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

::selection { background: rgba(34,211,238,0.3); color: #fff; }
[data-theme="light"] ::selection { background: rgba(8,145,178,0.22); color: #06121f; }

/* Scrollbar */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 3px solid transparent; background-clip: padding-box; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.wrap-tight { max-width: 920px; }
.section { padding: clamp(64px, 9vw, 132px) 0; position: relative; }
.center { text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--cyan-ink);
  padding: 6px 12px; border-radius: 999px;
  background: var(--grad-soft); border: 1px solid var(--border);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.section-title { font-size: clamp(28px, 4vw, 46px); margin-top: 20px; }
.section-sub { color: var(--muted); font-size: clamp(15px, 1.5vw, 18px); max-width: 620px; margin-top: 16px; line-height: 1.6; }
.center .section-sub { margin-left: auto; margin-right: auto; }
.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- Ambient backdrop ---------- */
.ambient {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(820px circle at 12% -4%, rgba(34,211,238,0.10), transparent 50%),
    radial-gradient(760px circle at 92% 8%, rgba(168,85,247,0.09), transparent 52%),
    radial-gradient(620px circle at 60% 100%, rgba(129,140,248,0.07), transparent 55%);
  animation: drift 20s ease-in-out infinite alternate;
}
[data-theme="light"] .ambient {
  background:
    radial-gradient(820px circle at 12% -4%, rgba(8,145,178,0.10), transparent 50%),
    radial-gradient(760px circle at 92% 8%, rgba(124,58,237,0.08), transparent 52%),
    radial-gradient(620px circle at 60% 100%, rgba(79,70,229,0.06), transparent 55%);
}
@keyframes drift { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(-26px,14px) scale(1.06); } }
.grid-tex {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 20%, transparent 80%);
}
.relative { position: relative; z-index: 1; }

/* ---------- Spotlight card ---------- */
.spot {
  position: relative;
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.spot::before {
  content: ''; position: absolute; inset: -1px; border-radius: 16px; padding: 1px;
  background: radial-gradient(380px circle at var(--mx,50%) var(--my,50%), rgba(34,211,238,0.5), rgba(34,211,238,0) 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none; opacity: 0; transition: opacity .3s ease;
}
.spot::after {
  content: ''; position: absolute; inset: 0; border-radius: 16px;
  background: radial-gradient(300px circle at var(--mx,50%) var(--my,50%), rgba(34,211,238,0.06), transparent 42%);
  pointer-events: none; opacity: 0; transition: opacity .3s ease;
}
.spot:hover::before, .spot:hover::after { opacity: 1; }
.spot:hover { transform: translateY(-3px); }
.spot-violet::before { background: radial-gradient(380px circle at var(--mx,50%) var(--my,50%), rgba(168,85,247,0.55), rgba(168,85,247,0) 42%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.spot-violet::after { background: radial-gradient(300px circle at var(--mx,50%) var(--my,50%), rgba(168,85,247,0.07), transparent 42%); }
[data-theme="light"] .spot::before { background: radial-gradient(380px circle at var(--mx,50%) var(--my,50%), rgba(8,145,178,0.5), rgba(8,145,178,0) 42%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
[data-theme="light"] .spot-violet::before { background: radial-gradient(380px circle at var(--mx,50%) var(--my,50%), rgba(124,58,237,0.45), rgba(124,58,237,0) 42%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }

.card-pad { padding: 28px; }
.card-pad-lg { padding: 36px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 600; font-size: 15px; border-radius: 11px; cursor: pointer;
  padding: 12px 22px; border: 1px solid transparent; transition: all .2s ease;
  font-family: 'Inter', sans-serif; white-space: nowrap; line-height: 1;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  color: #04121a; background: linear-gradient(180deg, #5fe6f7, #06b6d4);
  box-shadow: var(--ring-cyan);
}
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(34,211,238,0.65), 0 0 34px rgba(34,211,238,0.42); transform: translateY(-1px); }
[data-theme="light"] .btn-primary { color: #fff; background: linear-gradient(180deg, #0aa5c7, #0e7490); }
.btn-ghost { color: var(--text); background: var(--card-2); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan-ink); }
.btn-outline { color: var(--text-2); background: transparent; border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan-ink); }
.btn-sm { padding: 9px 16px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 15px 28px; font-size: 16px; }

/* Conic animated border CTA */
.conic { position: relative; isolation: isolate; border-radius: 13px; }
.conic::before {
  content: ''; position: absolute; inset: -2px; border-radius: 13px; z-index: -1;
  background: conic-gradient(from 0deg, var(--cyan), var(--indigo), var(--violet), var(--cyan));
  animation: spin 5s linear infinite; filter: blur(2px);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Chips / pills ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--border); color: var(--text-2);
  transition: all .2s ease;
}
.chip:hover { border-color: var(--cyan); color: var(--cyan-ink); }
.chip svg { width: 14px; height: 14px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 6px;
}
.badge-on { background: rgba(52,211,153,0.12); color: var(--emerald-ink); box-shadow: inset 0 0 0 1px rgba(52,211,153,0.3); }
.badge-live .d { width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }

/* ---------- Icon tile ---------- */
.itile {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--cyan);
}
.itile.violet { color: var(--violet); }
.itile svg { width: 22px; height: 22px; }
.itile-lg { width: 60px; height: 60px; border-radius: 15px; }
.itile-lg svg { width: 28px; height: 28px; }

/* ---------- Effects ---------- */
@keyframes blink { 50% { opacity: 0; } }
.caret::after { content: '_'; color: var(--cyan); margin-left: 2px; animation: blink .9s steps(1) infinite; }
@keyframes live-pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .4; transform: scale(.82);} }
.live-dot { animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes shimmer-slide { 0% { transform: translateX(-100%);} 100% { transform: translateX(220%);} }
.scanline { position: relative; overflow: hidden; }
.scanline::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(34,211,238,0.10), transparent); transform: translateX(-100%); animation: shimmer-slide 2.6s ease-in-out infinite; pointer-events: none; }

/* ---------- Scroll reveal (progressive: visible by default, JS adds .pre to hide) ---------- */
.reveal { transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
.reveal.pre { opacity: 0; transform: translateY(22px); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }
.reveal.d5 { transition-delay: .40s; } .reveal.d6 { transition-delay: .48s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; } }

/* ---------- Navbar ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: transparent; transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: var(--nav-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom-color: var(--border); }
.nav-inner { height: 72px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo { height: 46px; width: auto; flex-shrink: 0; display: block; }
.brand-logo--dark { display: none; }
[data-theme="dark"] .brand-logo--light { display: none; }
[data-theme="dark"] .brand-logo--dark { display: block; }
.brand-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand-name .bp { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 14px; font-weight: 500; color: var(--text-2); padding: 9px 15px; border-radius: 9px;
  position: relative; transition: color .2s ease, background .2s ease;
}
.nav-link:hover { color: var(--text); background: var(--card-2); }
.nav-link.active { color: var(--cyan-ink); }
.nav-link.active::after { content: ''; position: absolute; left: 15px; right: 15px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--card-2); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; transition: all .2s ease;
}
.icon-btn:hover { color: var(--cyan-ink); border-color: var(--cyan); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; } .theme-toggle .moon { display: block; }
[data-theme="light"] .theme-toggle .sun { display: block; } [data-theme="light"] .theme-toggle .moon { display: none; }
.hamburger { display: none; }

/* Mobile nav drawer */
.drawer {
  position: fixed; inset: 0; z-index: 200; background: var(--bg-2); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; padding: 24px 28px; transform: translateX(100%);
  transition: transform .35s cubic-bezier(.16,1,.3,1); visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer a.nav-link { font-size: 22px; font-family: 'Space Grotesk', sans-serif; padding: 16px 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.drawer a.nav-link.active::after { display: none; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); position: relative; z-index: 1; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding: 72px 0 48px; }
.footer h5 { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 18px; }
.footer-link { display: block; color: var(--muted); font-size: 14px; padding: 6px 0; transition: color .2s ease; }
.footer-link:hover { color: var(--cyan-ink); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.soc { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--card-2); border: 1px solid var(--border); color: var(--muted); transition: all .2s ease; }
.soc:hover { color: var(--cyan-ink); border-color: var(--cyan); transform: translateY(-2px); }
.soc svg { width: 17px; height: 17px; }

/* ---------- Stat / counter ---------- */
.stat-num { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: clamp(34px, 4.4vw, 52px); line-height: 1; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 8px; }
.delta { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--emerald-ink); }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 8px; }
.field .req { color: var(--cyan); }
.input, .select, .textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text);
  border-radius: 10px; padding: 12px 14px; font-size: 15px; font-family: 'Inter', sans-serif;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34,211,238,0.16); }
.textarea { resize: vertical; min-height: 120px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23969aac' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.field-err { border-color: var(--rose) !important; }
.err-msg { color: var(--rose); font-size: 12px; margin-top: 6px; display: none; }
.err-msg.show { display: block; }
.ok-note { display: none; }

/* ---------- Tabs ---------- */
.tabs { display: inline-flex; gap: 6px; padding: 5px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--border); flex-wrap: wrap; }
.tab { padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; border: none; background: transparent; transition: all .2s ease; font-family: 'Inter', sans-serif; }
.tab.active { color: var(--text); background: var(--grad-soft); box-shadow: inset 0 0 0 1px var(--border-strong); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade-up .4s cubic-bezier(.16,1,.3,1); }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: none; } }

/* ---------- Mock dashboard primitives ---------- */
.mock { background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.mock-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--card); }
.mock-dot { width: 10px; height: 10px; border-radius: 50%; }
.mock-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.mock-row:last-child { border-bottom: none; }
.bar-track { height: 8px; border-radius: 6px; background: var(--card-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--cyan), var(--indigo)); box-shadow: 0 0 12px rgba(34,211,238,0.4); transition: width 1.2s cubic-bezier(.16,1,.3,1); }
.json-key{color:var(--cyan-ink)} .json-str{color:var(--emerald-ink)} .json-num{color:var(--amber)}

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--border); border: none; margin: 0; }
.glow-line { height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: .5; }
.kicker-num { font-family: 'JetBrains Mono', monospace; color: var(--cyan-ink); font-size: 13px; }
.muted { color: var(--muted); } .text-2 { color: var(--text-2); }
.lead { font-size: clamp(17px, 1.8vw, 20px); color: var(--text-2); line-height: 1.65; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: inline-flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .hero-cta .btn { width: auto; }
}
