/* =========================================================
   Phone friendliness. Loaded after styles.css, so these rules win.
   ========================================================= */
a, button, input, select, summary, label { touch-action: manipulation; }
html { -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { overflow-wrap: break-word; }
.wrap {
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.stage { touch-action: pan-y; }
.stage-ui { margin-top: 20px; }
.icon-btn, .dots button { flex: none; }
.dots { gap: 0; }
.stage-name { min-width: 0; flex: 1 1 auto; }
.toast { bottom: calc(22px + env(safe-area-inset-bottom)); }

.filter-toggle { display: none; gap: .5em; }
.filter-toggle svg { width: 18px; height: 18px; }
.fcount {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  background: var(--theme); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px;
  font-size: .75rem; font-weight: 800; line-height: 1;
}
.cart-bar { display: none; }
@keyframes barUp { from { transform: translateY(140%); } }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }

/* Touch screens have no hover: stop hover effects sticking after a tap. */
@media (hover: none) {
  .btn:hover { transform: none; box-shadow: 4px 4px 0 var(--shc); }
  .btn-sm:hover { box-shadow: 3px 3px 0 var(--shc); }
  .icon-btn:hover { transform: none; box-shadow: 3px 3px 0 var(--ink); background: var(--white); }
  .chip:hover { transform: none; box-shadow: none; }
  .card:hover { transform: none; box-shadow: 5px 5px 0 var(--ink); }
  .card:hover .card-media::before { transform: none; }
  .card:hover .card-media > svg { animation: none; }
  .brand-tile:hover { transform: none; box-shadow: 6px 6px 0 rgba(255, 246, 230, .28); }
  .brand-tile:hover .brand-tin { transform: none; }
  .brand-tile:hover .brand-go svg { transform: none; }
  .s-btn:hover { transform: none; box-shadow: 4px 4px 0 var(--ink); }
  .why-card:hover { transform: none; box-shadow: 5px 5px 0 var(--ink); }
  .why-card:hover svg { transform: none; }
  .q-opt:hover { transform: none; box-shadow: 3px 3px 0 var(--ink); background: var(--cream); }
  .facts li:hover { transform: none; }
  .dots button:hover::after { transform: none; }
  .qty button:hover { background: none; }
  .nav a:hover::after { transform: scaleX(0); }
  .logo:hover .logo-mark { transform: none; }
  .foot-nav a:hover { background-size: 0 2px; }
  .card:active, .brand-tile:active, .s-btn:active { transform: scale(.985); }
}

@media (max-width: 700px) {
  /* ----- hero: headline, tin, then the details ----- */
  .hero-grid { grid-template-columns: 1fr; gap: 14px; padding-block: 22px 28px; }
  .hero-copy { display: contents; }
  .eyebrow { order: 1; justify-self: start; font-size: .6875rem; }
  .hero h1 { order: 2; font-size: clamp(2.3rem, 10.5vw, 3rem); margin-top: 2px; }
  .stage-wrap { order: 3; }
  .lede { order: 4; margin-top: 0; }
  .hero-cta { order: 5; margin-top: 2px; }
  .facts { order: 6; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
  .facts li { min-width: 0; padding: 8px 10px; }
  .facts b { font-size: 1.6rem; }
  .facts span { font-size: .625rem; letter-spacing: .04em; }
  .stage { max-width: 310px; }
  .spin-badge { width: 78px; right: -2%; }
  .badge-core { font-size: 1rem; }
  .fchip { font-size: .75rem; }
  .f3 { display: none; }
  .stage-ui { margin-top: 24px; }
  .pouch-field { opacity: .5; }

  /* ----- sections ----- */
  .section { padding-block: 52px; }
  .section h2 { font-size: clamp(1.9rem, 8.4vw, 2.5rem); }
  .section-head { margin-bottom: 22px; }
  .sub { font-size: 1rem; margin-top: 12px; }
  .kicker { margin-bottom: 14px; }

  /* ----- shop: two cards across, filters fold away ----- */
  .controls { gap: 10px; margin-bottom: 10px; }
  .search { flex: 1 1 100%; }
  .select { flex: 1 1 0; min-width: 0; }
  .select label { font-size: .875rem; white-space: nowrap; }
  .select select { flex: 1; width: 100%; min-width: 0; }
  .filter-toggle { display: inline-flex; flex: none; }
  .filters { display: none; padding: 10px 0 4px; }
  .filters.open { display: grid; animation: enter .3s both; }
  .chips { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; }

  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card { border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); }
  .card-media { aspect-ratio: 1 / .9; padding: 10px 8px 4px; }
  .card-media > svg, .card-media > img { width: 94%; }
  .tag-s { left: 8px; top: 8px; font-size: .6875rem; padding: 2px 8px; }
  .card-body { padding: 10px 12px 12px; gap: 3px; }
  .card-brand { font-size: .6875rem; }
  .card-title { font-size: 1.05rem; line-height: 1.08; }
  .card-meta { margin-top: 2px; }
  .card-meta .tag { display: none; }
  .pips i { width: 9px; height: 9px; }
  .card-buy { padding-top: 8px; gap: 6px; }
  .price { font-size: 1.15rem; }
  .price small { display: none; }
  .btn-sm { padding: .4em .95em; }

  /* ----- brand tiles: two across ----- */
  .brand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .brand-tile { min-height: 150px; padding: 14px; border-radius: 16px; box-shadow: 4px 4px 0 rgba(255, 246, 230, .28); }
  .brand-name { font-size: 1.35rem; }
  .brand-meta { font-size: .8125rem; max-width: 100%; }
  .bm-range, .brand-go { display: none; }
  .brand-tin { width: 58%; right: -10%; top: -4%; }

  /* ----- the rest ----- */
  .s-btn { padding: 12px 14px; }
  .quiz-card { padding: 18px; min-height: 0; }
  .why-card { padding: 20px; }
  .why-card svg { width: 52px; height: 52px; }
  .why-card h3 { font-size: 1.35rem; }
  summary { font-size: 1.05rem; padding: 10px 16px; }
  details p { padding: 0 16px 16px; }
  .site-footer { padding-top: 44px; }
  .foot-base { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }

  /* ----- phone basket bar ----- */
  .cart-bar {
    position: fixed; left: 12px; right: 12px; z-index: 70;
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 22px 0 10px;
    background: var(--ink); color: var(--cream); border: var(--bw) solid var(--cream); border-radius: 999px;
    box-shadow: 4px 4px 0 var(--theme); font-weight: 800; font-size: 1.0625rem;
    animation: barUp .45s var(--ease-pop);
  }
  .cart-bar:active { transform: scale(.98); }
  .cb-count { display: grid; place-items: center; min-width: 38px; height: 38px; border-radius: 50%; background: var(--theme); color: var(--ink); }
  .cb-label { flex: 1; text-align: left; }
  body.has-cartbar .site-footer { padding-bottom: 86px; }
  body.has-cartbar .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  body:has(dialog[open]) .cart-bar { display: none; }

  /* ----- dialogs become bottom sheets / full screen ----- */
  dialog.modal { width: 100vw; max-width: none; max-height: 94dvh; margin: auto 0 0; border-radius: 26px 26px 0 0; border-bottom: 0; box-shadow: none; }
  dialog.modal[open] { animation: sheetIn .4s cubic-bezier(.2, .9, .3, 1); }
  dialog.modal.closing { animation: sheetOut .22s ease forwards; }
  .drawer { width: 100vw; border-radius: 0; border: 0; }
  .drawer-foot { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .qv-art { min-height: 0; padding: 20px 56px 14px; }
  .qv-art svg, .qv-art img { width: 100%; }
  .qv-info { padding: 20px 18px calc(22px + env(safe-area-inset-bottom)); }
  .qv-buy .btn { flex: 1 1 100%; }
  .modal-head { padding: 16px 16px 0; }
  .demo-banner { margin: 10px 16px 0; }
  .co-grid { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
  .co-done { padding: 32px 20px calc(32px + env(safe-area-inset-bottom)); }
  .gate-in { padding: 84px 20px 24px; }
  .gate-art { top: -56px; height: 130px; }
}

/* very narrow phones */
@media (max-width: 380px) {
  .logo-mark { display: none; }
  .header-actions { gap: 8px; }
  .icon-btn { width: 44px; height: 44px; }
  .hero h1 { font-size: 2.1rem; }
  .card-title { font-size: .98rem; }
}

/* phones on their side: keep the age gate on screen */
@media (max-height: 560px) {
  .gate-art { display: none; }
  .gate-in { padding: 24px 20px; }
  dialog.gate { overflow: auto; max-height: calc(100dvh - 16px); }
}
