/* Small screens keep the blue glass material without continuous shader work. */
@media (max-width: 760px), (pointer: coarse) {
  body[data-page="home"] #hero-canvas { display: none; }
  body[data-page="home"] #hero::before {
    content: ""; position: absolute; inset: -8%; pointer-events: none;
    background: repeating-radial-gradient(ellipse at -15% 125%, transparent 0 48px, rgb(64 137 248 / .28) 53px, transparent 66px 96px);
    animation: mobile-ridges 20s ease-in-out infinite;
  }
  .emblem-wrap { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .emblem svg { filter: none; }
  #nav, #nav.solid, #nav.scrolled, :root #tabbar {
    background: var(--glass-sheen), var(--glass-dense);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  :root .card, :root[data-theme="light"] .card, .panel, .controls-bar, .exp-pager a {
    background: var(--glass-sheen), var(--glass-dense);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  :root #sheet, #sheet-backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .formula-carousel .f { filter: none; transition: opacity .3s ease, transform .3s ease; }
  #app { view-transition-name: none; }
  .hero-content { animation: none; }
}
@keyframes mobile-ridges {
  0%, 100% { transform: translate3d(-2%, -1%, 0) scale(1.04); }
  50% { transform: translate3d(2%, 1%, 0) scale(1.06); }
}
@media (max-width: 760px), (max-width: 900px) and (max-height: 500px) {
  :root { --nav-h: 82px; --tabbar-h: calc(88px + env(safe-area-inset-bottom, 0px)); }
  html { scroll-padding-top: calc(96px + env(safe-area-inset-top, 0px)); }
  #app { padding-bottom: var(--tabbar-h); }
  body[data-page="home"] { height: auto; overflow-y: auto; overscroll-behavior-y: contain; }
  body[data-page="home"] #hero {
    height: auto; min-height: 100svh;
    padding: calc(92px + env(safe-area-inset-top, 0px)) 16px calc(108px + env(safe-area-inset-bottom, 0px));
  }
  body[data-page="home"] .hero-content { width: 100%; min-width: 0; padding: 0; animation: none; }
  .hero-title { font-size: clamp(38px, 11.2vw, 60px); }
  .hero-sub { max-width: 100%; font-size: 14px; letter-spacing: .12em; }
  .hero-eyebrow { font-size: 9px; letter-spacing: .18em; }
  .hero-actions { width: 100%; justify-content: center; flex-wrap: wrap; gap: 10px; }
  .hero-actions .btn { min-height: 46px; padding: 12px 18px; }
  .hero-entries { display: none; }
  .nav-seg, .nav-cta { display: none; }
  #tabbar { display: flex; }
  .icon-btn, .sheet-close { min-width: 44px; min-height: 44px; }
  #tabbar a { min-height: 50px; font-size: 11px; }
  .lab-main, .stage, .stage > *, .panel { min-width: 0; }
  .lab-strip { scroll-snap-type: x proximity; overscroll-behavior-inline: contain; }
  .lab-strip a { min-height: 44px; scroll-snap-align: center; }
  .chip, summary { min-height: 44px; }
  .math-input, .matrix-grid input, select, textarea { font-size: 16px; min-height: 44px; }
  .canvas-wrap { min-height: 260px; height: clamp(260px, 48svh, 420px); }
  #limits .canvas-wrap { min-height: 300px; }
  #sheet {
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top, 0px)));
    overflow-y: auto; overscroll-behavior-y: contain;
    padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .sheet-head { margin-bottom: 14px; }
  .sheet-head h3 { font-size: 20px; }
}
button, a, summary { touch-action: manipulation; }
button, .chip, .grabber, #tabbar a, .nav-seg a { user-select: none; -webkit-user-select: none; }
@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] #hero::before { animation: none; }
}
