/* =========================================================
   TGA Craftworks — mobile & tablet refinements
   Loaded last on every page. Grouped by concern:
   1. browser chrome & touch basics   5. phone-landscape layouts
   2. visible-viewport stage heights  6. tablet-landscape (1024–1279)
   3. tap targets (coarse pointers)   7. comparison tables on phones
   4. readable small type             8. standards list fix
   ========================================================= */

/* ---------- 1. browser chrome & touch basics ---------- */
html { -webkit-tap-highlight-color: transparent; }
@media (pointer: coarse) {
  /* press feedback instead of hover */
  .pill:active, .nav__toggle:active, .nav__brand:active, .round-btn:active,
  .shades__btn:active, .chip span:active, .link-arrow:active { transform: scale(0.97); transition: transform 0.15s; }
  .menu__list a:active, .ft__col a:active, .cinfo__list a:active { opacity: 0.6; }
}
/* hover-only effects shouldn't "stick" after a tap on touchscreens */
@media (hover: none) {
  .incl__item:hover { background: var(--surface); color: inherit; border-radius: 22px; }
  .incl__item:hover img { filter: brightness(0) invert(0.86); }
  .pt__card:hover .pt__logo { border-radius: 24px; }
  .pt__card:hover .pt__logo img { transform: none; }
  .nav__toggle:hover .nav__icon { transform: none; }
  .nav__toggle:hover .nav__icon i:nth-child(2) { width: 8px; transform: translate(calc(-50% - 3px), calc(-50% + 3px)); }
  .nav.is-open .nav__toggle:hover .nav__icon i:nth-child(2) { width: 15px; transform: translate(-50%, -50%) rotate(-45deg); }
  .nav.is-open .nav__toggle:hover .nav__icon { transform: rotate(90deg); }
  .menu__list:hover a { opacity: 1; }
  a:hover .hr__a, button:hover .hr__a, [data-hover-reveal]:hover .hr__a { transform: none; }
  a:hover .hr__b, button:hover .hr__b, [data-hover-reveal]:hover .hr__b { transform: translateY(105%); }
}

/* ---------- 2. full-screen stages use the *visible* viewport ----------
   100vh on phones includes the area behind the browser toolbar, which hid
   bottom UI (HUD counter, CTAs). svh = the always-visible height. */
.mq__stage, .rs__stage, .ap__stage, .tour__stage, .about__stage, .ab-st__stage { height: 100vh; height: 100svh; }
.ab-cover__sticky, .ab-card, .menu { height: 100vh; height: 100svh; }
.menu { bottom: auto; }

/* ---------- 3. tap targets ≥ 44px on touch devices ---------- */
@media (pointer: coarse) {
  .link-arrow { min-height: 44px; }
  .round-btn { width: 2.75rem; height: 2.75rem; }
  .pill { padding: 0.95rem 1.6rem; }
  .chip span { padding: 0.8rem 1.15rem; }
  .ap__more { padding: 0.75rem 0; border-bottom: 0; }
  .ap__more .hr { border-bottom: 1px solid currentColor; }
  .cinfo__list a { display: inline-block; padding: 0.7rem 0; }
  .cinfo__list p a { padding: 0.7rem 0.15rem; }
  .menu__col a { padding: 0.45rem 0; }

  /* HUD step dots: big invisible hit area, same small visual dot */
  .hud__rail { gap: 0; transform: translateY(-50%); }
  .hud__dot { width: 2.75rem; height: 2.75rem; }
  .hud__rail-line, .hud__rail-fill { top: 1.375rem; height: calc(100% - 2.75rem); }

  /* footer: comfortable rows instead of tightly packed text links */
  .ft__col { gap: 0; }
  .ft__col .ft__k { margin-bottom: 0.35rem; }
  .ft__col a { display: block; padding: 0.82rem 0; }
  .ft__credit a { display: inline-block; padding: 0.85rem 0.1rem; margin: -0.85rem 0; }
  .ft__status { padding: 0.8rem 0; }
  .ft__bottom a[href="#top"] { display: inline-block; padding: 0.85rem 0; }
}

/* ---------- 4. readable small type on phones & tablets ---------- */
@media (max-width: 1023px) {
  .eyebrow, .ab-label, .ab-cover__sub, .hud__eyebrow, .hud__of, .mq__prompt,
  .ap__tags, .pt__card h3 span, .ba__tag, .ba-caps b, .shades__label,
  .shades__stat span, .cinfo__list span, .field label, .field legend,
  .ft__small, .menu__k, .tour__keys, .spec__cell:first-child, .intro__skip,
  .hero__meta p, .ap__more { font-size: 11.5px; }
  .incl__item small { font-size: 10.5px; }
  .ab-label { padding: 0.55rem 0.75rem; }
}

