@font-face {
  font-family: "Swerve Title";
  src: url("./assets/STIXGeneralBolIta.ttf") format("truetype");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Swerve Inter";
  src: url("./assets/Inter-Latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

.hero-preview {
  margin: 0;
  background: #151a20;
}

.swerve-hero {
  --display-face: "Swerve Title", Georgia, serif;
  --veil-edge: .22;
  --veil-center: .60;
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  inline-size: 100%;
  min-block-size: min(64svh, 33rem);
  max-block-size: min(93svh, 58rem);
  aspect-ratio: 40 / 23;
  overflow: hidden;
  padding: 2.75rem clamp(1rem, 5vw, 5rem);
  background: #151a20;
  color: #faf4e9;
}

.swerve-hero__film,
.swerve-hero__veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.swerve-hero__film {
  display: block;
  object-fit: cover;
}

.swerve-hero__veil {
  background:
    radial-gradient(ellipse 57% 50% at 50% 50%,
      rgb(16 19 24 / var(--veil-center)) 16%,
      rgb(16 19 24 / .41) 59%,
      transparent 100%),
    linear-gradient(180deg, rgb(16 19 24 / .16), transparent 31%, transparent 75%, rgb(16 19 24 / .30)),
    rgb(16 19 24 / var(--veil-edge));
}

.swerve-hero__title {
  position: relative;
  text-align: center;
  max-inline-size: 100%;
}

.swerve-hero h1 {
  margin: 0;
  font: italic 700 clamp(2.4rem, 8.05vw, 8.5rem) / .94 var(--display-face);
  letter-spacing: -.036em;
  text-shadow: 0 3px 20px rgb(6 10 14 / .52);
  text-wrap: balance;
}

.swerve-hero__subtitle {
  margin: clamp(.72rem, 1.6vw, 1.34rem) 0 0;
  font: italic 700 clamp(1rem, 2.04vw, 1.88rem) / 1.24 var(--display-face);
  color: #fff8ec;
  text-wrap: balance;
  text-shadow: 0 2px 8px rgb(6 10 14 / .85);
}

.swerve-hero__toggle {
  position: absolute;
  inset: auto clamp(.65rem, 2.5vw, 1.7rem) clamp(.65rem, 2.5vw, 1.7rem) auto;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 52px;
  min-width: 52px;
  padding: .55rem .76rem;
  border: 1px solid #fff4dd74;
  border-radius: .2rem;
  background: #131820a8;
  color: #fff8ec;
  cursor: pointer;
  font: 500 .73rem/1.1 "Swerve Inter", system-ui, sans-serif;
}

.swerve-hero__toggle[hidden] { display: none; }
.swerve-hero__toggle:hover { background: #131820df; }
.swerve-hero__toggle:focus-visible { outline: 2px solid #fff8ec; outline-offset: 4px; }

.swerve-hero__icon {
  display: block;
  box-sizing: border-box;
  width: .86rem;
  height: 1rem;
  border-block: .5rem solid transparent;
  border-left: .86rem solid currentColor;
}

.swerve-hero__toggle[data-playing="true"] .swerve-hero__icon {
  border-block: 0;
  border-inline: .2rem solid currentColor;
}

@media (max-width: 640px) {
  .swerve-hero {
    --veil-center: .69;
    min-block-size: clamp(18.5rem, 78vw, 22rem);
    max-block-size: none;
    aspect-ratio: 40 / 28;
    padding: .85rem 1.18rem 3.55rem;
  }

  .swerve-hero__veil {
    background:
      radial-gradient(ellipse 83% 58% at 50% 51%, rgb(16 19 24 / var(--veil-center)) 18%, transparent 100%),
      rgb(16 19 24 / var(--veil-edge));
  }

  .swerve-hero__subtitle {
    max-inline-size: 28ch;
    margin-inline: auto;
  }

  .swerve-hero__toggle {
    justify-content: center;
    padding: .5rem;
  }

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

.swerve-byline {
  --affiliation-1: #ffcb8a;
  --affiliation-2: #9edbff;
  --affiliation-3: #aee9ba;
  --corresponding: #bcbdc2;
  margin-block-start: clamp(1.05rem, 2.6vw, 2.3rem);
  text-shadow: 0 2px 8px rgb(6 10 14 / .88);
}

.swerve-byline ul {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.swerve-byline__authors {
  gap: .34rem clamp(1rem, 2.8vw, 2.2rem);
  font: italic 700 clamp(1.06rem, 2vw, 1.63rem) / 1.2 var(--display-face);
}

.swerve-byline__authors a:any-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: #fff8ec66;
  text-decoration-thickness: .06em;
  text-underline-offset: .16em;
}

.swerve-byline__authors a:hover,
.swerve-byline__authors a:focus-visible {
  text-decoration-color: currentColor;
}

.swerve-byline__authors a:focus-visible {
  outline: 2px solid #fff8ec;
  outline-offset: 3px;
}

.swerve-byline .swerve-byline__affiliations {
  gap: .34rem clamp(.9rem, 2.2vw, 1.9rem);
  margin-block-start: clamp(.56rem, 1.15vw, .98rem);
  color: #f7f1e8;
  font: italic 700 clamp(.9rem, 1.42vw, 1.18rem) / 1.38 var(--display-face);
}

.swerve-byline sup {
  position: relative;
  top: -.48em;
  vertical-align: baseline;
  font: 650 .64em / 0 "Swerve Inter", system-ui, sans-serif;
}

.swerve-byline .affiliation-1 { color: var(--affiliation-1); }
.swerve-byline .affiliation-2 { color: var(--affiliation-2); }
.swerve-byline .affiliation-3 { color: var(--affiliation-3); }
.swerve-byline .corresponding { color: var(--corresponding); }
.swerve-byline__authors sup { margin-inline-start: .19em; }
.swerve-byline__affiliations sup { margin-inline-end: .32em; }

.swerve-byline__note {
  margin: clamp(.38rem, .7vw, .59rem) 0 0;
  color: var(--corresponding);
  font: italic 700 clamp(.68rem, .85vw, .78rem) / 1.35 var(--display-face);
}


.swerve-hero__links {
  display: flex;
  justify-content: center;
  gap: clamp(.5rem, 1vw, .72rem);
  margin-block-start: clamp(.6rem, 1.45vw, 1.15rem);
}

.swerve-hero__link {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-block-size: 44px;
  min-inline-size: 6.1rem;
  padding: .5rem .85rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #363636;
  color: #fff8ec;
  font: italic 700 clamp(.96rem, 1.25vw, 1.1rem) / 1 var(--display-face);
  text-decoration: none;
  white-space: nowrap;
}

.swerve-hero__link svg {
  flex: none;
  inline-size: 18px;
  block-size: 18px;
}

a.swerve-hero__link:hover,
a.swerve-hero__link:focus-visible {
  background: #292929;
}

a.swerve-hero__link:focus-visible {
  outline: 2px solid #fff8ec;
  outline-offset: 3px;
}

@media (max-width: 540px) {
  .swerve-byline { margin-block-start: .78rem; }

  .swerve-byline .swerve-byline__authors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-inline-size: 20rem;
    column-gap: .75rem;
    font-size: clamp(.94rem, 4vw, 1.15rem);
  }

  .swerve-byline .swerve-byline__affiliations {
    gap: .25rem .7rem;
    font-size: .85rem;
  }
}

.swerve-hero__keys {
  position: absolute;
  inset: auto auto clamp(.65rem, 2.5vw, 1.7rem) clamp(.65rem, 2.5vw, 1.7rem);
  display: flex;
  align-items: end;
  gap: clamp(.55rem, 1.25vw, 1rem);
  pointer-events: none;
}

.swerve-hero__keyset {
  --key-size: clamp(1.8rem, 2.95vw, 2.45rem);
  display: grid;
  grid-template-columns: repeat(3, var(--key-size));
  grid-auto-rows: calc(var(--key-size) * .86);
  gap: .24rem;
  align-items: stretch;
}

.swerve-hero__keyset--movement { --key-accent: #f2cc9e; }
.swerve-hero__keyset--look { --key-accent: #a8d4f3; }

.swerve-hero__keyset kbd {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  border: 1px solid #fff5e568;
  border-radius: .27rem;
  color: #fcf3e5;
  background: #19212bcf;
  box-shadow: 0 2px 0 #10151bde;
  font: 650 clamp(.74rem, 1.15vw, 1rem) / 1 "Swerve Inter", system-ui, sans-serif;
}

.swerve-hero__keyset .swerve-hero__key--top { grid-column: 2 / 4; justify-self: start; width: var(--key-size); }

.swerve-hero__keyset kbd[data-active] {
  border-color: var(--key-accent);
  background: var(--key-accent);
  color: #19212b;
  box-shadow: 0 1px 0 #10151bdb, 0 0 .7rem color-mix(in srgb, var(--key-accent) 46%, transparent);
}

.swerve-hero__arrow {
  display: block;
  position: relative;
  width: .92em;
  height: .54em;
  transform: rotate(var(--arrow-rotation, 0deg));
}

.swerve-hero__arrow::before {
  content: "";
  position: absolute;
  inset: calc(50% - 1px) 0 auto 0;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

.swerve-hero__arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  box-sizing: border-box;
  width: .53em;
  height: .53em;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

.swerve-hero__keys [data-key="left"] { --arrow-rotation: 180deg; }
.swerve-hero__keys [data-key="up"] { --arrow-rotation: -90deg; }
.swerve-hero__keys [data-key="down"] { --arrow-rotation: 90deg; }

@media (max-width: 640px) {
  .swerve-hero__keyset {
    --key-size: clamp(1.24rem, 5.65vw, 1.72rem);
    gap: .18rem;
  }

  .swerve-hero__keyset kbd { border-radius: .2rem; }
}

@media (max-width: 360px) {
  .swerve-hero { min-block-size: 21rem; }
}
