@import url('./tokens.css');

* { box-sizing: border-box; }

html { scroll-behavior: auto; overscroll-behavior: none; height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

/* min-width: 0 overrides the flex item's default content-based minimum size — without it, a
   native <select>'s longest <option> text (e.g. long epoch/theme labels) can force main wider
   than the viewport and trigger page-level horizontal scroll, even though the select itself
   is styled to width:100% and would otherwise render fine. */
main { flex: 1 0 auto; min-width: 0; }

h1, h2, h3, p, figure { margin: 0; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

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

/* Always show the accent focus ring, never the browser-default one */
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 840px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 640px) {
  .container { padding-inline: var(--space-5); }
}

.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 (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;
  }
}
