/* ================================================================== */
/*  Benzo Agent — responsive.css                                       */
/*  Clean, tested, complete. Overrides main.css for mobile.            */
/* ================================================================== */

/* ================================================================== */
/*  Nav — mobile toggle (button + label based, always works)           */
/* ================================================================== */

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Theme button icon sizing */
.theme-btn { position: relative; }
.theme-btn .theme-icon-sun,
.theme-btn .theme-icon-moon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
  transition: opacity .25s ease;
}
.theme-btn .theme-icon-sun  { opacity: 0; }
.theme-btn .theme-icon-moon { opacity: 1; }
html[data-theme="light"] .theme-btn .theme-icon-sun  { opacity: 1; }
html[data-theme="light"] .theme-btn .theme-icon-moon { opacity: 0; }
.theme-btn svg { display: block; width: 18px; height: 18px; }

/* ================================================================== */
/*  1024px — Tablet landscape                                          */
/* ================================================================== */
@media (max-width: 1024px) {
  .nav-inner { padding: 0 20px; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }
  .docs-layout { grid-template-columns: 200px 1fr; gap: 40px; padding: 32px 20px 100px; }
  .privacy-card { padding: 48px 36px; }
  .cta-card { padding: 64px 32px; }
}

/* ================================================================== */
/*  880px — Tablet / large phone                                       */
/* ================================================================== */
@media (max-width: 880px) {
  :root { --nav-h: 60px; }

  /* ---------- MENU ---------- */
  .nav-links {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px;
    margin: 0;
    background: var(--bg, #080a10);
    border-top: 1px solid var(--border, rgba(255,255,255,0.1));
    overflow-y: auto;
    z-index: 9999;
    box-sizing: border-box;
    list-style: none;
  }
  
  .nav-links a {
    display: block;
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text, #eef0f6);
    background: transparent;
    border-radius: 10px;
    text-decoration: none;
    box-sizing: border-box;
  }
  .nav-links a:hover,
  .nav-links a:focus,
  .nav-links a.active {
    background: var(--surface, rgba(255,255,255,0.06));
  }
  .nav-toggle { display: flex; }
  .nav-actions .btn.btn-primary { display: none; }
  .nav-name { font-size: 15px; }
  .nav-logo { width: 30px; height: 30px; }

  /* ---------- HERO ---------- */
  .hero { padding: calc(var(--nav-h) + 32px) 20px 60px; min-height: auto; }
  .hero-inner { margin-bottom: 48px; }
  .hero-logo-wrap { width: 96px; height: 96px; margin-bottom: 20px; }
  .hero-logo { width: 96px; height: 96px; border-radius: 22px; }
  .hero-logo-ring { inset: -8px; border-radius: 30px; }
  .hero-title { font-size: clamp(32px, 9vw, 52px); margin-bottom: 20px; }
  .hero-sub { font-size: 15px; margin-bottom: 28px; padding: 0 4px; }
  .hero-cta { gap: 10px; margin-bottom: 22px; }
  .hero-meta { gap: 8px 12px; font-size: 12px; }
  .scroll-hint { display: none; }
  .hero-badge { font-size: 12px; padding: 6px 12px; margin-bottom: 18px; }

  /* Hero window */
  .hero-window-body { grid-template-columns: 1fr; min-height: auto; }
  .hero-sidebar { display: none; }
  .hero-main { padding: 14px; }
  .hero-window-bar { height: 36px; padding: 0 12px; }
  .win-url { font-size: 10.5px; margin-left: 10px; }
  .hero-row { padding: 7px 14px; font-size: 11px; gap: 10px; }

  /* ---------- SECTIONS ---------- */
  .container { padding: 0 20px; }
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 40px; }
  .section-title { font-size: clamp(26px, 7vw, 40px); margin-bottom: 14px; }
  .section-sub { font-size: 15px; }
  .eyebrow { font-size: 11.5px; padding: 5px 12px; margin-bottom: 12px; }

  /* ---------- FEATURE / USECASE / STEP GRIDS ---------- */
  .feature-grid,
  .usecase-grid,
  .req-grid,
  .tech-grid,
  .try-grid,
  .feature-detail-grid,
  .stack-grid,
  .action-grid { grid-template-columns: 1fr; gap: 16px; }

  .feature-card,
  .usecase-card,
  .step-card,
  .req-card,
  .fd-card,
  .tech-card,
  .try-card { padding: 24px 20px; }

  .step-card { max-width: none; flex: none; }
  .steps-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .step-arrow { transform: rotate(90deg); align-self: center; font-size: 20px; opacity: .35; }

  /* ---------- TRUST ---------- */
  .trust { padding: 40px 0; }
  .trust-logos { gap: 16px 28px; }
  .trust-logo { font-size: 17px; }
  .trust-label { font-size: 12px; margin-bottom: 20px; }

  /* ---------- PRIVACY ---------- */
  .privacy-card { padding: 40px 24px; border-radius: 22px; }
  .privacy-stats { gap: 32px; }
  .privacy-stat { min-width: 80px; }
  .privacy-stat strong { font-size: clamp(28px, 7vw, 36px); }

  /* ---------- CTA ---------- */
  .cta-section { padding: 56px 0 80px; }
  .cta-card { padding: 48px 24px; }
  .cta-card > p { font-size: 15px; margin-bottom: 24px; }

  /* ---------- PAGE HEROS ---------- */
  .page-hero { padding: calc(var(--nav-h) + 40px) 0 48px; }
  .page-title { font-size: clamp(28px, 7vw, 46px); }
  .page-sub { font-size: 15px; }

  /* ---------- DOWNLOAD ---------- */
  .download-hero { padding: calc(var(--nav-h) + 32px) 0 40px; }
  .download-card { padding: 36px 20px; margin-top: 28px; border-radius: 22px; }
  .download-icon-wrap { width: 108px; height: 108px; margin-bottom: 20px; }
  .download-icon { width: 88px; height: 88px; border-radius: 20px; }
  .download-name { font-size: 24px; }
  .download-desc { font-size: 13.5px; margin-bottom: 24px; }
  .download-btn { padding: 15px 18px; }
  .download-meta { gap: 12px 18px; margin-top: 20px; }
  .dm-item { font-size: 12px; }

  /* ---------- INSTALL STEPS ---------- */
  .install-step { padding: 18px 16px; gap: 14px; }
  .step-marker { width: 36px; height: 36px; font-size: 15px; }
  .step-body h3 { font-size: 15.5px; }
  .step-body p { font-size: 13px; }

  /* ---------- DOCS ---------- */
  .docs-layout { grid-template-columns: 1fr; gap: 20px; padding: 20px 20px 64px; }
  .docs-sidebar {
    position: sticky;
    top: 60px;
    z-index: 10;
    background: var(--bg, #080a10);
    margin: 0 -20px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .docs-sidebar::-webkit-scrollbar { display: none; }
  .docs-nav { flex-direction: row; gap: 6px; width: max-content; }
  .docs-nav-link {
    white-space: nowrap;
    padding: 8px 14px;
    border-left: none;
    border-radius: 8px;
    font-size: 13px;
    background: var(--surface, rgba(255,255,255,0.04));
  }
  .docs-nav-link.active {
    padding-left: 14px;
    background: color-mix(in srgb, var(--accent-2, #f43f5e) 12%, transparent);
  }

  /* ---------- TIMELINE ---------- */
  .timeline { padding-left: 26px; gap: 22px; }
  .timeline-dot { left: -26px; top: 24px; width: 18px; height: 18px; }
  .timeline-item { padding: 20px; }
  .timeline-body h3 { font-size: 16px; }

  /* ---------- FOOTER ---------- */
  .footer { padding: 48px 0 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; margin-bottom: 28px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand p { max-width: none; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 20px; }

  /* ---------- ERROR ---------- */
  .error-code { font-size: clamp(80px, 20vw, 140px); }
  .error-title { font-size: clamp(20px, 5vw, 30px); }
  .error-actions { flex-direction: column; align-items: stretch; max-width: 280px; }

  /* ---------- CURSOR ---------- */
  .cursor-glow { display: none !important; }
}

/* ================================================================== */
/*  640px — Small phone                                                */
/* ================================================================== */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .nav-inner { padding: 0 14px; }
  .nav-name { font-size: 14px; }
  .nav-logo { width: 28px; height: 28px; }

  .hero { padding: calc(var(--nav-h) + 24px) 16px 48px; }
  .hero-inner { margin-bottom: 36px; }
  .hero-logo-wrap { width: 80px; height: 80px; margin-bottom: 16px; }
  .hero-logo { width: 80px; height: 80px; border-radius: 20px; }
  .hero-title { font-size: clamp(28px, 10vw, 44px); }
  .hero-sub { font-size: 14.5px; }

  .section { padding: 52px 0; }
  .section-head { margin-bottom: 32px; }

  .feature-card,
  .usecase-card,
  .step-card,
  .req-card,
  .fd-card,
  .tech-card,
  .try-card { padding: 20px 18px; }

  .step-num { font-size: 34px; }
  .fd-num { font-size: 34px; top: 16px; right: 18px; }

  .privacy-card { padding: 32px 20px; }
  .privacy-icon-ring { width: 60px; height: 60px; margin-bottom: 16px; }
  .privacy-card h2 { font-size: 22px; }
  .privacy-card > p { font-size: 14px; }

  .cta-card { padding: 40px 20px; }
  .cta-card h2 { font-size: 26px; }

  .download-card { padding: 28px 16px; }
  .download-icon-wrap { width: 96px; height: 96px; }
  .download-icon { width: 78px; height: 78px; border-radius: 18px; }

  .install-step { flex-direction: column; gap: 12px; padding: 16px; }
  .step-marker { width: 32px; height: 32px; font-size: 14px; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
}

/* ================================================================== */
/*  480px — Smallest phone                                             */
/* ================================================================== */
@media (max-width: 480px) {
  .container { padding: 0 14px; }

  .hero { padding: calc(var(--nav-h) + 20px) 14px 40px; }
  .hero-logo-wrap { width: 72px; height: 72px; }
  .hero-logo { width: 72px; height: 72px; border-radius: 18px; }
  .hero-title { font-size: clamp(26px, 11vw, 40px); }
  .hero-sub { font-size: 14px; }

  .hero-cta { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-cta .btn { width: 100%; }

  .hero-meta { flex-direction: column; gap: 4px; align-items: center; font-size: 12px; }
  .hero-meta .dot-sep { display: none; }

  .section { padding: 44px 0; }
  .section-title { font-size: clamp(24px, 8vw, 32px); }

  .cta-buttons,
  .error-actions { flex-direction: column; align-items: stretch; }
  .cta-buttons .btn,
  .error-actions .btn { width: 100%; }
}

/* ================================================================== */
/*  Landscape phones                                                   */
/* ================================================================== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding-top: calc(var(--nav-h) + 20px); }
  .hero-logo-wrap { display: none; }
  .scroll-hint { display: none; }
}

/* ================================================================== */
/*  Reduced motion                                                     */
/* ================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}