/* ═══════════════════════════════════════════════════════════════════════════
   UniLedger — Responsive layer
   Loaded LAST on every page. Every rule here is either:
     (a) a base rule that HIDES a mobile-only element (so desktop never sees it), or
     (b) inside an @media (max-width) query (so it can only affect small screens).
   Desktop rendering is therefore byte-for-byte unchanged. No UI drift.
   Breakpoints mirror the existing codebase: 900px primary, 600/700/480 finer.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Global safety nets ──────────────────────────────────────────────────── */
img, svg, video, canvas { max-width: 100%; }
/* (body already has overflow-x:hidden in styles.css) */

/* ───────────────────────────────────────────────────────────────────────────
   NAVIGATION — mobile drawer
   The hamburger and drawer are hidden on desktop by default (below), and only
   revealed at <= 900px. The desktop nav center/login are hidden at <= 900px.
   ─────────────────────────────────────────────────────────────────────────── */
.nav-burger {
  display: none;                       /* hidden on desktop */
  align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 9999px;
  color: #fff;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.nav-burger:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.28); }

.nav-drawer { display: none; }         /* hidden on desktop */

@media (max-width: 900px) {
  /* Hide the desktop center links + the desktop login link */
  .nav-center { display: none !important; }
  .nav-desktop-login { display: none !important; }
  /* Let the right zone hold just the CTA + hamburger */
  .nav-burger { display: inline-flex !important; }
  /* The grid no longer needs a centre track — keep logo left, actions right */
  .nav-shell { grid-template-columns: 1fr auto !important; }
}

/* On the smallest screens, drop the inline CTA (it lives in the drawer) */
@media (max-width: 420px) {
  .nav-cta { display: none !important; }
}

/* Drawer shell — full-viewport overlay, only mounted markup visible when .open */
@media (max-width: 900px) {
  .nav-drawer {
    display: block;
    position: fixed; inset: 0;
    z-index: 200;
    pointer-events: none;
  }
  .nav-drawer.open { pointer-events: auto; }

  .nav-drawer-scrim {
    position: absolute; inset: 0;
    background: rgba(6, 10, 18, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.32s var(--ease);
  }
  .nav-drawer.open .nav-drawer-scrim { opacity: 1; }

  .nav-drawer-panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(380px, 88vw);
    background: rgba(12, 18, 28, 0.96);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-left: 1px solid rgba(255,255,255,0.1);
    box-shadow: -30px 0 80px -30px rgba(0,0,0,0.7);
    color: #fff;
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.36s var(--ease);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-drawer.open .nav-drawer-panel { transform: translateX(0); }

  .nav-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky; top: 0;
    background: rgba(12, 18, 28, 0.96);
    z-index: 1;
  }
  .nav-drawer-close {
    width: 40px; height: 40px; border-radius: 9999px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    cursor: pointer; transition: background 0.18s var(--ease);
  }
  .nav-drawer-close:hover { background: rgba(255,255,255,0.14); }

  .nav-drawer-body { padding: 12px 14px 4px; flex: 1; }

  .nav-drawer-row {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%;
    padding: 16px 12px;
    font-size: 17px; font-weight: 500;
    letter-spacing: -0.01em;
    color: #fff; text-align: left;
    background: none; border: none;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    cursor: pointer;
  }
  .nav-drawer-sub {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s var(--ease);
  }
  .nav-drawer-group { padding: 8px 0 12px; }
  .nav-drawer-grouplabel {
    display: block;
    font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: rgba(255,255,255,0.42);
    padding: 10px 12px 6px;
  }
  .nav-drawer-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px;
    font-size: 15px; color: rgba(255,255,255,0.86);
    border-radius: 10px;
    transition: background 0.16s var(--ease), color 0.16s var(--ease);
  }
  .nav-drawer-link:hover { background: rgba(255,255,255,0.05); color: #fff; }

  .nav-drawer-foot {
    display: flex; flex-direction: column; gap: 10px;
    padding: 16px 18px calc(18px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255,255,255,0.08);
    position: sticky; bottom: 0;
    background: rgba(12, 18, 28, 0.96);
  }
}

/* ───────────────────────────────────────────────────────────────────────────
   HOMEPAGE SECTIONS (sections-1 / 2 / 3) — collapse multi-column layouts.
   These grids are set via inline styles, so we override with !important inside
   the media query only. Targets are classNames added in the JSX.
   ─────────────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  /* sections-1 — Problem timeline + Reframe */
  .prob-row   { grid-template-columns: 1fr !important; gap: 6px !important; padding: 24px 0 !important; }
  .prob-row > div:last-child { text-align: left !important; }
  .prob-line  { display: none !important; }
  .reframe-grid { grid-template-columns: 1fr !important; gap: 20px !important; }

  /* sections-2 — Solution, Offline, Objections, Product tour */
  .sol-head    { grid-template-columns: 1fr !important; gap: 20px !important; margin-bottom: 40px !important; }
  .sol-grid    { grid-template-columns: 1fr !important; }
  .offline-grid{ grid-template-columns: 1fr !important; gap: 48px !important; }
  .obj-grid    { grid-template-columns: 1fr !important; gap: 36px !important; }
  .obj-grid > div:first-child { position: static !important; top: auto !important; }
  .tour-grid   { grid-template-columns: 1fr !important; }

  /* sections-3 — Transformation, Value reframe, Footer */
  .trans-grid  { grid-template-columns: repeat(2, 1fr) !important; gap: 40px 24px !important; }
  .trans-rail  { display: none !important; }
  .value-grid  { grid-template-columns: 1fr !important; gap: 18px !important; }
  .value-vs    { padding: 4px 0 !important; }
  .footer-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 32px !important; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .trans-grid  { grid-template-columns: 1fr !important; }
  .footer-grid { grid-template-columns: 1fr !important; }
}

/* Hero dashboard mock — let it scroll horizontally instead of being squeezed,
   so the "screenshot" keeps its exact proportions on a phone. */
@media (max-width: 820px) {
  .hero-mock-wrap {
    justify-content: flex-start !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    /* full-bleed within the container so the scroll feels intentional */
    margin-left: -20px; margin-right: -20px;
    padding-left: 20px; padding-right: 20px;
  }
  .hero-mock-wrap > * { flex: 0 0 auto; min-width: 680px; }
}

/* Quiet-question section — trim the very tall vertical rhythm on phones */
@media (max-width: 700px) {
  #quiet-question { padding: 96px 0 120px !important; }
}

/* Reduce-motion safety already handled in styles.css */
