:root {
  --bg: #07060f;
  --surface: #120f22;
  --ink: #ece9ff;
  --muted: #a29fc2;
  --line: #2c2748;
  --pink: #ff2a9d;
  --cyan: #19f0ff;
  --accent: var(--cyan);
  --on-accent: #07060f;
  --mono: "Share Tech Mono", ui-monospace, Menlo, monospace;
  --app-font: var(--mono);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60% 40% at 50% 0, rgb(255 42 157 / .16), transparent 70%),
    linear-gradient(rgb(25 240 255 / .04) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, rgb(25 240 255 / .04) 1px, transparent 1px) 0 0 / 44px 100%,
    var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--mono);
}

/* Scanlines over the whole page. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: repeating-linear-gradient(transparent 0 2px, rgb(0 0 0 / .1) 2px 4px);
}

main { flex: 1; }
a { color: inherit; }
h1, h2, h3 { font-weight: 400; line-height: 1.1; margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.top { padding: 20px max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
.brand {
  font: 400 24px "Tilt Neon", var(--mono);
  color: #ffe3f3;
  text-decoration: none;
  text-shadow: 0 0 6px var(--pink), 0 0 16px var(--pink);
}

/* Neon sign */
.sign {
  padding: 28px 20px 4px;
  text-align: center;
  font: 400 clamp(64px, 15vw, 190px)/1 "Tilt Neon", var(--mono);
  letter-spacing: .02em;
  color: #ffe9f6;
  text-shadow:
    0 0 4px #fff,
    0 0 12px var(--pink),
    0 0 28px var(--pink),
    0 0 60px var(--pink),
    0 0 110px rgb(255 42 157 / .7);
}
.bad { animation: flicker-a 5.3s linear infinite; }
.bad.z { animation: flicker-b 3.7s linear infinite; }

