/* ==========================================================================
   RETRO XS — BASE FOUNDATION & RESET STYLESHEET
   File: assets/base.css
   Architecture: Pure Modern CSS3 Reset, Fluid Typography, A11y & Layout
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Modern CSS Box-Sizing & Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ensure main content landmark takes remaining height */
main#MainContent {
  flex: 1 0 auto;
  width: 100%;
}

/* Reset headings, paragraphs, and text blocks */
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
  margin: 0;
  padding: 0;
}

/* Reset Lists */
ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Standard content list styling fallback */
.prose ul,
.prose ol {
  padding-inline-start: 1.5rem;
}
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

/* Responsive Media & Embeds */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Form Controls Reset */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  margin: 0;
  padding: 0;
}

button {
  cursor: pointer;
  background: none;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

textarea {
  resize: vertical;
  field-sizing: content;
}

/* Links & Anchors */
a {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
  transition: color 0.15s ease, opacity 0.15s ease;
}

/* Horizontal Rule */
hr {
  border: 0;
  border-top: 1px solid currentColor;
  margin: 1.5rem 0;
  opacity: 0.2;
}

/* Tables */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* --------------------------------------------------------------------------
   2. Typography Scaling & Fluid Headings
   -------------------------------------------------------------------------- */
h1, .h1 {
  font-size: clamp(2rem, 1.25rem + 3.75vw, 3.5rem); /* 32px to 56px */
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: break-word;
}

h2, .h2 {
  font-size: clamp(1.5rem, 1rem + 2.5vw, 2.5rem); /* 24px to 40px */
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: break-word;
}

h3, .h3 {
  font-size: clamp(1.25rem, 0.95rem + 1.5vw, 1.75rem); /* 20px to 28px */
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

h4, .h4 {
  font-size: clamp(1.1rem, 0.95rem + 0.75vw, 1.35rem); /* 17.6px to 21.6px */
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.01em;
  overflow-wrap: break-word;
}

p, body {
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.0625rem); /* 15.2px to 17px */
  line-height: 1.6;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.text-small,
small {
  font-size: 0.875rem; /* 14px */
  line-height: 1.5;
}

.text-micro,
caption {
  font-size: 0.75rem; /* 12px */
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   3. Layout Wrappers & Container Primitives
   -------------------------------------------------------------------------- */
.page-width,
.container {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2.5rem);
}

.page-width--narrow {
  max-width: 880px;
}

.page-width--wide {
  max-width: 1540px;
}

.section-spacing {
  padding-block: clamp(2.5rem, 5vw, 5rem);
}

.section-spacing--compact {
  padding-block: clamp(1.5rem, 3vw, 3rem);
}

/* --------------------------------------------------------------------------
   4. Accessibility Utilities
   -------------------------------------------------------------------------- */
/* Screen-Reader Only utility (WCAG compliant) */
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.visually-hidden:not(caption):not([aria-live]),
.sr-only:not(caption):not([aria-live]) {
  clip-path: inset(50%) !important;
}

/* Skip to Main Content Link */
.skip-to-content-link,
.skip-to-content {
  position: absolute;
  top: -120px;
  left: 1.5rem;
  z-index: 10000;
  padding: 0.85rem 1.75rem;
  background-color: #1a1d2e;
  color: #00f0ff;
  border: 2px solid #00f0ff;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
  transition: top 0.2s cubic-bezier(0, 0, 0.2, 1);
  text-decoration: none;
}

.skip-to-content-link:focus,
.skip-to-content:focus,
.skip-to-content-link:focus-visible,
.skip-to-content:focus-visible {
  top: 1.5rem;
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

/* Universal Accessible Focus Visible Outline */
:focus-visible {
  outline: 2px solid #00f0ff;
  outline-offset: 3px;
}

/* Programmatic focus outline suppression */
.focus-none,
.focus-none:focus,
.focus-none:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* High Contrast Mode (Forced Colors) Support */
@media (forced-colors: active) {
  :focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 3px;
  }
  .skip-to-content-link:focus,
  .skip-to-content:focus {
    outline: 3px solid Highlight;
    background: Canvas;
    color: LinkText;
  }
}

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

/* --------------------------------------------------------------------------
   5. General Utility Classes
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }

.hidden { display: none !important; }

/* Body / Dialog Scroll Lock Utility */
body.overflow-hidden,
.overflow-hidden {
  overflow: hidden !important;
}
