/* ==========================================================================
   hookmebysam base layer: type, focus, icons, utilities.
   Loads after the legacy sheets; uses only tokens from tokens.css.
   ========================================================================== */

html {
  font-family: var(--font-ui);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body {
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  background: var(--bg);
  color: var(--text);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
[hidden] { display: none !important; }

/* Keyboard focus: one consistent, always-visible ring. !important is deliberate:
   the legacy sheets contain dozens of `outline: none !important` rules. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus) !important;
  outline-offset: 2px !important;
}

/* ---- Icons (inline SVG sprite, see tools/build-sprite.js) ---- */
.i {
  width: 20px; height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 24px; height: 24px; }
.i-xl { width: 32px; height: 32px; }
.i-fill { fill: currentColor; }
.i-logo { stroke-width: 4.5; }       /* the logo symbol lives in a 64-unit viewBox */

/* ---- Brand ---- */
.brand { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--primary-text); text-decoration: none; }
.brand .i-logo { width: 28px; height: 28px; }
.brand-word {
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-word b { color: var(--primary-text); font-weight: 800; }

/* ---- Utilities ---- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.u-serif-accent { font-family: var(--font-serif); font-style: italic; font-weight: 500; letter-spacing: -0.01em; }
.u-muted { color: var(--text-3); }
.u-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Skeleton loading ---- */
.skeleton {
  background: linear-gradient(90deg, var(--surface-raised) 25%, var(--surface) 50%, var(--surface-raised) 75%);
  background-size: 200% 100%;
  animation: hm-shimmer 1.4s linear infinite;
  border-radius: var(--r-sm);
}
@keyframes hm-shimmer { to { background-position: -200% 0; } }

/* ---- Reduced motion: honour the OS setting everywhere ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Touch devices: 16px inputs so iOS Safari does not zoom the page on focus
   (pinch-zoom itself stays enabled for accessibility). */
@media (hover: none) and (pointer: coarse) {
  input, select, textarea { font-size: max(16px, 1em); }
}
