:root {
  color-scheme: dark;
  --bg: #090909;
  --ink: #f3ede1;
  --muted: rgba(243, 237, 225, 0.68);
  --line: rgba(243, 237, 225, 0.16);
  --accent: #d7a44d;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@font-face {
  font-family: "Diogenes";
  src: url("./assets/fonts/diogenes.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Old London";
  src: url("./assets/fonts/old-london.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 25% 18%, rgba(181, 20, 40, 0.22), transparent 24%),
    radial-gradient(circle at 72% 74%, rgba(215, 164, 77, 0.18), transparent 32%),
    linear-gradient(180deg, #090909 0%, #040404 100%);
}

button,
a {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

.site-nav {
  position: absolute;
  z-index: 4;
  top: clamp(18px, 4vh, 38px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.site-nav__logo {
  display: grid;
  place-items: center;
  width: clamp(76px, 8vw, 118px);
  opacity: 0.92;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.74));
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
  pointer-events: auto;
}

.site-nav__logo:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.site-nav__logo img {
  display: block;
  width: 100%;
  height: auto;
}

.stage,
.stage__canvas,
.stage__veil,
.stage__grid {
  position: absolute;
  inset: 0;
}

.stage {
  z-index: 0;
}

.stage__canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.stage__veil {
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 42%, transparent 0 20%, rgba(0, 0, 0, 0.14) 56%, rgba(0, 0, 0, 0.82) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.42), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.52)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 24%, rgba(0, 0, 0, 0.6));
}

.stage__grid {
  pointer-events: none;
  z-index: 1;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.88) 18%, rgba(0, 0, 0, 0.92) 100%);
}

.carousel {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(72px, 1fr) auto minmax(72px, 1fr);
  align-items: center;
  pointer-events: none;
}

.carousel__content {
  grid-column: 2;
  width: min(760px, calc(100vw - 132px));
  display: grid;
  justify-items: center;
  gap: clamp(16px, 2.8vh, 30px);
  text-align: center;
  pointer-events: none;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}

.carousel__content.is-changing {
  opacity: 0.18;
  transform: scale(0.985);
}

.carousel__label {
  margin: 0;
  justify-self: center;
  color: var(--ink);
  font-family: "Ancient", "Diploma", "Old English Text MT", "Old London", "Diogenes", "Cloister Black", "Engravers Old English", serif;
  font-size: clamp(2.8rem, 7vw, 6.2rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: none;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.9),
    0 3px 0 rgba(0, 0, 0, 0.78),
    0 10px 36px rgba(0, 0, 0, 0.56);
  opacity: 1;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
  pointer-events: none;
}

.carousel__text {
  width: min(620px, 100%);
  margin: 0;
  color: rgba(243, 237, 225, 0.84);
  font-family: "Inter", sans-serif;
  font-size: clamp(0.88rem, 1.45vw, 1.08rem);
  font-weight: 500;
  line-height: 1.48;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.72);
}

.carousel__links,
.person__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  pointer-events: auto;
}

.carousel__links--stacked {
  width: min(220px, 100%);
  display: grid;
  grid-template-columns: 1fr;
}

.carousel__links--stacked .carousel__link {
  justify-content: center;
}

.carousel__link,
.person__links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(243, 237, 225, 0.2);
  background: rgba(5, 5, 5, 0.24);
  backdrop-filter: blur(14px);
  color: rgba(243, 237, 225, 0.9);
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition:
    border-color 180ms var(--ease),
    background 180ms var(--ease),
    transform 180ms var(--ease);
}

.carousel__link:hover,
.person__links a:hover {
  border-color: rgba(215, 164, 77, 0.72);
  background: rgba(215, 164, 77, 0.12);
  transform: translateY(-1px);
}

.carousel__extra {
  width: 100%;
  display: grid;
  justify-items: center;
}

.people-list {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  pointer-events: auto;
}

.person {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(243, 237, 225, 0.14);
  background: rgba(6, 6, 6, 0.24);
  backdrop-filter: blur(14px);
}

