@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-700.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --bg: #0d1117;
  --screen-bg: radial-gradient(ellipse at center, #1a2433 0%, #0d1117 75%);
  --fg: #e6edf3;
  --glow: rgb(120 170 255 / 0.3);
  --ga: #7ee787;
  --gb: #58a6ff;
  --shadow: 0 0 0.04em var(--fg), 0 0 0.25em var(--glow);
  --scan: rgb(0 0 0 / 0.18);
  --font: 'JetBrains Mono', ui-monospace, monospace;
  --size: min(11vw, 22vh, 8.5rem);
  --letters: 6;
  --cycle: 10s;
  --runs: 2.5;
  --delay: 0s;
  --glitch-cycle: 5s;
  --glitch-runs: 5;
  --subtitle-size: clamp(0.875rem, min(3.6vw, 4vh), 1.5rem);
}

@property --sw-a {
  syntax: '<color>';
  inherits: false;
  initial-value: #1a2433;
}

@property --sw-b {
  syntax: '<color>';
  inherits: false;
  initial-value: #0d1117;
}

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

html,
body {
  margin: 0;
}

body {
  display: flow-root;
  min-height: 100dvh;
  background: #090909;
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: repeating-linear-gradient(to bottom, var(--scan) 0 1px, transparent 1px 4px);
}

main.screen {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: min(4vh, 2rem);
  padding: 4rem 1rem;
  background: var(--screen-bg);
  box-shadow: inset 0 0 18vmin rgb(0 0 0 / 0.6);
}

main.screen:has(> .row) {
  grid-template-rows: 1fr auto 1fr;
  align-content: stretch;
}

main.screen > .row {
  grid-row: 2;
}

main.screen > .row + .subtitle {
  grid-row: 3;
  align-self: start;
}

.power-on {
  --delay: 1.4s;
  transform-origin: center;
  animation: poweron 1.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.visited .power-on {
  --delay: 0s;
  animation: none;
}

main.screen::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(160deg, rgb(255 255 255 / 0.05) 0%, transparent 32%);
}

.row {
  position: relative;
  display: flex;
  align-items: center;
  font-size: var(--size);
}

.title {
  position: relative;
  margin: 0;
  width: calc(var(--letters) * 1ch);
  white-space: nowrap;
  font-size: var(--size);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: var(--shadow);
  animation: glitch var(--glitch-cycle) steps(1, end) var(--delay) var(--glitch-runs) both;
}

.title[data-letters='3'] {
  --letters: 3;
}

.title .type {
  position: relative;
  display: inline-block;
  vertical-align: bottom;
  white-space: nowrap;
}

.title .type > span {
  animation: var(--cycle) steps(1, end) var(--delay) var(--runs) both;
}
.title .type > span:nth-child(1) {
  animation-name: l6-1;
}
.title .type > span:nth-child(2) {
  animation-name: l6-2;
}
.title .type > span:nth-child(3) {
  animation-name: l6-3;
}
.title .type > span:nth-child(4) {
  animation-name: l6-4;
}
.title .type > span:nth-child(5) {
  animation-name: l6-5;
}
.title .type > span:nth-child(6) {
  animation-name: l6-6;
}
.title[data-letters='3'] .type > span:nth-child(1) {
  animation-name: l3-1;
}
.title[data-letters='3'] .type > span:nth-child(2) {
  animation-name: l3-2;
}
.title[data-letters='3'] .type > span:nth-child(3) {
  animation-name: l3-3;
}

.title .type::before {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  background: var(--bg);
  clip-path: inset(0 0 100%);
  animation:
    tear var(--glitch-cycle) steps(1, end) var(--delay) var(--glitch-runs) both,
    type-w var(--cycle) steps(var(--letters), end) var(--delay) var(--runs) both;
}

.title::after {
  content: '_';
  position: absolute;
  top: 0;
  left: 0;
  width: 1ch;
  animation:
    caret var(--cycle) steps(var(--letters), end) var(--delay) var(--runs) both,
    blink 0.9s step-end infinite,
    cursor-off 1ms calc(var(--delay) + var(--cycle) * var(--runs)) forwards;
}

.subtitle {
  margin: 0;
  font-size: var(--subtitle-size);
  letter-spacing: 0.05em;
  text-align: center;
}

.dedication {
  position: absolute;
  inset: auto 0 1rem;
  text-align: center;
  font-size: var(--subtitle-size);
  letter-spacing: 0.05em;
}

.dedication a {
  display: inline-block;
  padding: 0.5rem;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

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

a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 0.375rem;
}

