/* BaosAI — phone layout (≤767px) */

@media (max-width: 767px) {
  :root {
    --nav-h: 58px;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
  }

  main {
    width: 100%;
    max-width: 100%;
  }

  #particles {
    display: none !important;
  }

  .ambient-glow .glow-b {
    display: none;
  }

  .ambient-glow .glow-a {
    width: 120vw;
    max-width: none;
    opacity: 0.22;
  }

  /* —— Nav —— */
  .nav {
    height: var(--nav-h);
    padding-left: max(0.85rem, env(safe-area-inset-left, 0));
    padding-right: max(0.85rem, env(safe-area-inset-right, 0));
    background: rgba(3, 3, 8, 0.92);
  }

  .nav-brand {
    gap: 0.5rem;
    min-width: 0;
  }

  .nav-brand .brand-logo {
    width: 30px;
    height: 30px;
  }

  .brand-word {
    font-size: 0.88rem;
  }

  .nav-cta {
    flex-shrink: 0;
    padding: 0.5rem 0.9rem;
    font-size: 0.72rem;
    min-height: 36px;
  }

  /* —— Hero: video before form —— */
  .hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-height: auto;
    padding-top: calc(var(--nav-h) + 0.65rem);
    padding-bottom: 1.25rem;
    padding-left: max(1rem, env(safe-area-inset-left, 0));
    padding-right: max(1rem, env(safe-area-inset-right, 0));
    text-align: center;
    box-sizing: border-box;
  }

  .hero-copy {
    display: contents;
  }

  .hero-eyebrow {
    order: 1;
    margin: 0 0 0.6rem;
    font-size: 0.625rem;
    letter-spacing: 0.14em;
    line-height: 1.35;
  }

  .hero-title {
    order: 2;
    margin: 0 0 0.55rem;
    font-size: clamp(1.55rem, 8.2vw, 2rem);
    line-height: 1.08;
    padding: 0 0.15rem;
  }

  .hero-title .line {
    display: block;
  }

  .hero-sub {
    order: 3;
    margin: 0 auto 0.85rem;
    max-width: 22rem;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0;
    text-wrap: pretty;
  }

  .hero-stage {
    order: 4;
    width: 100%;
    max-width: 100%;
    margin: 0 0 1rem;
    perspective: none;
  }

  .hero-video-section {
    width: 100%;
  }

  .hero-video-wrapper {
    max-width: 100%;
    border-radius: 14px;
    transform: none !important;
    opacity: 1 !important;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06) inset,
      0 16px 40px -18px rgba(0, 0, 0, 0.75);
  }

  .hero-video-section.is-visible .hero-video-wrapper {
    transform: none !important;
  }

  .hero-video.is-ready,
  .hero-video {
    opacity: 1;
  }

  .hero-platforms {
    order: 5;
    justify-content: center;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
  }

  .platform-pill {
    font-size: 0.625rem;
    padding: 0.3rem 0.6rem;
  }

  .hero-waitlist {
    order: 6;
    width: 100%;
    max-width: none;
    margin: 0 0 0.75rem;
    padding: 0.85rem 0.85rem 0.75rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
  }

  .hero-waitlist__row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .hero-waitlist input[type="email"] {
    width: 100%;
    min-height: 48px;
    border-radius: 10px;
  }

  .hero-waitlist__btn {
    width: 100%;
    min-height: 48px;
    border-radius: 10px;
    font-size: 0.9rem;
  }

  .hero-waitlist__note {
    font-size: 0.9375rem;
    margin-top: 0.45rem;
    line-height: 1.45;
    text-wrap: pretty;
    max-width: 20rem;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    order: 7;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .btn-hero {
    width: 100%;
    padding: 0.7rem 0.5rem;
    font-size: 0.875rem;
    min-height: 48px;
  }

  .hero-scroll-hint {
    display: none !important;
  }

  /* —— Features —— */
  .capabilities {
    padding: 2.25rem max(1rem, env(safe-area-inset-left, 0)) 2.5rem
      max(1rem, env(safe-area-inset-right, 0));
  }

  .section-head {
    margin-bottom: 1.25rem;
    padding: 0 0.25rem;
  }

  .section-head h2 {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
  }

  .section-head p {
    font-size: 1rem;
    line-height: 1.5;
    text-wrap: pretty;
  }

  .cap-carousel__track .cap-card {
    padding: 1.15rem 1rem;
    border-radius: 14px;
  }

  .cap-carousel__track .cap-card:hover {
    transform: none;
    box-shadow: none;
  }

  .cap-tag {
    display: inline-block;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7dd3fc;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.1);
  }

  .cap-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 0.65rem;
  }

  .cap-card h3 {
    font-size: 1.0625rem;
    margin-bottom: 0.4rem;
  }

  .cap-card p {
    font-size: 1rem;
    line-height: 1.5;
  }

  /* —— Footer —— */
  .footer {
    padding: 1.5rem max(1rem, env(safe-area-inset-left, 0))
      max(1.75rem, env(safe-area-inset-bottom, 0)) max(1rem, env(safe-area-inset-right, 0));
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
    gap: 0.25rem 1rem;
  }

  .footer-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    min-width: 48px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
  }

  .nav-cta {
    min-height: 48px;
    padding: 0.55rem 1rem;
    font-size: 0.8125rem;
  }

  [data-reveal] {
    transform: translateY(12px);
  }

  /* —— Waitlist card —— */
  .beta {
    padding-top: 2rem;
    padding-left: max(1rem, env(safe-area-inset-left, 0));
    padding-right: max(1rem, env(safe-area-inset-right, 0));
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom, 0));
  }

  #beta-inner.beta-inner {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.35rem 1rem 1.2rem;
    border-radius: 18px;
    box-sizing: border-box;
  }

  #beta-inner .brand-logo--beta {
    width: 52px;
    height: 52px;
    margin-bottom: 0.75rem;
  }

  #beta-inner .beta-eyebrow {
    font-size: 0.625rem;
    margin-bottom: 0.65rem;
  }

  #beta-inner h2 {
    font-size: 1.35rem;
    line-height: 1.2;
    margin-bottom: 0.45rem;
  }

  #beta-inner .beta-lead {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 0.35rem;
    text-wrap: pretty;
  }

  #beta-inner .beta-platform-note {
    font-size: 0.9375rem;
    line-height: 1.45;
    margin-bottom: 0.85rem;
    text-wrap: balance;
    max-width: 18rem;
    margin-left: auto;
    margin-right: auto;
  }

  #beta-inner .beta-form {
    margin-top: 0.85rem;
    padding: 1rem 0.85rem 0.85rem;
    border-radius: 14px;
  }

  #beta-inner .beta-form-title {
    font-size: 0.9375rem;
    margin-bottom: 0.65rem;
  }

  #beta-inner .beta-trust {
    font-size: 0.9375rem;
    margin: 0.5rem 0 0.85rem;
    line-height: 1.5;
    text-wrap: pretty;
  }

  #beta-inner .beta-form-row input[type="email"] {
    height: 48px;
    font-size: 16px;
    border-radius: 10px;
  }

  #beta-inner .btn-submit--full {
    width: 100%;
    min-height: 48px;
    font-size: 0.875rem;
    border-radius: 10px;
  }

  #beta-inner .beta-form-footnote {
    font-size: 0.875rem;
    line-height: 1.45;
  }

  #beta-inner .beta-form-footnote a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 0.35rem;
    margin: -0.5rem 0;
  }

  #beta-inner .beta-form-msg {
    font-size: 0.75rem;
    margin-top: 0.65rem;
  }

  #beta-inner .beta-social-row {
    margin-top: 1rem;
    gap: 0.5rem;
  }

  #beta-inner .beta-social-icon-link {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  #beta-inner .beta-form-title {
    font-size: 1rem;
  }

  #beta-inner .beta-form-msg {
    font-size: 0.9375rem;
  }
}

@media (max-width: 380px) {
  .hero-cta {
    grid-template-columns: 1fr;
  }

  .platform-pill--accent {
    width: 100%;
    justify-content: center;
  }

  .hero-title {
    font-size: 1.5rem;
  }
}
