/* Cinzel (latin) for the section titles, served from this site instead of Google Fonts */
@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/cinzel-latin.woff2?v=f3c0a081) format("woff2");
}
/* PP Pangaia Medium (latin) for the hero title */
@font-face {
  font-family: "PP Pangaia";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(assets/fonts/pp-pangaia-medium.woff2?v=5320765f) format("woff2");
}

:root {
  --bg: #000;
  --card-bg: #181b25;
  --text: #fff;
  --text-medium: #99a0ae;
  --font-ui: "Selecta", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-body: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Cinzel", Georgia, serif;
  --font-hero: "PP Pangaia", Georgia, serif;
  --font-condensed: "PF Din Text Comp Pro", "Arial Narrow", "Helvetica Neue", sans-serif;
  /* Menu open/close: quick start, long soft landing so overlapping steps blend */
  --menu-ease: cubic-bezier(0.32, 0.72, 0, 1);
  /* Demo only: backdrop around the framed site */
  --demo-bg: #2c2c2e;
  --demo-gap: 40px;
}

* { box-sizing: border-box; }
/* Cursors drawn after the hero font, PP Pangaia (tools/make-cursors.py): a light arrow with a calligraphic
   concave edge, a pointing hand over anything clickable, and a serifed I over text. Bitmaps at 1x and 2x,
   so they stay sharp on Retina; native cursors are drawn by the system and cost nothing per frame */
