/* ==========================================================================
   AG NOVA — 02 BASE
   Reset, document defaults, typography defaults, scrollbars, selection.
   ========================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

html {
  /* Scroll happens on the document, not on an inner container.
     The taskbar is position: fixed, so it stays on screen regardless of
     how mobile browsers resize the visual viewport when hiding the URL bar.
     This avoids chasing dvh units with JavaScript. */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-y: scroll;
}

body {
  min-height: 100%;
  background-color: var(--nova-space);
  color: var(--nova-text-secondary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Reserve room for the fixed taskbar plus the iOS home indicator area,
     so the last panel is never trapped underneath it. */
  padding-bottom: calc(var(--taskbar-h) + env(safe-area-inset-bottom, 0px) + var(--sp-6));

  /* Faint starfield-adjacent atmosphere. Two soft radial pools of light,
     no image files, no cost. */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(143, 216, 224, 0.055), transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(230, 130, 47, 0.035), transparent 70%);
  background-attachment: fixed;
}

/* CRT Scanlines Micro-Movement */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0) 3px,
    rgba(0, 0, 0, 0.055) 3px,
    rgba(0, 0, 0, 0.055) 6px
  );
  animation: nova-scanlines-pulse 8s ease-in-out infinite;
}

@keyframes nova-scanlines-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY DEFAULTS
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: var(--ls-wide);
  color: var(--nova-text-primary);
  text-transform: uppercase;
}

p {
  margin-bottom: var(--sp-3);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--nova-cyan);
  text-decoration: none;
  transition: color var(--t-hover) var(--ease-snap);
}

a:hover {
  color: var(--nova-cyan-bright);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--nova-cyan);
  outline-offset: 2px;
}

ul, ol {
  list-style: none;
}

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

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.9em;
}

::selection {
  background: var(--nova-cyan);
  color: var(--nova-space);
}

/* --------------------------------------------------------------------------
   SCROLLBAR — part of the hardware, not a browser afterthought
   -------------------------------------------------------------------------- */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--nova-border) var(--nova-chassis);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--nova-chassis);
  border-left: var(--border-thin) solid var(--nova-grid);
}

::-webkit-scrollbar-thumb {
  background: var(--nova-border);
  border: 2px solid var(--nova-chassis);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--nova-cyan);
}

/* --------------------------------------------------------------------------
   ACCESSIBILITY UTILITIES
   -------------------------------------------------------------------------- */

.nova-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nova-skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-4);
  z-index: 200;
  padding: var(--sp-2) var(--sp-4);
  background: var(--nova-cyan);
  color: var(--nova-space);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-small);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

.nova-skip-link:focus {
  top: var(--sp-4);
}
