/* ==========================================================================
   Global Styles — Originate
   Reset, base typography, structural patterns.
   All values reference tokens.css custom properties.
   ========================================================================== */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

ul,
ol {
  list-style: none;
}

/* --- Base Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-medium);
  line-height: 1.15;
  text-transform: none; /* explicitly NOT uppercase */
}

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

p {
  margin-bottom: var(--space-4);
}

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

/* --- Originate Signature: Lime Highlight --- */
em {
  color: var(--color-accent);
  font-style: italic;
  font-weight: var(--font-weight-medium);
}

/* --- Links --- */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-underline-offset: 3px;
}

/* --- Focus Styles --- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- Selection --- */
::selection {
  background-color: var(--color-accent);
  color: var(--color-text-on-accent);
}

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

.container--narrow {
  width: 100%;
  max-width: var(--max-width-narrow);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

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

/* --- Skip to Content --- */
.sr-only--focusable {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-6);
  background-color: var(--color-accent);
  color: var(--color-text-on-accent);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: top var(--duration-fast) var(--ease-smooth);
}

.sr-only--focusable:focus {
  top: var(--space-4);
}

/* --- View Transitions (Progressive Enhancement) --- */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: fade-out var(--duration-fast) var(--ease-smooth);
}

::view-transition-new(root) {
  animation: fade-in var(--duration-fast) var(--ease-smooth);
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Scroll Lock (for mobile nav) --- */
body.scroll-locked {
  overflow: hidden;
}
