:root {
  --ink: #f4f2ec;
  --muted: rgba(244, 242, 236, 0.58);
  --line: rgba(255, 255, 255, 0.18);
  --gold: #c3a262;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background: #303132;
}

body {
  color: var(--ink);
  font-family:
    "Helvetica Neue",
    "Hiragino Sans",
    "Yu Gothic",
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  color: inherit;
  font: inherit;
}

.sire-app {
  position: relative;
  width: 100vw;
  height: 100svh;
  min-height: 620px;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 50% 42%,
      rgba(255, 255, 255, 0.025),
      transparent 46%
    ),
    #303132;
}

.sire-app::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(
      180deg,
      rgba(20, 21, 22, 0.3),
      transparent 26%
    ),
    radial-gradient(
      circle at center,
      transparent 48%,
      rgba(15, 16, 17, 0.42) 110%
    );
}

.scene {
  position: absolute;
  z-index: 1;
  inset: 0;
  touch-action: none;
}

.scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.fallback-space {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 52% 43%,
      rgba(255, 255, 255, 0.055),
      transparent 31%
    ),
    radial-gradient(
      circle at 18% 78%,
      rgba(255, 255, 255, 0.02),
      transparent 20%
    ),
    linear-gradient(
      180deg,
      #2c2d2e 0%,
      #363738 100%
    );
}

.scene.has-webgl .fallback-space {
  display: none;
}

.fallback-orb {
  position: absolute;
  display: grid;
  width: clamp(145px, 16vw, 230px);
  aspect-ratio: 1;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  filter:
    drop-shadow(
      0 26px 28px rgba(0, 0, 0, 0.24)
    );
  transform:
    translate(-50%, -50%);
  transition:
    opacity 320ms ease,
    transform 400ms
      cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 300ms ease;
  animation:
    fallback-float 5.5s
      ease-in-out infinite;
}

.fallback-orb::after {
  position: absolute;
  inset: -24%;
  border:
    1px solid rgba(255, 255, 255, 0);
  border-radius: 50%;
  content: "";
  transition:
    border-color 250ms ease;
}

.fallback-orb span {
  position: relative;
  z-index: 1;
  font-size:
    clamp(17px, 1.6vw, 25px);
  font-weight: 350;
  letter-spacing: -0.02em;
  text-shadow:
    0 2px 12px rgba(0, 0, 0, 0.5);
}

.fallback-orb.matchem {
  top: 29%;
  left: 50%;
  background:
    radial-gradient(
      circle at 33% 25%,
      #45494c 0%,
      #181a1b 45%,
      #090a0a 85%
    );
  animation-delay: -1.8s;
}

.fallback-orb.herod {
  top: 67%;
  left: 35%;
  background:
    radial-gradient(
      circle at 31% 24%,
      #f1f1ee 0%,
      #c8c9c7 50%,
      #929597 100%
    );
  animation-delay: -3.1s;
}

.fallback-orb.eclipse {
  top: 67%;
  left: 65%;
  background:
    radial-gradient(
      circle at 31% 24%,
      #d8c08d 0%,
      #b49555 52%,
      #755d2c 100%
    );
}

.fallback-orb:hover,
.fallback-orb.active {
  transform:
    translate(-50%, -50%)
    scale(1.09);
  box-shadow:
    0 0 42px
    rgba(255, 255, 255, 0.08);
}

.fallback-orb.active::after {
  border-color:
    rgba(255, 255, 255, 0.42);
}

.fallback-orb.muted {
  opacity: 0.36;
}

@keyframes fallback-float {
  0%,
  100% {
    translate: 0 -5px;
  }

  50% {
    translate: 0 5px;
  }
}

