/* starling.aprilnea.com. The palette comes from the app icon: a sunset gradient behind an ink-blue starling in
   light mode, and the starling's cream on a night sky in dark mode. One motif, the murmuration from the icon,
   flies across the hero; everything else stays quiet so the screenshots carry the page. */

:root {
  color-scheme: light dark;
  --sun-high: #f9c46b;
  --sun-low: #e4504a;
  --ink: #1e1b3a;
  --ink-soft: #4a4766;
  --paper: #fffaf2;
  --paper-sunk: #fbefdc;
  --rule: rgb(30 27 58 / 0.12);
  --accent: #c2372f;
  --button-text: #fffaf2;
  --button: #1e1b3a;
  --window-shadow:
    0 30px 60px -20px rgb(80 30 20 / 0.35),
    0 12px 24px -12px rgb(80 30 20 / 0.25);
  --serif: ui-serif, "New York", "Iowan Old Style", Charter, Georgia, serif;
  --sans:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    sans-serif;
  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sun-high: #26306f;
    --sun-low: #0b0f2a;
    --ink: #ffe6bf;
    --ink-soft: #c8bfae;
    --paper: #0b0f2a;
    --paper-sunk: #121840;
    --rule: rgb(255 230 191 / 0.14);
    --accent: #f9a35b;
    --button-text: #0b0f2a;
    --button: #ffe6bf;
    --window-shadow:
      0 30px 70px -20px rgb(0 0 0 / 0.7), 0 12px 24px -12px rgb(0 0 0 / 0.5);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 0.5rem;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

code,
kbd {
  font:
    0.92em ui-monospace,
    "SF Mono",
    Menlo,
    monospace;
  background: var(--paper-sunk);
  border-radius: 0.3rem;
  padding: 0.05em 0.3em;
}

/* Masthead */

.masthead {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font: 600 1.25rem var(--serif);
  text-decoration: none;
}

.masthead-download {
  font-weight: 600;
  text-decoration: none;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.35);
}

@media (prefers-color-scheme: dark) {
  .masthead-download {
    background: rgb(255 230 191 / 0.12);
  }
}

/* Hero: the sky from the icon, the murmuration, and the main window rising out of it. */

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  justify-items: center;
  padding: clamp(7rem, 14vw, 10rem) clamp(1.25rem, 4vw, 3rem) 0;
  background: linear-gradient(
    180deg,
    var(--sun-high) 0%,
    var(--sun-low) 78%,
    var(--paper) 78%
  );
}

.murmuration {
  position: absolute;
  top: 5.5rem;
  left: clamp(0.5rem, 3vw, 3rem);
  width: clamp(12rem, 22vw, 20rem);
  fill: var(--ink);
  opacity: 0.8;
  pointer-events: none;
}

.murmuration g {
  transform-origin: 30% 60%;
  animation: drift 26s ease-in-out infinite alternate;
}

@keyframes drift {
  from {
    transform: translate(0, 0) rotate(0deg);
  }
  to {
    transform: translate(6%, -5%) rotate(-3deg);
  }
}

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

.hero-text {
  position: relative;
  max-width: 44rem;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 1.25rem;
}

h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.75rem);
  letter-spacing: -0.02em;
}

.lede {
  max-width: var(--measure);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--ink-soft);
}

.actions {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
}

.button {
  display: inline-block;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text);
}

.button:hover {
  filter: brightness(1.15);
}

.requirements {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.window img {
  border-radius: clamp(0.6rem, 1.2vw, 1rem);
  box-shadow: var(--window-shadow);
}

.hero-window {
  position: relative;
  width: min(72rem, 100%);
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

/* Sections */

main > section {
  padding: clamp(4rem, 9vw, 7rem) clamp(1.25rem, 4vw, 3rem) 0;
  max-width: 76rem;
  margin: 0 auto;
}

main > .hero {
  max-width: none;
}

h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  letter-spacing: -0.01em;
}

.section-lede,
.feature-text p,
.servers p {
  max-width: var(--measure);
  color: var(--ink-soft);
}

.numbers {
  display: grid;
  gap: 1.25rem;
  justify-items: center;
  text-align: center;
}

.figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 4vw, 3rem);
  margin: 1.5rem 0 0;
  width: 100%;
  max-width: 52rem;
}

.figures div {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.35rem;
}

.figures dt {
  color: var(--ink-soft);
}

.figures dd {
  margin: 0;
  font: 600 1.4rem var(--serif);
}

.figure {
  display: block;
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--accent);
}

.footnote {
  max-width: 40rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.feature {
  display: grid;
  gap: 1.75rem;
}

.feature-text {
  display: grid;
  gap: 0.75rem;
}

.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
}

.pair .feature {
  align-content: start;
}

.crop img {
  border-radius: 0.9rem;
  box-shadow:
    0 0 0 1px var(--rule),
    var(--window-shadow);
}

.mac h2 {
  margin-bottom: 2rem;
}

.traits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem clamp(1.5rem, 4vw, 3rem);
}

.traits li {
  display: grid;
  gap: 0.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.traits h3 {
  font-size: 1.2rem;
}

.traits p {
  color: var(--ink-soft);
}

.servers {
  display: grid;
  gap: 1rem;
}

.servers .aside {
  font-style: italic;
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink);
}

.closing {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  text-align: center;
  padding-bottom: clamp(4rem, 9vw, 7rem);
}

.closing img {
  width: 7rem;
}

.footer {
  border-top: 1px solid var(--rule);
  padding: 2rem clamp(1.25rem, 4vw, 3rem) 3rem;
  display: grid;
  gap: 0.4rem;
  justify-items: center;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

@media (max-width: 52rem) {
  .pair,
  .traits {
    grid-template-columns: minmax(0, 1fr);
  }

  .figures {
    grid-template-columns: minmax(0, 1fr);
  }

  .murmuration {
    top: 4.5rem;
    width: 9rem;
    opacity: 0.35;
  }

  .hero {
    background: linear-gradient(
      180deg,
      var(--sun-high) 0%,
      var(--sun-low) 88%,
      var(--paper) 88%
    );
  }
}
