/* ==========================================================================
   base.css — Reset, Custom Properties, Typography Foundation
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */

:root {
  /* Colors */
  --color-primary: #F80205;
  --color-primary-hover: #C80003;
  --color-soft-accent: #FFCCCC;
  --color-secondary: #0F6B7A;
  --color-bg: #F7F9FA;
  --color-surface: #FFFFFF;
  --color-alt-bg: #F1F3F5;
  --color-border: #E1E5E9;
  --color-text: #1A1D21;
  --color-text-secondary: #4A525A;
  --color-text-muted: #6B737B;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Type scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Line heights */
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Layout widths */
  --content-width: 72rem;
  --reading-width: 65ch;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* ---------- Modern Reset ---------- */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
}

/* ---------- Typography ---------- */

h1, h2 {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--color-text);
}

h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  line-height: var(--leading-snug);
  color: var(--color-text);
}

h1 {
  font-size: var(--text-4xl);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-3xl);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--text-2xl);
}

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

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

h6 {
  font-size: var(--text-base);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  max-width: var(--reading-width);
  margin-bottom: var(--space-md);
}

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

strong {
  font-weight: 600;
}

small {
  font-size: var(--text-sm);
}

blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: var(--space-lg);
  margin: var(--space-xl) 0;
  color: var(--color-text-secondary);
  font-style: italic;
}

code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.9em;
  background-color: var(--color-alt-bg);
  padding: 0.1em 0.3em;
  border-radius: var(--radius-sm);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-2xl) 0;
}

/* ---------- Responsive Typography ---------- */

@media (min-width: 768px) {
  h1 {
    font-size: var(--text-5xl);
  }

  h2 {
    font-size: var(--text-4xl);
  }

  h3 {
    font-size: var(--text-3xl);
  }
}
