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

.skip-link {
  position: absolute;
  top: -40px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--primary);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only:focus-visible {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.skip-link:focus-visible {
  top: 12px;
}

/* Low-specificity theme-switch fade. Any element with its own transition
   (buttons, tooltip, inputs, nav links, switch knob) keeps that instead —
   class selectors win over this universal rule, so nothing here is clobbered.
   This is the fallback for browsers without the View Transitions API below. */
*,
*::before,
*::after {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Dark-mode bubble reveal (see assets/js/nav.js toggleThemeWithTransition).
   The browser's default cross-fade is disabled so the only visible motion is the
   expanding circle clip-path animated on ::view-transition-new(root); the "old"
   snapshot just sits still underneath while the new one wipes in over it. */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

p {
  margin: 0;
}

a {
  color: var(--primary);
}

a,
button,
[role="button"],
input,
select,
textarea,
summary,
[tabindex] {
  -webkit-tap-highlight-color: transparent;
}

a,
button,
[role="button"],
summary {
  touch-action: manipulation;
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

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

button {
  font: inherit;
}

label {
  display: block;
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

input,
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(78, 121, 255, 0.18);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-blue);
}

.field {
  margin: 0 0 14px;
}

.field-row {
  display: grid;
  gap: 14px;
}

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

.text-faint {
  color: var(--text-faint);
}

::selection {
  background: rgba(78, 121, 255, 0.25);
}
