/*
 * The app's design language, on the web.
 *
 * Same rules as the app and for the same reasons: nothing is bold, hierarchy
 * comes from size and colour and the switch between the serif and the sans,
 * and the ground is never pure black because the gradient fields need
 * something to sit against.
 */

:root {
  --ground: #08070c;
  --warm: #ff9c6e;
  --rose: #e56e9b;
  --cool: #7a78e8;
  --accent: #ffc1a2;
  --pill-from: #ffb48c;
  --pill-to: #ff90a9;
  --pill-ink: #1b1016;

  --ink: #f4f1f6;
  --ink-84: rgba(244, 241, 246, 0.84);
  --ink-62: rgba(244, 241, 246, 0.62);
  --ink-46: rgba(244, 241, 246, 0.46);
  --ink-40: rgba(244, 241, 246, 0.4);

  --surface: rgba(255, 255, 255, 0.05);
  --hairline: rgba(255, 255, 255, 0.08);

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Plus Jakarta Sans", ui-sans-serif, -apple-system, "Segoe UI", system-ui, sans-serif;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--ground);
  color: var(--ink-84);
  font: 300 17px/1.65 var(--sans);
  letter-spacing: 0.002em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* The drifting colour fields, the same three as the app's backdrop. */
.fields {
  position: fixed;
  inset: -20vmax;
  z-index: -1;
  pointer-events: none;
}
.fields span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.42;
  will-change: transform;
}
.fields .a {
  width: 62vmax; height: 62vmax; top: -12vmax; left: -6vmax;
  background: radial-gradient(circle, var(--warm) 0%, transparent 68%);
  animation: drift-a 34s ease-in-out infinite alternate;
}
.fields .b {
  width: 54vmax; height: 54vmax; top: 6vmax; right: -10vmax;
  background: radial-gradient(circle, var(--rose) 0%, transparent 68%);
  animation: drift-b 41s ease-in-out infinite alternate;
}
.fields .c {
  width: 66vmax; height: 66vmax; bottom: -22vmax; left: 16vmax;
  background: radial-gradient(circle, var(--cool) 0%, transparent 70%);
  opacity: 0.3;
  animation: drift-c 47s ease-in-out infinite alternate;
}

@keyframes drift-a { to { transform: translate3d(7vmax, 5vmax, 0) scale(1.14); } }
@keyframes drift-b { to { transform: translate3d(-6vmax, 9vmax, 0) scale(0.9); } }
@keyframes drift-c { to { transform: translate3d(5vmax, -7vmax, 0) scale(1.1); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fields span { animation: none; }
}

/* Layout. The header and footer live inside the same padded column as the
   content, so nothing can end up flush against the edge of a phone. */
.page { max-width: 40rem; margin: 0 auto; padding: 0 1.6rem 5rem; }

header.top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem 1.5rem; padding: 2.2rem 0 2.6rem; flex-wrap: wrap;
}

main { display: block; }

.mark {
  font-family: var(--serif); font-size: 1.35rem; color: var(--ink);
  text-decoration: none; letter-spacing: -0.01em;
}

nav { display: flex; gap: 1.35rem; flex-wrap: wrap; }
nav a { color: var(--ink-46); text-decoration: none; font-size: 0.92rem; transition: color 0.22s ease; }
nav a:hover, nav a[aria-current="page"] { color: var(--accent); }

/* Type */
h1 {
  font: 400 clamp(2.6rem, 8vw, 4rem)/1.1 var(--serif);
  letter-spacing: -0.022em; color: var(--ink); margin: 0 0 1.1rem;
}
h2 {
  font: 400 clamp(1.5rem, 4vw, 1.9rem)/1.25 var(--serif);
  letter-spacing: -0.016em; color: var(--ink); margin: 3.2rem 0 0.8rem;
}
h3 {
  font: 300 0.72rem/1 var(--sans); letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255, 180, 140, 0.8); margin: 2.6rem 0 0.9rem;
}
p { margin: 0 0 1.05rem; }
.lede { font-size: 1.12rem; color: var(--ink-62); margin-bottom: 2rem; }
.date { color: var(--ink-40); font-size: 0.92rem; margin: 0 0 3rem; }
.small { font-size: 0.92rem; color: var(--ink-46); }

ul { padding-left: 1.1rem; margin: 0 0 1.05rem; }
li { margin-bottom: 0.55rem; }
li::marker { color: var(--ink-40); }

strong { font-weight: 400; color: var(--ink); }

a { color: var(--accent); text-decoration-color: rgba(255, 193, 162, 0.32); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }

/* Pieces */
.card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 22px; padding: 1.5rem 1.6rem; margin: 1.6rem 0;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  height: 3.3rem; padding: 0 2rem; border-radius: 999px;
  background: linear-gradient(120deg, var(--pill-from), var(--pill-to));
  color: var(--pill-ink); font-size: 1.02rem; text-decoration: none;
  transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1), filter 0.18s ease;
}
.pill:hover { filter: brightness(1.05); }
.pill:active { transform: scale(0.978); }

hr { border: 0; border-top: 1px solid var(--hairline); margin: 3.4rem 0; }

footer {
  border-top: 1px solid var(--hairline); margin-top: 4.5rem; padding-top: 1.8rem;
  display: flex; justify-content: space-between; gap: 0.8rem 1.2rem; flex-wrap: wrap;
  font-size: 0.9rem; color: var(--ink-40);
}
footer .links { display: flex; gap: 1.2rem; }
footer a { color: var(--ink-46); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* Content arriving, matching the app's Enter. */
.rise { animation: rise 0.5s cubic-bezier(0.2, 0, 0, 1) both; }
.rise:nth-of-type(2) { animation-delay: 0.06s; }
.rise:nth-of-type(3) { animation-delay: 0.12s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } }

/* The line of small print under a pill, and the room a pill takes in the hero. */
.act { margin-top: 2.2rem; }
.after-pill { margin-top: 0.9rem; font-size: 0.9rem; color: var(--ink-46); }
.after-pill a { color: var(--ink-62); }

/*
  Apple's own badge, unaltered, as their guidelines ask. White on our ground,
  at least 40px tall, with clear space around it of a quarter of its height.
*/
.badge { display: inline-block; line-height: 0; padding: 14px 0; transition: transform 0.18s ease, filter 0.18s ease; }
.badge img { height: 56px; width: auto; display: block; }
.badge:hover { filter: brightness(1.06); }
.badge:active { transform: scale(0.978); }
