/* Reset, body, typography, utilities */

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

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

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  overscroll-behavior: none;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

img,
svg {
  display: block;
}

picture {
  display: contents;
}

hr {
  border: 0;
  margin: 0;
}

/* Focus ring, everywhere */
:focus-visible {
  outline: 2px solid #1e6fff;
  outline-offset: 3px;
}

/* Keep clipped shapes from hiding their own focus ring */
a:focus-visible,
button:focus-visible {
  outline-offset: 3px;
}

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

/* Display type: Saira italic, wide */
.display {
  font-family: var(--font-display);
  font-style: italic;
  font-stretch: 125%;
  font-weight: 900;
  letter-spacing: -0.01em;
}

/* Small caps mono labels */
.label {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

/* Inner scroll areas: scroll on their own, hide the bar */
.scrolly {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.scrolly::-webkit-scrollbar {
  display: none;
}

/* Theme switch fades colors over .45s. theme.js adds the class for a moment. */
.theme-fading,
.theme-fading *,
.theme-fading *::before,
.theme-fading *::after {
  transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease,
    -webkit-text-stroke-color 0.45s ease, fill 0.45s ease, stroke 0.45s ease !important;
}

/* No transitions while the first frame settles */
.is-booting *,
.is-booting *::before,
.is-booting *::after {
  transition: none !important;
}

/* Shared tooltip, moved by js/tooltip.js */
.tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  padding: 7px 10px;
  background: var(--name);
  color: var(--bg);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.tooltip.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Inline brand icons (js/icons.js). Fill is set inline per icon. */
.ico {
  display: block;
  width: 100%;
  height: 100%;
}

.boot-error {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 24px;
  background: var(--bg);
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.08em;
  line-height: 1.7;
}
