/* Shared marketing shell: a11y + mobile chrome. */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent, #1de9c6);
  color: #03110e;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

:where(a, button, summary, input, select, textarea, .btn, .drop, .mobnav a):focus {
  outline: none;
}

:where(a, button, summary, input, select, textarea, .btn, .drop, .mobnav a):focus-visible {
  outline: 2px solid var(--accent, #1de9c6);
  outline-offset: 3px;
}

@media (max-width: 860px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overscroll-behavior-x: none;
  }

  body {
    touch-action: pan-y pinch-zoom;
  }

  /* Clip only the page column — not html/body, or sticky/fixed chrome dies. */
  #page,
  .page-root {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  /* Notch is position:fixed (out of flow). Home hero pads itself. */
  #page:not([data-page="home"]) {
    padding-top: calc(env(safe-area-inset-top, 0px) + 36px);
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Wordmark + live ETH as a hanging cutout — no full-width black bar. */
  .mobtop {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 0;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 60;
    pointer-events: none;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    padding: env(safe-area-inset-top, 0px) 20px 0 !important;
    background: transparent !important;
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .mobtop .mobtop-brand {
    --notch: #000;
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 8px 20px 10px;
    border: none;
    border-radius: 0 0 16px 16px;
    background: var(--notch);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    position: relative;
    pointer-events: auto;
  }

  .mobtop .mobtop-brand::before,
  .mobtop .mobtop-brand::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: 12px;
    height: 12px;
    background: transparent;
    pointer-events: none;
  }

  .mobtop .mobtop-brand::before {
    left: -12px;
    border-bottom-right-radius: 12px;
    box-shadow: 4px 0 0 0 var(--notch);
  }

  .mobtop .mobtop-brand::after {
    right: -12px;
    border-bottom-left-radius: 12px;
    box-shadow: -4px 0 0 0 var(--notch);
  }

  .mobtop .brand {
    display: inline-flex;
    align-items: center;
    min-height: 0;
    padding: 0 !important;
    font-size: 1.12rem !important;
    line-height: 1.1;
    flex: none;
    text-decoration: none;
    pointer-events: auto;
    cursor: pointer;
  }

  /* Mobile site nav is a compact panel under the wordmark — not a burger or a full-width row. */
  .mobnav {
    display: none !important;
  }

  .mobtop-menu-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 168px;
    padding: 6px;
    border-radius: 12px;
    background: #0a1210;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    z-index: 80;
  }

  .mobtop-brand.is-open .mobtop-menu-panel {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .mobtop-menu-panel a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text, #eef7f4);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.02em;
  }

  .mobtop-menu-panel a:hover,
  .mobtop-menu-panel a:focus-visible {
    background: rgba(29, 233, 198, 0.12);
  }

  @media (prefers-reduced-motion: reduce) {
    .mobtop-menu-panel {
      box-shadow: none;
    }
  }

  .mobtop-eth {
    display: block !important;
    margin: 0 0 0 auto;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    line-height: 1.2;
    color: var(--muted-dim, #556e69);
    white-space: nowrap;
    text-align: right;
    pointer-events: auto;
  }

  .mobtop-eth .js-eth-price {
    color: var(--text, #eef7f4);
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .mobtop-eth .js-gas {
    color: var(--muted, #8aa19c);
    font-weight: 500;
  }

  /* Dashboard: tools sit inside the same notch pill as sign-in. The shared
     name lets the notch morph across a page swap instead of fading twice
     (marketing pages name theirs in marketing-shell.css). */
  .mobtop--tools {
    view-transition-name: mobtop;
  }

  .mobtop--tools .mobtop-brand {
    gap: 10px;
    padding: 8px 12px 10px;
    max-width: calc(100vw - 24px);
  }

  .mobtop--tools .mobtop-brand .brand {
    flex: 0 0 auto;
  }

  .mobtop--tools .mobtop-brand .mobtop-eth {
    margin: 0 0 0 auto;
    flex: 0 1 auto;
    min-width: 0;
  }

  .mobtop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    clip-path: none;
    aspect-ratio: auto;
    background: none !important;
    box-shadow: none !important;
    color: var(--muted-dim, #556e69);
    font: inherit;
    cursor: pointer;
    flex: 0 0 24px;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
  }

  .mobtop-btn svg {
    width: 15px;
    height: 15px;
    opacity: 0.72;
  }

  .mobtop-btn:hover,
  .mobtop-btn:focus-visible {
    color: var(--muted, #8aa19c);
    background: none !important;
    transform: none;
    box-shadow: none !important;
  }

  .mobtop-btn.is-slot-hidden {
    display: none;
    visibility: hidden;
    pointer-events: none;
  }

  .mobtop-btn.spinning svg {
    animation: mobtop-spin 0.8s linear infinite;
  }

  .mobtop-auth .mobtop-btn.spinning svg {
    animation: none !important;
  }

  @keyframes mobtop-spin {
    to {
      transform: rotate(360deg);
    }
  }

  .mobtop-auth {
    position: relative;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    display: block;
  }

  .mobtop-auth .mobtop-btn {
    position: absolute;
    top: 0;
    right: 0;
  }

  .page-root.dashboard-shell {
    padding-top: calc(env(safe-area-inset-top, 0px) + 36px);
  }
}
