/* ==========================================================================
   TEACHER LUPI — BASE STYLES
   Reset, typography, global element defaults, accessibility utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  background-color: var(--color-surface);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle dot pattern background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle, var(--color-surface-alt) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
  z-index: var(--z-bg);
  opacity: 0.5;
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: normal;
  line-height: var(--leading-tight);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-ink);
}

h1 { font-size: var(--text-hero); }
h2 { font-size: clamp(2.5rem, 6vw, var(--text-5xl)); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p {
  max-width: 72ch;
  line-height: var(--leading-normal);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

strong {
  font-weight: 700;
}

ul, ol {
  list-style: none;
}

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

img {
  image-rendering: -webkit-optimize-contrast;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* --------------------------------------------------------------------------
   SELECTION
   -------------------------------------------------------------------------- */
::selection {
  background-color: var(--color-accent);
  color: var(--color-ink);
}

/* --------------------------------------------------------------------------
   SCROLLBAR (Chromium)
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border: 2px solid var(--color-surface);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-hover);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) var(--color-surface);
}

/* --------------------------------------------------------------------------
   ACCESSIBILITY UTILITIES
   -------------------------------------------------------------------------- */

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip to main content link */
.skip-link {
  position: fixed;
  top: -100%;
  left: var(--space-4);
  z-index: calc(var(--z-toast) + 1);
  background: var(--color-accent);
  color: var(--color-ink);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  text-transform: uppercase;
  border: var(--neo-border-heavy);
  box-shadow: var(--neo-shadow-sm);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: var(--space-4);
  outline: none;
}

/* Focus ring for keyboard navigation */
:focus-visible {
  outline: 4px solid var(--color-accent);
  outline-offset: 3px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* --------------------------------------------------------------------------
   UTILITY CLASSES
   -------------------------------------------------------------------------- */
.text-primary { color: var(--color-primary); }
.text-accent  { color: var(--color-accent); }
.text-muted   { color: var(--color-ink-muted); }

.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font-body); }

.uppercase    { text-transform: uppercase; }
