/* The one stylesheet of the site. No import, no font file, no request. */
:root {
  color-scheme: light dark;
  --text: #1a1a1a;
  --ground: #ffffff;
  --link: #0b57d0;
  --line: 1rem;
  --group: 2.5rem;

  /* Roles of the creators page (#9595): its colours are named by job. */
  --muted: #4a4a4a;
  --panel: #f3f3f0;
  --hairline: #d9d9d4;
  --accent: #ffcc00;
  --on-accent: #1a1a1a;
  --signal: #1a1a1a;
  --on-signal: #ffffff;
  --card: #ffffff;
  --bar-track: #e2e2dd;
  --bar-apple: #727270;
  --on-bar-apple: #ffffff;
  --bar-left: #4a4a4a;
  --on-bar-left: #ffffff;
  --bar-linx: #8c8c88;
  --on-bar-linx: #1a1a1a;
  --you: #ffcc00;
  --on-you: #1a1a1a;
  --you-edge: #1a1a1a;
  --field: #ffffff;

  /* The same in light and in dark: the cinematic near-black and what stands on it. */
  --on-ink: #ffffff;
  --stage: #0d0f14;
  --on-stage: #f5f5f2;
  --on-stage-muted: #b9bcc4;
  --stage-raised: #1c1e26;
  --stage-hairline: #2d303a;
  --on-stage-link: #8ab4f8;
  --glow-accent: rgba(255, 204, 0, 0.16);
  --glow-blue: rgba(70, 110, 190, 0.24);

  /* Spacing and radius steps. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-6: 24px;
  --s-8: 32px;
  --s-12: 48px;
  --s-16: 64px;
  --s-24: 96px;
  --s-32: 128px;
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;
  --section: var(--s-16);
  --gutter: var(--s-4);
  --wrap-max: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #ececec;
    --ground: #121212;
    --link: #8ab4f8;
    --muted: #b8b8b8;
    --panel: #1e1e1e;
    --hairline: #333333;
    --accent: #ffd60a;
    --on-accent: #1a1a1a;
    --signal: #ffd60a;
    --on-signal: #1a1a1a;
    --card: #2a2a2a;
    --bar-track: #3a3a3a;
    --bar-apple: #9a9a96;
    --on-bar-apple: #1a1a1a;
    --bar-left: #c9c9c4;
    --on-bar-left: #1a1a1a;
    --bar-linx: #6e6e6a;
    --on-bar-linx: #ffffff;
    --you: #ffd60a;
    --on-you: #1a1a1a;
    --you-edge: transparent;
    --field: #1e1e1e;
  }
}

@media (min-width: 900px) {
  :root {
    --section: var(--s-24);
    --gutter: var(--s-8);
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  text-align: left;
}

body:not(.creators) main {
  box-sizing: border-box;
  max-width: 65ch;
  margin: 0 auto;
  padding: var(--group) var(--line);
}

body:not(.creators) h1 {
  margin: 0 0 var(--group);
  font-size: 2rem;
  line-height: 1.2;
}

body:not(.creators) h2 {
  margin: var(--group) 0 var(--line);
  font-size: 1.375rem;
  line-height: 1.3;
}

body:not(.creators) p,
body:not(.creators) ul,
body:not(.creators) ol {
  margin: 0 0 var(--line);
}

a {
  color: var(--link);
  text-decoration: underline;
}

body:not(.creators) nav {
  display: flex;
  flex-direction: column;
  margin-top: var(--group);
}

nav a,
a.contact {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ---------------------------------------------------------------------------
   The creators page (/creators, #9595). Its look is docs/prototypes/creators-page.html.
   The rules above are scoped to body:not(.creators); everything below acts on
   .creators or on a class only that page uses, so the text pages never change.
   Bare element rules sit in :where() (specificity 0), so a class always wins
   over them and a margin rule can never beat a component's own.
   --------------------------------------------------------------------------- */
:where(.creators) *,
:where(.creators) *::before,
:where(.creators) *::after {
  box-sizing: border-box;
}

:where(.creators) {
  -webkit-font-smoothing: antialiased;
}

:where(.creators) h1,
:where(.creators) h2,
:where(.creators) h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

:where(.creators) h1 {
  font-size: 36px;
  line-height: 1.15;
}

:where(.creators) h2 {
  margin-bottom: var(--s-4);
  font-size: 30px;
  line-height: 1.2;
}

:where(.creators) h3 {
  margin-bottom: var(--s-2);
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

@media (min-width: 720px) {
  :where(.creators) h1 {
    font-size: 48px;
    line-height: 1.1;
  }

  :where(.creators) h2 {
    font-size: 36px;
    line-height: 1.15;
  }
}

@media (min-width: 1100px) {
  :where(.creators) h1 {
    font-size: 60px;
    line-height: 1.05;
    letter-spacing: -0.03em;
  }
}

:where(.creators) p,
:where(.creators) ul,
:where(.creators) ol {
  margin: 0 0 var(--s-4);
}

:where(.creators) p {
  max-width: 65ch;
}

:where(.creators) section {
  padding: var(--section) 0;
}

.wrap {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* 16 px under an eyebrow, as the prototype draws it (its paragraph margin). */
.eyebrow {
  margin: 0 0 var(--s-4);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lead {
  max-width: 34ch;
  font-size: 20px;
  line-height: 1.4;
}

@media (min-width: 900px) {
  .lead {
    font-size: 24px;
    line-height: 1.3;
  }
}

/* A dark band: the cinematic ground, the same in light and in dark. */
.stage {
  background: var(--stage);
  color: var(--on-stage);
}

.stage a {
  color: var(--on-stage-link);
}

.stage .eyebrow {
  color: var(--on-stage);
}

a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--s-6);
  border-radius: var(--r-full);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.stage a.button {
  color: var(--on-accent);
}

.textlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-6);
  align-items: center;
}

/* The brand strip. */
.top {
  padding: var(--s-3) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.stage .brand {
  color: var(--on-stage);
}

.brand small {
  margin-left: var(--s-3);
  font-size: 18px;
  font-weight: 400;
}

.stage .brand small {
  color: var(--on-stage-muted);
}

/* The opening (#9596): a dark poster, the words beside a drawn phone on a
   computer and above it on a phone. */
.hero {
  position: relative;
  overflow: hidden;
}

.hero .actions {
  margin-bottom: 0;
}

/* The two glows belong to the whole opening (strip and poster) and fade out
   before its edges, so there is no seam between the two. */
.opening-a {
  background:
    radial-gradient(60% 45% at 85% 32%, var(--glow-accent), transparent 70%),
    radial-gradient(55% 40% at 10% 72%, var(--glow-blue), transparent 70%),
    var(--stage);
}

.opening-a .top,
.opening-a .hero-a {
  background: transparent;
}

.hero-grid {
  display: grid;
  gap: var(--s-12);
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: var(--s-16);
  }
}

.hero-copy .lead {
  margin: var(--s-6) 0 var(--s-8);
}

.hero-art {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.phone {
  display: block;
  width: 100%;
  height: auto;
}

/* The price tag stays inside the gutter on a phone and overhangs the phone's
   right edge on a computer. */
.tag {
  position: absolute;
  right: 0;
  bottom: 12%;
  width: 150px;
  height: auto;
}

@media (min-width: 900px) {
  .hero-art {
    max-width: 420px;
  }

  .tag {
    right: -24px;
    width: 180px;
  }
}

/* How it works. */
ol.steps {
  display: grid;
  gap: var(--s-8);
  margin: var(--s-8) 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 900px) {
  ol.steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-12);
  }
}

