/* flisq.io: one stylesheet for every page. The look is the main site's (site/src/styles): blue-black, one electric
   accent, Unbounded headings, Martian Mono labels, a pixel grid behind everything. Every effect decorates text that
   reads without it: with no JS or with reduced motion the pages are simply still. */

/* Each font comes in subsets by script; a page downloads only the ones its text uses (unicode-range). Unbounded 600:
   Fontsource 5.2.8 (latin, latin-ext for Turkish, cyrillic). Martian Mono 440: cut from the main site's source font.
   Korean and Arabic have no glyphs in either: they show in the system's font. */
@font-face {
  font-family: "Unbounded";
  src: url("/a/unbounded-latin.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Unbounded";
  src: url("/a/unbounded-latin-ext.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Unbounded";
  src: url("/a/unbounded-cyrillic.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Martian Mono";
  src: url("/a/martian-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201E, U+2022, U+2026, U+2116, U+2190, U+2192, U+2197;
}

@font-face {
  font-family: "Martian Mono";
  src: url("/a/martian-cyrillic.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0400-045F;
}

/* Fallbacks with the webfonts' metrics (measured on the main site), so the swap does not move the page. */
@font-face {
  font-family: "Unbounded Fallback";
  src: local("Arial");
  size-adjust: 138.4%;
  ascent-override: 99%;
  descent-override: 24%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Martian Fallback";
  src: local("Menlo");
  size-adjust: 116.3%;
  ascent-override: 100%;
  descent-override: 20%;
  line-gap-override: 0%;
}

:root {
  color-scheme: dark;
  --end: right;

  --bg: #04060a;
  --bg-1: #070b12;
  --bg-2: #0b111b;
  --bg-3: #111927;
  --line: rgb(140 170 255 / 0.1);
  --line-2: rgb(140 170 255 / 0.18);
  --line-3: rgb(140 170 255 / 0.3);
  --text: #e8eef9;
  --text-2: #a7b2c6;
  --text-3: #6f7a90;
  --accent: #5d9dff;
  --accent-hi: #8fbcff;
  --accent-lo: #2a5bd7;
  --cyan: #7ff2ff;
  --ink: #03050a;

  --font-display: "Unbounded", "Unbounded Fallback", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Martian Mono", "Martian Fallback", ui-monospace, monospace;

  --pad: clamp(16px, 4.2vw, 48px);
  --max: 1200px;
  --r: 16px;
  --hdr: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

[dir="rtl"] {
  --end: left;
}

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-padding-top: calc(var(--hdr) + 24px);
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

main {
  flex: 1;
  position: relative;
  isolation: isolate;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

p,
ul,
ol {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in oklch, currentColor 35%, transparent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: color 0.2s, text-decoration-color 0.2s;

  &:hover {
    text-decoration-color: currentColor;
  }
}

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

::selection {
  background: var(--accent);
  color: var(--ink);
}

svg,
canvas {
  display: block;
}

.mono,
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -48px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--ink);
  text-decoration: none;

  &:focus {
    top: 12px;
  }
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* The backdrop: a faint pixel grid and two glows, under everything. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 70% -10%, rgb(42 91 215 / 0.22), transparent 60%),
    radial-gradient(60% 50% at 0% 100%, rgb(127 242 255 / 0.05), transparent 70%),
    var(--bg);

  &::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(90% 70% at 60% 20%, #000 0%, transparent 75%);
    opacity: 0.55;
  }
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgb(255 255 255 / 0.025) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* Header: the mark and three links. */
.hdr {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--hdr);
  background: color-mix(in oklch, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}

.hdr-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 600 15px/1 var(--font-display);
  letter-spacing: 0.02em;

  img {
    width: 22px;
    height: 22px;
    border-radius: 6px;
  }
}

.nav {
  display: flex;
  gap: clamp(14px, 3vw, 28px);
  font-size: 14px;

  a {
    color: var(--text-2);
    text-decoration: none;

    &:hover,
    &[aria-current="page"] {
      color: var(--text);
    }

    &[aria-current="page"] {
      text-decoration: underline;
      text-decoration-color: var(--accent);
      text-underline-offset: 0.45em;
    }
  }
}

.hdr-end {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
}

/* Below this width the three links live in the footer only: in German or French they would not fit next to the mark
   and the language button. */
@media (width < 640px) {
  .nav {
    display: none;
  }
}

/* The language button and its menu (a popover: no JS). */
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  background: rgb(140 170 255 / 0.08);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--text-2);
  font: 400 11.5px/1 var(--font-mono);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.2s, box-shadow 0.2s;

  &:hover {
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--line-3);
  }
}

.langs {
  position: fixed;
  inset: auto;
  top: calc(var(--hdr) - 6px);
  inset-inline-end: var(--pad);
  margin: 0;
  width: min(260px, calc(100vw - 32px));
  padding: 10px;
  border: 0;
  border-radius: 14px;
  background: color-mix(in oklch, var(--bg-2) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 30px 80px -30px rgb(0 0 0 / 0.9);
  color: var(--text);

  ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-2);
    font-size: 14px;
    text-decoration: none;

    &:hover {
      background: rgb(140 170 255 / 0.08);
      color: var(--text);
    }

    &[aria-current] {
      color: var(--accent-hi);
      background: rgb(93 157 255 / 0.1);
    }
  }
}

