/* Shapeless Capital
   Black and white only. The logo, one line, and a copyright line.
   One typeface: Inter Light (weight 300).
   Motion, adapted from wodniack.dev and done in CSS alone: the logo draws in,
   and the letters of each line roll once like a split-flap display.
   Afterwards a single letter rolls now and then.
   Nothing moves when the visitor's system asks for reduced motion. */

@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

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

html {
  background: #000;
  color: #fff;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 1.125rem;
  line-height: 1.5;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, p { margin: 0; }
h1 { font-weight: inherit; font-size: inherit; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover { text-decoration: none; }

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 6px;
}

::selection {
  background: #fff;
  color: #000;
}

/* The logo above one line, centered in the window */

.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2.25rem, 6vh, 4rem);
  padding: clamp(3rem, 10vh, 6rem) clamp(1.5rem, 6vw, 4rem) clamp(2rem, 6vh, 3rem);
  text-align: center;
}

.logo img,
.logo a,
.mark {
  display: block;
}

.logo img,
.mark {
  width: clamp(9.5rem, 15vw, 13.5rem);
  height: auto;
}

.mark {
  aspect-ratio: 266.73 / 320.56;
  overflow: visible;
  color: #fff;
  fill: currentColor;
}

.line {
  max-width: 20em;
  font-size: clamp(1rem, 0.9rem + 0.3vw, 1.1875rem);
  line-height: 1.4;
  text-wrap: balance;
}

/* Copyright: small, at the bottom */

.foot {
  padding: 0 1.5rem clamp(1.5rem, 4vh, 2.25rem);
  text-align: center;
  font-size: 0.875rem;
}

/* Logo animation: the icon draws its outline, fills in, then the name rises into place.
   The resting state is the finished logo, so it shows fully if animations don't run. */

.mark .icon { stroke: currentColor; stroke-width: 0; }

@media (prefers-reduced-motion: no-preference) {
  .mark .icon {
    animation:
      draw 2s cubic-bezier(0.65, 0, 0.35, 1) 0.2s backwards,
      fill-in 0.9s ease-out 1.35s backwards;
  }

  .mark .name {
    animation: rise 0.9s ease-out 1.7s backwards;
  }
}

@keyframes draw {
  0% {
    stroke-width: 1.4;
    stroke-dasharray: 1 1;
    stroke-dashoffset: 1;
    stroke-opacity: 1;
  }
  70% {
    stroke-width: 1.4;
    stroke-dasharray: 1 1;
    stroke-dashoffset: 0;
    stroke-opacity: 1;
  }
  100% {
    stroke-width: 1.4;
    stroke-dasharray: 1 1;
    stroke-dashoffset: 0;
    stroke-opacity: 0;
  }
}

@keyframes fill-in {
  from { fill-opacity: 0; }
  to { fill-opacity: 1; }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Rolling letters. The readable copy (.sr) is for screen readers and search;
   the visible copy is split into letters. Each letter has an identical copy
   just below it, outside its clipping window; rolling up one step swaps them,
   so the text stays readable the whole time. Regenerate with tools/split-line.py. */

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  user-select: none;
}

.split .w { display: inline-block; white-space: nowrap; }
.split .c { display: inline-block; clip-path: inset(0 -0.3em); }
.split .r { display: inline-block; position: relative; }

.split .r::after {
  content: attr(data-l);
  position: absolute;
  top: 100%;
  left: 0;
}

/* Stagger: each word starts 70ms after the one before, each letter 18ms after its neighbor */
.split { --wd: 0ms; --cd: 0ms; }
.split .w:nth-child(2) { --wd: 70ms; }
.split .w:nth-child(3) { --wd: 140ms; }
.split .w:nth-child(4) { --wd: 210ms; }
.split .w:nth-child(5) { --wd: 280ms; }
.split .w:nth-child(6) { --wd: 350ms; }
.split .w:nth-child(7) { --wd: 420ms; }
.split .w:nth-child(8) { --wd: 490ms; }
.split .w:nth-child(9) { --wd: 560ms; }
.split .w:nth-child(10) { --wd: 630ms; }
.split .w:nth-child(n+11) { --wd: 700ms; }
.split .c:nth-child(2) { --cd: 18ms; }
.split .c:nth-child(3) { --cd: 36ms; }
.split .c:nth-child(4) { --cd: 54ms; }
.split .c:nth-child(5) { --cd: 72ms; }
.split .c:nth-child(6) { --cd: 90ms; }
.split .c:nth-child(7) { --cd: 108ms; }
.split .c:nth-child(8) { --cd: 126ms; }
.split .c:nth-child(9) { --cd: 144ms; }
.split .c:nth-child(10) { --cd: 162ms; }
.split .c:nth-child(11) { --cd: 180ms; }
.split .c:nth-child(12) { --cd: 198ms; }
.split .c:nth-child(n+13) { --cd: 216ms; }

.line .split { --base: 1.45s; }
.foot .split { --base: 2s; }

@media (prefers-reduced-motion: no-preference) {
  .split .r {
    animation: roll 0.7s cubic-bezier(0.86, 0, 0.07, 1) calc(var(--base) + var(--wd) + var(--cd));
  }

  /* Three letters keep rolling, now and then, on their own clocks */
  .split .x1 .r { animation: roll 0.7s cubic-bezier(0.86, 0, 0.07, 1) calc(var(--base) + var(--wd) + var(--cd)), idle 7s linear 3s infinite; }
  .split .x2 .r { animation: roll 0.7s cubic-bezier(0.86, 0, 0.07, 1) calc(var(--base) + var(--wd) + var(--cd)), idle 9s linear 4s infinite; }
  .split .x3 .r { animation: roll 0.7s cubic-bezier(0.86, 0, 0.07, 1) calc(var(--base) + var(--wd) + var(--cd)), idle 11s linear 5s infinite; }
}

@keyframes roll {
  from { transform: none; }
  to { transform: translateY(-100%); }
}

@keyframes idle {
  0%, 92% {
    transform: none;
    animation-timing-function: cubic-bezier(0.86, 0, 0.07, 1);
  }
  100% { transform: translateY(-100%); }
}
