/* CloserBroker — global responsive overrides
   Breakpoints: 1024px (tablet), 760px (small tablet / landscape phone), 480px (phone portrait) */

/* Clip decorative aurora gradients that escape sections without overflow:hidden.
   We use clip on container elements instead of overflow:hidden on html/body —
   the latter breaks position:fixed on iOS Safari (mobile menu becomes mis-clipped). */
main, footer.cb-footer { overflow-x: clip; }
@supports not (overflow-x: clip) {
  main, footer.cb-footer { overflow-x: hidden; }
}

/* Show/hide content per viewport — used to swap long-desktop copy for short-mobile copy
   without duplicating whole sections. Default: mobile-only is hidden, desktop-only shown. */
.cb-mobile-only { display: none; }
@media (max-width: 760px) {
  .cb-mobile-only { display: inline; }
  .cb-mobile-only.cb-block { display: block; }
  .cb-desktop-only { display: none !important; }
}

/* ----- Tablet ----- */
@media (max-width: 1024px) {
  :root { --section-py: 96px; }
  .container, .container-narrow { padding: 0 24px; }
}

/* ----- Small tablet / landscape phone ----- */
@media (max-width: 760px) {
  :root { --section-py: 96px; }
  .container, .container-narrow { padding: 0 20px; }
  .btn-lg { padding: 14px 22px; font-size: 15px; }
  .h1 { font-size: clamp(32px, 9vw, 48px) !important; }
  .h2 { font-size: clamp(26px, 7vw, 40px) !important; }
  .h3 { font-size: clamp(20px, 5vw, 26px) !important; }

  /* Disable cursor spotlight on touch devices to save paint */
  body::after { display: none !important; }

  /* Hide the cursor-tracking spotlight body */
  body { --spot: 0 !important; }

  /* Reduce default scrollbar weight */
  ::-webkit-scrollbar { width: 6px; height: 6px; }
}

/* ----- Phone portrait ----- */
@media (max-width: 480px) {
  :root { --section-py: 80px; }
  .container, .container-narrow { padding: 0 16px; }
  body { font-size: 15px; }
  .btn { padding: 11px 18px; font-size: 14px; }
  .btn-lg { padding: 13px 20px; font-size: 14.5px; }
  .h1 { font-size: clamp(40px, 12vw, 54px) !important; line-height: 1.06; }
  /* Long single-word titles need a tighter ramp to avoid overflow */
  .h1.cb-hero-compact { font-size: clamp(28px, 8.5vw, 40px) !important; }
  .h2 { font-size: clamp(24px, 7vw, 32px) !important; line-height: 1.1; }
  .h3 { font-size: clamp(19px, 5.5vw, 24px) !important; }
  .cb-hero-sub { font-size: 15px !important; line-height: 1.55 !important; }
  .cb-hero-cta-row { margin-bottom: 40px !important; }
  .eyebrow {
    font-size: 9.5px;
    padding: 5px 10px;
    white-space: nowrap;
    letter-spacing: 0.06em;
  }
  .cb-cta-eyebrow {
    font-size: 8.5px !important;
    padding: 5px 9px !important;
    white-space: nowrap !important;
    letter-spacing: 0.02em;
    gap: 6px !important;
  }
}

/* ----- Nav burger menu (driven by JSX-set classes) -----
   The Nav component renders a `.cb-nav-burger-btn` and `.cb-nav-mobile-menu`.
   They are display:none on desktop and shown only on small screens. */
.cb-nav-burger-btn { display: none; }
.cb-nav-desktop-links { display: flex; }
.cb-nav-desktop-cta { display: inline-flex; }
.cb-nav-mobile-menu { display: none; }

@media (max-width: 760px) {
  .cb-nav-burger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
    position: relative;
    z-index: 2;
  }
  .cb-nav-burger-btn:hover { border-color: var(--fg); }
  .cb-nav-burger-btn svg { width: 18px; height: 18px; }
  .cb-nav-desktop-links { display: none !important; }
  .cb-nav-desktop-cta { display: none !important; }
  .cb-nav-mobile-menu {
    display: block;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 60;
    overflow-y: auto;
    padding: 80px 24px 32px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
  }
  .cb-nav-mobile-menu[data-open="true"] {
    opacity: 1;
    visibility: visible;
  }
  .cb-nav-mobile-menu .cb-mobile-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-soft);
  }
  .cb-nav-mobile-menu .cb-mobile-section:last-of-type { border-bottom: none; }
  .cb-nav-mobile-menu .cb-mobile-section-title {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--fg-faint);
    margin-bottom: 8px;
  }
  .cb-nav-mobile-menu a.cb-mobile-link,
  .cb-nav-mobile-menu button.cb-mobile-link {
    display: block;
    padding: 12px 4px;
    font-size: 17px;
    color: var(--fg);
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    cursor: pointer;
  }
  .cb-nav-mobile-menu a.cb-mobile-link:hover,
  .cb-nav-mobile-menu button.cb-mobile-link:hover { color: var(--fg-soft); }
  .cb-nav-mobile-menu .cb-mobile-accordion-trigger {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .cb-nav-mobile-menu .cb-mobile-accordion-trigger > svg {
    color: var(--fg-faint);
    flex-shrink: 0;
  }
  .cb-nav-mobile-menu .cb-mobile-accordion-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.25s ease;
  }
  .cb-nav-mobile-menu .cb-mobile-accordion-panel[data-open="true"] {
    grid-template-rows: 1fr;
  }
  .cb-nav-mobile-menu .cb-mobile-accordion-inner {
    overflow: hidden;
    min-height: 0;
  }
  .cb-nav-mobile-menu .cb-mobile-sublink {
    padding-left: 16px !important;
    font-size: 16px !important;
    color: var(--fg-soft) !important;
  }
  .cb-nav-mobile-menu .cb-mobile-cta {
    margin-top: 24px;
    width: 100%;
    justify-content: center;
  }
  /* Lock body scroll when mobile menu is open */
  body.cb-nav-mobile-open { overflow: hidden; }
}

/* ----- Hero section overrides ----- */
@media (max-width: 760px) {
  /* Reduce the dashboard mockup wrapper margin */
  .cb-hero-mockup { margin-top: 40px !important; }
}

/* ----- Marquee : reduce gap on mobile ----- */
@media (max-width: 760px) {
  .marquee { gap: 36px !important; }
}
