/*
Theme Name: TopBox AI
Theme URI: https://topboxtool.com
Author: TopBox
Author URI: https://topboxtool.com
Description: A dark-futuristic AI tools WordPress theme with glassmorphism, an interactive neural network background, a custom cursor, parallax and scroll-reveal animations. Pure PHP + CSS + Vanilla JS (no React, no jQuery dependency).
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: topbox-ai
*/

/* =========================================================
   TOPBOX AI — DESIGN TOKENS
   All theme styles live under controlled selectors.
   ========================================================= */
:root {
  --tbt-bg: #0b0f19;
  --tbt-bg-soft: #0f1422;
  --tbt-surface: #161b28;
  --tbt-surface-2: #1c2333;
  --tbt-border: rgba(120, 140, 190, 0.16);
  --tbt-border-glow: rgba(56, 132, 255, 0.45);

  --tbt-text: #e7ecf5;
  --tbt-muted: #9aa6bf;
  --tbt-faint: #6b7488;

  --tbt-primary: #3b82f6;
  --tbt-primary-2: #8b5cf6;
  --tbt-cyan: #22d3ee;
  --tbt-grad: linear-gradient(120deg, #22d3ee 0%, #3b82f6 45%, #8b5cf6 100%);

  --tbt-radius: 14px;
  --tbt-radius-lg: 20px;
  --tbt-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.7);
  --tbt-glow: 0 0 40px -8px rgba(59, 130, 246, 0.5);

  --tbt-font-head: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --tbt-font-body: "Inter", system-ui, -apple-system, sans-serif;

  --tbt-maxw: 1180px;
}

/* =========================================================
   BASE (scoped to theme body class to avoid plugin clashes)
   ========================================================= */
body.topbox-ai {
  margin: 0;
  background-color: var(--tbt-bg);
  color: var(--tbt-text);
  font-family: var(--tbt-font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.topbox-ai h1,
body.topbox-ai h2,
body.topbox-ai h3,
body.topbox-ai h4 {
  font-family: var(--tbt-font-head);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
  color: var(--tbt-text);
}

body.topbox-ai a {
  color: var(--tbt-cyan);
  text-decoration: none;
  transition: color 0.2s ease;
}
body.topbox-ai a:hover { color: #7dd3fc; }

body.topbox-ai img { max-width: 100%; height: auto; }

.tbt-container {
  width: 100%;
  max-width: var(--tbt-maxw);
  margin-inline: auto;
  padding-inline: 22px;
}

.tbt-gradient-text {
  background: var(--tbt-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* =========================================================
   ANIMATED BACKGROUND LAYERS
   ========================================================= */
.tbt-bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.tbt-bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(99, 130, 200, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 130, 200, 0.05) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.tbt-bg-orb {
  position: fixed;
  z-index: 0;
  width: 540px;
  height: 540px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  pointer-events: none;
  will-change: transform;
}
.tbt-bg-orb.one { top: -160px; left: -120px; background: #3b82f6; }
.tbt-bg-orb.two { top: 30%; right: -180px; background: #8b5cf6; }

.topbox-ai .site-shell { position: relative; z-index: 1; }

/* =========================================================
   CUSTOM CURSOR
   ========================================================= */
.tbt-cursor-dot,
.tbt-cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}
.tbt-cursor-dot {
  width: 7px; height: 7px;
  background: var(--tbt-cyan);
}
.tbt-cursor-ring {
  width: 34px; height: 34px;
  border: 1.5px solid rgba(59, 130, 246, 0.6);
  transition: width 0.18s ease, height 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.tbt-cursor-ring.is-active {
  width: 54px; height: 54px;
  border-color: var(--tbt-primary-2);
  background: rgba(139, 92, 246, 0.08);
}
@media (hover: none), (pointer: coarse) {
  .tbt-cursor-dot, .tbt-cursor-ring { display: none; }
}

/* =========================================================
   HEADER / NAV
   ========================================================= */
.tbt-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(11, 15, 25, 0.72);
  border-bottom: 1px solid var(--tbt-border);
}
.tbt-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 70px;
}
.tbt-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--tbt-font-head);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--tbt-text);
}
.tbt-logo__mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--tbt-grad);
  display: grid;
  place-items: center;
  box-shadow: var(--tbt-glow);
}
.tbt-logo__mark span {
  width: 13px; height: 13px;
  border-radius: 4px;
  background: #0b0f19;
}
.tbt-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.tbt-nav ul {
  display: flex;
  gap: 26px;
  list-style: none;
  margin: 0; padding: 0;
}
.tbt-nav a {
  color: var(--tbt-muted);
  font-size: 15px;
  font-weight: 500;
}
.tbt-nav a:hover { color: var(--tbt-text); }