.site-header {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  padding: 42px 54px;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border:
    1px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.brand strong {
  display: block;
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.015em;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.26em;
}

.orbit-nav {
  display: flex;
  gap: 14px;
  pointer-events: auto;
}

.orbit-nav button {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background:
    rgba(255, 255, 255, 0.94);
  color: #303132;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.orbit-nav button:hover {
  transform: translateY(-3px);
}

.orbit-nav button.active {
  border-color:
    rgba(255, 255, 255, 0.8);
  background:
    rgba(255, 255, 255, 0.12);
  color: white;
  box-shadow:
    0 0 0 5px
    rgba(255, 255, 255, 0.08);
}

.orbit-nav button span {
  font-size: 14px;
  font-style: normal;
}

.orbit-nav button em {
  position: absolute;
  top: 50px;
  left: 50%;
  padding: 5px 8px;
  border-radius: 4px;
  background:
    rgba(17, 18, 19, 0.82);
  color: white;
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  transform:
    translate(-50%, -4px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  white-space: nowrap;
}

.orbit-nav button:hover em,
.orbit-nav button:focus-visible em {
  opacity: 1;
  transform: translate(-50%, 0);
}

.intro {
  position: absolute;
  z-index: 4;
  top: 135px;
  left: 55px;
  pointer-events: none;
}

.intro p,
.line-card p {
  margin: 0 0 12px;
  color:
    rgba(255, 255, 255, 0.52);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.28em;
}

.intro h1 {
  margin: 0;
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size:
    clamp(28px, 3vw, 48px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.space-label {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  color: white;
  font-family:
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-size:
    clamp(17px, 1.55vw, 25px);
  font-weight: 350;
  letter-spacing: -0.025em;
  text-shadow:
    0 2px 12px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  opacity: 0.96;
  transition:
    opacity 220ms ease,
    letter-spacing 220ms ease;
  white-space: nowrap;
}

.space-label:hover,
.space-label.is-selected {
  letter-spacing: 0.01em;
}

.space-label.is-muted {
  opacity: 0.36;
}

.line-card {
  position: absolute;
  z-index: 10;
  right: 54px;
  bottom: 87px;
  width: 270px;
  padding: 22px 0 0 22px;
  border-top:
    1px solid rgba(255, 255, 255, 0.35);
  border-left:
    1px solid rgba(255, 255, 255, 0.13);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition:
    opacity 300ms ease,
    transform 300ms ease;
}

.line-card.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.line-card-title {
  display: flex;
  min-height: 34px;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px;
}

.line-card h2 {
  margin: 0;
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 28px;
  font-weight: 400;
}

.line-card .line-card-year {
  color: rgba(255, 255, 255, 0.88);
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 22px;
}

.line-card .line-card-ancestor {
  display: flex;
  min-height: 16px;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.line-card-flag {
  display: none;
  flex: 0 0 auto;
  width: 22px;
  height: 16px;
  align-self: center;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.line-card-flag.is-visible {
  display: inline-block;
}

.line-card button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding: 12px 0;
  border: 0;
  border-bottom:
    1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.line-card button b {
  font-size: 18px;
  font-weight: 300;
  transition:
    transform 180ms ease;
}

.line-card button:hover b {
  transform: translateX(5px);
}

.interaction-hint {
  position: absolute;
  z-index: 10;
  bottom: 43px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  color:
    rgba(255, 255, 255, 0.55);
  font-size: 9px;
  letter-spacing: 0.12em;
  pointer-events: none;
  transform: translateX(-50%);
}

.interaction-hint i {
  width: 24px;
  height: 1px;
  background:
    rgba(255, 255, 255, 0.25);
}

.mobile-select {
  display: none;
}

footer {
  position: absolute;
  z-index: 10;
  bottom: 39px;
  left: 54px;
  display: flex;
  gap: 22px;
  color:
    rgba(255, 255, 255, 0.44);
  font-size: 8px;
  letter-spacing: 0.2em;
  pointer-events: none;
}

@media (max-width: 760px) {
  .sire-app {
    min-height: 560px;
  }

  .site-header {
    align-items: center;
    padding: 24px 22px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand small {
    display: none;
  }

  .orbit-nav {
    gap: 8px;
  }

  .orbit-nav button {
    display: none;
    width: 34px;
    height: 34px;
  }

  .orbit-nav button:nth-child(1),
  .orbit-nav button:nth-child(6) {
    display: grid;
  }

  .intro {
    top: 95px;
    left: 23px;
  }

  .intro h1 {
    font-size: 28px;
  }

  .space-label {
    font-size: 16px;
  }

  .fallback-orb {
    width: 132px;
  }

  .fallback-orb.matchem {
    top: 38%;
    left: 50%;
  }

  .fallback-orb.herod {
    top: 60%;
    left: 25%;
  }

  .fallback-orb.eclipse {
    top: 60%;
    left: 75%;
  }

  .line-card {
    right: 22px;
    bottom: 113px;
    width: 230px;
  }

  .interaction-hint,
  footer {
    display: none;
  }

  .mobile-select {
    position: absolute;
    z-index: 11;
    right: 18px;
    bottom: 25px;
    left: 18px;
    display: flex;
    justify-content: center;
    gap: 7px;
  }

  .mobile-select button {
    flex: 1;
    padding: 10px 5px;
    border:
      1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background:
      rgba(34, 35, 36, 0.52);
    font-size: 10px;
    letter-spacing: 0.04em;
    backdrop-filter: blur(10px);
  }

  .mobile-select button.active {
    border-color:
      rgba(255, 255, 255, 0.8);
    background:
      rgba(255, 255, 255, 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}