/* ===== Neon — Modern phone & tablet responsive experience (loaded last) ===== */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
img, svg {
  max-width: 100%;
}
a, button, summary {
  -webkit-tap-highlight-color: transparent;
}

/* Menu: backdrop blur + scroll lock */
body.menu-open {
  overflow: hidden;
}
body.menu-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 760px) {
  .sidebar {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    width: min(310px, 86vw);
    background: rgba(10, 10, 10, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.7);
  }
  .topbar {
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(62px + env(safe-area-inset-top, 0px));
    background: rgba(5, 5, 5, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .menu-toggle {
    width: 42px !important;
    height: 42px !important;
    padding: 11px !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
  }
  .menu-toggle:active {
    transform: scale(0.95);
    background: rgba(255, 51, 68, 0.15) !important;
    border-color: rgba(255, 51, 68, 0.35) !important;
  }
  .top-invite {
    min-height: 40px !important;
    padding: 8px 14px !important;
    border-radius: 9px !important;
  }
  .to-top {
    right: 16px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(25, 25, 25, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  }
  .to-top:active {
    transform: scale(0.92);
  }
  .cursor-glow {
    display: none;
  }

  /* Nav items on phone */
  .nav-link {
    font-size: 13.5px;
    min-height: 44px;
    padding: 9px 12px;
    border-radius: 10px;
    margin: 2px 0;
  }
  .nav-link:active {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(0.98);
  }
  .nav-icon-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }
}

@media (max-width: 560px) {
  /* readable type: optimized for mobile screens */
  .eyebrow, .nav-heading, .stat span, .feature-count, .feature-footer, .policy-meta, .stage-caption, .footer {
    font-size: 10px;
    letter-spacing: 0.8px;
  }
  .welcome-copy > p, .legal-hero > p, .start-copy p, .nf p {
    font-size: 13.5px;
    line-height: 1.75;
    color: #b0b0b0;
  }
  .feature-card, .feature-card:last-child {
    min-height: 0;
    padding: 22px 20px 52px;
    border-radius: 16px;
  }
  .feature-card h3 {
    font-size: 17px;
    margin-top: 10px;
  }
  .feature-card > p {
    font-size: 12.5px;
    line-height: 1.75;
  }
  .start-steps > div {
    padding: 14px 16px;
    border-radius: 12px;
  }
  .start-steps > div p {
    font-size: 13px;
  }
  .policy-section h2, .policy-callout h2 {
    font-size: 15px;
  }
  .policy-section p, .policy-section li, .policy-callout p, .policy-end p {
    font-size: 12.5px !important;
    line-height: 1.8;
  }
  .policy-toc a {
    font-size: 11.5px !important;
    padding: 10px 10px !important;
  }
  .legal-hero h1 {
    font-size: 34px;
    letter-spacing: -1.2px;
  }
  .button {
    min-height: 48px;
    font-size: 13px;
    border-radius: 10px;
  }
  .button:active {
    transform: scale(0.97);
  }
  .welcome-actions {
    flex-wrap: wrap;
    gap: 10px;
  }
  .welcome-actions .button {
    flex: 1 1 140px;
    justify-content: center;
  }
  .footer nav a {
    padding: 8px 4px;
    font-size: 11.5px;
  }
  .now-playing small {
    font-size: 8px;
  }
  .now-playing strong {
    font-size: 11px;
  }
  .status-icon {
    width: 28px;
    height: 28px;
  }
  .visual-stage {
    min-height: 270px;
    border-radius: 16px;
  }

  /* stats / developer / bot / faq / 404 */
  .stats-strip {
    gap: 10px;
  }
  .stat strong {
    font-size: 26px;
  }
  .dev-card {
    margin-top: 22px;
    border-radius: 16px;
  }
  .dev-banner {
    height: 135px;
  }
  .dev-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-top: -46px;
    padding: 0 20px 22px;
  }
  .dev-avatar {
    --s: 96px;
  }
  .dev-id {
    min-width: 0;
    width: 100%;
  }
  .dev-id p {
    font-size: 12.5px;
  }
  .dev-actions {
    width: 100%;
    gap: 8px;
  }
  .dev-actions .button {
    flex: 1 1 100%;
    justify-content: center;
  }
  .dev-tile {
    padding: 16px;
    border-radius: 14px;
  }
  .dev-tile p {
    font-size: 12px;
  }
  .dev-tile a, .dev-tile button {
    font-size: 12px;
    padding: 8px 0;
  }
  .faq summary {
    padding: 16px;
    font-size: 14px;
  }
  .faq details p {
    font-size: 12px;
    padding: 0 16px 16px;
  }
  .dev-chip {
    padding: 14px 16px;
    border-radius: 14px;
  }
  .dev-chip small {
    font-size: 9px;
  }
  .dev-chip strong {
    font-size: 14px;
  }
  .nf-code {
    letter-spacing: -4px;
  }
  .dev-badge {
    font-size: 11px;
    padding: 4px 8px;
  }
  .dev-about p, .dev-since p {
    font-size: 12.5px;
  }
  .dev-about span, .dev-since span {
    font-size: 10px;
  }
}

@media (max-width: 360px) {
  .welcome h1 {
    font-size: 36px;
    letter-spacing: -1.6px;
  }
  .stats-strip {
    grid-template-columns: 1fr 1fr;
  }
  .stat {
    padding: 12px;
  }
  .topbar-actions .top-invite {
    font-size: 0;
  }
  .topbar-actions .top-invite .discord-mark, .topbar-actions .top-invite .arrow {
    font-size: 14px;
  }
}

@media (hover: none) {
  .feature-card:hover, .dev-tile:hover, .stat:hover, .dev-chip:hover {
    transform: none;
    translate: none;
  }
}
