/* ===== BASE STYLES - ROVI 2025 ===== */
/* Global typography, html/body, font loading */

/* ===== FONT LOADING OPTIMIZATION ===== */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial'), local('Helvetica Neue'), local('Helvetica'), local('system-ui');
  font-display: swap;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
  size-adjust: 107%;
}

@font-face {
  font-family: 'Comfortaa Fallback';
  src: local('Arial Rounded MT Bold'), local('Helvetica Rounded'), local('Arial'), local('system-ui');
  font-display: swap;
  ascent-override: 92%;
  descent-override: 23%;
  line-gap-override: 0%;
  size-adjust: 95%;
}

/* ===== HTML & BODY ===== */
html {
  font-size: 62.5%; /* 10px base for rem calculations */
  scroll-behavior: smooth;
  background: transparent; /* Hero background visible */
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  font-optical-sizing: var(--font-optical-sizing);
  font-kerning: var(--font-kerning);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: var(--line-height-relaxed);
  color: var(--color-text-inverse);
  background: transparent; /* Hero background visible */
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  letter-spacing: -0.02em;
  margin: 0;
}

h1 {
  font-size: clamp(var(--font-size-4xl), 6vw, var(--font-size-6xl));
  font-weight: var(--font-weight-bold);
  background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: clamp(var(--font-size-2xl), 4.5vw, var(--font-size-4xl));
  font-weight: var(--font-weight-semibold);
  position: relative;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 6rem;
  height: 0.3rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
}

h3 {
  font-size: clamp(var(--font-size-xl), 3.5vw, var(--font-size-2xl));
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

h4 {
  font-size: clamp(var(--font-size-lg), 2.5vw, var(--font-size-xl));
  font-weight: var(--font-weight-semibold);
}

h5 {
  font-size: clamp(var(--font-size-base), 2vw, var(--font-size-lg));
  font-weight: var(--font-weight-medium);
}

h6 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
}

p {
  margin-bottom: var(--space-md);
  font-size: clamp(var(--font-size-sm), 2vw, var(--font-size-base));
}

.lead {
  font-size: clamp(var(--font-size-base), 2.5vw, var(--font-size-xl));
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  max-width: 65ch;
}

/* ===== TEXT UTILITIES ===== */
h1, h2, h3, h4, h5, h6,
p, span, div {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: none;
}

pre, code {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* ===== MEDIA ELEMENTS ===== */
img,
video,
iframe,
embed,
object {
  max-width: 100%;
  height: auto;
}

picture {
  display: block;
  width: 100%;
}

picture img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== ACCESSIBILITY ===== */
.skip-link {
  position: absolute;
  top: -4rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-secondary);
  color: var(--color-text-inverse);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  text-decoration: none;
  z-index: 10000;
  transition: top var(--transition-fast);
}

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

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

/* ===== REDUCED MOTION ===== */
@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;
  }
}
