/* Fonts, reset, type scale and layout helpers. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-variable.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Libre Baskerville";
  src: url("../fonts/libre-baskerville-variable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Libre Baskerville";
  src: url("../fonts/libre-baskerville-italic-variable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

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

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-height) + 1rem);
  }

  body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.75rem;
    -webkit-font-smoothing: antialiased;
  }

  main {
    flex: 1;
  }

  h1, h2, h3, h4, p, ul, ol, pre {
    margin: 0;
  }

  h1, h2, h3, h4 {
    font-weight: 600;
    text-wrap: balance;
  }

  h1 { font-size: 2.25rem; line-height: 2.5rem; letter-spacing: -0.025em; }
  h2 { font-size: 1.875rem; line-height: 2.25rem; letter-spacing: -0.025em; }
  h3 { font-size: 1.5rem; line-height: 2rem; letter-spacing: -0.02em; }
  h4 { font-size: 1.25rem; line-height: 1.75rem; letter-spacing: -0.02em; }

  p {
    text-wrap: pretty;
  }

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

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

  code, pre {
    font-family: var(--font-mono);
    font-size: 0.875rem;
  }

  :focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: 0.25rem;
  }

  [hidden] {
    display: none !important;
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }

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

  .section {
    padding-block: 4rem;
  }

  .stack > * + * {
    margin-top: 1rem;
  }

  .text-lead { font-size: 1.25rem; line-height: 1.75rem; color: var(--muted-foreground); }
  .text-large { font-size: 1.125rem; line-height: 1.75rem; font-weight: 600; }
  .text-small { font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; }
  .text-muted { font-size: 0.875rem; line-height: 1.25rem; color: var(--muted-foreground); }
  .text-caption { font-size: 0.75rem; line-height: 1rem; color: var(--muted-foreground); letter-spacing: 0.01em; }
  .font-serif { font-family: var(--font-serif); }

  .text-gradient {
    background: linear-gradient(135deg, var(--link) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* Shown for one theme only. The second block repeats the first for a visitor whose system is dark
     and who has made no choice (or has JavaScript off). */
  .only-dark { display: none; }
  :root[data-theme="dark"] {
    .only-light { display: none; }
    .only-dark { display: block; }
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      .only-light { display: none; }
      .only-dark { display: block; }
    }
  }
}
