/* ==========================================================================
   AKSO — Reset
   A modern, opinionated reset. Restores sensible defaults rather than
   stripping everything, and bakes in the accessibility behaviours
   (focus-visible, reduced motion) that the rest of the system relies on.
   ========================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

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

html,
body {
  height: 100%;
}

body {
  min-height: 100svh;
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Prevent scroll while the mobile menu / lightbox is open */
body.is-locked {
  overflow: hidden;
  height: 100svh;
}

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

video {
  width: 100%;
}

img {
  font-style: italic;           /* Style alt text if an image fails to load */
  background-repeat: no-repeat;
  background-size: cover;
  shape-margin: 1rem;
}

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

button {
  cursor: pointer;
  text-align: inherit;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

p,
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  text-wrap: pretty;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-medium);
  text-wrap: balance;
}

/* Root stacking context for the app; helps custom page-transition overlays */
#app {
  position: relative;
  isolation: isolate;
}

/* ---------------------------------------------------------------------
   Focus states — always visible, styled to match the dark theme.
   Never suppressed; only re-styled.
   --------------------------------------------------------------------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 1px solid var(--color-focus);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------------
   Selection colour
   --------------------------------------------------------------------- */
::selection {
  background-color: var(--color-text-primary);
  color: var(--color-bg);
}

/* ---------------------------------------------------------------------
   Reduced motion — global kill switch respected across the site.
   Page-specific JS also checks this before initialising GSAP timelines.
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------
   Utility: visually hidden but accessible to assistive tech
   --------------------------------------------------------------------- */
.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;
}

/* ---------------------------------------------------------------------
   Skip link
   --------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-3);
  z-index: 1200;
  padding: var(--space-2) var(--space-3);
  background-color: var(--color-inverse-bg);
  color: var(--color-inverse-text);
  font-size: var(--text-nav);
  font-weight: var(--weight-medium);
  transition: top var(--duration-fast) var(--ease-standard);
}

.skip-link:focus-visible {
  top: var(--space-3);
  outline-offset: 2px;
}
