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

/* Any explicit `display` on a component would otherwise beat the
   [hidden] attribute's UA `display:none`, which is how a hidden error
   chip can still paint. Hidden means hidden. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--nav-offset, 88px);
  scroll-behavior: smooth;
}

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

/* Slim custom scrollbar on page and any overflow region. Nav keeps
   its hidden scrollbar in layout.css. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}
*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border: 1px solid var(--scrollbar-track);
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-size-body);
  line-height: var(--text-lh-body);
  color: var(--ink);
  /* The grid paper runs the whole page, so it shows through the transparent
     header and behind every section, matching the app shells. Sections layer
     opaque cards on top; .tusome-desk adds only its corner glow. */
  background-color: var(--paper);
  background-image: var(--grid-lines);
  background-size: var(--grid-size) var(--grid-size);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0;
}

h1 {
  font-size: var(--text-size-hero);
  line-height: var(--text-lh-hero);
  letter-spacing: var(--text-ls-hero);
  text-transform: uppercase;
}

h2 {
  font-size: var(--text-size-h2);
  letter-spacing: var(--text-ls-h2);
  line-height: var(--text-lh-h2);
  text-transform: none;
  text-wrap: balance;
}

h3 {
  font-size: var(--text-size-h3);
  letter-spacing: var(--text-ls-h3);
  line-height: 1.22;
  text-wrap: balance;
}

p {
  margin: 0 0 var(--stack-block);
  max-width: var(--measure-prose);
  text-wrap: pretty;
}

/* Reading roles. Body is the default; lead is the one-paragraph
   introduction under a heading; micro is metadata that must never
   compete with either. */
.u-lead {
  font-size: var(--text-size-lead);
  line-height: var(--text-lh-lead);
  color: var(--ink-2);
  max-width: var(--measure-lead);
}
.u-micro {
  font-size: var(--text-size-micro);
  color: var(--ink-3);
}

strong, b { font-weight: var(--weight-strong); }

a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
  transition: background var(--snap);
}
a:hover { background: var(--blue-soft); }
a:active { color: var(--ink); }

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

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

button {
  font: inherit;
  color: inherit;
  border-radius: var(--radius);
}

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

::selection { background: var(--tape); color: var(--ink); }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--tape);
  color: var(--ink);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-size-label);
  text-transform: uppercase;
  border: var(--border);
}
.skip-link:focus {
  left: var(--space-3);
  top: var(--space-3);
}

/* The grid now lives on <body>. A desk section just adds the soft corner
   glow over it, so its own grid would only double the lines out of phase. */
.tusome-desk {
  position: relative;
}
.tusome-desk::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .06;
  pointer-events: none;
  background-image: radial-gradient(circle at 20% 30%, var(--ink-3) 0, transparent 45%),
    radial-gradient(circle at 80% 70%, var(--ink-3) 0, transparent 45%);
}