.switch {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgb(126 231 135 / 0.06) 0 2px, transparent 2px 6px),
    radial-gradient(ellipse at center, var(--sw-a) 0%, var(--sw-b) 75%);
  animation: sweep 1s both;
}

.switch::before {
  content: '';
  position: absolute;
  inset: -0.3rem 0 auto;
  height: 0.3rem;
  background: #c8ffe6;
  box-shadow:
    0 0 1rem 0.3rem rgb(140 255 200 / 0.7),
    0 0 4rem 1rem rgb(1 121 111 / 0.8);
}

.switch::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #02a896;
  mix-blend-mode: screen;
  clip-path: inset(0 0 100%);
  animation: slices 1s steps(1, end) both;
}

.from-ats .switch {
  display: block;
  --sw-a: #01796f;
  --sw-b: #013f3a;
  animation:
    sweep 1s both,
    dim 1s linear both;
}

.from-ats main.screen {
  --delay: 0.9s;
  animation: jolt 1s steps(1, end) both;
}

@keyframes dim {
  0% {
    --sw-a: #01796f;
    --sw-b: #013f3a;
  }
  22% {
    --sw-a: #02a896;
    --sw-b: #01584f;
  }
  55% {
    --sw-a: #01564f;
    --sw-b: #022b28;
  }
  100% {
    --sw-a: #0b3a3a;
    --sw-b: #061d1f;
  }
}

