/* ============================================================
   MODERN CSS RESET — FANUCAiLeadCV
   Inspired by Josh Comeau's reset (joshwcomeau.com/css/custom-css-reset)
   and Andy Bell's Piccalilli reset. Tuned for a dark-tech design system.

   Rules are ordered from broadest to most specific.
   ============================================================ */

/* 1. Intuitive box-sizing model across all elements */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin and padding everywhere */
* {
  margin: 0;
  padding: 0;
}

/* 3. Enable percentage-based heights in the cascade */
html,
body {
  height: 100%;
}

/* 4. Sub-pixel font smoothing for dark backgrounds */
body {
  -webkit-font-smoothing:  antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 5. Sensible media defaults — block display, no overflow */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 6. Remove built-in form typography so components can own it */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* 7. Break long words rather than overflow their container */
p,
h1,
h2,
h3,
h4,
h5,
h6,
blockquote,
figcaption {
  overflow-wrap: break-word;
  hyphens: auto;
}

/* 8. Remove list presentation from nav lists only;
      content <ul>/<ol> keep their list markers */
nav ol,
nav ul {
  list-style: none;
}

/* 9. Remove default underline and colour from anchors —
      each component applies its own link styles */
a {
  color: inherit;
  text-decoration: none;
}

/* 10. Button reset — let each button component style itself */
button {
  cursor: pointer;
  background: none;
  border: none;
  -webkit-appearance: none;
  appearance: none;
}

/* 11. Fieldset / legend reset */
fieldset {
  border: none;
}

/* 12. Horizontal rule: use token colour */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
}

/* 13. Tables: collapse by default */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 14. Strong / em baseline */
strong, b { font-weight: var(--font-bold); }
em, i     { font-style: italic; }

/* ============================================================
   BASE STYLES
   Applied after reset — establishes the design system baseline.
   ============================================================ */

html {
  font-size: 16px;       /* 1rem = 16px — never change this */
  color-scheme: dark;    /* tells browsers this is a dark page */
}

body {
  font-family: var(--font-sans);
  font-size:   var(--text-base);
  line-height: var(--leading-normal);
  color:       var(--color-text-primary);
  background-color: var(--color-bg-base);
}

/* Default anchor hover: accent colour */
a:hover {
  color: var(--color-accent);
  transition: color var(--duration-fast) var(--ease-out);
}

/* ============================================================
   FOCUS STYLES
   Keyboard-navigable focus ring uses the FANUC Yellow accent.
   Mouse clicks do NOT show the ring (focus:not(:focus-visible)).
   ============================================================ */

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================
   SMOOTH SCROLLING
   Opt-in via media query — reduced-motion users get instant jump.
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ============================================================
   ALPINE.JS — x-cloak utility
   Prevents flash of un-bound template markup before Alpine
   initialises. Must be in a CSS file that loads before Alpine.
   ============================================================ */

[x-cloak] {
  display: none !important;
}

/* ============================================================
   GLOBAL REDUCED-MOTION OVERRIDE
   The nuclear option: if the user prefers reduced motion,
   disable all animations and transitions site-wide.
   Per-component overrides in animations.css refine this further.
   ============================================================ */

@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;
  }
}