.person h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Inter", sans-serif;
  font-size: clamp(0.82rem, 1.5vw, 0.96rem);
  font-weight: 700;
  line-height: 1.2;
}

.person__links {
  gap: 8px;
}

.person__links a {
  min-height: 28px;
  padding: 0 9px;
  font-size: 0.62rem;
}

.story-box {
  width: min(640px, 100%);
  max-height: min(29vh, 260px);
  overflow: auto;
  padding: 22px 24px;
  border: 1px solid rgba(243, 237, 225, 0.16);
  background: rgba(5, 5, 5, 0.38);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(215, 164, 77, 0.62) rgba(255, 255, 255, 0.08);
}

.story-box p {
  margin: 0;
  color: rgba(243, 237, 225, 0.82);
  font-family: "Inter", sans-serif;
  font-size: clamp(0.82rem, 1.35vw, 0.96rem);
  line-height: 1.64;
  text-align: left;
}

.story-box p + p {
  margin-top: 18px;
}

.carousel__arrow {
  width: clamp(42px, 5vw, 54px);
  height: clamp(42px, 5vw, 54px);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 8, 8, 0.26);
  backdrop-filter: blur(12px);
  cursor: pointer;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.2rem;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  line-height: 1;
  transition:
    border-color 220ms var(--ease),
    background 220ms var(--ease),
    transform 220ms var(--ease);
  pointer-events: auto;
}

.carousel__arrow:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.carousel__arrow:focus-visible {
  outline: 2px solid rgba(215, 164, 77, 0.95);
  outline-offset: 2px;
}

.carousel__arrow--left {
  grid-column: 1;
  justify-self: start;
  margin-left: clamp(14px, 3vw, 32px);
}

.carousel__arrow--right {
  grid-column: 3;
  justify-self: end;
  margin-right: clamp(14px, 3vw, 32px);
}

.loader {
  position: absolute;
  inset: auto 0 34px 0;
  z-index: 4;
  margin: 0 auto;
  width: min(460px, calc(100vw - 36px));
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.82);
  backdrop-filter: blur(18px);
  transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}

.loader.is-hidden {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

.loader__line {
  display: block;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.loader__line i {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--danger), var(--accent));
  transition: width 180ms linear;
}

.loader p {
  margin: 0;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.fallback {
  position: absolute;
  inset: auto 18px 18px 18px;
  z-index: 5;
  display: none;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.92);
}

.fallback h1,
.fallback p {
  margin: 0;
}

.fallback__links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.fallback__links a {
  padding: 10px 14px;
  border: 1px solid var(--line);
}

@media (max-width: 900px) {
  .carousel__content {
    width: min(680px, calc(100vw - 108px));
  }
}

@media (max-width: 720px) {
  .carousel {
    grid-template-columns: 54px minmax(0, 1fr) 54px;
  }

  .carousel__content {
    width: min(100%, calc(100vw - 108px));
    gap: 14px;
  }

  .carousel__label {
    font-size: clamp(2.2rem, 13vw, 4.1rem);
  }

  .carousel__text {
    font-size: 0.82rem;
    line-height: 1.42;
  }

  .carousel__links {
    gap: 10px;
  }

  .carousel__link {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.62rem;
  }

  .people-list {
    grid-template-columns: 1fr;
    width: min(320px, 100%);
    gap: 10px;
  }

  .person {
    padding: 12px;
    gap: 8px;
  }

  .person__links a {
    min-height: 26px;
  }

  .story-box {
    max-height: 28vh;
    padding: 16px;
  }

  .story-box p {
    font-size: 0.78rem;
    line-height: 1.54;
  }

  .carousel__arrow {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .carousel__arrow--left {
    margin-left: 10px;
  }

  .carousel__arrow--right {
    margin-right: 10px;
  }

  .site-nav {
    top: 16px;
  }

  .site-nav__logo {
    width: 74px;
  }
}
