/* Reset, type defaults and shared components. Colors and fonts come from tokens.css. */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--c-surface);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--c-ink);
  text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--c-blue); text-underline-offset: 0.18em; }

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

:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 3px; border-radius: 6px; }

.visually-hidden {
  position: absolute !important;
  /* Pinned: an unpositioned legend in a flex fieldset otherwise lands past the right edge and scrolls the page sideways. */
  top: 0; left: 0; margin: -1px;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 8px;
  background: var(--c-ink); color: #fff;
}
.skip:focus { top: 12px; }

.eyebrow {
  margin: 0 0 12px;
  font-size: var(--step-label);
  line-height: var(--lh-label);
  font-weight: var(--wt-label);
  letter-spacing: var(--tr-label);

  color: var(--c-muted);
}

.muted { color: var(--c-muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 44px;
  padding: 0.6em 1.15em;
  border-radius: 999px;
  border: 1px solid rgba(34, 34, 34, 0.18);
  background: var(--c-white);
  color: var(--c-ink);
  font-size: 15px; font-weight: 600; line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--c-ink); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn--primary { background: var(--c-blue); border-color: transparent; color: #FFFFFF; }
.btn--primary:hover { border-color: transparent; background: var(--c-blue-dark); }
.btn--highlight { background: var(--c-highlight); border: 3px solid rgba(0, 0, 0, 0.1); color: var(--c-ink); }
.btn--highlight:hover { border-color: rgba(0, 0, 0, 0.1); filter: brightness(0.96); }
.btn--sm { min-height: 36px; padding: 0.45em 0.9em; font-size: 14px; }
.btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

/* Copy chips */
.chip {
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.3em 0.6em;
  border: 0; border-radius: 6px;
  background: rgba(34, 34, 34, 0.07);
  color: var(--c-ink);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13px; line-height: 1.4;
  cursor: copy;
  text-align: left;
  white-space: nowrap;
  max-width: 100%;
  transition: background-color 0.2s, color 0.2s;
}
.chip:hover { background: rgba(34, 34, 34, 0.13); }
.chip.is-copied { background: var(--c-ink); color: #fff; }
.chip svg { width: 13px; height: 13px; opacity: 0.55; flex: none; }

/* Cards */
.card {
  background: var(--c-white);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Segmented radio controls */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.seg legend { width: 100%; margin-bottom: 8px; padding: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(34, 34, 34, 0.18);
  background: var(--c-white);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.seg input:checked + label { background: var(--c-ink); border-color: var(--c-ink); color: #fff; }
.seg input:focus-visible + label { outline: 2px solid var(--c-blue); outline-offset: 2px; }

/* Emphasis, as on crogoat.net: yellow text on blue, and a marker box on light. */
.hl-text { color: var(--c-highlight); }
.marker {
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  padding: 0.13em 0.2em 0.04em;
  border-radius: 6px;
  background: color-mix(in srgb, var(--c-highlight) 90%, transparent);
  color: var(--c-ink);
}
