/* Stay's site, in Apple's design language (the owner's call, 2026-11-28; tokens from
   design-md `apple`): SF Pro, display sizes set tight; white and a pale grey taking turns as
   the section divider; one accent, Stay's ultramarine where Apple has its blue; pill buttons;
   one soft shadow, under pictures only. The painting is Stay's own and stays. Light only,
   whatever the Mac is set to: the site tells one story, in Stay's colours (the owner, 2026-11-28).
   No scripts, no web fonts, nothing loaded from anywhere else (see vercel.json). */

:root {
  --paper: #ffffff;
  --parchment: #f5f5f7;
  --ink: #1d1d1f;
  --ink-dim: #6e6e73;
  --ultramarine: #1d3f94;
  --ultramarine-deep: #142d6c;
  --duck: #f2c230;
  --hairline: rgba(0, 0, 0, 0.1);
  --card: #ffffff;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --measure: 38rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.47 var(--sans);
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ultramarine); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ultramarine-deep); text-decoration-thickness: 2px; }
a:focus-visible, .button:focus-visible { outline: 2px solid var(--ultramarine); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--card); padding: 0.5rem 0.75rem; z-index: 1; }

/* ——— header and footer, the same on every page ——— */

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 72rem; margin: 0 auto; padding: 1.25rem 1.5rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.125rem; }
.brand img { width: 32px; height: 32px; }
.bar nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; font-size: 0.95rem; }
/* Narrow screens and large text: the links wrap under the name rather than run off the page. */
@media (max-width: 30em) { header .bar { flex-wrap: wrap; } header .bar nav { gap: 0.4rem 1rem; } }
.bar nav a { color: var(--ink-dim); text-decoration: none; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--ink); }

/* Apple's footer: the pale grey, small type. */
footer {
  background: var(--parchment);
  border-top: 1px solid var(--hairline);
  margin-top: 6rem;
}
footer .bar { flex-wrap: wrap; color: var(--ink-dim); font-size: 0.875rem; padding-block: 2rem; }
footer nav { flex-wrap: wrap; }

/* ——— home ——— */

/* The first screen is the painting, edge to edge, with the header and the words on its blue. */
.page-index header { position: absolute; inset: 0 0 auto 0; z-index: 3; }
.page-index header .brand, .page-index header nav a { color: #fff; }
.page-index header nav a { opacity: 0.85; }
.page-index header nav a:hover { opacity: 1; color: #fff; }

.stage {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(88vh, 860px); display: flex; align-items: center;
  background: #1d3f94 url(/assets/painting.webp) 50% 42% / cover no-repeat;
  color: #fff;
}
/* A little shade on the left, so the words read on any part of the blue. */
.stage::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(8, 18, 48, 0.42), rgba(8, 18, 48, 0) 62%);
}
.stage .copy { width: 100%; max-width: 72rem; margin: 0 auto; padding: 7rem 1.5rem 3rem; }
.stage h1 {
  font: 600 clamp(2.6rem, 6.2vw, 5.2rem)/1.03 var(--display); letter-spacing: -0.02em;
  margin: 0 0 1.1rem; max-width: 12ch; text-wrap: balance; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}