@keyframes sweep {
  0% {
    top: 0;
    opacity: 1;
    animation-timing-function: steps(2, end);
  }
  14% {
    top: 22%;
    animation-timing-function: steps(1, end);
  }
  20% {
    top: 9%;
    animation-timing-function: cubic-bezier(0.6, 0, 0.3, 1);
  }
  42% {
    top: 48%;
    animation-timing-function: steps(1, end);
  }
  47% {
    top: 37%;
    animation-timing-function: steps(3, end);
  }
  66% {
    top: 74%;
    animation-timing-function: steps(1, end);
  }
  70% {
    top: 61%;
    animation-timing-function: cubic-bezier(0.5, 0, 0.2, 1);
  }
  92% {
    top: 100%;
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes slices {
  0%,
  100% {
    clip-path: inset(0 0 100%);
    transform: none;
  }
  6% {
    clip-path: inset(30% 0 58%);
    transform: translateX(-4vw);
  }
  9% {
    clip-path: inset(70% 0 18%);
    transform: translateX(6vw);
  }
  12% {
    clip-path: inset(0 0 100%);
  }
  24% {
    clip-path: inset(52% 0 40%);
    transform: translateX(3vw);
  }
  27% {
    clip-path: inset(10% 0 82%);
    transform: translateX(-7vw);
  }
  30% {
    clip-path: inset(0 0 100%);
  }
  50% {
    clip-path: inset(62% 0 30%);
    transform: translateX(-5vw);
  }
  53% {
    clip-path: inset(80% 0 6%);
    transform: translateX(4vw);
  }
  56% {
    clip-path: inset(0 0 100%);
  }
  76% {
    clip-path: inset(84% 0 9%);
    transform: translateX(8vw);
  }
  79% {
    clip-path: inset(0 0 100%);
  }
}

@keyframes jolt {
  0%,
  100% {
    transform: none;
    filter: none;
  }
  8% {
    transform: translateX(0.6vw) skewX(-2deg);
    filter: hue-rotate(-40deg) contrast(1.4);
  }
  10% {
    transform: none;
    filter: none;
  }
  26% {
    transform: translateX(-0.9vw);
    filter: brightness(1.6) saturate(1.6);
  }
  28% {
    transform: none;
    filter: none;
  }
  51% {
    transform: translateX(0.5vw) skewX(3deg);
    filter: hue-rotate(30deg) brightness(1.3);
  }
  54% {
    transform: none;
    filter: none;
  }
  78% {
    transform: translateY(-0.4vh);
    filter: brightness(1.8);
  }
  81% {
    transform: none;
    filter: none;
  }
}

@keyframes poweron {
  0% {
    transform: scale(0.02, 0.004);
    filter: brightness(6);
  }
  35% {
    transform: scale(1, 0.004);
    filter: brightness(5);
  }
  65% {
    transform: scale(1, 1);
    filter: brightness(2);
  }
  100% {
    transform: scale(1, 1);
    filter: none;
  }
}

@keyframes type-w {
  0% {
    width: 0;
  }
  24%,
  76% {
    width: calc(var(--letters) * 1ch);
  }
  80.8%,
  100% {
    width: 0;
  }
}

@keyframes l6-1 {
  0% {
    opacity: 0;
  }
  4% {
    opacity: 1;
  }
  80.8%,
  100% {
    opacity: 0;
  }
}

@keyframes l6-2 {
  0% {
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  80%,
  100% {
    opacity: 0;
  }
}

@keyframes l6-3 {
  0% {
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  79.2%,
  100% {
    opacity: 0;
  }
}

@keyframes l6-4 {
  0% {
    opacity: 0;
  }
  16% {
    opacity: 1;
  }
  78.4%,
  100% {
    opacity: 0;
  }
}

@keyframes l6-5 {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  77.6%,
  100% {
    opacity: 0;
  }
}

@keyframes l6-6 {
  0% {
    opacity: 0;
  }
  24% {
    opacity: 1;
  }
  76.8%,
  100% {
    opacity: 0;
  }
}

@keyframes l3-1 {
  0% {
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  80.8%,
  100% {
    opacity: 0;
  }
}

@keyframes l3-2 {
  0% {
    opacity: 0;
  }
  16% {
    opacity: 1;
  }
  79.2%,
  100% {
    opacity: 0;
  }
}

@keyframes l3-3 {
  0% {
    opacity: 0;
  }
  24% {
    opacity: 1;
  }
  77.6%,
  100% {
    opacity: 0;
  }
}

@keyframes caret {
  0% {
    transform: translateX(0);
  }
  24%,
  76% {
    transform: translateX(calc(var(--letters) * 1ch));
  }
  80.8%,
  100% {
    transform: translateX(0);
  }
}

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

@keyframes cursor-off {
  to {
    visibility: hidden;
  }
}

@keyframes glitch {
  0%,
  25%,
  64%,
  100% {
    opacity: 1;
    transform: none;
    filter: none;
    text-shadow: var(--shadow);
  }
  20% {
    opacity: 0.5;
    transform: translateX(0.07em);
    text-shadow:
      -0.09em 0 0.02em var(--ga),
      0.09em 0 0.06em var(--gb),
      0 0 0.25em var(--glow);
  }
  21% {
    opacity: 1;
    transform: translateX(-0.05em) skewX(-8deg);
    filter: brightness(1.2);
    text-shadow:
      0.06em 0 0.03em var(--ga),
      -0.12em 0 0.08em var(--gb),
      0 0 0.25em var(--glow);
  }
  22.5% {
    opacity: 0.35;
    transform: translateX(0.03em);
    text-shadow: var(--shadow);
  }
  23.5% {
    opacity: 0.85;
    transform: translateX(-0.09em) skewX(5deg);
    filter: brightness(1.1);
    text-shadow:
      0.1em 0 0.04em var(--ga),
      -0.05em 0 0.06em var(--gb),
      0 0 0.25em var(--glow);
  }
  61% {
    opacity: 0.4;
    transform: translateX(-0.06em);
    text-shadow:
      0.08em 0 0.05em var(--gb),
      0 0 0.25em var(--glow);
  }
  62.5% {
    opacity: 1;
    transform: translateX(0.04em) skewX(-6deg);
    filter: brightness(1.25);
    text-shadow:
      -0.07em 0 0.03em var(--ga),
      0 0 0.25em var(--glow);
  }
}

@keyframes tear {
  0%,
  25%,
  64%,
  100% {
    clip-path: inset(0 0 100%);
    transform: none;
  }
  20% {
    clip-path: inset(12% 0 62%);
    transform: translateX(-0.14em);
  }
  21% {
    clip-path: inset(55% 0 22%);
    transform: translateX(0.12em);
  }
  22.5% {
    clip-path: inset(30% 0 52%);
    transform: translateX(-0.07em);
  }
  23.5% {
    clip-path: inset(72% 0 8%);
    transform: translateX(0.16em);
  }
  61% {
    clip-path: inset(40% 0 38%);
    transform: translateX(0.1em);
  }
  62.5% {
    clip-path: inset(6% 0 78%);
    transform: translateX(-0.12em);
  }
}

@media (prefers-reduced-motion: reduce) {
  .power-on,
  .from-ats main.screen,
  .title,
  .title .type,
  .title .type::before {
    animation: none;
  }
  .title .type > span,
  .title .type::before {
    animation: none !important;
  }
  .title::after {
    animation: none;
    opacity: 0;
  }
  .switch {
    display: none !important;
  }
}