.tbt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 11px;
  border: 0;
  font-family: var(--tbt-font-head);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  color: #06121f;
  background: var(--tbt-grad);
  box-shadow: var(--tbt-glow);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  will-change: transform;
}
.tbt-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.tbt-btn--ghost {
  background: transparent;
  color: var(--tbt-text);
  border: 1px solid var(--tbt-border);
  box-shadow: none;
}
.tbt-btn--ghost:hover { border-color: var(--tbt-border-glow); }

.tbt-burger { display: none; background: none; border: 0; cursor: pointer; }
.tbt-burger span { display: block; width: 24px; height: 2px; background: var(--tbt-text); margin: 5px 0; transition: 0.25s; }

/* =========================================================
   HERO
   ========================================================= */
.tbt-hero {
  position: relative;
  padding: clamp(70px, 12vw, 140px) 0 clamp(60px, 9vw, 110px);
  text-align: center;
}
.tbt-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--tbt-border);
  background: rgba(34, 211, 238, 0.06);
  color: var(--tbt-muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 26px;
}
.tbt-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--tbt-cyan);
  box-shadow: 0 0 10px var(--tbt-cyan);
  animation: tbt-pulse 1.8s infinite;
}
@keyframes tbt-pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.tbt-hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  margin-bottom: 22px;
}
.tbt-hero p.lead {
  max-width: 640px;
  margin: 0 auto 34px;
  color: var(--tbt-muted);
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
}
.tbt-hero__cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.tbt-stats {
  display: flex;
  gap: 40px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 60px;
}
.tbt-stat__num {
  font-family: var(--tbt-font-head);
  font-size: 2rem;
  font-weight: 800;
}
.tbt-stat__label { color: var(--tbt-faint); font-size: 14px; }

/* =========================================================
   SECTIONS / CARDS
   ========================================================= */
.tbt-section { padding: clamp(56px, 9vw, 100px) 0; position: relative; }
.tbt-section__head { text-align: center; max-width: 680px; margin: 0 auto 54px; }
.tbt-section__head h2 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
.tbt-section__head p { color: var(--tbt-muted); font-size: 1.08rem; }

.tbt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 22px;
}
.tbt-card {
  position: relative;
  background: linear-gradient(180deg, var(--tbt-surface), var(--tbt-bg-soft));
  border: 1px solid var(--tbt-border);
  border-radius: var(--tbt-radius-lg);
  padding: 30px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(.2,.7,.2,1), border-color 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}
