/* Hadrien Bode portfolio. One stylesheet for every page; no dark mode (light only, on purpose). */

/* ───────── Reset and shared behaviour ───────── */
:root { color-scheme: light; --bg: #f4f4f7; --panel: #fff; --text: #111114; --muted: #62626b; --line: #e4e4ea; --accent: #0a62e0; --focus: #0a62e0; --clip-radius: 18px; --max: 1120px; --gutter: clamp(16px, 3.4vw, 48px); }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Smooth only after a click in the page (a menu link has focus), so a refresh or a back lands in place without gliding. */
html:focus-within { scroll-behavior: smooth; }
body { margin: 0; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
main:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[id] { scroll-margin-top: 88px; }
.ico { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 40; padding: 10px 16px; border-radius: 8px; background: #17161a; color: #fff; font-weight: 600; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* Clips: a still image, replaced by its looping video while it plays (main.js). */
.clip { position: relative; overflow: hidden; aspect-ratio: 9 / 16.5; border-radius: var(--clip-radius); background: #e6e2da; }
.clip--wide { aspect-ratio: 16 / 9; }
.clip--tall { aspect-ratio: 9 / 19.5; }
.card .clip--tall { aspect-ratio: 9 / 16.5; }
.clip img, .clip video { width: 100%; height: 100%; object-fit: cover; }
.clip video { position: absolute; inset: 0; opacity: 0; transition: opacity 200ms; }
.clip.is-playing video { opacity: 1; }
.clip__btn { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #17161a; font-size: .8rem; line-height: 1; }
@media (prefers-reduced-motion: reduce) {
  html, html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ───────── Layout ───────── */
body { background: var(--bg); color: var(--text); font-family: Figtree, system-ui, sans-serif; }
main { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
h1, h2 { font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); }
strong { font-weight: 650; }
.muted { color: var(--muted); }

.top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 4px max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); background: rgba(244, 244, 247, .97); border-bottom: 1px solid var(--line); }
.top__name { display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; }
.top__nav { display: flex; gap: 4px; }
.top__nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; font-size: .9375rem; font-weight: 550; color: var(--muted); }
.top__nav a:hover { color: var(--text); }
.top__nav a[aria-current] { color: var(--accent); }

.listing { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px clamp(16px, 3vw, 32px); align-items: center; padding: clamp(28px, 5vw, 56px) 0 24px; }
.mono { display: block; width: clamp(96px, 16vw, 168px); height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 22%; background: #d9ccff; }
.listing h1 { font-size: clamp(2rem, 1.2rem + 3.6vw, 3.75rem); }
.listing .muted { margin-top: 4px; font-size: clamp(1rem, .9rem + .4vw, 1.25rem); }
.listing__text .pill { margin-top: 14px; }
.listing__text .pill + .pill { margin-left: 8px; }
.listing__lede { grid-column: 1 / -1; max-width: 42em; font-size: clamp(1.0625rem, 1rem + .4vw, 1.3125rem); }

.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 20px; border-radius: 999px; background: #e8eef9; color: var(--accent); font-weight: 700; font-size: .9375rem; white-space: nowrap; transition: background 200ms; }
.pill:hover { background: #d9e4f6; }
.pill--solid { background: var(--accent); color: #fff; }
.pill--solid:hover { background: #084fb6; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 16px 0; border-block: 1px solid var(--line); text-align: center; }
.stats li { padding: 4px 12px; }
.stats li + li { border-left: 1px solid var(--line); }
.stats strong { display: block; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); font-weight: 800; line-height: 1.1; }
.stats span { display: block; margin-top: 4px; color: var(--muted); font-size: .8125rem; line-height: 1.3; }

.panel { margin-top: clamp(24px, 3vw, 36px); padding: clamp(20px, 3vw, 36px); border-radius: 24px; background: var(--panel); }
.kicker { color: var(--accent); font-size: .8125rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.today { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px clamp(24px, 4vw, 48px); align-items: center; }
.today__head { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.today__head h2 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); }
.today__head .muted { margin-top: 4px; font-size: .9375rem; }
.today__intro { margin-top: 18px; font-size: 1.1875rem; font-weight: 600; line-height: 1.3; }
.today__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ticks { display: grid; gap: 6px; margin-top: 12px; color: var(--muted); }
.ticks li { position: relative; padding-left: 16px; }
.ticks li::before { content: ''; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.ticks strong { color: var(--text); }

.shelf { margin-top: clamp(32px, 5vw, 56px); }
/* 404 page */
.lost { display: grid; justify-items: start; gap: 12px; margin-block: clamp(32px, 8vw, 96px); padding-block: clamp(32px, 6vw, 64px); }
.lost h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; }
.lost .pill { margin-top: 8px; }
.shelf__sub { margin-top: 6px; color: var(--muted); }
.shelf__sub + .apps { margin-top: 14px; }
.apps .app:hover .pill--solid { background: #084fb6; }
/* Games shelf: games with a demo carry a Playable badge, low on the image so it leaves the title art clear.
   The View pill takes its place on hover. */
.card__badge { position: absolute; z-index: 1; bottom: 12px; left: 12px; transition: opacity 200ms; display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px 5px 9px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--accent); font-size: .8125rem; font-weight: 750; box-shadow: 0 2px 8px rgba(17, 17, 20, .16); }
.shelf__row { display: flex; gap: 16px; margin: 16px calc(var(--gutter) * -1) 0; padding: 4px var(--gutter) 12px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-width: thin; }
/* One row height; each card takes the width of its image format. */
.shelf__row { --h: clamp(348px, 38.5vw, 425px); }
.shot-card { flex: none; width: calc(var(--h) * (var(--ar, 9 / 16.5))); scroll-snap-align: start; }
.shot-card .clip { aspect-ratio: var(--ar); }
.card__cover { display: block; width: 100%; height: var(--h); object-fit: cover; border-radius: var(--clip-radius); background: #e6e2da; }
.card__link { display: block; border-radius: 18px; }
/* Games shelf, on hover: the image zooms in its frame, a soft shade rises from the bottom and a "View" pill slides up. */
.card__media { position: relative; display: block; border-radius: var(--clip-radius); overflow: hidden; isolation: isolate; }
.card__view { display: none; }
@media (hover: hover) and (pointer: fine) {
  .card__media > .card__cover, .card__media > .clip { transition: transform 500ms cubic-bezier(.2, .7, .3, 1); }
  .card__view { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 20px; background: linear-gradient(to top, rgba(17, 17, 20, .45), rgba(17, 17, 20, 0) 45%); opacity: 0; transition: opacity 300ms; }
  .card__view span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 999px; background: #fff; color: var(--accent); font-weight: 700; font-size: .9375rem; box-shadow: 0 4px 14px rgba(17, 17, 20, .2); transform: translateY(14px); transition: transform 400ms cubic-bezier(.2, .7, .3, 1); }
  .card__view span::after { content: '→'; }
  .card__link:hover .card__media > .card__cover, .card__link:hover .card__media > .clip { transform: scale(1.04); }
  .card__link:hover .card__view, .card__link:focus-visible .card__view { opacity: 1; }
  .card__link:hover .card__badge, .card__link:focus-visible .card__badge { opacity: 0; }
  .card__link:hover .card__view span, .card__link:focus-visible .card__view span { transform: none; }
  .shot-card .card__link:hover strong { color: var(--accent); }
  /* Clicked: the zoom settles back and the pill fades before the page changes (main.js). */
  .card__link.is-leaving .card__media > .card__cover, .card__link.is-leaving .card__media > .clip { transform: none; transition-duration: 180ms; }
  .card__link.is-leaving .card__view { opacity: 0; transition-duration: 150ms; }
}
@media (prefers-reduced-motion: reduce) {
  .card__media > .card__cover, .card__media > .clip, .card__view, .card__view span { transition: opacity 200ms; }
  .card__link:hover .card__media > .card__cover, .card__link:hover .card__media > .clip { transform: none; }
  .card__view span { transform: none; }
}

.app { display: flex; align-items: center; gap: 12px; }
.app--mini { margin-top: 10px; }
.app__icon { width: 64px; height: 64px; flex: none; border-radius: 22%; }
.app--mini .app__icon { width: 44px; height: 44px; }
/* The studio stays on one line so every shelf card keeps the same height. */
.app--mini .app__text { min-width: 0; }
.app--mini .app__text span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.app__text { flex: 1; min-width: 0; line-height: 1.25; }
.app__text strong, .app__text span { display: block; }
.app__text span { margin-top: 2px; color: var(--muted); font-size: .875rem; }
.apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 48px); margin-top: 16px; padding-block: 8px; }
.apps .card { border-bottom: 1px solid var(--line); }
.apps .card:nth-last-child(-n+2) { border-bottom: 0; }
.apps .app { padding: 12px 0; }
.apps .app:hover strong { color: var(--accent); }

.about__big { margin-top: 12px; max-width: 34em; font-size: clamp(1.125rem, 1rem + .6vw, 1.5rem); font-weight: 600; line-height: 1.3; }

.skills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.skills li { padding: 6px 14px; border-radius: 999px; background: var(--bg); font-size: .875rem; font-weight: 650; }
.xp__more { margin-top: 24px; }
/* Experience: a company per row with a badge, its roles on a small timeline when there are several. */
.tl { margin-top: 8px; }
.tl__co { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.tl__co:last-child { border-bottom: 0; }
/* Company logos, from each studio's site or Wikipedia. */
.tl__badge { width: 56px; height: 56px; border-radius: 22%; background: #fff; }
.tl__company { font-size: 1.25rem; font-weight: 800; line-height: 1.2; }
.tl__logo { display: block; width: 56px; height: 56px; border-radius: 22%; transition: transform .15s ease; }
.tl__logo:hover { transform: scale(1.05); }
.tl__company a { color: inherit; text-decoration: none; }
.tl__company a:hover { color: var(--accent); }
.tl__ext { color: var(--muted); font-size: .8em; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .tl__logo { transition: none; } .tl__logo:hover { transform: none; } }
.tl__roles { display: grid; gap: 16px; margin-top: 10px; }
.tl__roles--multi { position: relative; padding-left: 20px; }
.tl__roles--multi::before { content: ''; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 2px; border-radius: 1px; background: var(--line); }
.tl__roles--multi .tl__role { position: relative; }
.tl__roles--multi .tl__role::before { content: ''; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--accent); }
.tl__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.tl__date { flex: none; padding: 2px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.tl__line { margin-top: 4px; color: var(--muted); }
.tl__line strong { color: var(--text); }

.contact { margin-bottom: 40px; text-align: center; padding-block: clamp(36px, 6vw, 72px); }
.contact h2 { font-size: clamp(1.75rem, 1.2rem + 3vw, 3.25rem); }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }

.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; max-width: var(--max); margin: 0 auto; padding: 8px var(--gutter) 64px; color: var(--muted); font-size: .875rem; }
.foot__links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot__links a { display: inline-flex; align-items: center; min-height: 44px; }
.foot__links a:hover { color: var(--text); }

.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 8px; color: var(--accent); font-weight: 650; font-size: .9375rem; }
.listing--project { padding-top: 8px; }
.project__icon { width: clamp(96px, 16vw, 150px); height: auto; border-radius: 22%; }
.listing--project h1 { overflow-wrap: break-word; }
.strip { --h: clamp(300px, 34vw, 440px); display: flex; gap: 12px; margin: 24px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter) 8px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-width: thin; }
.strip > * { flex: none; width: auto; height: var(--h); scroll-snap-align: start; }
.strip__cover { border-radius: var(--clip-radius); background: #e6e2da; }
/* Every project opens on a portrait picture framed like its Games card. */
.strip--card > :first-child { aspect-ratio: 9 / 16.5; object-fit: cover; }
/* Carousels: arrows on mouse screens (added by main.js). */
.rail { position: relative; }
.rail__btn { display: none; }
@media (hover: hover) and (pointer: fine) {
  .rail__btn { position: absolute; z-index: 2; top: var(--arrow-y, 50%); display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--text); box-shadow: 0 2px 10px rgba(17, 17, 20, .18); cursor: pointer; opacity: 0; transform: translateY(-50%); transition: opacity 200ms, color 200ms; }
  .rail__btn--prev { left: calc(var(--gutter) * -.5 - 22px + 8px); }
  .rail__btn--next { right: calc(var(--gutter) * -.5 - 22px + 8px); }
  .rail:hover .rail__btn, .rail__btn:focus-visible { opacity: 1; }
  .rail__btn:hover { color: var(--accent); }
  .rail__btn[hidden] { display: none; }
}
@media (prefers-reduced-motion: reduce) { .rail__btn { transition: none; } }
/* Project page: "What I did", the story beside a column of short facts. */
.did h2 { margin-bottom: 18px; }
.did__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: clamp(20px, 4vw, 48px); align-items: start; }
.did--facts .did__grid { grid-template-columns: minmax(0, 1fr); }
.did__text { display: grid; gap: 14px; max-width: 40em; font-size: 1.0625rem; line-height: 1.55; }
.did__text .ticks { margin-top: 2px; }
.did__facts { display: grid; gap: 10px; }
.did--facts .did__facts { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.fact { padding: 12px 16px; border-radius: 16px; background: var(--bg); }
.fact dt { color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.fact dd { margin-top: 2px; font-weight: 650; line-height: 1.35; }
.shots-row { margin-top: clamp(28px, 4vw, 44px); }
.shots-row h2 { font-size: 1.375rem; }
.strip.strip--shots { --h: clamp(240px, 26vw, 340px); margin-top: 14px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0 40px; }
.pager a { padding: 16px 20px; border-radius: 18px; background: var(--panel); }
.pager a[rel='next'] { text-align: right; }
.pager span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8125rem; }
.pager strong { display: block; margin-top: 2px; }
.pager a:hover strong { color: var(--accent); }

@media (max-width: 860px) {
  .today { grid-template-columns: minmax(0, 1fr); }
  .apps { grid-template-columns: minmax(0, 1fr); }
  .apps .card:nth-last-child(2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 359px) {
  /* The tab bar is too narrow for "Playable ads" on one line. */
  .nav__more { display: none; }
}
@media (max-width: 620px) {
  /* A tab bar replaces the top links on phones. */
  /* No top bar on phones: the name is the home's title, and the tab bar below is the menu. (Arriving at an
     anchor, All work → #work, Safari on iPhone also drew the first frames without the sticky bar.) */
  .top { position: static; padding: 0; border: 0; background: none; }
  .top__name { display: none; }
  [id] { scroll-margin-top: 16px; }
  .listing--project .pill { white-space: normal; text-align: center; }
  .top__nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; justify-content: space-around; gap: 0; padding: 2px 4px calc(2px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); }
  /* Scrolling fast, Safari on iPhone moves the bar a moment after its own toolbar: the bar's background goes on
     below it, so the gap that opens is the bar's colour rather than the page showing through. */
  .top__nav::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 120px; background: inherit; pointer-events: none; }
  .top__nav a { flex: 1; justify-content: center; padding: 0; font-size: .8125rem; white-space: nowrap; }
  .foot { padding-bottom: 76px; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 14px; }
  .stats li:nth-child(3) { border-left: 0; }
  .shelf__row { --h: 66vw; }
  /* The key art fills the screen width; the captures follow at the same height. */
  .strip { --h: calc((100vw - 2 * var(--gutter)) * .78); }
  .strip--tall { --h: calc(62vw * 16.5 / 9); }
  .strip.strip--shots { --h: calc(46vw * 16.5 / 9); }
  /* A row of landscape images: one fills the screen width. */
  .strip.strip--wide { --h: calc((100vw - 2 * var(--gutter)) * 9 / 16); }
  .did__grid { grid-template-columns: minmax(0, 1fr); }
  .did__facts { grid-template-columns: 1fr 1fr; gap: 8px; }
  .fact { padding: 10px 12px; }
  .fact dd { font-size: .9375rem; }
    .pager strong { font-size: .9375rem; }
}

/* Playable ad demo: a phone-shaped dialog over the project page */
.ico--fill { fill: currentColor; stroke: none; }
.play { width: min(440px, calc(100vw - 2 * var(--gutter))); max-height: calc(100dvh - 32px); padding: 16px; border: 0; border-radius: 28px; background: var(--panel); color: var(--text); }
/* No backdrop blur: it would be recomputed every frame the game renders. */
.play::backdrop { background: rgba(17, 17, 20, .72); }
.play[open] { display: flex; flex-direction: column; gap: 12px; }
.play__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.play__bar h2 { font-size: 1.25rem; }
.play__close { display: grid; place-items: center; width: 44px; height: 44px; margin: -6px -6px -6px 0; border-radius: 50%; background: var(--bg); font-size: 1.5rem; line-height: 1; }
.play__close:hover { background: var(--line); }
.play__levels { display: flex; gap: 8px; }
.play__level { flex: 1; min-height: 40px; border-radius: 999px; background: #e8eef9; color: var(--accent); font-weight: 700; font-size: .875rem; }
.play__level[aria-pressed='true'] { background: var(--accent); color: #fff; }
/* Keeps the 9:16 frame of the ad, shrinking with short screens. */
.play__frame { align-self: center; width: min(100%, calc((100dvh - 200px) * 9 / 16)); aspect-ratio: 9 / 16; overflow: hidden; border-radius: 18px; background: #1b1b1f; }
.play__frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.play__note { color: var(--muted); font-size: .8125rem; text-align: center; }
@media (max-width: 620px) {
  .play { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border-radius: 0; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); }
  .play__frame { flex: 1; width: 100%; aspect-ratio: auto; min-height: 0; }
  .listing__text .pill + .pill { margin-left: 0; }
}

/* Links inside running text (project cards). */
a.inline { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a.inline:hover { text-decoration-thickness: 2px; }

/* ───────── Motion ─────────
   All of it only when the visitor has not asked for reduced motion. html.intro marks the first visit of the
   home in a session (set in the page head); main.js counts the key numbers up and adds .reveal / .is-in. */
.stats strong { font-variant-numeric: tabular-nums; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes sheet { from { transform: translateY(48px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes art-in { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  /* First arrival: the top of the home rises in, one block after the other. */
  .intro .listing > .mono, .intro .listing__text, .intro .listing__lede, .intro .stats, .intro .today { animation: rise 750ms cubic-bezier(.2, .7, .3, 1) both; }
  .intro .listing__text { animation-delay: 90ms; }
  .intro .listing__lede { animation-delay: 180ms; }
  .intro .stats { animation-delay: 270ms; }
  .intro .today { animation-delay: 380ms; }
  /* Sections below the fold fade up as they come into view; Games cards follow one another. */
  .reveal { opacity: 0; transform: translateY(28px); transition: opacity 700ms, transform 800ms cubic-bezier(.2, .7, .3, 1); }
  .reveal.is-in { opacity: 1; transform: none; }
  .reveal .shot-card { opacity: 0; transform: translateY(24px); transition: opacity 600ms, transform 700ms cubic-bezier(.2, .7, .3, 1); transition-delay: calc(150ms + var(--i, 0) * 70ms); }
  .reveal.is-in .shot-card { opacity: 1; transform: none; }

  /* Buttons give way a little under the finger or the click. */
  .pill, .play__level, .play__close, .clip__btn { transition: background 200ms, transform 150ms; }
  .pill:active, .play__level:active, .play__close:active, .clip__btn:active { transform: scale(.95); }
  .rail__btn { transition: opacity 200ms, color 200ms, transform 150ms; }
  .rail__btn:active { transform: translateY(-50%) scale(.9); }

  /* The playable demo opens with a small pop (a sheet sliding up on phones). */
  .play[open] { animation: pop 300ms cubic-bezier(.2, .7, .3, 1); }
  .play[open]::backdrop { animation: fade 300ms; }

  /* Between pages (Chrome, Edge, Safari 18.2+): a short crossfade, the header stays put, and the key art of a
     Games card flies to its place on the project page (and back). */
  /* The old page fades out quickly, so the two pages barely show through each other. */
  ::view-transition-old(root) { animation-duration: 140ms; }
  ::view-transition-new(root) { animation-duration: 280ms; }
  .top { view-transition-name: top; }
  ::view-transition-group(art) { animation-duration: 420ms; animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  /* The flying picture keeps the one it left with, and the destination fades in over it at the end of the
     flight (their crops can differ); the old one stays opaque underneath in case the new one is still decoding. */
  ::view-transition-old(art) { animation: none; height: 100%; object-fit: cover; }
  ::view-transition-new(art) { animation: art-in 180ms 220ms both; height: 100%; object-fit: cover; }
  ::view-transition-old(top) { display: none; }
  ::view-transition-new(top) { animation: none; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 620px) {
  .play[open] { animation-name: sheet; }
  /* On phones the header and the tab bar stay in the page's own crossfade: Safari places a separate capture of
     the bottom tab bar halfway up the screen. Both pages fade together, so identical bars do not flicker. */
  .top { view-transition-name: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 250ms; }
}
