@layer entelecy.reset, entelecy.tokens, entelecy.base, entelecy.components, entelecy.page;

@layer entelecy.reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
  }

  body,
  h1,
  h2,
  h3,
  p,
  figure {
    margin: 0;
  }

  img,
  svg,
  iframe {
    max-width: 100%;
  }

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

@layer entelecy.base {
  html {
    background: var(--ec-bg);
  }

  body {
    min-width: 20rem;
    min-height: 100vh;
    overflow-x: clip;
    color: var(--ec-text);
    background: var(--ec-bg);
    font-family: var(--ec-font-sans);
    font-size: var(--ec-step-0);
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    transition: color var(--ec-duration-base) var(--ec-ease),
      background var(--ec-duration-base) var(--ec-ease);
  }

  a {
    color: inherit;
  }

  main,
  section,
  article,
  aside,
  nav {
    min-width: 0;
  }

  h1,
  h2,
  h3 {
    text-wrap: balance;
  }

  h1,
  h2 {
    font-family: var(--ec-font-display);
    font-weight: 400;
    letter-spacing: -0.035em;
    line-height: 1.02;
  }

  h1 {
    font-size: var(--ec-step-4);
  }

  h2 {
    font-size: var(--ec-step-3);
  }

  h3 {
    font-size: var(--ec-step-1);
    line-height: 1.25;
  }

  em {
    font-weight: 400;
  }

  :focus-visible {
    outline: 2px solid var(--ec-focus);
    outline-offset: 4px;
  }

  ::selection {
    color: var(--ec-accent-ink);
    background: var(--ec-accent);
  }

  .ec-container {
    width: min(100% - (2 * var(--ec-gutter)), var(--ec-content));
    margin-inline: auto;
  }

  .ec-reading {
    max-width: var(--ec-reading);
  }

  .ec-section {
    padding-block: var(--ec-space-9);
    border-top: 1px solid var(--ec-line);
  }

  .ec-sr-only {
    width: 1px;
    height: 1px;
    position: absolute;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  @media (max-width: 44rem) {
    :root {
      --ec-gutter: 1rem;
      --ec-header-height: 4rem;
    }

    .ec-section {
      padding-block: var(--ec-space-8);
    }
  }

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

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