/* ==========================================================================
   RepRecap — Base Reset + Typography
   Modern CSS reset with design-system-grounded base styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   BOX MODEL RESET
   -------------------------------------------------------------------------- */

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

/* --------------------------------------------------------------------------
   ROOT + BODY
   -------------------------------------------------------------------------- */

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

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

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

body {
  background-color: var(--scaffold);
  color: var(--on-surface);
  font-family: var(--font-display);
  font-size: var(--text-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY — Headings
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-snug);
  color: var(--on-surface);
}

h1 {
  font-size: var(--text-hero);
  letter-spacing: var(--ls-tighter);
  line-height: var(--lh-tight);
  font-weight: 800;
}

h2 {
  font-size: var(--text-h2);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-snug);
  font-weight: 700;
}

h3 {
  font-size: var(--text-h3);
  letter-spacing: var(--ls-snug);
  line-height: var(--lh-snug);
  font-weight: 600;
}

h4 {
  font-size: var(--text-body-lg);
  letter-spacing: var(--ls-snug);
  font-weight: 600;
}

h5 {
  font-size: var(--text-body);
  letter-spacing: var(--ls-normal);
  font-weight: 600;
}

h6 {
  font-size: var(--text-sm);
  letter-spacing: var(--ls-wide);
  font-weight: 600;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY — Body text
   -------------------------------------------------------------------------- */

p {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--lh-relaxed);
  color: var(--on-surface-variant);
  max-width: 68ch;
}

p + p {
  margin-top: var(--space-md);
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY — Inline elements
   -------------------------------------------------------------------------- */

strong,
b {
  font-weight: 700;
  color: var(--on-surface);
}

em,
i {
  font-style: italic;
}

small {
  font-size: var(--text-xs);
  color: var(--on-surface-variant);
}

/* --------------------------------------------------------------------------
   LINKS
   -------------------------------------------------------------------------- */

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-short) var(--ease-default);
}

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

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* --------------------------------------------------------------------------
   IMAGES + MEDIA
   -------------------------------------------------------------------------- */

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

svg {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   LISTS
   -------------------------------------------------------------------------- */

ul,
ol {
  list-style: none;
}

/* --------------------------------------------------------------------------
   FORM ELEMENTS — Baseline normalization
   -------------------------------------------------------------------------- */

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

button {
  cursor: pointer;
  background: none;
  border: none;
}

/* --------------------------------------------------------------------------
   TABLES
   -------------------------------------------------------------------------- */

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* --------------------------------------------------------------------------
   LAYOUT — Container
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.container--md {
  max-width: var(--container-md);
}

.container--sm {
  max-width: var(--container-sm);
}

/* --------------------------------------------------------------------------
   LAYOUT — Section base
   -------------------------------------------------------------------------- */

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

.section--sm {
  padding-block: calc(var(--section-gap) * 0.6);
}

.section--lg {
  padding-block: calc(var(--section-gap) * 1.4);
}

/* --------------------------------------------------------------------------
   ACCESSIBILITY — Visually hidden (screen readers 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-width: 0;
}

/* --------------------------------------------------------------------------
   SELECTION
   -------------------------------------------------------------------------- */

::selection {
  background-color: var(--primary-subtle);
  color: var(--primary);
}

::-moz-selection {
  background-color: var(--primary-subtle);
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   ACCESSIBILITY — Skip link
   -------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 700;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: top var(--duration-short) var(--ease-default);
}
.skip-link:focus {
  top: 0;
}

/* --------------------------------------------------------------------------
   SCROLLBAR — Webkit (dark, minimal)
   -------------------------------------------------------------------------- */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background-color: var(--surface-highest);
  border-radius: var(--radius-full);
  border: 1px solid var(--surface-low);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--on-surface-variant);
}

::-webkit-scrollbar-corner {
  background: var(--surface-low);
}

/* --------------------------------------------------------------------------
   FOCUS — Global visible focus ring
   -------------------------------------------------------------------------- */

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   DIVIDER
   -------------------------------------------------------------------------- */

hr {
  border: none;
  border-top: 1px solid var(--surface-highest);
  margin-block: var(--space-lg);
}

/* --------------------------------------------------------------------------
   UTILITY — Flex + Grid shorthands
   -------------------------------------------------------------------------- */

.flex {
  display: flex;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm  { gap: var(--space-sm);  }
.gap-md  { gap: var(--space-md);  }
.gap-lg  { gap: var(--space-lg);  }
.gap-xl  { gap: var(--space-xl);  }
.gap-xxl { gap: var(--space-xxl); }

/* --------------------------------------------------------------------------
   UTILITY — Text helpers
   -------------------------------------------------------------------------- */

.text-center  { text-align: center; }
.text-left    { text-align: left;   }
.text-right   { text-align: right;  }

.text-muted   { color: var(--on-surface-variant); }
.text-primary { color: var(--primary); }

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

/* --------------------------------------------------------------------------
   UTILITY — Spacing helpers (padding / margin)
   -------------------------------------------------------------------------- */

.mt-sm  { margin-top: var(--space-sm);  }
.mt-md  { margin-top: var(--space-md);  }
.mt-lg  { margin-top: var(--space-lg);  }
.mt-xl  { margin-top: var(--space-xl);  }
.mt-xxl { margin-top: var(--space-xxl); }

.mb-sm  { margin-bottom: var(--space-sm);  }
.mb-md  { margin-bottom: var(--space-md);  }
.mb-lg  { margin-bottom: var(--space-lg);  }
.mb-xl  { margin-bottom: var(--space-xl);  }
.mb-xxl { margin-bottom: var(--space-xxl); }

/* --------------------------------------------------------------------------
   UTILITY — Width
   -------------------------------------------------------------------------- */

.w-full  { width: 100%;  }
.h-full  { height: 100%; }

/* --------------------------------------------------------------------------
   UTILITY — Display
   -------------------------------------------------------------------------- */

.hidden { display: none; }

@media (max-width: 767px) {
  .hidden-mobile { display: none; }
}

@media (min-width: 768px) {
  .hidden-desktop { display: none; }
}
