/* =====================================================================
   base.css - structure only, no taste.
   Everything in here exists so a variant cannot break the machinery:
   box model, scroll lock, modal positioning, focus visibility.
   COSMETICS BELONG TO THE VARIANT. If you find yourself adding a colour
   or a font here, you are in the wrong file. See AGENTS.md.
   ===================================================================== */

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

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--rb-boot-bg, #111);
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

img, picture, svg, video, canvas { max-width: 100%; display: block; }
img, video { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

#rb-root { min-height: 100svh; }
#rb-root[data-state="loading"] { opacity: 0; }
#rb-root[data-state="ready"] { animation: rb-fade-in .5s ease both; }
@keyframes rb-fade-in { from { opacity: 0 } to { opacity: 1 } }

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

.rb-noscript { max-width: 40rem; margin: 0 auto; padding: 3rem 1.5rem; line-height: 1.6; }

/* ---------- modal structure ---------------------------------------- */

body.rb-scroll-lock { overflow: hidden; }

.rb-modal-layer {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(.5rem, 3vw, 2.5rem);
}
.rb-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .72);
  border: 0; padding: 0; margin: 0; cursor: pointer;
  animation: rb-fade-in .25s ease both;
}
.rb-modal {
  position: relative;
  width: min(52rem, 100%);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #111;
  animation: rb-modal-in .3s ease both;
}
.rb-modal[data-size="sm"] { width: min(32rem, 100%); }
.rb-modal[data-size="lg"] { width: min(68rem, 100%); }
@keyframes rb-modal-in { from { opacity: 0; transform: translateY(1.25rem) } to { opacity: 1; transform: none } }

.rb-modal__head { position: relative; }
.rb-modal__close { background: none; border: 0; cursor: pointer; line-height: 1; }
.rb-modal__body > :first-child { margin-top: 0; }
.rb-modal__body > :last-child { margin-bottom: 0; }

/* Longform text pulled from /content/*.md lands in here. A variant styles
   .rb-prose however it likes; these are only sane defaults. */
.rb-prose { line-height: 1.7; }
.rb-prose img { margin: 1.5em 0; }
.rb-prose blockquote { margin-inline: 0; padding-inline-start: 1.25em; }
.rb-prose pre { overflow-x: auto; }

/* ---------- shared form skeleton ------------------------------------ */

.rb-form { display: grid; gap: 1rem; }
.rb-field { display: grid; gap: .35rem; }
.rb-field input, .rb-field textarea {
  width: 100%; background: transparent; border: 1px solid currentColor;
  padding: .6em .75em; border-radius: 0;
}
.rb-field textarea { min-height: 8rem; resize: vertical; }
.rb-form__hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
.rb-form__status[hidden] { display: none; }
.rb-form button[disabled] { opacity: .55; cursor: progress; }

/* ---------- respect the user ---------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