.langs-title {
  padding: 4px 10px 8px;
  font: 400 10px/1.4 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

@media (prefers-reduced-motion: no-preference) {
  .langs {
    transition: opacity 0.2s, translate 0.25s var(--ease), display 0.25s allow-discrete, overlay 0.25s allow-discrete;
    opacity: 0;
    translate: 0 -6px;

    &:popover-open {
      opacity: 1;
      translate: 0 0;

      @starting-style {
        opacity: 0;
        translate: 0 -6px;
      }
    }
  }
}

/* Scripts without the display fonts. Arabic letters join: no tracking anywhere. Korean breaks between words. */
:lang(ar) * {
  letter-spacing: 0 !important;
}

:lang(ar) .eyebrow,
:lang(ar) .langs-title,
:lang(ar) .facts dt,
:lang(ar) table th,
:lang(ar) .card-k {
  font-family: var(--font-body);
  font-size: 12.5px;
}

:lang(ko) {
  word-break: keep-all;
}

/* An address keeps its own direction (dir="ltr") but stands on the reading side of the card. */
[dir="rtl"] .card-v {
  text-align: right;
}

/* Labels: mono, uppercase, two pixels in front. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 400 11.5px/1.4 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-hi);

  &::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-inline-end: 9px;
    background: currentColor;
    box-shadow: 9px 0 0 color-mix(in oklch, currentColor 40%, transparent);
  }
}

.lead {
  font-size: clamp(18px, 1.55vw, 21px);
  line-height: 1.5;
  color: var(--text-2);
  max-width: 36rem;
}

/* The particle stage: a canvas as big as the first screen of the home page (it scrolls away with the card), a box in
   the hero of the other pages. */
.stage {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s var(--ease);

  &.is-live {
    opacity: 1;
  }
}

.stage-box {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  bottom: 0;
  width: 46%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s var(--ease);

  &.is-live {
    opacity: 1;
  }

  @media (width < 1080px) {
    display: none;
  }
}

/* Home: the app's card, as in the App Store: icon, name, subtitle, a line, the info strip, the screenshots. The
   particle stage stands beside it, on the side the text ends (above it on a phone). */
.hero {
  position: relative;
  min-height: calc(100svh - 120px);
  margin-top: calc(var(--hdr) * -1);
  padding-top: var(--hdr);
  display: grid;
  align-items: center;
}

.hero-wrap {
  padding-block: 72px 56px;

  @media (width < 720px) {
    /* The picture takes the top of the screen; the card comes under it. */
    padding-block: 34svh 40px;
  }
}

.app {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px 28px;
  align-items: center;
  max-width: min(44rem, 58%);

  @media (width < 1080px) {
    max-width: 44rem;
  }

  @media (width < 560px) {
    gap: 16px 18px;
  }
}

.app-icon {
  width: clamp(88px, 11vw, 148px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06), 0 24px 60px -20px rgb(42 91 215 / 0.75);
}

.app-name {
  display: grid;
  gap: 8px;

  h1 {
    font-size: clamp(44px, 7vw, 104px);
    line-height: 0.92;
    letter-spacing: -0.02em;
  }
}

.subtitle {
  font-size: clamp(17px, 1.6vw, 21px);
  color: var(--text-2);
}

.app-about {
  grid-column: 1 / -1;
  display: grid;
  gap: 22px;
  justify-items: start;
  margin-top: 8px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  font-size: 15px;

  a {
    color: var(--accent-hi);
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgb(93 157 255 / 0.14);
  box-shadow: inset 0 0 0 1px rgb(93 157 255 / 0.35);
  color: var(--accent-hi);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
}

/* The info strip: five cells with hairlines between them, a mono label, a big value, a small caption. */
.facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding-block: 18px;
  border-block: 1px solid var(--line);

  > div {
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 6px;
    padding: 4px 10px;
    text-align: center;
  }

  > div + div {
    border-inline-start: 1px solid var(--line);
  }

  dt {
    font: 400 10px/1.4 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
  }

  dd {
    margin: 0;
    font: 600 clamp(18px, 2vw, 24px) / 1.15 var(--font-display);
    letter-spacing: -0.01em;
    color: var(--text);
  }

  small {
    display: block;
    margin-top: 4px;
    font: 400 12.5px/1.3 var(--font-body);
    letter-spacing: 0;
    color: var(--text-3);
  }

  @media (width < 720px) {
    grid-template-columns: repeat(5, minmax(108px, 1fr));
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: calc(var(--pad) * -1);
    padding-inline: var(--pad);
  }
}

/* The screenshots: a row that scrolls sideways and snaps, as in the store. */
.preview {
  padding-block: 40px clamp(64px, 12vh, 120px);
  display: grid;
  gap: 18px;
}

.preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;

  h2 {
    font-size: clamp(20px, 2vw, 26px);
    letter-spacing: -0.02em;
  }
}

