@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700;800&display=swap');

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

:root {
  --primary: #0f172a;
  --secondary: #1e293b;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --border: #334155;
  --bg-hover: #1e293b;
}

html {
  scroll-behavior: smooth;
}

html, body {
  overflow-x: hidden;
  overflow-y: auto !important;
  max-width: 100%;
  width: 100%;
}

body {
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #050d1a;
  background-image:
    url('circuit-board-bg.jpg'),
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: cover, 80px 80px, 80px 80px;
  background-position: center, -1px -1px, -1px -1px;
  background-attachment: fixed, fixed, fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.8s ease;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.55);
  pointer-events: none;
  z-index: -1;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION  —  desktop stays horizontal, mobile gets hamburger
   ═══════════════════════════════════════════════════════════════ */

nav {
  background: rgba(10, 22, 40, 0.98);
  backdrop-filter: blur(15px);
  border-bottom: 2px solid rgba(0, 212, 255, 0.3);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 8px 16px rgba(0,0,0,0.5), inset 0 1px 0 rgba(0,212,255,0.2);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #00d4ff;
  text-decoration: none;
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Desktop nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  flex-wrap: nowrap;
}

.nav-links li a {
  display: block;
  padding: 0.4rem 0.7rem;
  color: #e8f4f8;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
  position: relative;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  background: #00d4ff;
  transition: width 0.25s;
}

.nav-links li a:hover {
  background: rgba(0, 212, 255, 0.08);
  color: #00f0ff;
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
  width: 60%;
}

.nav-links li a.active {
  color: #00f0ff;
}

/* ── Hamburger button ──────────────────────────────────────── */
.hamburger {
  display: none;                 /* hidden on desktop */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: rgba(0, 212, 255, 0.07);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.2s;
}

.hamburger:hover {
  background: rgba(0, 212, 255, 0.15);
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #00d4ff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s, width 0.3s;
}

/* Animate to X when open */
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile: show hamburger, collapse nav links ─────────────── */
@media (max-width: 900px) {

  .hamburger {
    display: flex;
  }

  .nav-links {
    /* Hidden by default — slides down when .open is added */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(8, 18, 36, 0.99);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    z-index: 999;
  }

  .nav-links.open {
    max-height: 600px;
    padding: 0.5rem 0 1rem;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links li a {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    border-radius: 0;
    width: 100%;
    border-left: 3px solid transparent;
  }

  .nav-links li a:hover,
  .nav-links li a.active {
    background: rgba(0, 212, 255, 0.07);
    border-left-color: #00d4ff;
  }

  .nav-links li a::after {
    display: none;   /* no underline animation on mobile */
  }
}

/* ═══════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════ */
.hero {
  width: 100%;
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8rem 3rem 7rem;
  background: linear-gradient(rgba(5,12,25,0.65), rgba(5,12,25,0.82));
  backdrop-filter: blur(4px);
  position: relative;
  overflow: visible;
}

.hero::after {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0,212,255,0.12) 0%, rgba(0,150,255,0.06) 40%, transparent 70%);
  top: -80px;
  right: -100px;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}

.hero::before {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -80px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0,100,200,0.07) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.hero h1 {
  position: relative;
  z-index: 2;
  font-size: 3.8rem;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 800;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, #ffffff 0%, #7dd3fc 45%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.15;
  letter-spacing: -1px;
  max-width: 820px;
  padding: 0 1rem;
}

