:root {
  --bg: #F4F4F2;
  --fg: #1A1A1A;
  --accent: #2F2FE4;
  --fade: 240ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Figtree', system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><path d='M3 2 L3 14 L6 11 L9 17 L11 16 L8 10 L13 10 Z' fill='%232F2FE4'/></svg>") 3 2, auto;
}

main {
  position: relative;
  height: 100vh;
  width: 100%;
}

.counter {
  position: fixed;
  top: 32vh;
  left: clamp(2rem, 22vw, 26rem);
  font-size: 0.7rem;
  color: #999;
  font-feature-settings: "tnum";
  letter-spacing: 0;
  z-index: 20;
  user-select: none;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.skip {
  position: fixed;
  top: 32vh;
  right: clamp(2rem, 22vw, 26rem);
  font-size: 0.7rem;
  color: #999;
  letter-spacing: 0;
  z-index: 20;
  user-select: none;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-weight: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.skip svg { display: block; }

.socials {
  position: fixed;
  bottom: 26vh;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: #999;
  letter-spacing: 0;
  z-index: 20;
  user-select: none;
  white-space: nowrap;
}

.socials a {
  color: #999;
  text-decoration: none;
}

.chunk {
  position: absolute;
  inset: 0;
  padding: 0 clamp(2rem, 22vw, 26rem);
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  font-size: clamp(1.15rem, 1.7vw, 1.5rem);
  line-height: 1.5;
  letter-spacing: -0.02em;
  opacity: 0;
  transition: opacity var(--fade) ease;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.chunk > p,
.chunk > .text {
  align-self: stretch;
  z-index: 1;
}

.chunk.active {
  opacity: 1;
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
}

.chunk p + p { margin-top: 0; }

a, .accent {
  color: var(--accent);
  text-decoration: none;
}

.highlight {
  background-color: var(--accent);
  color: var(--bg);
  padding: 0 0.25em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

a.ext {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.12em;
  white-space: nowrap;
}

a.ext svg {
  flex-shrink: 0;
  margin-bottom: 0.34em;
}

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

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

.has-bg { isolation: isolate; }

.bg-fx {
  position: absolute;
  top: var(--bg-top, 50%);
  left: var(--bg-left, 50%);
  width: var(--bg-w, min(55vw, 700px));
  aspect-ratio: 5 / 3;
  transform: translate(var(--bg-anchor-x, -50%), var(--bg-anchor-y, -50%));
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, black 18%, black 82%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%);
          mask-image:
    linear-gradient(to right, transparent 0%, black 18%, black 82%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
}

.bg-fx-image {
  position: absolute;
  inset: 0;
  background: var(--bg-img) center/cover no-repeat;
  opacity: 0.4;
}

.bg-fx-noise {
  position: absolute;
  inset: 0;
  background: #fff;
  filter: url(#static-noise);
  mix-blend-mode: hard-light;
  opacity: 1;
}

.bg-fx-cursor {
  position: absolute;
  inset: 0;
  background: #fff;
  filter: url(#static-noise);
  mix-blend-mode: hard-light;
  opacity: 1;
  -webkit-mask-image: radial-gradient(circle 180px at var(--cx, 50%) var(--cy, 50%), black 0%, transparent 100%);
          mask-image: radial-gradient(circle 180px at var(--cx, 50%) var(--cy, 50%), black 0%, transparent 100%);
}

@media (max-width: 640px) {
  .chunk {
    padding: 0 1.25rem;
    font-size: 0.95rem;
    transform: translateY(-5vh);
  }
  .counter {
    left: 1.25rem;
  }
  .skip {
    right: 1.25rem;
  }

  .bg-fx {
    width: 65vw;
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
  }

  .has-bg > div.bg-fx:only-of-type { top: 50%; left: 50%; }

  .has-bg > div.bg-fx:first-of-type:nth-last-of-type(2) { top: 42%; left: 30%; }
  .has-bg > div.bg-fx:first-of-type:nth-last-of-type(2) ~ div.bg-fx { top: 58%; left: 70%; }

  .has-bg > div.bg-fx:first-of-type:nth-last-of-type(3) { top: 28%; left: 25%; }
  .has-bg > div.bg-fx:first-of-type:nth-last-of-type(3) + div.bg-fx { top: 50%; left: 50%; }
  .has-bg > div.bg-fx:first-of-type:nth-last-of-type(3) + div.bg-fx + div.bg-fx { top: 72%; left: 75%; }
}