.steps li {
  padding-top: var(--s-6);
  border-top: 1px solid var(--hairline);
}

.steps .n {
  display: block;
  margin-bottom: var(--s-4);
  color: var(--signal);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

@media (min-width: 900px) {
  .steps .n {
    font-size: 60px;
  }
}

.steps p {
  margin: 0;
}

/* The money (#9597): two figures, one per Apple commission. A bar is a CSS box
   of a share of its track, never an image. */
.figures {
  display: grid;
  gap: var(--s-8);
  margin: var(--s-8) 0;
}

@media (min-width: 900px) {
  .figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-12);
    margin-bottom: var(--s-12);
  }
}

figure {
  margin: 0;
  padding: var(--s-6);
  border-radius: var(--r-lg);
  background: var(--card);
}

figcaption {
  margin-bottom: var(--s-4);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

figcaption small {
  display: block;
  color: var(--muted);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0;
}

table.split {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

table.split th,
table.split td {
  padding: var(--s-3) 0;
  border-top: 1px solid var(--hairline);
  text-align: left;
  vertical-align: middle;
}

table.split tr:first-child th,
table.split tr:first-child td {
  border-top: 0;
}

table.split th {
  width: 40%;
  padding-right: var(--s-3);
  font-weight: 400;
}

table.split td.v {
  width: 4.5em;
  padding-left: var(--s-3);
  font-weight: 600;
  text-align: right;
}

table.split tr.you th,
table.split tr.you td {
  font-weight: 700;
}

@media (max-width: 719px) {
  table.split,
  table.split tbody {
    display: block;
  }

  table.split tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--s-1) var(--s-4);
    padding: var(--s-3) 0;
    border-top: 1px solid var(--hairline);
  }

  table.split tr:first-child {
    border-top: 0;
  }

  table.split th,
  table.split td {
    display: block;
    width: auto;
    padding: 0;
    border-top: 0;
  }

  table.split th {
    grid-column: 1 / -1;
  }

  table.split td.v {
    width: auto;
  }
}

