/* ==========================================================================
   Kay's Toolbox — Website Design System (Dark Glassmorphic & Glowing Accents)
   ========================================================================== */

:root {
  --bg-dark: #080c14;
  --bg-surface: #0e1424;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.85);

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-purple: #a855f7;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.35);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  --shadow-glow: 0 0 35px rgba(99, 102, 241, 0.25);
  --shadow-card: 0 15px 30px -5px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
}

/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* ── Ambient Background Glows ───────────────────────────────────────────── */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.bg-glow-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #4f46e5 0%, transparent 70%);
  top: -150px;
  left: 10%;
}

.bg-glow-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  top: 30%;
  right: -100px;
}

.bg-glow-3 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #a855f7 0%, transparent 70%);
  bottom: 10%;
  left: 20%;
}

.bg-grid-pattern {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

/* ── Glassmorphism Common Class ─────────────────────────────────────────── */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 1;
}

/* ── Navigation Bar ──────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 16px;
  margin: 0 auto;
  max-width: 1200px;
  width: calc(100% - 32px);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  z-index: 100;
  transition: all 0.3s ease;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.logo-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.logo-box.small {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.brand-icon {
  width: 22px;
  height: 22px;
  color: #ffffff;
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
}

.brand-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--text-main);
}

.nav-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #4f46e5);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-large {
  padding: 14px 28px;
  font-size: 15px;
}

/* ── Hero Section ────────────────────────────────────────────────────────── */
.hero-section {
  position: relative;
  z-index: 1;
  padding: 80px 20px 60px;
  text-align: center;
}

.hero-container {
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
}

.hero-headline {
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, #a5b4fc, #06b6d4, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-muted);
  max-width: 740px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

/* ── Command Box ─────────────────────────────────────────────────────────── */
.command-box {
  max-width: 680px;
  margin: 0 auto 36px;
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: left;
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.2);
}

.command-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-subtle);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red    { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green  { background: #10b981; }

.terminal-title {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.copy-btn.copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.command-code {
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: #a5b4fc;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
}

.prompt-symbol {
  color: var(--accent-cyan);
  font-weight: bold;
  user-select: none;
}

.hero-cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.hero-meta-row {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}

/* ── Common Section Structure ───────────────────────────────────────────── */
.section-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 90px 20px;
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto;
}

/* ── Features Grid ──────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  padding: 32px 28px;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-glow);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), var(--shadow-glow);
}

.feature-icon-box {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.icon-indigo { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.icon-cyan   { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.icon-emerald{ background: rgba(16, 185, 129, 0.15); color: #34d399; }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.feature-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.feature-bullet-list {
  list-style: none;
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-bullet-list li::before {
  content: "▹";
  color: var(--accent-cyan);
  margin-right: 8px;
}

/* ── App Catalog Preview ────────────────────────────────────────────────── */
.category-pills-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.cat-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-pill:hover, .cat-pill.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
}

.apps-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.app-mini-card {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
}

.app-mini-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.app-mini-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.app-mini-info {
  flex: 1;
  min-width: 0;
}

.app-mini-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-mini-info span {
  font-size: 12px;
  color: var(--text-dim);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-tag {
  font-size: 11px;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
}

/* ── CLI Showcase ───────────────────────────────────────────────────────── */
.cli-showcase-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px;
}

.cli-pane-left h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.cli-pane-left p {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 24px;
}

.cli-features-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cli-feat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cli-feat-item strong code {
  color: #a5b4fc;
  font-family: var(--font-mono);
  font-size: 14px;
}

.cli-feat-item span {
  font-size: 13px;
  color: var(--text-dim);
}

.mock-terminal {
  background: #050811;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 100%;
}

.mock-term-header {
  background: #0d1222;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.mock-term-header span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.mock-term-title {
  width: auto !important;
  height: auto !important;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-left: 8px;
}

.mock-term-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: #e2e8f0;
  overflow-x: auto;
}

.term-dim   { color: #64748b; }
.term-cyan  { color: #22d3ee; }
.term-green { color: #34d399; }

/* ── Security Matrix ────────────────────────────────────────────────────── */
.security-matrix {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  padding: 40px;
  gap: 24px;
}

.sec-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sec-badge {
  font-size: 12px;
  font-weight: 700;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  align-self: flex-start;
}

.sec-col h3 {
  font-size: 18px;
  font-weight: 700;
}

.sec-col p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.sec-divider {
  width: 1px;
  height: 100px;
  background: var(--border-subtle);
}

/* ── FAQ Accordion ──────────────────────────────────────────────────────── */
.faq-accordion {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  overflow: hidden;
  transition: all 0.2s ease;
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}

.faq-icon {
  color: var(--text-dim);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), padding 0.35s ease;
  padding: 0 24px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  color: var(--accent-primary);
}

.faq-item.active .faq-answer {
  max-height: 250px;
  padding: 0 24px 20px;
}

/* ── CTA Banner ─────────────────────────────────────────────────────────── */
.cta-banner-section {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.cta-banner {
  padding: 60px 40px;
  text-align: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.1));
  border-color: rgba(99, 102, 241, 0.3);
}

.cta-content h2 {
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 800;
  margin-bottom: 12px;
}

.cta-content p {
  color: var(--text-muted);
  font-size: 17px;
  margin-bottom: 28px;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-subtle);
  background: #050811;
  padding: 60px 20px 40px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 12px;
}

.footer-desc {
  font-size: 14px;
  color: var(--text-dim);
  max-width: 320px;
  margin-bottom: 16px;
}

.footer-copy {
  font-size: 13px;
  color: #475569;
}

.footer-links-col h4 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-main);
  margin-bottom: 16px;
}

.footer-links-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links-col a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-links-col a:hover {
  color: var(--text-main);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cli-showcase-wrap {
    grid-template-columns: 1fr;
  }
  .security-matrix {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .sec-divider {
    display: none;
  }
  .footer-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .btn-nav-github span {
    display: none;
  }
}

/* ==========================================================================
   SITE PRELOADER STYLES
   ========================================================================== */
.site-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, transform 0.4s ease;
  user-select: none;
}

.site-preloader.fade-out {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.preloader-logo-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preloader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(99, 102, 241, 0.3);
  border-top-color: var(--accent-cyan);
  border-right-color: var(--accent-primary);
  animation: preloaderSpin 4s linear infinite;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

@keyframes preloaderSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.preloader-brand {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
}

.preloader-bar-track {
  width: 140px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.preloader-bar {
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
  border-radius: 999px;
  animation: preloaderSlide 1.2s infinite ease-in-out;
}

@keyframes preloaderSlide {
  0%   { transform: translateX(-100%); width: 25%; }
  50%  { width: 55%; }
  100% { transform: translateX(200%); width: 25%; }
}