html {
  cursor: url(assets/cursor.png?v=8dfd3651) 2 1, default;
  cursor: -webkit-image-set(url(assets/cursor.png?v=8dfd3651) 1x, url(assets/cursor@2x.png?v=c0057bf1) 2x) 2 1, default;
  cursor: image-set(url(assets/cursor.png?v=8dfd3651) 1x, url(assets/cursor@2x.png?v=c0057bf1) 2x) 2 1, default;
}
p, h1, h2, li {
  cursor: url(assets/cursor-text.png?v=ba255dce) 9 9, text;
  cursor: -webkit-image-set(url(assets/cursor-text.png?v=ba255dce) 1x, url(assets/cursor-text@2x.png?v=7ded7c28) 2x) 9 9, text;
  cursor: image-set(url(assets/cursor-text.png?v=ba255dce) 1x, url(assets/cursor-text@2x.png?v=7ded7c28) 2x) 9 9, text;
}
a, button, summary, label, a *, button * {
  cursor: url(assets/cursor-pointer.png?v=5eb78ed4) 7 1, pointer;
  cursor: -webkit-image-set(url(assets/cursor-pointer.png?v=5eb78ed4) 1x, url(assets/cursor-pointer@2x.png?v=6ee95833) 2x) 7 1, pointer;
  cursor: image-set(url(assets/cursor-pointer.png?v=5eb78ed4) 1x, url(assets/cursor-pointer@2x.png?v=6ee95833) 2x) 7 1, pointer;
}
/* The artwork's card text is part of the picture, not text to select */
.visual, .visual * {
  cursor: url(assets/cursor.png?v=8dfd3651) 2 1, default;
  cursor: -webkit-image-set(url(assets/cursor.png?v=8dfd3651) 1x, url(assets/cursor@2x.png?v=c0057bf1) 2x) 2 1, default;
  cursor: image-set(url(assets/cursor.png?v=8dfd3651) 1x, url(assets/cursor@2x.png?v=c0057bf1) 2x) 2 1, default;
}
/* Selected text: a dark grey just off the black page instead of the system blue */
::selection { background-color: #222329; }
/* Text painted through background-clip has no colour of its own, so selected it takes a light one */
.hero-title::selection, .hero-title span::selection, .gradient::selection { color: #cdbcd8; -webkit-text-fill-color: #cdbcd8; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
p, h1, h2 { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
.page img { display: block; max-width: none; }
/* AVIF with a PNG fallback; the wrapper adds no box of its own */
.page picture { display: contents; }

.page { position: relative; background: var(--bg); }
.main { position: relative; overflow-x: clip; container-type: inline-size; }

/* Demo: the site renders on a simulated screen (1440×900 by default, ?demo=WxH to change),
   scaled down by layout.js to fit the window, on a grey backdrop */
html.demo {
  --demo-w: 1440px;
  --demo-h: 900px;
  --demo-scale: 1;
}
html.demo, html.demo body { height: 100%; overflow: hidden; background: var(--demo-bg); }
html.demo body { display: grid; place-items: center; }
html.demo .page {
  flex: none;
  width: var(--demo-w);
  height: var(--demo-h);
  zoom: var(--demo-scale);
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 80px rgba(0, 0, 0, 0.5);
}
html.demo .header { position: absolute; }
html.demo .main { position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; }
html.demo .main::-webkit-scrollbar { display: none; }
@media (max-width: 600px) { html.demo { --demo-gap: 12px; } }
html.demo .page { border-radius: calc(12px / var(--demo-scale)); }

/* Header */
.header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  container: header / inline-size;
}
.header-inner { position: relative; }
.header-inner > * { pointer-events: auto; }
/* Behind the name pill: content scrolling up under it blurs and darkens, most at the top edge, easing
   off to nothing at the pill's bottom edge. The blur is progressive: four layers, each blurrier one masked to a shorter
   band from the top, so it thickens smoothly towards the edge instead of stopping at a line */
.header-fade {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 64px; /* down to the bottom edge of the pill (20px + 44px), not past it */
  pointer-events: none;
}
.header-fade i {
  position: absolute;
  inset: 0;
  -webkit-backdrop-filter: blur(var(--b));
  backdrop-filter: blur(var(--b));
  -webkit-mask: linear-gradient(#000 var(--from), transparent var(--to));
  mask: linear-gradient(#000 var(--from), transparent var(--to));
}
.header-fade i:nth-child(1) { --b: 4px; --from: 50%; --to: 100%; }
.header-fade i:nth-child(2) { --b: 8px; --from: 35%; --to: 90%; }
.header-fade i:nth-child(3) { --b: 16px; --from: 20%; --to: 75%; }
.header-fade i:nth-child(4) { --b: 32px; --from: 0%; --to: 55%; }
/* The darkening: the background at 80% at the top edge down to nothing, in twelve steps that hold dark a
   little before easing off, gently at both ends */
.header-fade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(0, 0, 0, 0.8) 0.0%, rgba(0, 0, 0, 0.8) 9.1%, rgba(0, 0, 0, 0.781) 18.2%, rgba(0, 0, 0, 0.723) 27.3%,
    rgba(0, 0, 0, 0.634) 36.4%, rgba(0, 0, 0, 0.525) 45.5%, rgba(0, 0, 0, 0.406) 54.5%, rgba(0, 0, 0, 0.286) 63.6%,
    rgba(0, 0, 0, 0.176) 72.7%, rgba(0, 0, 0, 0.085) 81.8%, rgba(0, 0, 0, 0.023) 90.9%, rgba(0, 0, 0, 0.0) 100.0%
  );
}


/* On a case the fade is only for the opening view: it goes as soon as the page scrolls (case.js) */
.header-fade.is-off { opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s 0.3s; }
.header-fade { transition: opacity 0.3s ease; }

.pill-name {
  position: absolute;
  top: 20px;
  left: calc(50% - 22px);
  width: min(360px, 100% - 32px);
  transform: translateX(-50%);
  border-radius: 22px;
  background: rgba(24, 26, 31, 0.49);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  /* Inner glow from Figma, plus a soft drop shadow */
  box-shadow: inset 0 0 48px #201729, 0 2px 6px rgba(0, 0, 0, 0.16), 0 10px 32px rgba(0, 0, 0, 0.28);
  transition: width 0.3s var(--menu-ease) 0.1s, background-color 0.4s var(--menu-ease);
  contain: layout style;
}
/* Opening: the pill widens by 200px while the menu starts to unfold; closing runs the other way round.
   The open pill gets a denser fill; the rim stays as it is */
.pill-name.is-open {
  width: min(560px, 100% - 32px);
  background-color: rgba(24, 26, 31, 0.56);
  transition: width 0.36s var(--menu-ease), background-color 0.4s var(--menu-ease);
}
/* Glass rim, brighter where the light (−45°) hits */
.pill-name::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 0.5px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03) 35%, rgba(255, 255, 255, 0.03) 65%, rgba(255, 255, 255, 0.06));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.pill-name-bar { position: relative; height: 44px; }
/* A thin slanted streak of light crosses the whole pill under the mouse (menu.js sets --glow-x) */
.pill-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.65, 0, 0.35, 1);
  pointer-events: none;
}
.pill-glow::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -18px;
  width: 36px;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(238, 234, 241, 0.05), transparent);
  translate: var(--glow-x, 0) 0;
  rotate: 20deg;
  /* Its own layer: moving it does not repaint the pill or rerun its blur */
  will-change: translate;
}
.pill-name:not(.is-open):hover .pill-glow { opacity: 1; }
@media (hover: none) { .pill-glow { display: none; } }
.name-swap { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.name {
  position: absolute;
  left: calc(50% + 0.5px);
  top: calc(50% - 12px);
  transform: translateX(-50%);
  font: 500 16px/24px var(--font-ui);
  white-space: nowrap;
  transition: translate 0.5s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.5s cubic-bezier(0.65, 0, 0.35, 1), filter 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}
/* Leaving text blurs and fades out, arriving text does the reverse */
.name-menu, .name-tg { translate: 0 44px; opacity: 0; filter: blur(4px); }
/* Hovering an icon rolls the name up and its label in from below; "Menu" stays while the menu is open */
.pill-name.is-open p.name,
.pill-name:not(.is-open):has(.burger:focus-visible, .telegram:focus-visible) p.name { translate: 0 -44px; opacity: 0; filter: blur(4px); }
.pill-name.is-open .name-menu,
.pill-name:not(.is-open):has(.burger:focus-visible) .name-menu,
.pill-name:not(.is-open):has(.telegram:focus-visible) .name-tg { translate: 0 0; opacity: 1; filter: none; }
/* Scrolling (menu.js): the title of the section on screen takes the name's place. Titles of sections above
   wait above the pill and those below wait under it, so scrolling down rolls them up and scrolling up rolls
   them down. Hovering an icon or opening the menu rolls the shown title up like the name */
.name-section { translate: 0 44px; opacity: 0; filter: blur(4px); }
.name-section.is-above,
.pill-name.has-section p.name { translate: 0 -44px; opacity: 0; filter: blur(4px); }
.name-section.is-current { translate: 0 0; opacity: 1; filter: none; }
.pill-name.is-open .name-section.is-current,
.pill-name:not(.is-open):has(.burger:focus-visible, .telegram:focus-visible) .name-section.is-current { translate: 0 -44px; opacity: 0; filter: blur(4px); }
/* ...and tints the pill: pink from the hero title for the menu, Telegram blue for Telegram */
.pill-name::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background-color: transparent;
  transition: background-color 0.5s cubic-bezier(0.65, 0, 0.35, 1);
  pointer-events: none;
}
.pill-name.is-open::after,
.pill-name:not(.is-open):has(.burger:focus-visible)::after { background-color: rgba(250, 163, 216, 0.05); }
.pill-name:not(.is-open):has(.telegram:focus-visible)::after { background-color: rgba(42, 171, 238, 0.05); }
/* Hover only where there is a real pointer: on touch screens a tapped icon keeps :hover after the tap,
   so closing the menu would leave "Menu" in the pill instead of rolling the name back */
