/* ==========================================================================
   Mobile / tablet pass — loaded last so it wins over sd-theme.css base rules.
   sd-theme.css re-declares `.sd-nav { display:flex }` after sd-layout.css, so
   the 900px rule from sd-layout never applied at phone widths.
   ========================================================================== */

/* `clip` (not `hidden`) keeps `position: sticky` working on the header. */
html,
body {
  overflow-x: clip;
}

@media (max-width: 900px) {
  .sd-header {
    position: sticky;
    top: 0;
    z-index: 200;
  }

  .sd-header__inner {
    position: relative;
  }

  .sd-header .sd-brand {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    margin-right: auto;
  }

  .sd-burger {
    display: inline-flex;
  }

  .sd-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 90;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    flex: 0 0 auto;
    padding: 8px;
    border: 1px solid var(--c-white-12, rgba(255, 255, 255, 0.12));
    border-radius: 16px;
    background: #07090c;
    backdrop-filter: blur(34px) saturate(1.4);
    -webkit-backdrop-filter: blur(34px) saturate(1.4);
    box-shadow: 0 26px 60px -18px rgba(0, 0, 0, 0.95);
  }

  .sd-nav.is-open {
    display: flex;
  }

  .sd-nav__link {
    padding: 12px 14px;
    text-align: left;
  }

  .sd-nav__pill {
    display: none;
  }

  .sd-header__actions {
    margin-left: auto;
    flex: 0 0 auto;
  }

  .sd-section__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .sd-footer__inner {
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .sd-header {
    padding: 10px 12px;
  }

  .sd-header__inner {
    min-height: 0;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 16px;
  }

  .sd-header .sd-brand__text,
  .sd-is-compact .sd-header .sd-brand__text {
    display: none;
  }

  .sd-header__buy,
  .sd-balance {
    display: none;
  }

  .sd-account__name {
    display: none;
  }

  /* Hero: copy first, preview second on phones. */
  .sd-hm__hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-top: 24px;
  }

  .sd-hm__preview {
    order: 0;
    max-width: 100%;
  }

  .sd-hm__hero-title {
    font-size: clamp(34px, 11vw, 52px);
  }
}

@media (max-width: 420px) {
  .sd-header__inner {
    padding: 8px 10px;
  }

  .sd-nav {
    left: -4px;
    right: -4px;
  }
}