.shots {
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 4px 0 14px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--line-3) transparent;
  mask-image: linear-gradient(to var(--end), #000 92%, transparent);

  li {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  img {
    display: block;
    width: clamp(200px, 22vw, 260px);
    height: auto;
    aspect-ratio: 600 / 1304;
    border-radius: 26px;
    background: var(--bg-2);
    box-shadow: 0 0 0 1px var(--line-2), 0 26px 60px -34px rgb(0 0 0 / 0.9);
  }

  @media (prefers-reduced-motion: no-preference) {
    scroll-behavior: smooth;
  }
}

/* Inner pages: a hero with the label, the title and the date, then the text. */
.page-hero {
  position: relative;
  padding-block: clamp(56px, 11vh, 120px) clamp(36px, 6vh, 64px);
}

.page-hero-text {
  display: grid;
  gap: 22px;
  max-width: 44rem;

  h1 {
    font-size: clamp(36px, 5.4vw, 80px);
    line-height: 1;
  }
}

.meta {
  font: 400 12px/1.5 var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.prose {
  max-width: 44rem;
  padding-bottom: clamp(64px, 12vh, 140px);
  display: grid;
  gap: 18px;
  color: var(--text-2);

  h2 {
    margin-top: 34px;
    font-size: clamp(22px, 2.2vw, 28px);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
    scroll-margin-top: calc(var(--hdr) + 24px);
  }

  h2 .n {
    display: block;
    margin-bottom: 10px;
    font: 400 11px/1 var(--font-mono);
    letter-spacing: 0.14em;
    color: var(--accent);
  }

  strong {
    color: var(--text);
    font-weight: 600;
  }

  ul {
    display: grid;
    gap: 10px;
    padding-inline-start: 0;
    list-style: none;
  }

  li {
    position: relative;
    padding-inline-start: 22px;

    &::before {
      content: "";
      position: absolute;
      inset-inline-start: 2px;
      top: 0.68em;
      width: 6px;
      height: 6px;
      background: var(--accent);
    }
  }

  a {
    color: var(--accent-hi);
  }
}

.table-scroll {
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--line-2);
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;

  th,
  td {
    padding: 12px 14px;
    text-align: start;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
  }

  th {
    font: 400 10.5px/1.4 var(--font-mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
    background: var(--bg-1);
  }

  tr:last-child td {
    border-bottom: 0;
  }

  td:first-child {
    color: var(--text);
  }

  td:last-child {
    white-space: nowrap;
    color: var(--cyan);
    font-family: var(--font-mono);
    font-size: 12.5px;
  }

  /* On a phone each row is a block: what, then why and how long under it; nothing hides off the edge. */
  @media (width < 720px) {
    min-width: 0;

    thead {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
    }

    tbody,
    tr,
    td {
      display: block;
    }

    tr {
      padding: 14px 16px;
      border-bottom: 1px solid var(--line);
    }

    td {
      padding: 0;
      border: 0;
    }

    td:nth-child(2) {
      margin-top: 4px;
      font-size: 14px;
    }

    td:nth-child(2)::before {
      content: "Why: " / "";
      color: var(--text-3);
    }

    td:last-child {
      margin-top: 6px;
      white-space: normal;
    }
  }
}

/* Contact cards with a glow that follows the pointer. */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-block: 6px 10px;

  @media (width < 820px) {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card {
  --mx: 50%;
  --my: 0%;
  position: relative;
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: var(--r);
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line-2);
  text-decoration: none;
  overflow: hidden;
  transition: box-shadow 0.3s, translate 0.3s var(--ease);

  &::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(260px circle at var(--mx) var(--my), rgb(93 157 255 / 0.18), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
  }

  &:hover {
    box-shadow: inset 0 0 0 1px var(--line-3), 0 20px 60px -30px rgb(42 91 215 / 0.8);
    translate: 0 -2px;

    &::before {
      opacity: 1;
    }
  }

  .card-k {
    font: 400 10.5px/1.4 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
  }

  .card-v {
    font: 400 14px/1.4 var(--font-mono);
    color: var(--accent-hi);
    overflow-wrap: anywhere;
  }

  .card-d {
    font-size: 14px;
    color: var(--text-2);
  }
}

/* Footer. */
.ftr {
  position: relative;
  border-top: 1px solid var(--line);
  background: color-mix(in oklch, var(--bg) 80%, transparent);
  font-size: 13.5px;
  color: var(--text-3);
}

.ftr-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  padding-block: 26px;

  nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
  }

  a {
    text-decoration: none;

    &:hover {
      color: var(--text);
    }
  }
}

