/* Base element styles for the app shell: reset, typography, focus ring. */

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--body);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  color: var(--ink);
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h3 {
  font-size: 16px;
  line-height: 1.3;
}

p {
  margin: 0 0 var(--space-3);
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* One consistent keyboard focus ring for everything interactive. */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: var(--radius-sm);
}

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

/* Hides Alpine-controlled elements until Alpine has initialised them. */
[x-cloak] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Lets keyboard users jump past the sidebar; visible only while focused. */
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  transform: translateY(-200%);
}

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