.bar {
  display: block;
  height: 12px;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--bar-track);
}

.bar i {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: var(--r-sm);
  background: var(--bar-left);
}

.bar.apple i {
  background: var(--bar-apple);
}

.bar.you i {
  background: var(--you);
  box-shadow: inset 0 0 0 2px var(--you-edge);
}

.bar.total {
  background: transparent;
}

.bar.total i {
  background: var(--bar-track);
  box-shadow: inset 0 0 0 1px var(--bar-left);
}

.money .note {
  background: var(--card);
}

.money .note p {
  max-width: 65ch;
}

/* The terms (#9597). */
.creators ol.terms-list {
  display: grid;
  gap: var(--s-6);
  margin: var(--s-8) 0 var(--s-6);
  padding: 0;
  list-style: none;
}

@media (min-width: 900px) {
  .creators ol.terms-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-8) var(--s-12);
    margin-bottom: var(--s-8);
  }
}

.terms-list li {
  padding-top: var(--s-4);
  border-top: 1px solid var(--hairline);
}

.terms-list b {
  display: block;
  margin-bottom: var(--s-2);
  font-size: 24px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.note {
  max-width: none;
  margin: 0 0 var(--s-4);
  padding: var(--s-4) var(--s-6);
  border-radius: var(--r-lg);
  background: var(--panel);
}

.note p {
  margin: 0;
}

.panel {
  background: var(--panel);
}

/* The footer. */
.creators footer {
  padding: var(--s-8) 0;
  border-top: 1px solid var(--hairline);
}

.creators footer nav {
  display: flex;
  flex-direction: column;
  margin-top: 0;
}

@media (min-width: 720px) {
  .creators footer nav {
    flex-direction: row;
    gap: var(--s-8);
  }
}

/* Motion: earned by the opening and the steps. Nothing loops. Under Reduce Motion
   each one is an opacity change over the same span and nothing travels. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(12px);
    }

    to {
      opacity: 1;
      transform: none;
    }
  }

  .rise {
    animation: rise 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .rise:nth-child(2) {
    animation-delay: 80ms;
  }

  .rise:nth-child(3) {
    animation-delay: 160ms;
  }

  .rise:nth-child(4) {
    animation-delay: 240ms;
  }

  .hero-art.rise {
    animation-delay: 200ms;
  }

  @supports (animation-timeline: view()) {
    .bar i {
      animation: wipe linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 80%;
    }

    @keyframes wipe {
      from {
        clip-path: inset(0 100% 0 0);
      }

      to {
        clip-path: inset(0 0 0 0);
      }
    }

    .steps li,
    .terms-list li {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  @keyframes fade {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }

  .rise {
    animation: fade 420ms linear both;
  }

  .rise:nth-child(2) {
    animation-delay: 80ms;
  }

  .rise:nth-child(3) {
    animation-delay: 160ms;
  }

  .rise:nth-child(4) {
    animation-delay: 240ms;
  }

  @supports (animation-timeline: view()) {
    .bar i {
      animation: fade linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 80%;
    }

    .steps li,
    .terms-list li {
      animation: fade linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}
