/* ============================================
   Home
   ============================================ */

.home-shell {
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
  padding-block: calc(var(--navbar-height) + clamp(2rem, 6vw, 5rem)) var(--space-3xl);
}

/* Hero */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding-block-end: clamp(2.5rem, 6vw, 4.5rem);
}

/* .page-title, a size up */
.home-hero__title {
  max-width: 14ch;
  font-size: clamp(2.9rem, 6vw, 5.25rem);
}

.home-hero__subtitle {
  max-width: 46ch;
  margin-block-start: var(--space-lg);
  line-height: 1.75;
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-lg);
  margin-block-start: var(--space-xl);
}

.home-hero__action {
  font-size: var(--text-sm);
  transition:
    background-color var(--transition-base),
    color var(--transition-base);
}

.home-hero__action--primary {
  padding: 0.8rem 1.4rem;
  background: var(--color-headline);
  color: var(--color-on-strong);
}

.home-hero__action--primary:hover,
.home-hero__action--primary:focus-visible {
  background: var(--color-link);
}

.home-hero__action--secondary {
  padding-block: 0.8rem;
  color: var(--color-link);
}

.home-hero__action--secondary:hover,
.home-hero__action--secondary:focus-visible {
  color: var(--color-headline);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.home-hero__logo {
  width: clamp(10rem, 22vw, 15rem);
  height: auto;
  /* The spiral is see-through (its gaps, and the whole SVG at 72%
     opacity), so on a dark page the stars behind it showed through the
     arcs. A disc of the page colour behind it, fading out at the rim so it
     doesn't draw a circle against the nebula glow, keeps it in front. */
  display: grid;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--color-background) 88%, transparent);
}

/* The outer and inner rings spin opposite ways. They're two images turned
   with CSS rather than one SVG animating itself: an animated SVG in <img>
   is re-rendered on the main thread every frame, repainting the page,
   while a transform animation runs on the compositor. */
.home-hero__rings {
  grid-area: 1 / 1;
  inline-size: 100%;
  block-size: auto;
  animation: home-hero-spin 48s linear infinite;
}

.home-hero__rings--inner {
  animation-duration: 60s;
  animation-direction: reverse;
}

@keyframes home-hero-spin {
  to {
    transform: rotate(1turn);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero__rings {
    animation: none;
  }
}

/* Sections */
.home-section {
  padding-block-start: var(--space-2xl);
}

.home-section__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-lg);
  padding-block-end: var(--space-md);
}

.home-section__title {
  letter-spacing: -0.02em;
}

@media (max-width: 40rem) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Decorative only; on a phone it would just push the posts down. */
  .home-hero__logo {
    display: none;
  }
}