/* ---------- 5. phones held in landscape (short & wide) ----------
   Same side-by-side arrangements as desktop, sized for ~390px height. */
@media (orientation: landscape) and (max-height: 500px) {
  .hero__meta { display: none; }
  .hero__head { top: 24%; }
  .hero__title { font-size: clamp(2.25rem, 11vh, 3.5rem); }
  .hero__actions { flex-direction: row; gap: 1.25rem; }
  .hero__bottom { bottom: 0.9rem; }

  .rs__stage { padding: 4.25rem 0.75rem 0.75rem; }
  .rs__slide { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
  .rs__slide--right .rs__text { grid-column-start: 2; }
  .rs__swiper { top: 0; left: auto; right: 0; height: auto; width: calc(50% - 6px); border-radius: 22px; }
  .rs__text { padding: 1.1rem 1.25rem; border-radius: 22px; }
  .rs__h { font-size: min(4.6vw, 11vh); }
  .rs__copy { font-size: 0.75rem; }
  .rs__counter span { width: 2.4rem; height: 2.4rem; }

  .ap__texts { left: 66%; right: 3%; top: 17%; bottom: 5%; }
  .ap__text { gap: 0.6rem; }
  .ap__h { font-size: min(4vw, 9vh); }
  .ap__copy { font-size: 0.75rem; line-height: 1.4; }
  .ap__hero { padding: 1.25rem 1.5rem; }
  .ap__hh { font-size: min(9vw, 15vh); }

  .tour__ui { padding: 4.25rem 1.25rem 1rem; }
  .tour__h { font-size: min(12vw, 17vh); }
  .tour__bottom { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
  .tour__side { max-width: 22rem; }

  .hud__panel { padding: 3.5rem 1.25rem 0.9rem; }
  .hud__title { font-size: min(5vw, 10vh); }
  .hud__desc { display: none; }
  .hud__rail { top: 50%; }

  .about__phrase { top: 18%; }
  .ab-st__inner { padding-top: 3.5rem; gap: 1rem; }
  .ab-st__text { font-size: min(3.4vw, 7vh); }
  .ab-st__text--caps { font-size: min(4.6vw, 9vh); }
  .ab-card { padding: 4rem 0.75rem 0.75rem; }
  .ab-card__panel { flex-direction: row; gap: 1.25rem; }
  .ab-card__text { flex: 0 0 40%; justify-content: space-between; }
  .ab-card__h { order: 0; font-size: min(4vw, 9vh); }

  .menu__inner { padding-top: 4.25rem; }
  .menu__label { font-size: min(9vh, 7vw); }
  .menu__foot { display: none; }
}

/* ---------- 6. tablet landscape / small laptops (1024–1279) ----------
   The image docks narrower (see js dock()), so the text column gets room. */
@media (min-width: 1024px) and (max-width: 1279px) {
  .ap__texts { left: 67%; right: 3%; top: 14%; bottom: 14%; }
  .ap__h { font-size: 3vw; }
  .ap__copy { font-size: 0.8125rem; }
  .st__row { grid-template-columns: 8% 34% 1fr; }
}

/* ---------- 7. comparison tables on phones: stacked, no sideways scroll ----------
   Each row becomes: attribute label, then "product → value" pairs
   (product names come from the header row via data-col, set in main.js). */
@media (max-width: 639px) {
  .spec-scroll { overflow: visible; }
  .spec-scroll .spec { min-width: 0; }
  .spec__row--head { display: none; }
  .spec__row { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 0.35rem 0.75rem; padding: 1.05rem 0; align-items: start; }
  .spec__row .spec__cell:first-child { grid-column: 1 / -1; margin-bottom: 0.2rem; opacity: 1; color: var(--ink); }
  .spec__cell[data-col]::before {
    content: attr(data-col); display: block; margin-bottom: 0.3rem;
    font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
  }
  .spec__cell { font-size: 0.875rem; line-height: 1.35; }
}

/* ---------- 8. standards list ----------
   The decorative hover fill must never take a grid cell (on touch devices it
   did, which pushed the copy into a one-word-wide column). */
.st__row > .st__fill {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: var(--ink); border-radius: 14px; transform: scaleY(0); transform-origin: bottom;
  transition: transform 0.55s var(--ease);
}
@media (hover: none) { .st__row > .st__fill { display: none; } }
