/* mobile.css — quick-fix overrides for the React prototype.
   Loaded AFTER styles.css to override inline-style-equivalent values.
   Will be deprecated when the rebuild ships. */

/* ===== Container padding tightens at small viewports ===== */
@media (max-width: 640px) {
  .container, .container-wide {
    padding: 0 20px !important;
  }
}

/* ===== Hero typography lower bounds ===== */
@media (max-width: 480px) {
  /* Hero <h1> ARIA wordmark — original clamp(72px, 11vw, 144px) */
  section#top h1.display {
    font-size: 64px !important;
    letter-spacing: -0.025em !important;
  }
  /* Hero tagline <h2> — original clamp(44px, 6.2vw, 84px) */
  section#top h2.display {
    font-size: 32px !important;
    line-height: 1.1 !important;
  }
  /* Hero body paragraph */
  section#top p {
    font-size: 16px !important;
  }
}

/* ===== Three-beat pills stack vertically (target via flexible attribute selector) ===== */
@media (max-width: 640px) {
  /* The flex row of "AI captures → human promotes → trusted acts".
     Inline style includes "flex-wrap: wrap" — we override to column. */
  section#top div.fade-up[style*="flex-wrap"][style*="999"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
}

/* ===== Section heads: stack 140px column above content ===== */
@media (max-width: 768px) {
  .section-head {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .section-title {
    font-size: clamp(28px, 8vw, 44px) !important;
  }
}

/* ===== Hero terminal: prevent overflow ===== */
@media (max-width: 768px) {
  .terminal {
    font-size: 11px !important;
    padding: 14px 16px !important;
    overflow-x: auto !important;
  }
}

/* ===== CTA stacks ===== */
@media (max-width: 480px) {
  /* Hero CTA buttons take full width */
  section#top a.btn-grad,
  section#top a.btn-ghost {
    width: 100%;
    justify-content: center;
  }
}

/* ===== Aurora performance trim on small viewports ===== */
@media (max-width: 640px) {
  .aurora .blob {
    filter: blur(40px) !important;
    opacity: 0.2 !important;
  }
}

/* ===== Top nav: hide desktop links + CTAs, show hamburger ===== */
@media (max-width: 768px) {
  /* Hide the desktop nav links (the <nav> inside fixed <header>) */
  body > div#root header > div > nav {
    display: none !important;
  }
  /* Hide the desktop CTA row (last flex child of header's container) */
  body > div#root header > div > div:last-child {
    display: none !important;
  }
  /* Show hamburger trigger */
  #aria-mobile-trigger {
    display: flex !important;
  }
}

/* Hamburger hidden on desktop by default */
#aria-mobile-trigger {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 110;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(11, 10, 20, 0.18);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #0B0A14;
  cursor: pointer;
}

/* Mobile menu panel styling */
#aria-mobile-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(11, 10, 20, 0.96);
  color: #FAFAF7;
  display: none;
  flex-direction: column;
  padding: 80px 32px 40px;
  gap: 8px;
}
#aria-mobile-panel.open {
  display: flex;
}
#aria-mobile-panel a {
  font-family: "Newsreader", "Times New Roman", serif;
  font-size: 28px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: inherit;
  text-decoration: none;
}
#aria-mobile-panel a:last-child {
  border-bottom: none;
}
#aria-mobile-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 32px;
  background: none;
  border: none;
  color: #FAFAF7;
  cursor: pointer;
  line-height: 1;
}


/* ============================================================
   Stack inline-style grids on mobile (≤768px).
   Targets the React prototype's inline gridTemplateColumns patterns:
   - features.jsx: repeat(12, 1fr) — 7-benefit grid
   - trust-and-commands.jsx: repeat(12, 1fr), repeat(3, 1fr) — trust layer + commands
   - closing.jsx: 320px 1fr (Easy to adopt), 1fr 1fr, 1.2fr 1.4fr 1.6fr (compare),
     repeat(3, 1fr) (knowledge types)
   - lifecycle.jsx: repeat(5, 1fr), 2fr 1fr, minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr)

   Exclusions: small icon-column patterns (60px / 52px / 128px wide)
   stay 2-col because they're per-card layouts that work fine on mobile.
   ============================================================ */
@media (max-width: 768px) {
  div[style*="grid-template-columns"]:not([style*="60px 1fr"]):not([style*="52px 1fr"]):not([style*="128px 1fr"]) {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    align-items: start !important;
  }
}

/* Children of inline-styled grids: reset their span on mobile so the parent's
   single-column constraint actually holds (CSS Grid otherwise creates implicit
   columns to satisfy span-N values, which defeats stacking).
   Targets FeatureCards (span 3/6), TrustLayer cards, lifecycle stage cards, etc. */
@media (max-width: 768px) {
  div[style*="grid-template-columns"] > div[style*="grid-column"] {
    grid-column: 1 / -1 !important;
  }
}

/* ============================================================
   Compare Matrix (closing.jsx CompareMatrix) — mobile rendering.

   The matrix is a 5-column axis-by-tool grid on desktop. The global
   mobile-collapse rule above collapses it to 1 column at ≤768px, which
   is the right default. Two tweaks make the stacked version readable:
   1. Hide the column-header row — it's just a list of useless labels
      once columns are stacked.
   2. Prefix each value cell with its tool name via data-label/::before,
      so readers can tell which tool a given value belongs to without
      the column header. ARIA cell suppresses the prefix because its
      higher-opacity styling already signals it as the "us" column.
   ============================================================ */
@media (max-width: 768px) {
  .compare-matrix-header {
    display: none !important;
  }
  .compare-matrix-row {
    padding: 20px 20px !important;
  }
  .compare-matrix-axis {
    margin-bottom: 4px;
  }
  .compare-matrix-cell {
    display: block !important;
  }
  .compare-matrix-cell[data-label]:not(.compare-matrix-cell-aria)::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(250, 250, 247, 0.35);
    margin-bottom: 4px;
  }
  /* Mark spacing: when cell flips from flex to block at mobile, the
     flex `gap` no longer applies — restore separation via margin-right. */
  .compare-matrix-mark {
    margin-right: 6px;
  }
}

/* Signup strip — identity + signup form stack vertically on narrow viewports.
   The row uses flex-wrap: wrap natively; this just constrains the email input
   so it doesn't overflow on small phones (<480px). */
@media (max-width: 640px) {
  .signup-strip-form {
    width: 100%;
  }
  .signup-strip-form input[type="email"] {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
  }
}