@media (hover: hover) {
  .pill-name:not(.is-open):has(.burger:hover, .telegram:hover) p.name { translate: 0 -44px; opacity: 0; filter: blur(4px); }
  .pill-name:not(.is-open):has(.burger:hover) .name-menu,
  .pill-name:not(.is-open):has(.telegram:hover) .name-tg { translate: 0 0; opacity: 1; filter: none; }
  .pill-name:not(.is-open):has(.burger:hover, .telegram:hover) .name-section.is-current { translate: 0 -44px; opacity: 0; filter: blur(4px); }
  .pill-name:not(.is-open):has(.burger:hover)::after { background-color: rgba(250, 163, 216, 0.05); }
  .pill-name:not(.is-open):has(.telegram:hover)::after { background-color: rgba(42, 171, 238, 0.05); }
}
/* Burger and Telegram sit in round 36px boxes; the icons stay where they were in Figma */
.burger, .telegram {
  position: absolute;
  top: 4px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
/* Burger: its lines start 12px from the pill's edge */
.burger {
  left: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
}
.burger span { width: 20px; height: 1.5px; background: #72747b; }
/* The Telegram plane on its own, painted with the background colour so hover can recolour it.
   The glyph fills 26px almost edge to edge and is centred in the container 8px in: the plane itself
   then ends 15px from the pill's edge, and is centred vertically */
.telegram { right: 8px; }
/* The plane is drawn on an inner layer, so the mask doesn't cut off the focus ring */
.telegram::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #72747b;
  transition: background-color 0.5s cubic-bezier(0.65, 0, 0.35, 1);
  -webkit-mask: url(assets/telegram.svg?v=681a7269) center / 26px no-repeat;
  mask: url(assets/telegram.svg?v=681a7269) center / 26px no-repeat;
}
.burger:hover span, .burger:focus-visible span,
.telegram:hover::before, .telegram:focus-visible::before { background-color: #eeeaf1; }

/* Narrow screens: no room for the Figma offset, centre the pill */
@container header (max-width: 440px) {
  .pill-name { left: 50%; }
}

/* Menu that unfolds down from the name pill */
.menu {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s var(--menu-ease);
}
.pill-name.is-open .menu { grid-template-rows: 1fr; transition: grid-template-rows 0.4s var(--menu-ease) 0.1s; }
.menu-inner { overflow: hidden; }
.menu-list {
  margin: 0;
  padding: 8px 24px 0;
  list-style: none;
}
.menu-list a {
  display: block;
  /* Hug the text with some padding for the focus ring, without moving the text */
  width: fit-content;
  margin: 0 -12px;
  padding: 12px;
  border-radius: 14px;
  font: 500 24px/28px var(--font-ui);
  color: #cdbcd8;
  transition: color 0.2s;
}
.menu-list a:hover, .menu-list a:focus-visible { color: #faa3d8; }
/* The page you are on */
.menu-list a[aria-current="page"] { color: #faa3d8; }
.menu-links {
  display: flex;
  gap: 24px;
  padding: 16px 24px 24px;
  font: 400 16px/20px var(--font-ui);
  color: var(--text-medium);
}
.menu-links a { margin: -4px -8px; padding: 4px 8px; border-radius: 8px; }
.menu-links a:hover, .menu-links a:focus-visible { color: var(--text); }

/* Keyboard focus: a thin light ring with a small gap, following each element's rounding */
.page :focus-visible {
  outline: 1.5px solid rgba(238, 234, 241, 0.7);
  outline-offset: 2px;
}
.page :focus:not(:focus-visible) { outline: none; }
.menu-list a:focus-visible, .menu-links a:focus-visible { outline-offset: 0; }
.menu-list li, .menu-links {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.15s var(--menu-ease), transform 0.15s var(--menu-ease);
}
.pill-name.is-open .menu-list li, .pill-name.is-open .menu-links {
  opacity: 1;
  transform: none;
  transition: opacity 0.3s var(--menu-ease) 0.22s, transform 0.3s var(--menu-ease) 0.22s;
}

.burger span { transition: transform 0.3s var(--menu-ease), opacity 0.2s var(--menu-ease), background-color 0.5s cubic-bezier(0.65, 0, 0.35, 1); }
.pill-name.is-open .burger span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.pill-name.is-open .burger span:nth-child(2) { opacity: 0; }
.pill-name.is-open .burger span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (prefers-reduced-motion: reduce) {
  .pill-name, .pill-name *, .pill-name::after { transition: none !important; }
}

/* Background glow, anchored to the page centre as in the 1920px frame */
.glow {
  position: absolute;
  left: calc(50% - 1017.01px);
  top: -424.09px;
  width: 1723.012px;
  height: 1992.082px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.glow-shape { position: relative; flex: none; width: 1214.969px; height: 1672.974px; transform: rotate(20.45deg); }
/* The blur is baked into a small bitmap: an SVG filter this size would rerun on every repaint */
.glow-shape img { position: absolute; left: -16.46%; top: -11.95%; width: 132.92%; height: 123.9%; }

/* Hero */
/* Figma 1440: headline top at 229px, artwork top at 600px; spacing shrinks on narrower screens */
.hero { position: relative; padding-top: clamp(140px, 15.9cqw, 229px); }
.hero-title {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  /* The face and size of the section titles below it (.screen-title, "Selected work"), in its own colours */
  font: 400 clamp(32px, 4cqw, 56px) / 0.98 var(--font-display);
  text-align: center;
  color: transparent;
  /* Figma: a pink-violet sheen across a muted violet fill */
  background-image:
    linear-gradient(-33.33deg, rgba(255, 255, 255, 0) 8.13%, rgba(237, 223, 248, 0.767) 23.2%, #a885c4 34.08%, #faa3d8 38.22%, rgba(255, 255, 255, 0) 79.2%),
    linear-gradient(90deg, #81728b, #81728b);
  -webkit-background-clip: text;
  background-clip: text;
}
.hero-title span { display: block; }
/* Phones: the lines run on and wrap where they fit, balanced, instead of three forced lines each breaking in two */
@container (max-width: 640px) {
  .hero-title { width: auto; text-wrap: balance; }
  .hero-title span { display: inline; }
}

/* Phones: the longread (.reel) takes the place of the scenes that take turns. Its pictures are laid out in
   three dense compositions like the desktop scenes, overlapping each other: each picture is placed by
   --x, --y and --w in hundredths of the page width (cqw), stacked by --z, in a group --h tall. Each one
   rises out of the dark as it scrolls in: small, low and see-through at the bottom of the screen, settling at
   full size by the time it is a third of the way up, then drifting up a little as it leaves at the top.
   Scroll-driven where the browser can (Chrome, Safari 26), a one-off reveal (reel.js) elsewhere */
.reel { display: none; }
@container (max-width: 640px) {
  .visual { display: none; }
  .reel { display: block; padding-top: 48px; }
}
.reel-group { position: relative; height: calc(var(--h) * 1cqw); }
/* .page picture is display: contents elsewhere; here the picture itself is the box that moves */
.page .reel-item {
  display: block;
  position: absolute;
  left: calc(var(--x) * 1cqw);
  top: calc(var(--y) * 1cqw);
  width: calc(var(--w) * 1cqw);
  z-index: var(--z);
}
.reel-item img { display: block; width: 100%; height: auto; }
@supports (animation-timeline: view()) {
  .reel-item {
    animation: reel-rise linear both;
    animation-timeline: view();
    animation-range: entry 0% exit 100%;
  }
  /* The second of a pair follows the first a beat later */
  .reel-late { animation-range: entry 20% exit 100%; }
}
/* Only transform and opacity, which the compositor runs on its own: a filter here would be redrawn on
   every scrolled frame and stutters on phones. The pictures keep their full colour as they leave */
@keyframes reel-rise {
  0% { opacity: 0; transform: translateY(96px) scale(0.7); }
  40% { opacity: 1; transform: none; }
  70% { transform: none; }
  100% { opacity: 1; transform: translateY(-24px) scale(0.95); }
}
/* Fallback: reel.js adds .is-in once a picture is a little way into the screen */
@supports not (animation-timeline: view()) {
  .reel-item { opacity: 0; transform: translateY(80px) scale(0.8); transition: opacity 0.9s, transform 1.1s cubic-bezier(0.22, 1, 0.36, 1); }
  .reel-item.is-in { opacity: 1; transform: none; }
  .reel-late { transition-delay: 0.15s; }
}
@media (prefers-reduced-motion: reduce) {
  .reel-item { animation: none; opacity: 1; transform: none; transition: none; }
}

/* Artwork: never narrower than 560px, so on phones it bleeds past the edges instead of shrinking away */
.visual {
  --vs: 1;
  position: relative;
  left: 50%;
  width: clamp(560px, 100%, 1308px);
  height: calc(728px * var(--vs));
  margin-top: clamp(48px, 19.1cqw, 275px);
  /* In Figma the composition sits 31px right of the page centre */
  transform: translateX(calc(-50% + 31px * var(--vs)));
}
.visual-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1308px;
  height: 728px;
  transform: scale(var(--vs));
  transform-origin: 0 0;
}
.phone { position: absolute; left: 0; top: 0; width: 443px; height: 660px; object-fit: cover; }
.pig {
  position: absolute;
  left: 195px;
  top: 0;
  width: 728px;
  height: 728px;
  -webkit-mask: url(assets/pig-mask.avif?v=f682299f) 0 0 / 728px 728px no-repeat;
  mask: url(assets/pig-mask.avif?v=f682299f) 0 0 / 728px 728px no-repeat alpha;
}
.pig img { width: 100%; height: 100%; object-fit: cover; }
/* Figma's render of the sticker with its baked-in black converted to transparency */
.cashback { position: absolute; left: 589px; top: 27px; width: 581.418px; height: 424.151px; }

/* "My tickets" card */
.rot { position: absolute; display: flex; align-items: center; justify-content: center; }
.rot > * { position: relative; flex: none; }
.tickets { left: 780px; top: 389px; width: 382.031px; height: 165.791px; }
.tickets-card {
  display: flex;
  flex-direction: column;
  width: 370px;
  border-radius: 20px;
  background: var(--card-bg);
  overflow: hidden;
  transform: rotate(10.51deg);
}
.tickets-head { position: relative; height: 56px; }
.tickets-title {
  position: absolute;
  left: 16px;
  top: calc(50% - 8px);
  font: italic 700 24px/22px var(--font-condensed);
  text-transform: uppercase;
  text-box: trim-both cap alphabetic;
  white-space: nowrap;
}
.tickets-badge {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 9px;
  background: #000;
  font: 400 16px/22px var(--font-body);
  white-space: nowrap;
}
.tickets-label { color: var(--text-medium); }
.tickets-count { display: flex; align-items: center; gap: 2px; font-weight: 600; }
.tickets-foot { position: relative; height: 44px; border-top: 0.5px solid rgba(255, 255, 255, 0.06); }
.trophy { position: absolute; left: -19.38px; top: calc(50% + 1.86px); width: 73.199px; height: 73.199px; transform: translateY(-50%); }
.trophy-inner { left: -2.28px; top: calc(50% + 3.29px); width: 84.352px; height: 84.352px; transform: translateY(-50%); }
.trophy-inner img { width: 65.501px; height: 65.501px; object-position: bottom; transform: rotate(-20.59deg); }
.tickets-note {
  position: absolute;
  left: 43px;
  top: calc(50% - 8.25px);
  font: 600 12px/16px var(--font-body);
  white-space: pre;
}
.gradient {
  background: linear-gradient(to right, #ffc85a 27.885%, #ff4e0e 68.269%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Artwork pieces (artwork.js): hovered with a mouse, or tapped, a piece grows a little and a tooltip
   tells what it is. The pig's box is mostly transparent, so only an ellipse over its body reacts */
/* The artwork is pictures, not text: it never shows a selection and its images cannot be dragged off */
.visual { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.visual img { -webkit-user-drag: none; }
.art { scale: 1; transition: scale 0.5s cubic-bezier(0.33, 1, 0.68, 1); }
.art.is-active { scale: 1.05; }
.pig { pointer-events: none; }
.pig-hit { position: absolute; left: 83px; top: 37px; width: 561px; height: 608px; border-radius: 50%; pointer-events: auto; }

/* Three scenes of artwork take turns (scenes.js). Pieces are placed as in Figma, every group lined up
   on the first one's centre. Only transform and opacity move, so switching costs the GPU nothing much */
.scene { position: absolute; inset: 0; visibility: hidden; transition: visibility 0s 1.2s; }
.scene.is-current { visibility: visible; transition: none; }
.scene:not(.is-current), .scene:not(.is-current) * { pointer-events: none !important; }
picture.piece { position: absolute; display: block; }
picture.piece img { display: block; width: 100%; height: 100%; }
.cinema { left: 680px; top: -15px; width: 668px; height: 462px; }
.cv { left: 497px; top: -107px; width: 242px; height: 242px; }
.lesson { left: 106px; top: -56px; width: 659px; height: 566px; }
.wallets { left: 596px; top: -35px; width: 921px; height: 712px; }
.raffle { left: 650px; top: -32px; width: 217px; height: 58px; }
.lucky-race { left: 607px; top: 73px; width: 284px; height: 566px; }
.casino { left: -150px; top: 94px; width: 794px; height: 627px; }
.race-banner { left: 584px; top: -101px; width: 648px; height: 195px; }
.recipe { left: 987px; top: 134px; width: 139px; height: 457px; }

/* Waiting pieces sit lower and a little smaller; the scene's pieces rise in one after another with a
   soft overshoot, and the scene before them lifts away the same way */
.piece { opacity: 0; transform: translate3d(0, 64px, 0) scale(0.9) rotate(-2deg); }
.is-current .piece {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.5s ease-out calc(0.32s + var(--i) * 0.08s),
    transform 1.1s cubic-bezier(0.2, 1.3, 0.35, 1) calc(0.32s + var(--i) * 0.08s),
    scale 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}
.scene.is-leaving .piece {
  opacity: 0;
  transform: translate3d(0, -48px, 0) scale(0.94) rotate(1.5deg);
  transition:
    opacity 0.42s ease-in calc(var(--i) * 0.05s),
    transform 0.6s cubic-bezier(0.55, 0, 0.75, 0.2) calc(var(--i) * 0.05s),
    scale 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}
@media (prefers-reduced-motion: reduce) {
  .piece, .scene.is-leaving .piece { transform: none; }
}

.art-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 999;
  width: max-content;
  max-width: 260px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(24, 26, 31, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08), 0 10px 32px rgba(0, 0, 0, 0.32);
  font: 400 14px/18px var(--font-ui);
  color: var(--text-medium);
  opacity: 0;
  scale: 0.96;
  transform-origin: 0 0;
  transition: opacity 0.2s ease, scale 0.2s ease;
  pointer-events: none;
  will-change: transform;
}
.art-tip.is-visible { opacity: 1; scale: 1; }
.art-tip-title { margin-bottom: 4px; font-weight: 500; color: var(--text); }
@media (prefers-reduced-motion: reduce) {
  .art, .art-tip { transition: opacity 0.2s ease; }
}

/* Inner page: black, with the case logo hanging like a lamp under the header.
   Every animation here runs on transform and opacity only, so it stays on the compositor:
   no style recalculation or repaint per frame, nothing to slow scrolling down */
/* Layout (Figma, 1440): a top block 627px tall with the logo and a two-column intro at 384px;
   the cards (885px wide) start at 485px, over the block's lower part */
.case {
  --case-w: min(885px, 100% - 32px);
  /* How far the cards reach up into the top block */
  --overlap: clamp(60px, 9.86cqw, 142px);
  padding-bottom: clamp(80px, 14.8cqw, 213px);
}
.case-hero {
  /* The logo sits where the name pill is on the main page, 220px wide and centred on the pill's centre
     line (42px down, 22px left of the middle), level with the close button whatever its height.
     The ratio is a division ("100 / 24"), so it is bracketed wherever it divides */
  --logo-w: 220px;
  --logo-mid: 42px;
  --logo-top: calc(var(--logo-mid) - var(--logo-w) / (var(--logo-ratio)) / 2);
  --logo-x: calc(50% - 22px);
  --beam-w: clamp(260px, 34cqw, 480px);
  --tilt-ease: cubic-bezier(0.65, 0, 0.35, 1);
  --sway: case-sway 9s ease-in-out 2.2s infinite;
  position: relative;
  padding: clamp(330px, 26.7cqw, 384px) 0 calc(var(--overlap) + clamp(40px, 4.9cqw, 70px));
}

/* Intro: the case's name large over a couple of paragraphs on the left; on the right what the product is
   and its numbers, a value over its label */
.case-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: start;
  gap: 40px 64px;
  width: var(--case-w);
  margin: 0 auto;
  font: 400 18px/26px var(--font-ui);
  text-align: left;
}
.case-intro-title {
  margin: 0 0 28px;
  font: 300 clamp(48px, 5.6cqw, 80px) / 1 var(--font-ui);
  letter-spacing: -0.02em;
  color: var(--text);
}
.case-intro-text { max-width: 520px; color: rgba(255, 255, 255, 0.7); text-wrap: pretty; }
.case-intro-text + .case-intro-text { margin-top: 20px; }
.case-intro-side { padding-top: 12px; }
.case-intro-lead { display: block; margin: 0 0 40px; font: 500 22px/28px var(--font-ui); color: var(--text); }
.case-intro-arrow { display: inline-block; margin-left: 4px; font-weight: 300; transition: translate 0.3s cubic-bezier(0.33, 1, 0.68, 1); }
a.case-intro-lead:hover .case-intro-arrow { translate: 3px -3px; }
.case-stats { display: grid; gap: 28px; margin: 0; }
.case-stats div { display: flex; flex-direction: column-reverse; gap: 4px; }
.case-stats dd { margin: 0; font: 500 22px/28px var(--font-ui); color: var(--text); }
.case-stats dt { color: rgba(255, 255, 255, 0.7); }

/* The light picks out the intro's letters: each line is painted with one gradient laid over the whole hero
   (case.js gives each its offset in it, --ox / --oy), bright and tinted with the light's colour under the cone
   and dim grey away from it, so the words in the light glow and the rest sink into the dark. --lit-in rises
   with the light's opening and --lit-out falls as scrolling draws the light back into the logo */
@property --lit-in { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --lit-out { syntax: "<number>"; inherits: true; initial-value: 1; }
.case-intro {
  animation: case-lit-in 5s cubic-bezier(0.55, 0, 0.45, 1) 0.4s backwards;
}
@keyframes case-lit-in { from { --lit-in: 0; } }
@supports (animation-timeline: scroll()) {
  .case-intro {
    animation: case-lit-in 5s cubic-bezier(0.55, 0, 0.45, 1) 0.4s backwards, case-lit-out linear both;
    animation-timeline: auto, scroll();
    animation-range: normal, 0 560px;
  }
}
@keyframes case-lit-out { to { --lit-out: 0; } }
.case-intro-title, .case-intro-text, .case-intro-lead, .case-stats dt, .case-stats dd {
  --near: 1;
  --far: 0.42;
  --lit: calc(var(--lit-in) * var(--lit-out));
  color: transparent;
  background: radial-gradient(
    ellipse 46% 62% at var(--logo-x) 22%,
    rgb(var(--text-lit) / calc(var(--far) + (var(--near) - var(--far)) * var(--lit))) 0%,
    rgb(var(--text-lit) / calc(var(--far) + (var(--near) - var(--far)) * var(--lit) * 0.92)) 34%,
    rgb(255 255 255 / calc(var(--far) + (var(--near) - var(--far)) * var(--lit) * 0.45)) 62%,
    rgb(255 255 255 / var(--far)) 100%
  ) calc(var(--ox, 0px) * -1) calc(var(--oy, 0px) * -1) / var(--hero-w, 100%) var(--hero-h, 100%) no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
}
.case-intro-text, .case-stats dt { --near: 0.86; --far: 0.3; }
.case-intro-arrow { color: transparent; }
.case-intro ::selection { color: #fff; -webkit-text-fill-color: #fff; }

/* Cards for the screens: one wide (885×508) and two halves (434×430) */
.case-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: var(--case-w);
  margin: calc(var(--overlap) * -1) auto 0;
}
.case-card {
  aspect-ratio: 434 / 430;
  border-radius: 20px;
  background: #0f1013;
}
.case-card-wide {
  position: relative;
  grid-column: 1 / -1;
  aspect-ratio: 885 / 508;
  /* A little see-through, so the light behind it shows faintly */
  background: rgba(15, 16, 19, 0.88);
}
/* Where the light lands: a bright line along the top edge (.case-edge), and a warm glow spilling down inside */
.case-card-wide::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  animation: case-fade 2s ease 3.4s backwards;
  /* A wide, slow fall-off, so the light melts into the card instead of ending in a dark rim */
  background: radial-gradient(ellipse 52% 46% at 50% 0, rgb(var(--glow) / 0.24), rgb(var(--glow) / 0.15) 25%, rgb(var(--glow-edge) / 0.08) 50%, rgb(var(--glow-edge) / 0.03) 75%, transparent);
}
/* A hairline that fades in and out along a long even ramp, warmest in the middle, with a faint oval glow
   around it, so it reads as light catching the edge and has no hard ends. It comes in the light's three
   colour pairs (--a-l / --a-r …, the side colours in tools/make-case-light.py), fading into each other on
   the same clocks as .case-light-b and -c, so the line shimmers with the light behind it */
.case-edge {
  position: absolute;
  top: -14px;
  left: 50%;
  width: min(680px, 84%);
  height: 28px;
  translate: -50% 0;
  pointer-events: none;
  animation: case-fade 2s ease 3.4s backwards;
}
.case-edge i {
  --l: var(--a-l);
  --r: var(--a-r);
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgb(var(--l) / 0.05) 12%, rgb(var(--l) / 0.16) 25%, rgb(var(--l) / 0.3) 37%, rgb(var(--halo) / 0.45) 50%, rgb(var(--r) / 0.3) 63%, rgb(var(--r) / 0.16) 75%, rgb(var(--r) / 0.05) 88%, transparent) center / 100% 1px no-repeat,
    radial-gradient(closest-side, rgb(var(--glow) / 0.16), rgb(var(--glow) / 0.06) 45%, rgb(var(--glow) / 0.015) 75%, transparent);
}
.case-edge .case-edge-b { --l: var(--a-r); --r: var(--a-l); animation: case-glow 2.6s ease-in-out infinite alternate; }
.case-edge .case-edge-c { --l: var(--c-l); --r: var(--c-r); animation: case-glow 3.7s ease-in-out 1s infinite alternate-reverse; }

/* Narrow screens centre the pill, so the logo follows */
@container (max-width: 440px) {
  .case-hero { --logo-x: 50%; }
}
/* Phones: one column (the page width, so it also works in the demo frame) */
@container (max-width: 640px) {
  .case-intro, .case-grid { grid-template-columns: 1fr; }
  .case-intro-text { max-width: none; }
  .case-intro-side { padding-top: 0; }
  .case-intro-lead { margin-bottom: 24px; }
  .case-stats { grid-template-columns: 1fr 1fr; gap: 24px 16px; }
}

/* The logo: its face over a stack of metal copies of its outline that give it thickness.
   Three nested turns: the mouse (case.js), the slow sway, and the opening tilt from facing you to facing down */
.case-logo {
  position: absolute;
  left: var(--logo-x);
  top: var(--logo-top);
  width: var(--logo-w);
  aspect-ratio: var(--logo-ratio);
  translate: -50% 0;
  /* The logo stands in the name pill's place, so like the pill it sits over the header's blur fade
     (z-index above .header), and the cards scroll under the fade. The perspective is set here rather
     than on .case-hero, so the hero makes no stacking context of its own that would keep the logo under */
  z-index: 11;
  perspective: 900px;
  perspective-origin: 50% 50%;
}
.case-logo, .case-logo-turn, .case-logo-sway, .case-logo-tilt { transform-style: preserve-3d; }
.case-logo-turn, .case-logo-sway, .case-logo-tilt, .case-logo-tilt > span { position: absolute; inset: 0; }
.case-logo-sway { animation: var(--sway); }
.case-logo-tilt { transform: rotateX(-38deg); animation: case-tilt 1.8s var(--tilt-ease) 0.4s backwards; }
@keyframes case-tilt { from { transform: none; } }
@keyframes case-sway { 25% { transform: rotateY(7deg); } 75% { transform: rotateY(-7deg); } }

/* Each layer sits --depth-step further back; their rims make the side wall: metal in the theme's
   colour with a polished line a few layers in, darkening towards the back */
.case-layer {
  --shine: max(0, 1 - max(var(--i) - 4, 4 - var(--i)) / 2);
  transform: translateZ(calc(var(--i) * var(--depth-step) * -1));
  background: color-mix(in oklab, color-mix(in oklab, var(--wall-shine) calc(var(--shine) * 100%), var(--wall)), var(--wall-dark) calc(var(--i) * 2.8%));
}
/* The halo is a copy of the face that glows around its outline */
.case-logo-halo {
  filter: drop-shadow(0 0 9px rgb(var(--halo) / 0.6));
  animation: case-fade 1.6s cubic-bezier(0.33, 0, 0.2, 1) 1.3s backwards;
}
.case-logo-face, .case-logo-halo { background: center / contain no-repeat; }
@keyframes case-fade { from { opacity: 0; } }

/* Metal over the rim and the dot, and a soft reflection over the whole face. The bands are drawn once
   on a wide strip that repeats every three logo widths; moving the strip makes them slide (--u is one logo width):
   the <b> follows the tilt and the sway, the <i> follows the mouse (case.js) */
.case-logo-metal, .case-logo-gloss { overflow: hidden; }
.case-logo-metal { transform: translateZ(0.1px); }
.case-logo-gloss { transform: translateZ(0.2px); }
.case-sheen, .case-sheen b { position: absolute; inset: 0; }
.case-sheen b {
  --u: calc(100% / 9);
  left: -400%;
  width: 900%;
  translate: calc(var(--u) * var(--end)) 0;
  animation: case-sheen-in 1.8s var(--tilt-ease) 0.4s backwards, var(--sway);
  animation-name: case-sheen-in, case-sheen-sway;
}
.case-logo-metal b {
  --start: -0.3;
  --end: -1.3;
  --swing: 0.58;
  background: var(--metal) 0 0 / calc(100% / 3) 100% repeat-x;
}
.case-logo-gloss b {
  --start: -0.2;
  --end: -1.4;
  --swing: 0.7;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 236, 220, 0.16) 50%, transparent 58%) 0 0 / calc(100% / 3) 100% repeat-x;
}
@keyframes case-sheen-in { from { translate: calc(var(--u) * var(--start)) 0; } }
@keyframes case-sheen-sway {
  25% { transform: translateX(calc(var(--u) * var(--swing) * -1)); }
  75% { transform: translateX(calc(var(--u) * var(--swing))); }
}

/* Light from the logo: a soft cone that widens down onto the first card, whose top edge lights up.
   Three bitmaps from tools/make-case-light.py in different colour pairs fade into each other at different
   paces, so the colours keep drifting. They never turn: a turned bitmap shows its edge as a hard line */
.case-beam {
  position: absolute;
  /* It starts 70px above the logo's centre (ABOVE in the script), so the logo sits on the light */
  inset: calc(var(--logo-mid) - 70px) 0 clamp(-560px, -38cqw, -240px);
  transform-origin: var(--logo-x) 70px;
  /* It starts with the logo's tilt (case-tilt, 0.4s + 1.8s): faint and small while the logo turns down,
     then, once it faces down, it keeps widening and brightening slowly to full */
  /* Two single sweeps with no stop between: it grows on a long ease-out, and its brightness creeps in
     slowly while the logo turns, then rises */
  animation:
    case-beam-grow 5s cubic-bezier(0.22, 0.6, 0.3, 1) 0.4s backwards,
    case-beam-fade 5s cubic-bezier(0.55, 0, 0.45, 1) 0.4s backwards;
  /* One layer for its whole life, so it is not redrawn (and does not flash) when the opening ends */
  will-change: transform, opacity;
  pointer-events: none;
}
.case-light {
  /* Centred on the logo and sized to the page, so on a phone too the light fades out well before the sides */
  --light-w: clamp(720px, 160cqw, 2400px);
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--logo-x) - var(--light-w) / 2);
  width: var(--light-w);
  background: var(--light-a) 0 0 / 100% 100% no-repeat;
}
.case-light-b {
  background-image: var(--light-b);
  animation: case-glow 2.6s ease-in-out infinite alternate;
}
.case-light-c {
  background-image: var(--light-c);
  animation: case-glow 3.7s ease-in-out 1s infinite alternate-reverse;
}
/* Fine grain over the light at screen resolution hides the steps of its dark gradient.
   In overlay mode mid grey changes nothing, so black stays black and only the lit part is shaded */
.case-grain {
  position: absolute;
  inset: 0;
  background: url(assets/grain.webp?v=8d921b38) 0 0 / 64px 64px;
  mix-blend-mode: overlay;
}
/* Phones: no grain. Blending it over the moving light is redone on every frame, and iOS Safari can
   lose the blend after the animation and show the grain as a grey veil */
@media (hover: none) {
  .case-grain { display: none; }
}
@keyframes case-glow { from { opacity: 0; } }
/* Scrolling down draws the light back into the logo, the reverse of its opening: it shrinks towards the
   logo and fades, and the card's edge and inner glow go with it; scrolling up lets it out again.
   Scroll-driven, so it runs on the compositor (Chrome, Safari 26); elsewhere the light just scrolls away */
.case-beam-back { position: absolute; inset: 0; pointer-events: none; transform-origin: var(--logo-x) var(--logo-mid); }
@supports (animation-timeline: scroll()) {
  .case-beam-back {
    animation: case-light-back linear both;
    animation-timeline: scroll();
    animation-range: 0 560px;
  }
  /* The opening fade comes second, so it wins while it plays; after it, the scroll takes over */
  .case-card-wide::after, .case-edge {
    animation: case-edge-back linear both, case-fade 2s ease 3.4s backwards;
    animation-timeline: scroll(), auto;
    animation-range: 0 420px, normal;
  }
}
@keyframes case-light-back {
  to { transform: scale(0.14, 0.1); opacity: 0; }
}
@keyframes case-edge-back { to { opacity: 0; } }
@keyframes case-beam-grow { from { transform: scale(0.3, 0.4); } }
@keyframes case-beam-fade { from { opacity: 0; } }

/* Case themes: the logo and the colours of its metal and light. A colour given as "r g b" is used
   at several strengths. Winline is orange; Chexx is violet and pink */
.case-winline {
  --logo-ratio: 100 / 24;
  --depth-step: 0.5px;
  --wall: #e8600f;
  --wall-shine: #ffb27a;
  --wall-dark: #3a1200;
  --metal: linear-gradient(115deg, #6e2200, #ff6a13 14%, #ffd9b0 22%, #ff7a1f 30%, #a33a00 44%, #ff8a3d 58%, #fff0dc 64%, #ff6a13 72%, #5a1a00);
  --halo: 255 196 110;
  --text-lit: 255 226 196;
  --glow: 255 112 36;
  --glow-edge: 214 70 24;
  --a-l: 255 104 36;
  --a-r: 255 170 64;
  --c-l: 255 72 48;
  --c-r: 255 200 100;
  --light-a: url(assets/case-light-winline-a.webp?v=dbd14d17);
  --light-b: url(assets/case-light-winline-b.webp?v=354f082c);
  --light-c: url(assets/case-light-winline-c.webp?v=ecc20d6e);
}
.case-winline .case-logo-face, .case-winline .case-logo-halo { background-image: url(assets/winline.svg?v=46f1b8ae); }
/* The pill's outline is a plain rounded box, cheaper than a mask */
.case-winline .case-layer, .case-winline .case-logo-gloss { border-radius: 999px; }
.case-winline .case-logo-metal { -webkit-mask: url(assets/winline-rim.svg?v=d70d9c32) center / contain no-repeat; mask: url(assets/winline-rim.svg?v=d70d9c32) center / contain no-repeat; }

.case-chexx {
  --logo-ratio: 180 / 17.6;
  --depth-step: 0.35px;
  --wall: #7b4dff;
  --wall-shine: #d9c9ff;
  --wall-dark: #14072e;
  --metal: linear-gradient(115deg, #5a0030, #ff045c 14%, #ffd1ea 22%, #ff3bb9 30%, #8a0048 44%, #ff5ccb 58%, #fff0fa 64%, #ff045c 72%, #40002a);
  --halo: 196 140 255;
  --text-lit: 230 214 255;
  --glow: 150 72 255;
  --glow-edge: 110 36 214;
  --a-l: 140 78 255;
  --a-r: 200 82 244;
  --c-l: 96 96 255;
  --c-r: 236 96 216;
  --light-a: url(assets/case-light-chexx-a.webp?v=593dd051);
  --light-b: url(assets/case-light-chexx-b.webp?v=eab7e5ca);
  --light-c: url(assets/case-light-chexx-c.webp?v=f7274f14);
}
.case-chexx .case-logo-face, .case-chexx .case-logo-halo { background-image: url(assets/chexx.svg?v=4605c793); }
/* Letters, not a box: the thickness and the reflection follow the logo's outline */
.case-chexx .case-layer, .case-chexx .case-logo-gloss { -webkit-mask: url(assets/chexx-shape.svg?v=53995e2d) center / contain no-repeat; mask: url(assets/chexx-shape.svg?v=53995e2d) center / contain no-repeat; }
.case-chexx .case-logo-metal { -webkit-mask: url(assets/chexx-mark.svg?v=e3079f4a) center / contain no-repeat; mask: url(assets/chexx-mark.svg?v=e3079f4a) center / contain no-repeat; }

/* case.js holds the opening until the page has loaded and painted, so it does not start while the
   phone is still busy loading and then jump ahead */
.case-hero.is-waiting, .case-hero.is-waiting *, .is-waiting-page .case-card-wide::after, .is-waiting-page .case-edge { animation-play-state: paused; }
/* Phones: half the metal layers, each twice as far from the next, so the logo is as thick with half
   the layers to composite in 3D */
@media (hover: none) {
  .case-layer:nth-child(even) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .case-hero * { animation: none !important; }
}

/* Close button on a case: a round button in the name pill's glass. Hovered it fills white and the cross turns black */
.case-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(24, 26, 31, 0.49);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: inset 0 0 24px #201729, 0 2px 6px rgba(0, 0, 0, 0.16), 0 10px 32px rgba(0, 0, 0, 0.28);
  transition: background-color 0.3s cubic-bezier(0.65, 0, 0.35, 1), box-shadow 0.3s cubic-bezier(0.65, 0, 0.35, 1), translate 0.4s cubic-bezier(0.33, 1, 0.68, 1);
}
/* On a phone it is yanked up off the screen while the page scrolls down (case.js): it braces, squashed,
   then shoots up stretching as it speeds away. Coming back it drops in and settles with a small bounce */
.case-close.is-away { animation: case-close-yank 0.5s forwards; }
.case-close.is-back { animation: case-close-drop 0.6s; }
@keyframes case-close-yank {
  0% { transform: none; animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1); }
  24% { transform: translateY(5px) scale(1.1, 0.88); animation-timing-function: cubic-bezier(0.6, 0, 0.9, 0.3); }
  100% { transform: translateY(-140px) scale(0.78, 1.4); }
}
@keyframes case-close-drop {
  0% { transform: translateY(-140px) scale(0.85, 1.25); animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1); }
  58% { transform: translateY(4px) scale(1.08, 0.92); animation-timing-function: ease-in-out; }
  80% { transform: translateY(-2px) scale(0.98, 1.03); animation-timing-function: ease-in-out; }
  100% { transform: none; }
}
/* The same glass rim as the pill */
.case-close::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 0.5px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03) 35%, rgba(255, 255, 255, 0.03) 65%, rgba(255, 255, 255, 0.06));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.case-close span {
  grid-area: 1 / 1;
  width: 18px;
  height: 1.5px;
  border-radius: 1px;
  background: #72747b;
  rotate: 45deg;
  transition: background-color 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}