.hero-tagline {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.hero-trust-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.hero-trust-dot {
  width: 3px;
  height: 3px;
  background: #334155;
  border-radius: 50%;
}

.hero p {
  position: relative;
  z-index: 2;
  font-size: 1.15rem;
  color: #94a3b8;
  margin-bottom: 2.5rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.cta-buttons {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: rgba(255,255,255,0.06);
  color: #e2e8f0 !important;
  border: 1.5px solid rgba(255,255,255,0.22) !important;
  font-weight: 600;
  backdrop-filter: blur(8px);
  letter-spacing: 0.2px;
}

.btn-primary:hover {
  background: rgba(255,255,255,0.12) !important;
  color: #ffffff !important;
  border-color: rgba(255,255,255,0.45) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4) !important;
}

.btn-primary:active {
  background: rgba(255,255,255,0.18) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.hero .btn-free {
  border-color: rgba(81,207,102,0.5) !important;
  color: #86efac !important;
}
.hero .btn-free:hover {
  border-color: rgba(81,207,102,0.85) !important;
  background: rgba(81,207,102,0.1) !important;
  color: #bbf7d0 !important;
}

.hero .btn-embeddedc {
  border-color: rgba(245,158,11,0.5) !important;
  color: #fcd34d !important;
}
.hero .btn-embeddedc:hover {
  border-color: rgba(245,158,11,0.85) !important;
  background: rgba(245,158,11,0.1) !important;
  color: #fde68a !important;
}

.hero .btn-premium {
  border-color: rgba(0,212,255,0.5) !important;
  color: #7dd3fc !important;
}
.hero .btn-premium:hover {
  border-color: rgba(0,212,255,0.85) !important;
  background: rgba(0,212,255,0.1) !important;
  color: #bae6fd !important;
}

.btn-secondary {
  background: transparent;
  color: #00d4ff;
  border: 2px solid #00d4ff;
}
.btn-secondary:hover {
  background: rgba(0,212,255,0.1);
  color: #00f0ff;
  border-color: #00f0ff;
  box-shadow: 0 4px 12px rgba(0,212,255,0.3);
}

/* ═══════════════════════════════════════════════════════════════
   FEATURES
   ═══════════════════════════════════════════════════════════════ */
.features {
  max-width: 1200px;
  margin: 4rem auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: rgba(10,22,40,0.7);
  border: 1.5px solid rgba(0,212,255,0.3);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(0,212,255,0.3) 0%, rgba(0,150,255,0.15) 30%, transparent 70%);
  border-radius: 50%;
  transition: all 0.5s ease;
  filter: blur(20px);
}

.feature-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: rgba(0,212,255,0.6);
  box-shadow: 0 10px 30px rgba(0,212,255,0.25), 0 0 20px rgba(0,212,255,0.15);
}

.feature-card:hover::before {
  top: -25%;
  right: -25%;
}

.feature-card h3 {
  position: relative;
  z-index: 2;
  color: #00f0ff;
}

.feature-card p {
  position: relative;
  z-index: 2;
  color: #b3d9ff;
}

/* ═══════════════════════════════════════════════════════════════
   CONTAINER
   ═══════════════════════════════════════════════════════════════ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: auto;
  padding-left: 15px;
  padding-right: 15px;
  position: relative;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(59,130,246,0.05) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   PREMIUM
   ═══════════════════════════════════════════════════════════════ */
.premium-title {
  text-align: center;
  color: #00f0ff;
  margin-top: 60px;
  font-size: 28px;
}

.premium-box {
  max-width: 650px;
  margin: 30px auto;
  padding: 40px;
  background: rgba(10,22,40,0.75);
  border: 1px solid rgba(0,212,255,0.4);
  border-radius: 12px;
  text-align: center;
  backdrop-filter: blur(8px);
}

.premium-box p {
  font-size: 18px;
  color: #d6eaff;
  margin-bottom: 25px;
}

.premium-btn {
  background: linear-gradient(135deg, #00d4ff, #0099ff);
  color: white;
  padding: 14px 32px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
}

.premium-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,212,255,0.4);
}

/* ═══════════════════════════════════════════════════════════════
   PAGE TITLE
   ═══════════════════════════════════════════════════════════════ */
.page-title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
  color: #00f0ff;
  position: relative;
  padding-bottom: 1.5rem;
  text-shadow: 0 0 20px rgba(0,212,255,0.4);
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #00d4ff 50%, transparent 100%);
}

/* ═══════════════════════════════════════════════════════════════
   SEARCH
   ═══════════════════════════════════════════════════════════════ */
