/*
 * ELEMENTS
 * ========
 * Document-level resets and bare-element defaults. Components opt out
 * only where they need to — most styling rides on these.
 *
 * Minimal cross-browser reset. Modern browsers diverge less than they
 * used to, so we no longer pull in normalize.css — these few rules
 * cover the bits that still drift (form-element fonts, button defaults).
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

body {
  margin: 0;
  padding: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--base-line-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-wrap: break-word;
}

table {
  width: 100%;
  margin-bottom: 1.5rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  text-align: right;
  padding: 8px 12px;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
}

th {
  text-align: left;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

tbody tr:nth-child(odd) {
  background: var(--color-surface);
}

footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin: 2.5rem 0 1.5rem;
}

ul {
  list-style: none;
  padding: 0;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

a {
  color: var(--color-blue-dark);
  text-decoration: none;

  &:hover,
  &:focus-visible {
    text-decoration: underline;
  }
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

img {
  max-width: 100%;
  height: auto;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 1.5rem 0;
}

/*
 * Reusable card shell — used by the section partials. Render targets
 * that haven't been populated yet (or are absent for this HAR pair,
 * e.g. no filmstrip data) collapse so the layout doesn't show empty
 * rectangles between filled sections.
 */
.card {
  background: var(--color-surface-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin: 0 0 18px 0;
}

.card:not(:has(*)) {
  display: none;
}

/* Visually-hidden but exposed to assistive tech. Used for the table
   <caption>, the skip-link target hint, and any heading/label that's
   meaningful for screen readers but visually redundant. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

/* Skip-to-content link — hidden offscreen until focused, then docks
   at the top of the viewport so keyboard users can bypass the BETA
   ribbon and header on every page load. */
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 200;
  padding: 8px 16px;
  background: var(--color-surface-card);
  color: var(--color-blue-dark);
  border: 1px solid var(--color-info-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: top var(--motion-fast);
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 12px;
  text-decoration: none;
}

/* Universal visible focus ring for keyboard users. Components that
   already define their own focus styling override this; the rule
   just guarantees nothing is silently un-focusable. */
:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Respect users who prefer reduced motion — disable hover translates,
   slider-thumb transitions, and any other animation. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

.card-title {
  /* Flex container so inline action chips (e.g. "Side by side" on
     the Waterfall card) sit at a sensible distance from the title
     text and align vertically to the middle — not the baseline of
     a smaller chip against a larger h3. */
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 12px 0;
  font-size: 1.125rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}
