/* =============================================================================
   SARD Base Styles
   Reset, typography defaults, semantic HTML base, layout primitives.
   No component classes here — those live in components.css.
   ============================================================================= */

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

html {
  font-size: 100%;          /* respects user browser font-size preferences */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-paper);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

ul,
ol {
  list-style: none;
}

/* role="list" restores VoiceOver list semantics when list-style is removed */

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

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

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-link-hover);
}

/* ---------------------------------------------------------------------------
   Focus
   Visible focus ring on keyboard navigation; suppressed on mouse click.
   --------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------------------
   Visually hidden — accessible to screen readers, invisible to sighted users
   Use for elements that provide context to assistive technology but should
   not appear in the visual layout (e.g. section labels, sr-only text).
   --------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------------
   Skip link
   --------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -120px;
  z-index: var(--z-modal);
  padding: 0.5em 1.1em;
  background-color: var(--color-ink);
  color: var(--color-paper);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: top var(--transition-fast);
}

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

/* ---------------------------------------------------------------------------
   Typography — Headings
   Fraunces is a variable font with an optical size (opsz) axis.
   font-optical-sizing: auto tells the browser to adjust opsz based on
   rendered size — large headings get display character, small ones get
   text-grade refinement. Gracefully degrades if opsz axis is unavailable.
   --------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--color-text);
  line-height: var(--leading-tight);
  font-optical-sizing: auto;
  text-wrap: balance;
}

h1 {
  font-size: clamp(var(--text-2xl), 5.5vw, var(--text-5xl));
  font-weight: 700;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(var(--text-xl), 4vw, var(--text-4xl));
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(var(--text-lg), 2.5vw, var(--text-2xl));
  font-weight: 600;
  letter-spacing: -0.01em;
}

h4 {
  font-size: clamp(var(--text-md), 1.8vw, var(--text-xl));
  font-weight: 600;
  letter-spacing: -0.005em;
}

h5,
h6 {
  font-size: var(--text-base);
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Typography — Body and prose
   --------------------------------------------------------------------------- */
p {
  color: var(--color-text-body);
  line-height: var(--leading-relaxed);
  max-width: 72ch;
}

.lead {
  font-size: clamp(var(--text-base), 2vw, var(--text-lg));
  line-height: var(--leading-relaxed);
  color: var(--color-text-body);
}

/* Section eyebrow — mono uppercase label above headings */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

/* Metric / data figure — mono tabular figures */
.data-figure {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--color-ink);
  line-height: var(--leading-tight);
  font-variant-numeric: tabular-nums;
}

.text--muted {
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------------
   Telugu bilingual extension point

   Usage: add lang="te" to any element containing Telugu text.
   Example: <p lang="te">...</p> or <span lang="te">...</span>

   A .text--bilingual wrapper can be used when Latin and Telugu appear
   side-by-side in the same block — apply it to the container, then
   use lang="te" on the Telugu span.

   Telugu characters sit taller than Latin descenders; +0.2 on line-height
   prevents adjacent lines from colliding. Adjust if needed when real
   bilingual content is introduced.
   --------------------------------------------------------------------------- */
[lang="te"] {
  font-family: 'Noto Sans Telugu', var(--font-body);
  line-height: calc(var(--leading-relaxed) + 0.2);
}

/* ---------------------------------------------------------------------------
   Layout primitives
   --------------------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.container--narrow {
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.container--wide {
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

/* Default vertical section rhythm */
.section {
  padding-block: var(--section-pad);
}

.section--sm {
  padding-block: var(--space-12);
}

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

/* Section surface modifiers */
.section--paper {
  background-color: var(--color-paper);
}

.section--clay {
  background-color: var(--color-clay);
}

.section--surface {
  background-color: var(--color-surface);
}

.section--ink {
  background-color: var(--color-ink);
  color: var(--color-text-inverse);
}

.section--ink h1,
.section--ink h2,
.section--ink h3,
.section--ink h4,
.section--ink p {
  color: var(--color-text-inverse);
}

/* ---------------------------------------------------------------------------
   Responsive container padding
   Breakpoints: 640px (sm), 768px (md), 1024px (lg), 1280px (xl)
   --------------------------------------------------------------------------- */
@media (min-width: 640px) {
  .container,
  .container--narrow,
  .container--wide {
    padding-inline: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .container,
  .container--narrow,
  .container--wide {
    padding-inline: var(--space-8);
  }
}
