/*
 * Phone polish, shared by every page. Loaded after each page's own styles so it wins ties.
 * Pairs with js/mobile.js (auto-hiding header, Ask button in the bottom bar, keyboard-aware chat).
 */
.dock .dock-ask { display: none; }

@media (max-width: 640px) {
  /* ---- Tap targets: at least ~44px to hit, without changing how anything looks ---- */
  .nav a, .brand, .c-hero .back, .chip a, .product-cap a { position: relative; }
  .nav a::after, .brand::after, .c-hero .back::after, .chip a::after, .product-cap a::after {
    content: ""; position: absolute; inset: -12px -8px;
  }
  .section-head > a { display: inline-flex; align-items: center; min-height: 44px; }
  .theme { width: 44px; height: 44px; }
  .ask-fab, .askline, .emailpill button { min-height: 44px; }
  .tabs button, .filters button, .sk-tabs button { min-height: 44px; }
  .cap .zoom { min-height: 40px; padding-inline: 14px; }
  .ask-sugg button { min-height: 42px; }

  /* ---- Small labels stay readable ---- */
  .hero .status, .status, .shelf, .pl, .est, .metrics b, .case b,
  .cover .shelf, .proof .pl, .sk-list .core b { font-size: 11.5px; }
  th { font-size: 12px; }

  /* ---- Header slides away while reading, comes back on the slightest scroll up ---- */
  .top { transition: transform .3s ease; will-change: transform; }
  .hdr-away .top { transform: translateY(calc(-100% - 16px)); }

  /* ---- One bottom bar: Email · LinkedIn · Resume · Ask (the floating Ask button hides while it shows) ---- */
  .dock { gap: 2px; padding: 5px; bottom: max(10px, env(safe-area-inset-bottom, 0px)); }
  .dock a, .dock button {
    flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap;
    padding: 14px 4px; font-size: 13.5px;
  }
  .dock .dock-ask {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    background: var(--accent); color: #fff; font-weight: 600;
  }
  .dock .dock-ask:hover { background: var(--accent); filter: brightness(1.08); }
  html:not(.dock-hide) .ask-fab { opacity: 0; pointer-events: none; transform: translateY(16px); }
  body { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

  /* ---- Chat opens as a bottom sheet and stays above the on-screen keyboard ---- */
  .ask {
    left: 0; right: 0; width: auto;
    bottom: var(--kb, 0px);
    height: min(88svh, calc(var(--vvh, 100svh) - 16px), 680px);
    border-radius: 22px 22px 0 0; border-bottom: 0;
  }
  .ask-head { padding-top: 18px; }
  .ask-form { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  .top { transition: none; }
}
