/* ============================================================
   DCMS Portal — 02 base
   Reset, document defaults, focus, selection, a11y utilities.
   ============================================================ */

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

  * {
    margin: 0;
  }

  html {
    scrollbar-gutter: stable;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
  }

  body {
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: 1.5;
    color: var(--text);
    background-color: var(--bg);
    background-image: radial-gradient(1100px 480px at 50% -160px, var(--bg-glow), transparent 70%);
    background-repeat: no-repeat;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
    overflow-wrap: break-word;
  }

  p {
    overflow-wrap: break-word;
  }

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

  input, button, select, textarea {
    font: inherit;
    color: inherit;
  }

  button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }

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

  a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  ul, ol {
    padding-left: 1.25em;
  }

  code, kbd, samp, pre, .mono {
    font-family: var(--font-mono);
  }

  code {
    font-size: 0.875em;
    background: var(--surface-2);
    border-radius: 5px;
    padding: 0.08em 0.4em;
  }

  strong {
    font-weight: 650;
  }

  [hidden] {
    display: none !important;
  }

  ::selection {
    background: var(--selection);
    color: inherit;
  }

  /* -- focus ----------------------------------------------------------- */
  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
  }

  :focus:not(:focus-visible) {
    outline: none;
  }

  /* -- a11y utilities ---------------------------------------------------- */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  /* Hidden icon/gradient sprite. Deliberately NOT display:none — see
     partials/icons.ejs: the logo's gradient paint servers must stay
     paintable, which a display:none subtree would prevent. */
  .svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
  }

  .skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: var(--z-skip);
    padding: 10px 16px;
    background: var(--surface);
    color: var(--accent-ink);
    font-weight: 600;
    font-size: var(--fs-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    box-shadow: var(--shadow-lift);
    transform: translateY(calc(-100% - 16px));
    transition: transform var(--dur-fast) var(--ease-out);
  }

  .skip-link:focus {
    transform: none;
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  /* -- tiny text helpers ------------------------------------------------- */
  .muted {
    color: var(--text-muted);
  }

  .mono {
    letter-spacing: 0.01em;
  }
}