.case-close span + span { rotate: -45deg; }
.case-close:hover, .case-close:focus-visible {
  background-color: #fff;
  box-shadow: inset 0 0 0 transparent, 0 2px 6px rgba(0, 0, 0, 0.16), 0 10px 32px rgba(0, 0, 0, 0.28);
}
.case-close:hover span, .case-close:focus-visible span { background-color: #000; }
@container header (max-width: 440px) {
  .case-close { right: 16px; }
}

/* Further screens */
.screen {
  position: relative;
  min-height: 100svh;
  padding: clamp(120px, 12cqw, 220px) 16px;
}
html.demo .screen { min-height: var(--demo-h); }
/* Extra room after the last section, so the page scrolls on and its title can slide under the name pill */
.screen:last-child { padding-bottom: calc(clamp(120px, 12cqw, 220px) + 800px); }
.screen-title {
  font: 400 clamp(32px, 4cqw, 56px) / 1 var(--font-display);
  text-align: center;
  color: #cdbcd8;
}
.screen-text {
  max-width: 760px;
  margin: 32px auto 0;
  font: 400 clamp(18px, 1.67cqw, 24px) / 1.45 var(--font-ui);
  text-align: center;
  text-wrap: balance;
  color: var(--text-medium);
}
.screen-text em { font-style: normal; color: #cdbcd8; }
.screen-note { margin-top: 24px; font: 400 20px/24px var(--font-ui); text-align: center; color: var(--text-medium); }

/* Tap on a touch screen (bounce.js): a short hop up and a soft landing with a small rebound */
.is-bouncing { animation: bounce 0.55s cubic-bezier(0.33, 1, 0.68, 1); }
.art { --hop: -28px; }
.burger, .telegram, .case-close { --hop: -5px; -webkit-tap-highlight-color: transparent; }
/* The case logo hops on any click (case.js), on its mouse-turn layer, so the sway keeps running underneath */
.case-logo { -webkit-tap-highlight-color: transparent; }
.case-logo-turn { --hop: -10px; }
@keyframes bounce {
  0% { translate: 0 0; }
  30% { translate: 0 var(--hop); }
  60% { translate: 0 calc(var(--hop) * -0.12); }
  80% { translate: 0 calc(var(--hop) * 0.2); }
  100% { translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) { .is-bouncing { animation: none; } }

