/* Business Object's home page. Dark, like the app sites, but its own look:
 * a faint pixel grid on near-black, white type, one vivid red, crisp thin
 * edges and small corners. The hero's motion is the mark itself: its
 * pixels slide into place and a sheen passes over it.
 *
 * No web fonts and nothing fetched from anyone else. One script,
 * /site/site.js: the contact address and the pixel wipe into an app's site.
 * Under reduced motion it all stands still.
 *
 * Each app's card wears that app's own colours: Questify's lime, Sound
 * Deck's navy with orange and blue. */

:root {
  color-scheme: dark;

  --bg: #0e0b0c;
  --surface: #171213;
  --grid: rgba(240, 65, 47, 0.07);
  --text: #ffffff;
  --muted: #b3a9a8;
  --edge: rgba(255, 255, 255, 0.14);

  /* The mark's red, made vivid; a lighter tint for links on dark. */
  --red: #f0412f;
  --red-glow: rgba(240, 65, 47, 0.45);
  --red-soft: #ff7465;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  /* Graph paper: the grid the mark's pixels sit on. */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  /* Fixed, so the glowing cells below stay on its lines while scrolling. */
  background-attachment: fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--red-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* --- the background: grid cells glowing now and then ------------------------- */

/* Sixteen cells of the page's grid, each fading up to a faint red glow and
 * back at its own slow pace, scattered so they never light in a pattern.
 * Fixed to the screen, on the grid's lines (multiples of 32 px). */
.bg-pixels {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-pixels b {
  position: absolute;
  width: 31px;
  height: 31px;
  margin: 1px 0 0 1px;
  background: var(--red);
  opacity: 0;
  animation: cell 11s ease-in-out infinite;
}

.bg-pixels b:nth-child(1)  { left: calc(32px * 2);  top: calc(32px * 4);  animation-delay: 0s; }
.bg-pixels b:nth-child(2)  { left: calc(32px * 9);  top: calc(32px * 2);  animation-delay: -3s;  animation-duration: 14s; }
.bg-pixels b:nth-child(3)  { left: calc(32px * 5);  top: calc(32px * 13); animation-delay: -7s; }
.bg-pixels b:nth-child(4)  { left: calc(32px * 17); top: calc(32px * 7);  animation-delay: -1s;  animation-duration: 16s; }
.bg-pixels b:nth-child(5)  { left: calc(32px * 24); top: calc(32px * 3);  animation-delay: -9s; }
.bg-pixels b:nth-child(6)  { left: calc(32px * 30); top: calc(32px * 11); animation-delay: -5s;  animation-duration: 13s; }
.bg-pixels b:nth-child(7)  { left: calc(32px * 36); top: calc(32px * 5);  animation-delay: -12s; animation-duration: 17s; }
.bg-pixels b:nth-child(8)  { left: calc(32px * 41); top: calc(32px * 16); animation-delay: -2s; }
.bg-pixels b:nth-child(9)  { left: calc(32px * 8);  top: calc(32px * 21); animation-delay: -10s; animation-duration: 15s; }
.bg-pixels b:nth-child(10) { left: calc(32px * 14); top: calc(32px * 17); animation-delay: -6s; }
.bg-pixels b:nth-child(11) { left: calc(32px * 21); top: calc(32px * 24); animation-delay: -4s;  animation-duration: 12s; }
.bg-pixels b:nth-child(12) { left: calc(32px * 27); top: calc(32px * 19); animation-delay: -13s; }
.bg-pixels b:nth-child(13) { left: calc(32px * 34); top: calc(32px * 26); animation-delay: -8s;  animation-duration: 16s; }
.bg-pixels b:nth-child(14) { left: calc(32px * 39); top: calc(32px * 9);  animation-delay: -11s; }
.bg-pixels b:nth-child(15) { left: calc(32px * 3);  top: calc(32px * 9);  animation-delay: -14s; animation-duration: 18s; }
.bg-pixels b:nth-child(16) { left: calc(32px * 11); top: calc(32px * 11); animation-delay: -15s; animation-duration: 14s; }

@keyframes cell {
  0%,
  100% {
    opacity: 0;
    box-shadow: none;
  }

  45% {
    opacity: 0.16;
    box-shadow: 0 0 24px rgba(240, 65, 47, 0.6);
  }

  55% {
    opacity: 0.16;
    box-shadow: 0 0 24px rgba(240, 65, 47, 0.6);
  }
}

/* --- the hero ----------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 0 16px 80px;
  /* A red light behind the mark, nothing moving in it. */
  background: radial-gradient(55% 65% at 78% 45%, rgba(240, 65, 47, 0.2), transparent 70%);
}

.bar {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 0;
}

.bar {
  position: relative;
  z-index: 5;
}

/* The mark and name, a button that opens the apps menu. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 6px 10px 6px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.brand:hover,
.brand[aria-expanded="true"] {
  background: var(--surface);
  border-color: var(--edge);
}

.brand:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.brand img {
  border-radius: 4px;
}

.brand .caret {
  color: var(--muted);
  transition: transform 0.2s;
}

.brand[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}

/* The apps, dropped below the mark. */
.app-menu {
  position: absolute;
  top: calc(100% - 16px);
  left: 0;
  width: min(300px, calc(100vw - 32px));
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(240, 65, 47, 0.08);
  overflow: hidden;
  /* Grows out of the mark's corner in four chunky steps. */
  animation: menu-grow 0.13s steps(4, end) both;
}

/* The red pixel block over the menu while it opens (site.js builds it);
 * each square shrinks away in turn. */
.menu-pixels {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  pointer-events: none;
}

.menu-pixels i {
  background: var(--red);
  animation: menu-pixel 0.16s steps(3, end) both;
}

/* Every third square a darker red, so the block reads as pixels. */
.menu-pixels i:nth-child(3n) {
  background: #c4321f;
}

/* The items slide in after the block, one after another. */
.app-menu li {
  animation: menu-item 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.app-menu li:nth-child(1) { animation-delay: 0.16s; }
.app-menu li:nth-child(2) { animation-delay: 0.21s; }
.app-menu li:nth-child(3) { animation-delay: 0.26s; }
.app-menu li:nth-child(4) { animation-delay: 0.31s; }
.app-menu li:nth-child(5) { animation-delay: 0.36s; }

@keyframes menu-grow {
  from {
    clip-path: inset(0 100% 100% 0 round 10px);
  }

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

@keyframes menu-pixel {
  from {
    transform: scale(1.02);
  }

  to {
    transform: scale(0);
  }
}

@keyframes menu-item {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
}

.app-menu[hidden] {
  display: none;
}

.app-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.app-menu a:hover,
.app-menu a:focus-visible {
  background: rgba(240, 65, 47, 0.12);
  outline: none;
}

.app-menu img {
  flex: none;
  border-radius: 9px;
}

/* The page you are on: a red bar at its left edge. */
.app-menu a[aria-current="page"] {
  box-shadow: inset 3px 0 0 var(--red);
  background: rgba(255, 255, 255, 0.04);
}

/* Business Object's own item, set apart from the apps by a line. */
.app-menu li:first-child {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--edge);
}

.app-menu b {
  display: block;
  line-height: 1.25;
}

.app-menu small {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.3;
}


.hero-body {
  max-width: 1080px;
  margin: 0 auto;
  padding-top: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.pitch h1 {
  margin: 0 0 20px;
  font-size: clamp(2.6rem, 9vw, 4.6rem);
  font-weight: 800;
}

.line {
  display: block;
}

/* The second line as a red block, lit from behind. */
.pitch em {
  font-style: normal;
  display: inline-block;
  margin-top: 8px;
  padding: 0 0.18em 0.06em;
  border-radius: 4px;
  background: var(--red);
  color: var(--white);
  box-shadow: 0 12px 48px var(--red-glow);
}

.sub {
  margin: 0 0 32px;
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  color: var(--muted);
  max-width: 28em;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 8px;
  background: var(--white);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px var(--red-glow);
}

/* The mark, large. Its red cells slide in one by one in reading order
 * (60 ms apart) and settle without a bounce, hold, then fade out together;
 * a sheen crosses it while it is whole. A 9 s cycle. */
/* The stage gives the mark its 3D view; the mark sways slowly within it.
 * Its thickness is a stack of 1 px dark-red layers below and to the right,
 * as the side of a block seen from the left. */
.mark-stage {
  justify-self: center;
  perspective: 1000px;
}

.mark {
  position: relative;
  overflow: hidden;
  width: min(72vw, 330px);
  aspect-ratio: 1;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 10px;
  box-shadow:
    1px 1px 0 #5c1a12, 2px 2px 0 #5c1a12, 3px 3px 0 #561811, 4px 4px 0 #561811,
    5px 5px 0 #4f1610, 6px 6px 0 #4f1610, 7px 7px 0 #48140e, 8px 8px 0 #48140e,
    9px 9px 0 #41120d, 10px 10px 0 #41120d, 11px 11px 0 #3a100b, 12px 12px 0 #3a100b,
    0 40px 100px var(--red-glow);
  transform: rotateY(-22deg) rotateX(14deg) rotateZ(-2deg);
  animation: sway 12s ease-in-out infinite alternate;
}

@keyframes sway {
  from {
    transform: rotateY(-26deg) rotateX(16deg) rotateZ(-2deg);
  }

  to {
    transform: rotateY(-12deg) rotateX(8deg) rotateZ(-1deg);
  }
}

.mark::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.28) 50%, transparent 60%);
  transform: translateX(-110%);
  animation: sheen 9s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sheen {
  0%,
  30% {
    transform: translateX(-110%);
  }

  50%,
  100% {
    transform: translateX(110%);
  }
}

.row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.r0 { --r: 0; }
.r1 { --r: 1; }
.r2 { --r: 2; }
.r3 { --r: 3; }
.r4 { --r: 4; }

.row i:nth-child(1) { --c: 0; }
.row i:nth-child(2) { --c: 1; }
.row i:nth-child(3) { --c: 2; }
.row i:nth-child(4) { --c: 3; }
.row i:nth-child(5) { --c: 4; }

.mark i {
  background: var(--red);
  animation: settle 9s cubic-bezier(0.2, 0.8, 0.2, 1) infinite both;
  animation-delay: calc((var(--r) * 5 + var(--c)) * 0.06s);
}

/* The holes are the mark's white, still while the red moves. */
.mark i.hole {
  background: var(--white);
  animation: none;
}

@keyframes settle {
  0% {
    transform: translateY(-24px);
    opacity: 0;
  }

  5%,
  80% {
    transform: none;
    opacity: 1;
  }

  90%,
  100% {
    transform: none;
    opacity: 0;
  }
}

@media (min-width: 820px) {
  .hero {
    padding-bottom: 112px;
  }

  .hero-body {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    padding-top: 48px;
  }
}

/* --- the apps ------------------------------------------------------------------ */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.apps h2,
.contact h2 {
  margin: 0 0 24px;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}

@media (min-width: 720px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* A tall card: a picture strip on top, the icon over its edge, then name,
 * line, text, and the buttons at the foot. The whole card is a link to the
 * app's site (the name's link, stretched); the Play button sits above it.
 * On hover it lifts and glows in its app's colour (--accent). */
.app {
  --accent: var(--red);

  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 600px;
  padding: 0 28px 32px;
  border: 1px solid var(--edge);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 0 2px var(--accent), 0 30px 80px var(--glow, rgba(0, 0, 0, 0.5));
}

.app:has(.app-link:focus-visible) {
  outline: 2px solid var(--white);
  outline-offset: 4px;
}

.app-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* The stage at the top of the card: the app's own motion faint on the
 * left, a phone with the app's screen turned in 3D on the right. */
.app-art {
  position: relative;
  align-self: stretch;
  /* Tall enough that the whole phone stands clear of the line below it. */
  height: 350px;
  margin: 0 -28px;
  overflow: hidden;
  perspective: 900px;
  border-bottom: 2px solid currentColor;
}

.app-art .stones,
.app-art .wave,
.app-art .days {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.55;
}

/* The phone: a dark bezel round the screenshot, its side a stack of 1 px
 * layers like the mark's. On hover it turns towards you and lifts. */
.phone {
  position: absolute;
  right: 12%;
  top: 24px;
  width: 140px;
  padding: 5px;
  border-radius: 22px;
  background: #0b0b0d;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    -1px 1px 0 #26262b, -2px 2px 0 #26262b, -3px 3px 0 #1f1f23, -4px 4px 0 #1f1f23,
    -5px 5px 0 #18181b, -6px 6px 0 #18181b,
    -20px 30px 50px rgba(0, 0, 0, 0.5);
  transform: rotateY(24deg) rotateX(10deg) rotateZ(3deg);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 17px;
}

.app:hover .phone {
  transform: rotateY(8deg) rotateX(4deg) rotateZ(1deg) translateY(-8px) scale(1.04);
}

.app-icon {
  margin: 28px 0 24px;
  border-radius: 20px;
  border: 2px solid currentColor;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.app h3 {
  margin: 0 0 6px;
  font-size: 2.2rem;
}

.app-link {
  color: inherit;
  text-decoration: none;
}

.app-link:focus-visible {
  outline: none;
}

/* The stretched link: its box covers the whole card. */
.app-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.app-tag {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 1.2rem;
}

.app-desc {
  margin: 0 0 32px;
  font-size: 1.05rem;
}

.app-links {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border: 2px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

/* The Play button stays its own link, above the card's. */
.btn-solid {
  position: relative;
  z-index: 2;
  transition: transform 0.15s ease;
}

.btn-solid:hover {
  transform: translateY(-2px);
}

.btn-line {
  border-color: currentColor;
}

.app:hover .btn-line svg {
  transform: translateX(4px);
}

.btn-line svg {
  transition: transform 0.15s ease;
}

/* Questify: its listing's lime, with yellow glows, ink text; in the strip,
 * a row of streak stones lighting one by one. */
.app-questify {
  --accent: #c8ff3d;
  --glow: rgba(200, 255, 61, 0.3);

  color: #0c0c0a;
  background: linear-gradient(165deg, #c8ff3d 0%, #9be22e 60%, #c8ff3d 100%);
}

.app-questify .app-glow {
  background:
    radial-gradient(320px 260px at 90% 5%, rgba(255, 212, 38, 0.75), transparent),
    radial-gradient(300px 240px at 0% 100%, rgba(255, 212, 38, 0.5), transparent);
}

.app-questify .btn-solid {
  background: #0c0c0a;
  color: #c8ff3d;
}

.app-questify .btn-solid:focus-visible {
  outline-color: #0c0c0a;
}

.stones {
  display: flex;
  gap: 14px;
}

.stones i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(12, 12, 10, 0.18);
  animation: stone 6s ease-in-out infinite;
}

.stones i:nth-child(1) { animation-delay: 0s; }
.stones i:nth-child(2) { animation-delay: 0.3s; }
.stones i:nth-child(3) { animation-delay: 0.6s; }
.stones i:nth-child(4) { animation-delay: 0.9s; }
.stones i:nth-child(5) { animation-delay: 1.2s; }
.stones i:nth-child(6) { animation-delay: 1.5s; }
.stones i:nth-child(7) { animation-delay: 1.8s; }

@keyframes stone {
  0%,
  100% {
    background: rgba(12, 12, 10, 0.18);
    box-shadow: none;
  }

  8%,
  60% {
    background: #ffd426;
    box-shadow: 0 0 0 3px rgba(12, 12, 10, 0.85), 0 0 18px rgba(255, 212, 38, 0.8);
  }
}

/* Sound Deck: navy, an orange and a blue spotlight; in the strip, a
 * waveform playing. */
.app-sounddeck {
  --accent: #e64a19;
  --glow: rgba(230, 74, 25, 0.35);

  color: #eef2fa;
  background: #0e1320;
}

.app-sounddeck .app-glow {
  background:
    radial-gradient(340px 280px at 0% 0%, rgba(230, 74, 25, 0.5), transparent),
    radial-gradient(380px 300px at 100% 100%, rgba(25, 118, 210, 0.55), transparent);
}

.app-sounddeck .app-tag {
  color: #ff8a65;
}

.app-sounddeck .btn-solid {
  background: #e64a19;
  color: #fff;
}

.app-sounddeck .btn-line {
  color: #64b5f6;
}

.wave {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 110px;
}

.wave i {
  width: 8px;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(#ff8a65, #64b5f6);
  transform-origin: center;
  animation: bar 1.4s ease-in-out infinite alternate;
}

.wave i:nth-child(3n)   { animation-duration: 1.1s; }
.wave i:nth-child(3n+1) { animation-duration: 1.7s; }
.wave i:nth-child(4n)   { animation-delay: -0.5s; }
.wave i:nth-child(5n+2) { animation-delay: -0.9s; }
.wave i:nth-child(odd)  { animation-direction: alternate-reverse; }

@keyframes bar {
  from {
    transform: scaleY(0.15);
  }

  to {
    transform: scaleY(1);
  }
}

/* Trading Sundays: its listing's lavender to rose, ink text; in the strip,
 * four weeks of days lighting one by one, Sundays rose, the last Sunday of
 * the month flashing red, the trading Sunday, as on its own site. */
.app-trading {
  --accent: #e8211d;
  --glow: rgba(210, 122, 143, 0.4);

  color: #221f30;
  background: linear-gradient(172deg, #dfe0f4 0%, #e2cfe0 45%, #dba3b4 75%, #d27a8f 100%);
}

.app-trading .app-glow {
  background: radial-gradient(320px 260px at 95% 0%, rgba(255, 255, 255, 0.45), transparent);
}

.app-trading .btn-solid {
  background: #365f8e;
  color: #fff;
}

.app-trading .btn-solid:focus-visible {
  outline-color: #221f30;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 18px);
  gap: 8px;
}

.days i {
  width: 18px;
  height: 18px;
  border-radius: 24%;
  background: rgba(34, 31, 48, 0.12);
  animation: day 10s linear infinite both;
}

.days i:nth-child(7n) {
  animation-name: sunday;
}

.days i:last-child {
  animation-name: trading;
}

.days i:nth-child(1) { animation-delay: 0.00s; }
.days i:nth-child(2) { animation-delay: 0.25s; }
.days i:nth-child(3) { animation-delay: 0.50s; }
.days i:nth-child(4) { animation-delay: 0.75s; }
.days i:nth-child(5) { animation-delay: 1.00s; }
.days i:nth-child(6) { animation-delay: 1.25s; }
.days i:nth-child(7) { animation-delay: 1.50s; }
.days i:nth-child(8) { animation-delay: 1.75s; }
.days i:nth-child(9) { animation-delay: 2.00s; }
.days i:nth-child(10) { animation-delay: 2.25s; }
.days i:nth-child(11) { animation-delay: 2.50s; }
.days i:nth-child(12) { animation-delay: 2.75s; }
.days i:nth-child(13) { animation-delay: 3.00s; }
.days i:nth-child(14) { animation-delay: 3.25s; }
.days i:nth-child(15) { animation-delay: 3.50s; }
.days i:nth-child(16) { animation-delay: 3.75s; }
.days i:nth-child(17) { animation-delay: 4.00s; }
.days i:nth-child(18) { animation-delay: 4.25s; }
.days i:nth-child(19) { animation-delay: 4.50s; }
.days i:nth-child(20) { animation-delay: 4.75s; }
.days i:nth-child(21) { animation-delay: 5.00s; }
.days i:nth-child(22) { animation-delay: 5.25s; }
.days i:nth-child(23) { animation-delay: 5.50s; }
.days i:nth-child(24) { animation-delay: 5.75s; }
.days i:nth-child(25) { animation-delay: 6.00s; }
.days i:nth-child(26) { animation-delay: 6.25s; }
.days i:nth-child(27) { animation-delay: 6.50s; }
.days i:nth-child(28) { animation-delay: 6.75s; }

@keyframes day {
  0% {
    background: rgba(34, 31, 48, 0.12);
  }

  2%,
  70% {
    background: rgba(255, 255, 255, 0.85);
  }

  80%,
  100% {
    background: rgba(34, 31, 48, 0.12);
  }
}

@keyframes sunday {
  0% {
    background: rgba(34, 31, 48, 0.12);
  }

  2%,
  70% {
    background: #eea3b4;
  }

  80%,
  100% {
    background: rgba(34, 31, 48, 0.12);
  }
}

@keyframes trading {
  0% {
    background: rgba(34, 31, 48, 0.12);
    box-shadow: none;
    transform: none;
  }

  2%,
  70% {
    background: #e8211d;
    box-shadow: 0 0 16px rgba(232, 33, 29, 0.7);
    transform: scale(1.15);
  }

  80%,
  100% {
    background: rgba(34, 31, 48, 0.12);
    box-shadow: none;
    transform: none;
  }
}

/* Three cards side by side on a wide screen; on a middle one, two, and the
 * third centred below them. */
@media (min-width: 720px) and (max-width: 1019px) {
  .app-grid > .app:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 16px);
  }
}

@media (min-width: 1020px) {
  .app-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app h3 {
    font-size: 1.9rem;
  }
}

/* --- the pixel wipe into an app's site (site.js) -------------------------------- */

.wipe {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  pointer-events: none;
}

.wipe i {
  transform: scale(0);
  animation: wipe-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes wipe-in {
  to {
    transform: scale(1.02);
  }
}

/* The card's icon, flown to the middle (site.js moves it there from the
 * card); landing at 150 px, its corners and edge scaled up from the card's
 * 96 px icon. */
.wipe-icon {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border: 3px solid currentColor;
  border-radius: 31px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  will-change: transform;
}

/* --- contact and footer --------------------------------------------------------- */

.contact {
  margin: 80px 0 0;
  padding: 40px 24px;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
}

.contact h2 {
  margin-bottom: 12px;
}

.contact p {
  margin: 0;
  color: var(--muted);
}

.mail {
  display: inline-block;
  margin-top: 8px;
  font-size: clamp(1.1rem, 4.4vw, 1.5rem);
  font-weight: 800;
}

.foot {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 16px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.foot p {
  margin: 0;
}

/* --- the 404 page -------------------------------------------------------------- */

.lost {
  min-height: 100vh;
}

/* "404" in pixels on the home page's block: 11 columns (4, gap, 0, gap,
 * 4), five rows of digits and two of floor below them. */
.lost .mark-stage {
  width: 100%;
  max-width: 460px;
}

/* Turned less than the home page's mark, so the digits stay readable. */
.mark-404 {
  width: 100%;
  aspect-ratio: 11 / 7;
  grid-template-columns: repeat(11, 1fr);
  grid-template-rows: repeat(7, 1fr);
  animation-name: sway-404;
}

@keyframes sway-404 {
  from {
    transform: rotateY(-14deg) rotateX(8deg) rotateZ(-1deg);
  }

  to {
    transform: rotateY(-6deg) rotateX(4deg) rotateZ(0deg);
  }
}

.mark-404 i {
  animation: none;
  /* A hairline between pixels, so the digits read as pixels. */
  box-shadow: inset 0 0 0 1px var(--surface);
}

.mark-404 i.o {
  background: none;
}

/* A fallen pixel: its place keeps a faint dashed outline, and the pixel
 * itself (the b) lies on the floor, tilted. Now and then it floats back
 * up, stays a moment, and falls again. --fall is how many rows down the
 * floor is. */
.mark-404 i.drop {
  position: relative;
  background: none;
  outline: 1px dashed rgba(255, 255, 255, 0.2);
  outline-offset: -4px;
}

.mark-404 .drop b {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--red);
  box-shadow: 0 0 18px var(--red-glow);
  animation: fall 11s infinite both;
}

.mark-404 .d1 { --fall: 4; --tilt: 8deg; }
.mark-404 .d2 { --fall: 2; --tilt: -6deg; }
.mark-404 .d3 { --fall: 6; --tilt: 14deg; }

.mark-404 .d2 b {
  animation-delay: -3.7s;
}

.mark-404 .d3 b {
  animation-delay: -7.4s;
}

@keyframes fall {
  0%,
  50% {
    transform: translateY(calc(var(--fall) * 100%)) rotate(var(--tilt));
    animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
  }

  64%,
  84% {
    transform: none;
    animation-timing-function: cubic-bezier(0.6, 0, 0.9, 0.6);
  }

  93%,
  100% {
    transform: translateY(calc(var(--fall) * 100%)) rotate(var(--tilt));
  }
}

/* --- reduced motion: everything still ------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .bg-pixels {
    display: none;
  }

  .mark,
  .mark i,
  .mark::after,
  .mark-404 .drop b,
  .app-menu,
  .app-menu li,
  .stones i,
  .wave i,
  .days i,
  .days i:nth-child(7n),
  .days i:last-child {
    animation: none;
  }

  .wave i {
    transform: scaleY(0.6);
  }

  .cta,
  .app,
  .phone,
  .btn-solid,
  .btn-line svg {
    transition: none;
  }
}
