/**
 * DR. STEVE ITOPA - BASE ARCHITECTURE & RESET
 * Standards-compliant CSS resets, typography baselines, and grid containers
 */

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

  html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    color-scheme: dark;
  }

  body {
    min-height: 100vh;
    background-color: var(--color-navy-base);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    overflow-x: hidden;
    position: relative;
  }

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

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

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

  a {
    color: inherit;
    text-decoration: none;
    transition: color var(--duration-fast) ease;
  }
}

@layer base {
  /* Headings & Editorial Typography Hierarchy */
  h1, h2, h3, .heading-display {
    font-family: var(--font-serif-display);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
  }

  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }
  h4 { font-size: var(--text-xl); font-family: var(--font-sans); font-weight: 600; }

  p {
    color: var(--color-text-secondary);
    font-weight: 400;
    max-width: 72ch;
  }

  /* Accessibility Focus Rings */
  :focus-visible {
    outline: 2px solid var(--color-ochre-base);
    outline-offset: 4px;
    border-radius: var(--radius-sm);
  }

  /* Selection State */
  ::selection {
    background-color: var(--color-ochre-base);
    color: var(--color-navy-dark);
  }
}

@layer utilities {
  /* Containers */
  .container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--space-md);
  }

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

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

  /* Flex & Grid Scaffolds */
  .flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Subtle Section Separator */
  .section-rule {
    border: none;
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent 0%,
      var(--color-border-subtle) 30%,
      var(--color-ochre-base) 50%,
      var(--color-border-subtle) 70%,
      transparent 100%
    );
    margin-block: var(--space-2xl);
    opacity: 0.6;
  }

  /* Section Spacing */
  .section-padding {
    padding-block: var(--space-3xl);
    position: relative;
  }

  /* Screen Reader Accessible Utility */
  .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;
  }
}