.tbt-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--tbt-grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tbt-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--tbt-shadow);
  border-color: transparent;
}
.tbt-card:hover::before { opacity: 1; }
.tbt-card__icon {
  width: 52px; height: 52px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid var(--tbt-border);
  margin-bottom: 18px;
  color: var(--tbt-cyan);
}
.tbt-card h3 { font-size: 1.3rem; margin-bottom: 8px; }
.tbt-card p { color: var(--tbt-muted); font-size: 0.97rem; margin: 0 0 18px; }
.tbt-card__link {
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* feature cards (no link) */
.tbt-feature .tbt-card__icon { background: rgba(139, 92, 246, 0.12); color: var(--tbt-primary-2); }

/* =========================================================
   CTA BANNER
   ========================================================= */
.tbt-cta-banner {
  position: relative;
  text-align: center;
  border-radius: var(--tbt-radius-lg);
  border: 1px solid var(--tbt-border);
  background: radial-gradient(ellipse 70% 120% at 50% 0%, rgba(59,130,246,0.16), transparent 70%), var(--tbt-surface);
  padding: clamp(40px, 7vw, 72px) 26px;
  overflow: hidden;
}
.tbt-cta-banner h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.tbt-cta-banner p { color: var(--tbt-muted); max-width: 520px; margin: 0 auto 28px; }

/* =========================================================
   FOOTER
   ========================================================= */
.tbt-footer {
  border-top: 1px solid var(--tbt-border);
  background: var(--tbt-bg-soft);
  padding: 56px 0 30px;
  position: relative;
  z-index: 1;
}
.tbt-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 36px;
}
.tbt-footer h4 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--tbt-faint); }
.tbt-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tbt-footer a { color: var(--tbt-muted); font-size: 0.95rem; }
.tbt-footer a:hover { color: var(--tbt-text); }
.tbt-footer__bottom {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--tbt-border);
  text-align: center;
  color: var(--tbt-faint);
  font-size: 0.88rem;
}

/* =========================================================
   ARTICLE / SINGLE / PAGE CONTENT
   ========================================================= */
.tbt-content {
  max-width: 760px;
  margin-inline: auto;
  padding: clamp(40px, 7vw, 80px) 0;
}
.tbt-content h1 { font-size: clamp(2rem, 5vw, 3rem); }
.tbt-content .tbt-meta { color: var(--tbt-faint); font-size: 0.9rem; margin-bottom: 30px; }
.tbt-content p { color: #c8d2e4; margin: 0 0 1.3em; }
.tbt-content h2, .tbt-content h3 { margin-top: 1.6em; }
.tbt-content blockquote {
  border-left: 3px solid var(--tbt-primary);
  margin: 1.6em 0;
  padding: 6px 0 6px 22px;
  color: var(--tbt-muted);
  font-style: italic;
}
.tbt-content img { border-radius: var(--tbt-radius); margin: 1.4em 0; }
.tbt-content ul, .tbt-content ol { color: #c8d2e4; padding-left: 1.3em; }

/* =========================================================
   SCROLL-REVEAL ANIMATION
   ========================================================= */
.tbt-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.7,.2,1);
}
.tbt-reveal.is-visible { opacity: 1; transform: none; }
.tbt-reveal[data-delay="1"] { transition-delay: 0.08s; }
.tbt-reveal[data-delay="2"] { transition-delay: 0.16s; }
.tbt-reveal[data-delay="3"] { transition-delay: 0.24s; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 860px) {
  .tbt-footer__grid { grid-template-columns: 1fr 1fr; }
  .tbt-nav { display: none; }
  .tbt-nav.is-open {
    display: flex;
    position: absolute;
    top: 70px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 14px 22px 22px;
    background: rgba(11,15,25,0.97);
    border-bottom: 1px solid var(--tbt-border);
  }
  .tbt-nav.is-open ul { flex-direction: column; gap: 4px; width: 100%; }
  .tbt-nav.is-open a { display: block; padding: 12px 0; width: 100%; }
  .tbt-burger { display: block; }
}
@media (max-width: 540px) {
  .tbt-footer__grid { grid-template-columns: 1fr; }
  .tbt-stats { gap: 26px; }
}

/* =========================================================
   ACCESSIBILITY — reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .tbt-reveal { opacity: 1; transform: none; transition: none; }
  .tbt-bg-orb, .tbt-badge .dot { animation: none; }
  .tbt-cursor-dot, .tbt-cursor-ring { display: none; }
}