.search-box {
  margin-bottom: 2rem;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 1rem;
  background: rgba(30,41,59,0.8);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.search-box input::placeholder { color: var(--text-secondary); }

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* ═══════════════════════════════════════════════════════════════
   QUESTION CARDS
   ═══════════════════════════════════════════════════════════════ */
.question-card {
  background: rgba(10,22,40,0.6);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  backdrop-filter: blur(5px);
  animation: slideIn 0.5s ease forwards;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.question-card:nth-child(1) { animation-delay: 0.1s; }
.question-card:nth-child(2) { animation-delay: 0.2s; }
.question-card:nth-child(3) { animation-delay: 0.3s; }
.question-card:nth-child(4) { animation-delay: 0.4s; }
.question-card:nth-child(5) { animation-delay: 0.5s; }

.question-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #00d4ff 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.question-card:hover {
  border-color: rgba(0,212,255,0.5);
  background: rgba(10,22,40,0.85);
  box-shadow: 0 4px 12px rgba(0,212,255,0.2);
}

.question-card:hover::before { opacity: 1; }

.question-header {
  padding: 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background 0.3s ease;
}

.question-header:hover { background: rgba(59,130,246,0.05); }

.question-text {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
}

.toggle-icon {
  color: var(--accent);
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.question-card.active .toggle-icon { transform: rotate(180deg); }

.question-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.question-card.active .question-answer { max-height: 1000px; }

.answer-content {
  padding: 0 1.5rem 1.5rem;
  color: var(--text-secondary);
  background: rgba(15,23,42,0.3);
}

.answer-content p { margin-bottom: 1rem; }

.answer-content code {
  background: rgba(59,130,246,0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--accent-light);
  font-family: 'Courier New', monospace;
}

.answer-content pre {
  background: rgba(15,23,42,0.8);
  border-left: 3px solid var(--accent);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1rem 0;
}

.answer-content pre code {
  background: none;
  padding: 0;
  color: var(--accent-light);
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
footer {
  background: rgba(10,22,40,0.98);
  border-top: 2px solid rgba(0,212,255,0.3);
  padding: 2rem;
  margin-top: auto;
  text-align: center;
  color: #8fb3d9;
  width: 100%;
}

footer p {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: #00d4ff;
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 0.9rem;
}

.footer-links a:hover { color: #00f0ff; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE  —  tablet (≤ 900px handled by hamburger above)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  body { overflow-x: hidden; }

  .container {
    max-width: 100%;
    padding: 1.5rem;
    margin: 1rem auto;
  }

  .hero {
    padding: 2rem 1rem;
    min-height: 60vh;
  }

  .hero h1 { font-size: 1.8rem; }
  .hero p  { font-size: 1rem; }

  .cta-buttons {
    flex-direction: column;
    gap: 0.8rem;
  }

  .btn {
    width: 100%;
    padding: 0.6rem 1.5rem;
  }

  .features {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
    margin: 2rem auto;
  }

  .feature-card { padding: 1.5rem; }
  .feature-card h3 { font-size: 1.1rem; }

  .page-title { font-size: 1.8rem; }
  .search-box input { font-size: 14px; }
  .question-card { margin-bottom: 1rem; }

  footer { padding: 1.5rem; }
  footer p { font-size: 0.85rem; }
  .footer-links { gap: 1rem; }
  .footer-links a { font-size: 0.85rem; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 0 1rem; }
  .logo { font-size: 1rem; }

  .hero { padding: 1.5rem 1rem; min-height: 50vh; }
  .hero h1 { font-size: 1.4rem; }
  .hero p  { font-size: 0.9rem; }

  .cta-buttons { gap: 0.5rem; }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .container { padding: 1rem; }
  .page-title { font-size: 1.4rem; }
  .features { padding: 0.5rem; margin: 1rem auto; }

  footer { padding: 1rem; }
  footer p { font-size: 0.75rem; }
  .footer-links { gap: 0.5rem; flex-direction: column; }
  .footer-links a { font-size: 0.8rem; }

  .premium-box {
    max-width: 95%;
    padding: 1.5rem 1rem;
    margin: 20px auto;
  }

  .premium-box p { font-size: 0.95rem; margin-bottom: 1rem; }

  .premium-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    width: 100%;
  }

  .question-header { padding: 1rem; }
  .answer-content  { padding: 0 1rem 1rem; }
}

/* ════════════════════════════════════════════════════════
   GLOBAL CONSISTENCY FIXES  — applied site-wide
   ════════════════════════════════════════════════════════ */

/* Universal font sizing — no blurry/tiny text anywhere */
body {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Prevent backdrop-filter from blurring text on content sections */
.container, .question-card, .feature-card,
.answer-content, .premium-box, .search-box {
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Page titles — same size everywhere */
.page-title {
  font-size: 2.4rem !important;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 800;
  text-align: center;
  color: #00f0ff;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  text-shadow: 0 0 30px rgba(0,212,255,0.35);
  letter-spacing: -0.5px;
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00d4ff, transparent);
}

/* Question text — consistent size across all pages */
.question-text {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
}

/* Answer text — consistent */
.answer-content {
  font-size: 0.95rem;
  line-height: 1.75;
}

/* Free badge — standardize */
.free-badge {
  display: inline-block;
  background: rgba(81,207,102,0.15);
  border: 1px solid rgba(81,207,102,0.4);
  color: #51cf66;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 1.2rem;
}

/* Tab bars (used on device driver, c-programming) */
.tab-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(10,22,40,0.9);
  border-bottom: 1px solid rgba(0,212,255,0.2);
  position: sticky;
  top: 60px;
  z-index: 900;
  backdrop-filter: blur(10px);
}

.tab-btn {
  padding: 0.45rem 1.1rem;
  border: 1px solid rgba(0,212,255,0.25);
  background: transparent;
  color: #94a3b8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
}

.tab-btn.active, .tab-btn:hover {
  background: rgba(0,212,255,0.12);
  color: #00f0ff;
  border-color: rgba(0,212,255,0.5);
}

/* Fix hero background blur making text look blurry */
.hero {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Responsive page-title */
@media (max-width: 768px) {
  .page-title {
    font-size: 1.8rem !important;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.4rem !important;
    letter-spacing: 0;
  }
  body {
    font-size: 15px;
  }
}