/* 404. */
.lost {
  min-height: calc(100svh - var(--hdr) - 80px);
  display: grid;
  align-content: center;
  gap: 22px;
  justify-items: start;

  h1 {
    font-size: clamp(64px, 14vw, 200px);
    line-height: 0.9;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.2s, translate 0.3s var(--ease);

  &:hover {
    background: var(--accent-hi);
    translate: 0 -1px;
  }
}

/* Glitch: two coloured copies of the text, cut into slices that jump for a moment. The copies come from data-text and
   are hidden from screen readers. */
.glitch {
  position: relative;

  &::before,
  &::after {
    content: attr(data-text) / "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
  }

  &::before {
    color: var(--cyan);
    mix-blend-mode: screen;
  }

  &::after {
    color: #ff3e8f;
    mix-blend-mode: screen;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .glitch-auto::before {
    animation: glitch-a 7s steps(1) infinite;
  }

  .glitch-auto::after {
    animation: glitch-b 7s steps(1) infinite;
  }

  .glitch.is-glitching::before {
    animation: glitch-a 0.9s steps(1) 1;
  }

  .glitch.is-glitching::after {
    animation: glitch-b 0.9s steps(1) 1;
  }

  /* Reveal on scroll, in CSS only: a block rises and sharpens as it enters. */
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }

  .caret::after {
    animation: caret 1.1s steps(1) infinite;
  }
}

@keyframes glitch-a {
  0%,
  86%,
  100% {
    opacity: 0;
    translate: 0;
    clip-path: inset(0 0 100% 0);
  }

  87% {
    opacity: 0.9;
    translate: -4px 0;
    clip-path: inset(12% 0 64% 0);
  }

  89% {
    translate: 5px 0;
    clip-path: inset(58% 0 18% 0);
  }

  91% {
    translate: -2px 0;
    clip-path: inset(30% 0 42% 0);
  }

  93% {
    translate: 3px 0;
    clip-path: inset(80% 0 4% 0);
  }

  95% {
    opacity: 0.8;
    translate: -1px 0;
    clip-path: inset(4% 0 86% 0);
  }
}

@keyframes glitch-b {
  0%,
  86%,
  100% {
    opacity: 0;
    translate: 0;
    clip-path: inset(0 0 100% 0);
  }

  88% {
    opacity: 0.85;
    translate: 4px 0;
    clip-path: inset(70% 0 10% 0);
  }

  90% {
    translate: -5px 0;
    clip-path: inset(20% 0 60% 0);
  }

  92% {
    translate: 2px 0;
    clip-path: inset(46% 0 30% 0);
  }

  94% {
    opacity: 0.7;
    translate: -3px 0;
    clip-path: inset(6% 0 78% 0);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    translate: 0 40px;
    clip-path: inset(0 0 30% 0);
  }

  to {
    opacity: 1;
    translate: 0 0;
    clip-path: inset(0 0 -20% 0);
  }
}

.caret::after {
  content: "" / "";
  display: inline-block;
  width: 0.5em;
  height: 0.9em;
  margin-inline-start: 0.12em;
  vertical-align: -0.08em;
  background: var(--accent);
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

[data-scramble] {
  font-variant-numeric: tabular-nums;
}