@keyframes flicker-a {
  0%, 11%, 13.5%, 15%, 54%, 56.5%, 58%, 59.5%, 100% { color: #ffe9f6; text-shadow: inherit; }
  12%, 14%, 55%, 57%, 58.8%, 60%, 64% { color: #3a1c30; text-shadow: none; }
  64.5% { color: #ffe9f6; text-shadow: inherit; }
}
@keyframes flicker-b {
  0%, 27%, 29%, 31%, 76%, 100% { color: #ffe9f6; text-shadow: inherit; }
  28%, 30%, 32%, 44%, 71%, 73%, 75% { color: #3a1c30; text-shadow: none; }
  32.5%, 43.5%, 72%, 74% { color: #ffb8e0; text-shadow: 0 0 8px var(--pink); }
}

.tagline { margin: 6px 0 22px; text-align: center; color: var(--cyan); font-size: 15px; letter-spacing: .32em; text-transform: uppercase; }

/* Moving wall: one lane per app */
.wall {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  height: max(620px, calc(100dvh - 330px));
  margin: 0;
  padding: 0 10px;
}
.lane { min-width: 0; min-height: 0; --accent: var(--neon); }
.lane > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--neon) 35%, transparent);
  border-radius: 10px;
  overflow: hidden;
  background: rgb(18 15 34 / .75);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.lane-name {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 112px;
  padding: 6px 10px;
  text-align: center;
  font-family: var(--app-font), var(--mono);
  font-size: var(--name-size, 30px);
  overflow-wrap: anywhere;
  color: var(--neon);
  text-shadow: 0 0 10px color-mix(in srgb, var(--neon) 65%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--neon) 35%, transparent);
}
.reel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(transparent, #000 7%, #000 93%, transparent);
}
.track { display: flex; flex-direction: column; gap: 12px; padding: 0 12px; animation: reel-up var(--speed) linear infinite; }
.reel.down .track { animation-name: reel-down; }
.track img { display: block; flex: none; width: 100%; height: auto; border-radius: 8px; }

@keyframes reel-up { to { transform: translateY(calc(-50% - 6px)); } }
@keyframes reel-down { from { transform: translateY(calc(-50% - 6px)); } to { transform: none; } }
@keyframes reel-left { to { transform: translateX(calc(-50% - 6px)); } }
@keyframes reel-right { from { transform: translateX(calc(-50% - 6px)); } to { transform: none; } }

@media (hover: hover) {
  .lane > a:hover { border-color: var(--neon); box-shadow: 0 0 22px color-mix(in srgb, var(--neon) 45%, transparent); }
  .lane > a:hover .track { animation-play-state: paused; }
}

/* App pages */
.back { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; color: var(--muted); text-decoration: none; font-size: 15px; }
.back:hover { color: var(--accent); }

.detail { width: 100%; max-width: 900px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
.hero { display: flex; align-items: center; gap: 28px; padding: 20px 0 30px; }
.hero img { flex: none; width: 128px; height: 128px; border-radius: 22%; box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 45%, transparent); }
.hero h1 {
  font-family: var(--app-font), var(--mono);
  font-size: var(--title-size, clamp(36px, 7vw, 60px));
  overflow-wrap: anywhere;
  color: var(--accent);
  text-shadow: 0 0 14px color-mix(in srgb, var(--accent) 65%, transparent);
}
.line { margin: 12px 0 0; font-size: 20px; line-height: 1.35; }
.meta { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.dl {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-decoration: none;
}
.dl strong { font-size: 18px; font-weight: 400; }
.dl span { color: var(--muted); font-size: 14px; }
.dl small { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.4; }
a.dl:hover { border-color: var(--accent); }
.dl.mine::before { content: "For this device"; font-size: 12px; margin-bottom: 4px; }
a.dl.mine { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent); }
a.dl.mine span, a.dl.mine small { color: inherit; opacity: .85; }
.dl.off.mine::before { color: var(--muted); }

.gallery { display: grid; grid-template-columns: minmax(0, 1fr) 208px; gap: 12px; margin-top: 32px; }
.gallery.single { grid-template-columns: minmax(0, 1fr); }
.stage {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 420px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.stage img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; border-radius: 8px; }

.thumbs { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 100px; gap: 8px; margin: 0; padding: 0; align-content: start; max-height: 420px; overflow-y: auto; }
.thumbs a { display: block; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.thumbs a[aria-current] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 12px var(--accent); }
.thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }

.about { margin: 36px 0 0; font-size: 19px; max-width: 38em; }
.detail section:not(.hero, .downloads, .gallery) { margin-top: 48px; }
.detail h2 { font-size: 26px; margin-bottom: 16px; color: var(--accent); }

.features { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px 32px; margin: 0; padding: 0; }
.features h3 { font-size: 18px; line-height: 1.3; }
.features p { margin: 4px 0 0; color: var(--muted); font-size: 16px; }

.steps { margin: 0; padding-left: 22px; max-width: 40em; }
.steps li { margin-bottom: 10px; padding-left: 4px; }
.steps li::marker { color: var(--accent); }

.sums { margin-top: 48px; color: var(--muted); font-size: 14px; }
.sums summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.sums dl { margin: 0; }
.sums dt { margin-top: 10px; }
.sums dd { margin: 0; overflow-wrap: anywhere; }
.sums code { font-size: 12.5px; }

.intro { padding: 72px 20px 40px; text-align: center; }
.intro h1 { font-size: clamp(38px, 8vw, 68px); color: var(--cyan); }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  margin-top: 40px;
  padding: 18px 20px max(22px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.foot p { margin: 0; }

/* Five columns are too thin on a phone, so the lanes become sliding rows. */
@media (max-width: 760px) {
  .sign { padding-top: 14px; }
  .tagline { font-size: 13px; letter-spacing: .24em; }
  .wall { grid-template-columns: minmax(0, 1fr); height: auto; }
  .lane-name { height: 76px; font-size: var(--name-size-phone, 26px); }
  .reel {
    flex: none;
    height: 210px;
    padding: 10px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  }
  .track { flex-direction: row; width: max-content; height: 100%; padding: 0; animation-name: reel-left; }
  .reel.down .track { animation-name: reel-right; }
  .track img { width: auto; height: 100%; }

  .hero { align-items: flex-start; flex-direction: column; gap: 16px; padding-top: 8px; }
  .hero img { width: 96px; height: 96px; }
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .stage { height: 300px; padding: 10px; }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); grid-auto-rows: 62px; max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bad, .bad.z, .track { animation: none; }
  .reel { overflow: auto; }
}
