/* ============================================================
   styles.css
   Global base styles, reset, typography & layout primitives.
   Depends on: variables.css
   ============================================================ */

/* ---------------------------------------------------------
   Modern reset
--------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* Layered carbon-fibre texture over deep radial blue lighting */
  background-image:
    radial-gradient(circle at 15% 0%, rgba(0, 168, 255, 0.10), transparent 45%),
    radial-gradient(circle at 85% 100%, rgba(10, 132, 255, 0.08), transparent 45%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.015) 0 1px, transparent 1px 7px);
  background-attachment: fixed;
}

/* Offset in-page anchors for the floating fixed nav */
html { scroll-padding-top: calc(var(--header-height) + var(--space-xl)); }

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

/* Form controls inherit type */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Remove list styling by default */
ul,
ol {
  list-style: none;
}

/* ---------------------------------------------------------
   Typography
--------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  color: var(--color-white);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-base); }

p {
  margin-bottom: var(--space-md);
  max-width: 70ch;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color var(--speed-fast) var(--ease-standard);
}

a:hover {
  color: var(--color-primary);
}

strong { font-weight: var(--fw-semibold); }
small { font-size: var(--fs-sm); }

/* ---------------------------------------------------------
   Layout primitives
--------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--section-padding-y);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.flex {
  display: flex;
  gap: var(--space-md);
}

/* ---------------------------------------------------------
   Accessibility helpers
--------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-md);
  z-index: var(--z-toast);
  padding: var(--space-xs) var(--space-md);
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  transition: top var(--speed-base) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-md);
}

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

:focus-visible {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 3px;
}

/* ---------------------------------------------------------
   Utility classes
--------------------------------------------------------- */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-muted { color: var(--color-text-muted); }
.no-scroll { overflow: hidden; }
.hidden { display: none !important; }
