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

html {
  min-width: 320px;
  color-scheme: light;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--canvas);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

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

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

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

.lucide {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke-width: 2;
  vertical-align: middle;
}

.lucide-xs {
  width: 14px;
  height: 14px;
}

.lucide-sm {
  width: 16px;
  height: 16px;
}

.lucide-md {
  width: 20px;
  height: 20px;
}

.lucide-lg {
  width: 24px;
  height: 24px;
}

.lucide-xl {
  width: 32px;
  height: 32px;
}

.lucide-2xl {
  width: 48px;
  height: 48px;
}

a {
  color: var(--primary-dark);
  text-underline-offset: 3px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-block: 0;
  color: var(--text);
  font-family: var(--font-display);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

p {
  margin-block: 0;
}

.app-shell {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--canvas);
}

.container {
  width: min(100% - 48px, var(--container));
  min-width: 0;
  margin-inline: auto;
  padding-block: 28px 56px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2000;
  padding: 10px 14px;
  color: var(--white);
  background: var(--primary-dark);
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:where(a, button, input, select, textarea, [role="button"], [tabindex]):focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

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

@media (max-width: 768px) {
  .container {
    width: min(100% - 32px, var(--container));
    padding-block: 24px 40px;
  }
}

@media (max-width: 480px) {
  button {
    min-width: 44px;
  }

  button,
  input,
  select,
  textarea {
    min-width: 44px;
    min-height: 44px;
  }

  .container {
    width: min(100% - 24px, var(--container));
    padding-block: 20px 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}
