/**
 * S. Video Creation — Reset & Base Styles
 * Follows accessibility and performance requirements from PROJECT_RULES.md
 */

/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base HTML & viewport setup */
html {
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
}

/* Offset targets when navigated to via hash/anchor links so headings are never hidden behind sticky header */
section[id],
div[id],
main[id] {
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

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

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
}

h2 {
  font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl));
}

h3 {
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-2xl));
}

h4 {
  font-size: var(--text-lg);
}

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

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

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

a:hover {
  color: var(--color-brand-white);
}

/* Accessible focus ring */
:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* Media elements */
img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Lists */
ul,
ol {
  list-style: none;
}

/* Form controls & buttons base */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
}

button {
  cursor: pointer;
}

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

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

/* Devanagari typography support for Hindi */
:lang(hi) {
  font-family: var(--font-family-devanagari);
}

:lang(hi) h1,
:lang(hi) h2,
:lang(hi) h3,
:lang(hi) h4,
:lang(hi) h5,
:lang(hi) h6 {
  font-family: var(--font-family-devanagari);
  letter-spacing: normal;
  line-height: 1.35;
}

:lang(hi) p,
:lang(hi) li,
:lang(hi) span,
:lang(hi) a {
  overflow-wrap: break-word;
}

