/* Base layout and shared elements */

@layer components {
  body {
    background: var(--color-background);
    background-image: linear-gradient(168deg,
      var(--sky-1) 0%, var(--sky-2) 34%, var(--sky-3) 70%, var(--sky-4) 100%);
    background-attachment: fixed;
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
  }

  /* The rail is fixed; every page sits to the right of it. */
  #app { padding-left: var(--rail-width); min-height: 100svh; }

  /* The anatomy page is a full-bleed canvas rather than a document. */
  #app:has(.stage) { padding-left: 0; }

  .stage {
    position: fixed;
    inset: 0 0 0 var(--rail-width);
  }

  /* ---------------------------------------------------------------- article */

  .page {
    max-width: var(--content-width);
    margin-inline: auto;
    padding: clamp(3rem, 9vh, 6rem) clamp(1.25rem, 5vw, 3rem) 6rem;
  }

  .page-kicker {
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--color-ink-faint);
    margin-bottom: var(--space-3);
  }

  .page-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.4rem, 6vw, 3.4rem);
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-4);
  }

  .page-lede {
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    color: var(--color-ink-soft);
    max-width: 36rem;
  }

  .page-lede a,
  .prose a {
    color: var(--color-ink);
    text-decoration: underline;
    text-decoration-color: var(--color-border-strong);
    text-underline-offset: 0.22em;
    text-decoration-thickness: 1px;
    transition: text-decoration-color var(--transition-fast), color var(--transition-fast);
  }
  .page-lede a:hover,
  .prose a:hover { color: var(--color-accent); text-decoration-color: currentColor; }

  .prose { margin-top: var(--space-7); }
  .prose > * + * { margin-top: var(--space-4); }
  .prose p { color: var(--color-ink-soft); line-height: var(--leading-relaxed); }
  .prose strong { color: var(--color-ink); font-weight: 600; }

  .prose h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: var(--text-2xl);
    line-height: var(--leading-snug);
    letter-spacing: -0.01em;
    margin-top: var(--space-8);
    color: var(--color-ink);
  }

  .prose h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: var(--text-xl);
    margin-top: var(--space-6);
  }

  .rule {
    border: 0;
    height: 1px;
    background: var(--color-border);
    margin-block: var(--space-7);
  }

  /* ------------------------------------------------------------------ cards */

  .card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
  }

  /* ---------------------------------------------------------------- utility */

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

  ::selection { background: var(--mv-violet); color: #fff; }

  @media (max-width: 900px) {
    #app { padding-left: 0; padding-top: 3.25rem; }
    .stage { inset: 3.25rem 0 0 0; }
  }
}