.stage .lede { font-size: 1.25rem; max-width: 33rem; margin: 0 0 2rem; color: rgba(255, 255, 255, 0.92); text-wrap: pretty; }
.stage .get { margin-bottom: 1.5rem; }
.stage .button { background: #fff; color: #1d3f94; }
.stage .button:hover { background: #f2f0ea; color: #142d6c; }
.stage .button[aria-disabled="true"] { background: rgba(255, 255, 255, 0.22); color: #fff; }
.stage .get small, .stage .get small a { color: rgba(255, 255, 255, 0.85); }
.stage .get small a:hover { color: #fff; }

/* The duck's wake under the words: drawn once on load, the duck at its front, then still.
   Only transforms move (the line is uncovered by two layers sliding against each other, the
   duck is a picture sliding along), so the browser moves pictures instead of redrawing an SVG
   every frame, which stuttered in Safari. The end of the swim is the resting state. */
.wake { position: relative; height: 90px; max-width: 60rem; pointer-events: none; }
.wake .run { position: absolute; left: 0.6%; width: 87.6%; top: 33.3%; height: 35.6%; }
.run { container-type: inline-size; }
.run .reveal, .run .reveal-in { position: absolute; inset: 0; display: block; }
.run .reveal { overflow: hidden; }
.run svg { display: block; width: 100%; height: 100%; overflow: visible; }
.run path { fill: none; stroke: rgba(255, 255, 255, 0.92); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.run .duck { position: absolute; left: 0; bottom: 50%; height: auto; transform: translateX(100cqw); }
.wake .duck { width: 46px; margin-left: -23px; }
@media (prefers-reduced-motion: no-preference) {
  .wake .reveal, .wake .reveal-in, .wake .duck {
    animation: 2.6s cubic-bezier(0.45, 0.05, 0.25, 1) 0.6s both; will-change: transform;
  }
  .wake .reveal { animation-name: uncover; }
  .wake .reveal-in { animation-name: hold-still; }
  .wake .duck { animation-name: swim-along; }
}
@keyframes uncover { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes hold-still { from { transform: translateX(100%); } to { transform: none; } }
@keyframes swim-along { from { transform: translateX(0); } to { transform: translateX(100cqw); } }

/* On a phone the painting turns to keep its yellow stroke in view, and the shade goes deeper. */
@media (max-width: 700px) {
  .stage { background-position: 100% 50%; min-height: 0; }
  .stage::before { background: linear-gradient(180deg, rgba(8, 18, 48, 0.5), rgba(8, 18, 48, 0.2)); }
  /* Room for the header, whose links wrap under the name here ("Stay Sticky" is wider). */
  .stage .copy { padding: 8rem 1.25rem 2rem; }
  .wake { height: 70px; }
  .wake .duck { width: 38px; margin-left: -19px; }
}

.hero { max-width: 68rem; margin: 0 auto; padding: 5rem 1.5rem 5.5rem; }
.hero h1 {
  font: 600 clamp(2.4rem, 5.5vw, 4.25rem)/1.05 var(--display);
  letter-spacing: -0.02em; margin: 0 0 1rem; max-width: 14ch; text-wrap: balance;
}
.hero p.lede { font-size: 1.25rem; color: var(--ink-dim); max-width: 34rem; margin: 0 0 2rem; text-wrap: pretty; }

.get { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-bottom: 3rem; }
.button {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--ultramarine); color: #fff; text-decoration: none;
  font-weight: 400; font-size: 1.0625rem; padding: 0.7rem 1.4rem; border-radius: 999px;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.button:hover { color: #fff; background: var(--ultramarine-deep); }
.button:active { transform: scale(0.97); }
.button[aria-disabled="true"] { background: var(--hairline); color: var(--ink-dim); cursor: default; }
.get small { color: var(--ink-dim); font-size: 0.9rem; }

figure { margin: 0; }
/* A note picture is the note alone, cut to its own corners (52 px on 1920 × 1200 for these two,
   64 px on 1920 × 988 for the tiles below); the radius follows it at any width, so the one soft
   shadow hugs the note. */
.shot img, .story img.note {
  display: block; width: 100%; height: auto; border-radius: 2.7% / 4.33%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 24px 60px -24px rgba(20, 40, 90, 0.5);
}



/* The story under the first screen, as Apple lays a page out: bands of white and pale grey
   taking turns, the duck's own band on the painting, and the shape changing as it goes, centred,
   side by side, tiles, so no two bands in a row look alike. */
.problem, .story, .small-print { padding: 5.5rem max(1.5rem, (100% - 72rem) / 2); text-align: center; }
.problem { background: var(--parchment); }
.problem > *, .story > div:first-child, .small-print > h2 { max-width: 40rem; margin-left: auto; margin-right: auto; }
.problem h2, .story h2, .small-print h2, .closing h2 {
  font: 600 clamp(2rem, 4.4vw, 3rem)/1.08 var(--display); letter-spacing: -0.025em; margin: 0 auto 0.9rem; text-wrap: balance;
}
.problem p { font-size: 1.3rem; line-height: 1.4; color: var(--ink-dim); text-wrap: pretty; margin: 0 auto; }

.story { display: flex; flex-direction: column; gap: 3rem; align-items: center; }
.story p { margin: 0 0 0.7rem; color: var(--ink-dim); font-size: 1.3rem; line-height: 1.4; text-wrap: pretty; }
.story strong { color: var(--ink); font-weight: 600; }
.story .aside { font-weight: 600; color: var(--ink); }
.story > img, .story > .pair { width: 100%; max-width: 58rem; }
.story > img { display: block; height: auto; border-radius: 18px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 24px 60px -28px rgba(20, 40, 90, 0.45); }
.story .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.story .pair img { display: block; width: 100%; height: auto; border-radius: 3.33% / 6.48%; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 20px 50px -26px rgba(20, 40, 90, 0.4); }
.story.tiles, .story.side:last-child { background: var(--parchment); }

/* Side by side: the words on one side, the picture larger on the other. */
.story.side { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4.5rem; align-items: center; text-align: left; }
.story.side > div:first-child { margin: 0; }
.story.side > img { max-width: none; }
.story.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.story.flip > img { order: -1; }

/* The keys to press, as keys. */
.keys { display: inline-flex; gap: 0.18em; vertical-align: 0.08em; }
kbd {
  display: inline-block; min-width: 1.75em; padding: 0.12em 0.42em; text-align: center;
  font: 500 0.78em/1.35 var(--sans); color: var(--ink);
  background: linear-gradient(#ffffff, #f2f2f4); border: 1px solid rgba(0, 0, 0, 0.14); border-radius: 0.38em;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The duck's band: the painting again, the three clicks spelled out, and the task written large,
   swum out as the band comes up the screen: the duck leaves its box (started), swims the words
   out, and the box ticks. Transforms and opacity only, as in the first screen. The end of the
   swim is the resting state: with Reduce Motion, or without scroll timelines, it shows swum. */
.story.swim-band {
  color: #fff; background: #1d3f94 url(/assets/painting.webp) 30% 75% / cover no-repeat;
  position: relative; isolation: isolate;
}
.story.swim-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(8, 18, 48, 0.22); }
.swim-band h2 { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25); }
.swim-band p { color: rgba(255, 255, 255, 0.9); }
.swim-band .aside { color: #fff; margin: 0; }
.steps { list-style: none; margin: 0 0 1rem; padding: 0; font-size: 1.3rem; line-height: 1.4; color: rgba(255, 255, 255, 0.9); }
.steps li + li { margin-top: 0.35rem; }
.steps strong { color: #fff; }

.swim { margin: 0; width: 100%; display: flex; justify-content: center; view-timeline: --swim block; }
.task { display: inline-flex; align-items: center; gap: 0.45em; font: 500 clamp(2.1rem, 6vw, 4rem)/1.2 var(--display); letter-spacing: -0.01em; color: #fff; }
.task .box {
  flex: none; display: grid; place-items: center; width: 0.9em; height: 0.9em; border-radius: 0.22em;
  border: 0.05em solid rgba(255, 255, 255, 0.9); background: rgba(255, 255, 255, 0.16);
}
.task .tick { width: 78%; height: 78%; }
.task .tick path { fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.task .words-wrap { position: relative; }
.task .words { opacity: 0.62; }
.task .run { position: absolute; left: -0.05em; right: -0.05em; top: 0.6em; height: 0.18em; }
.task .run path { stroke: #fff; stroke-width: 3.5; }
.task .duck { width: 1.1em; margin-left: -0.55em; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .task .reveal, .task .reveal-in, .task .duck, .task .box, .task .tick, .task .words {
      animation: linear both; animation-timeline: --swim; animation-range: cover 20% cover 58%;
    }
    .task .reveal, .task .reveal-in, .task .duck { will-change: transform; }
    .task .box, .task .tick, .task .words { will-change: opacity; }
    .task .reveal { animation-name: band-uncover; }
    .task .reveal-in { animation-name: band-hold; }
    .task .duck { animation-name: band-swim; }
    .task .box { animation-name: box-shows; }
    .task .tick { animation-name: tick-shows; }
    .task .words { animation-name: words-swum; }
  }
}
/* 0–15%: the duck hops from its box onto the line; 15–100%: it swims, uncovering its wake. */
@keyframes band-swim { 0% { transform: translate(-0.9em, 0.38em); } 15% { transform: translate(0, 0); } 100% { transform: translate(100cqw, 0); } }
@keyframes band-uncover { 0%, 15% { transform: translateX(-100%); } 100% { transform: none; } }
@keyframes band-hold { 0%, 15% { transform: translateX(100%); } 100% { transform: none; } }
@keyframes box-shows { 0%, 8% { opacity: 0; } 18%, 100% { opacity: 1; } }
@keyframes tick-shows { 0%, 94% { opacity: 0; } 100% { opacity: 1; } }
@keyframes words-swum { 0%, 82% { opacity: 1; } 100% { opacity: 0.62; } }

/* The small print as Apple's store cards: pale grey on white, round corners, no shadow. */
.small-print h2 { margin: 0 auto 2.5rem; }
.small-print dl { max-width: 64rem; margin: 0 auto; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); text-align: left; }
.small-print dl > div { background: var(--parchment); border-radius: 18px; padding: 1.6rem 1.5rem; }
.small-print dt { font: 600 1.3rem/1.2 var(--display); letter-spacing: -0.015em; }
.small-print dd { margin: 0.4rem 0 0; color: var(--ink-dim); }

/* The door again, on the painting, at the end. */
.closing {
  margin: 0 0 -6rem; padding: 6rem 1.5rem; text-align: center; color: #fff;
  background: #1d3f94 url(/assets/painting.webp) 50% 70% / cover no-repeat;
}
.closing h2 { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25); margin-bottom: 1.6rem; }
.closing .get { justify-content: center; margin: 0; }
.closing .button { background: #fff; color: #1d3f94; }
.closing .button:hover { background: #f2f0ea; color: #142d6c; }
.closing .button[aria-disabled="true"] { background: rgba(255, 255, 255, 0.22); color: #fff; }
.closing .get small, .closing .get small a { color: rgba(255, 255, 255, 0.85); }

@media (max-width: 860px) {
  .problem, .story, .small-print { padding: 4rem 1.25rem; }
  .story, .story.side, .story.flip { display: flex; flex-direction: column; gap: 2rem; text-align: center; }
  .story.side > div:first-child { margin: 0 auto; }
  .story.flip > img { order: 0; }
  .story p { font-size: 1.15rem; }
  .story .pair { grid-template-columns: 1fr; }
}

/* ——— the reading pages: privacy, terms, security, acknowledgements ——— */

main.doc { max-width: var(--measure); margin: 0 auto; padding: 2.5rem 1.5rem 0; }
.doc h1 { font: 600 clamp(2rem, 4vw, 2.75rem)/1.1 var(--display); letter-spacing: -0.015em; margin: 0 0 0.5rem; }
.doc .meta { color: var(--ink-dim); font-size: 0.9rem; margin: 0 0 2.5rem; }
.doc h2 { font: 600 1.3rem/1.3 var(--sans); margin: 2.75rem 0 0.6rem; }
.doc h3 { font: 600 1.05rem/1.4 var(--sans); margin: 1.75rem 0 0.4rem; }
.doc p, .doc li { text-wrap: pretty; }
.doc ul { padding-left: 1.2rem; }
.doc li + li { margin-top: 0.35rem; }
.doc .summary { background: var(--card); border: 1px solid var(--hairline); border-radius: 12px; padding: 1.1rem 1.35rem; }
.doc .summary p { margin: 0.4rem 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 1rem 0; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem 0.6rem 0; border-bottom: 1px solid var(--hairline); }
.doc th { font-weight: 600; }
.doc code, .doc pre { font: 0.9em/1.5 ui-monospace, "SF Mono", Menlo, monospace; }
.doc pre { background: var(--card); border: 1px solid var(--hairline); border-radius: 10px; padding: 0.9rem 1rem; overflow-x: auto; }
.soon { font: 500 0.75rem/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-dim);
        border: 1px solid var(--hairline); border-radius: 999px; padding: 0.2em 0.6em; vertical-align: middle; }
.doc li::marker { color: var(--ink-dim); }
.pending { background: color-mix(in srgb, var(--duck) 35%, transparent); padding: 0 0.25em; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}
