:root {
  color-scheme: light;
  --paper: #e5f1f4;
  --paper-deep: #d4e7ed;
  --ink: #173b56;
  --muted: #6f8996;
  --line: rgba(34, 76, 101, 0.22);
  --mist: rgba(232, 242, 244, 0.88);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-height: 100%;
  background: var(--paper);
  scroll-behavior: auto;
  overscroll-behavior: none;
}

body {
  height: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  background:
    radial-gradient(ellipse at 50% 27%, rgba(255, 255, 255, 0.86), transparent 38%),
    linear-gradient(180deg, #f4f9fa 0%, #e2eff3 48%, #c5dce5 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  scrollbar-width: none;
}

body::-webkit-scrollbar {
  display: none;
}

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

button {
  border: 0;
}

a {
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.explore {
  position: relative;
  min-height: 100%;
  isolation: isolate;
}

.explore__track {
  position: relative;
  height: 380svh;
}

.scene {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(180deg, #f4f9fa 0%, #e2eff3 48%, #c5dce5 100%);
}

.scene::before {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse at 50% 27%, rgba(255, 255, 255, 0.92), transparent 38%),
    linear-gradient(180deg, rgba(244, 249, 250, 0.2), rgba(203, 224, 229, 0.2));
  content: "";
}

.scene::after {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 -18vh 16vh rgba(190, 218, 224, 0.24);
  content: "";
}

.scene__atmosphere,
.scene__halo,
.scene__grain,
.scene__mist {
  pointer-events: none;
}

.scene__halo {
  position: absolute;
  z-index: -1;
  width: min(70vw, 760px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(214, 231, 235, 0.24);
  filter: blur(42px);
}

.scene__halo--left {
  top: 19%;
  left: -28%;
}

.scene__halo--right {
  top: 34%;
  right: -34%;
  opacity: 0.72;
}

.scene__grain {
  position: absolute;
  inset: 0;
  z-index: 24;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.24'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.brand {
  position: absolute;
  top: calc(clamp(20px, 4.8svh, 52px) + var(--safe-top));
  left: 50%;
  z-index: 40;
  width: min(82vw, 286px);
  transform: translateX(-50%);
  pointer-events: none;
}

.brand__plate {
  display: grid;
  place-items: center;
  width: 100%;
  padding: clamp(8px, 1.4vw, 14px) clamp(16px, 2.8vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  background: rgba(246, 250, 250, 0.74);
  box-shadow:
    0 14px 34px rgba(65, 103, 119, 0.08),
    inset 0 0 0 1px rgba(208, 226, 229, 0.46);
  backdrop-filter: blur(16px);
}

.brand__logo {
  display: block;
  width: clamp(132px, 20vw, 204px);
  height: auto;
  max-height: 16svh;
  object-fit: contain;
}

.ridge-stack {
  position: absolute;
  top: 50%;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  overflow: visible;
  pointer-events: none;
}

.ridge-card {
  --x: var(--offset);
  --y: 0vh;
  --scale: 0.78;
  --opacity: 0.08;
  --blur: 1.2px;
  --ridge-saturation: 1.04;
  --ridge-brightness: 1;
  --ridge-fog-opacity: 0.62;
  --info-scale: 1;
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: var(--opacity);
  transform: translate3d(var(--x), var(--y), 0) scale(var(--scale));
  transform-origin: 50% 44%;
  filter: saturate(var(--ridge-saturation)) brightness(var(--ridge-brightness)) blur(var(--blur));
  pointer-events: none;
  transition: none;
  backface-visibility: hidden;
  will-change: transform, opacity, filter;
}

.ridge-card--decor {
  opacity: var(--opacity);
}

.ridge-card__art {
  filter: saturate(1.08) contrast(1.02);
}

.ridge-card__hit {
  position: absolute;
  inset: 0;
  display: block;
  outline: none;
  pointer-events: auto;
  cursor: pointer;
}

.ridge-card__hit:focus-visible .ridge-card__info {
  outline: 2px solid rgba(45, 120, 134, 0.58);
  outline-offset: 5px;
}

.ridge-card__hit:hover .ridge-card__info,
.ridge-card__hit:focus-visible .ridge-card__info {
  --info-scale: 1.03;
}

.ridge-card__art {
  position: absolute;
  bottom: -1svh;
  left: 50%;
  display: block;
  width: min(var(--art-width, 240vw), 2700px);
  height: auto;
  pointer-events: auto;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  cursor: pointer;
  user-select: none;
  isolation: isolate;
}

.ridge-card__art::after {
  position: absolute;
  right: -10%;
  bottom: -12%;
  left: -10%;
  z-index: 1;
  height: 34%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 8%, rgba(230, 243, 245, 0.34), rgba(230, 243, 245, 0) 68%),
    linear-gradient(180deg, rgba(230, 243, 245, 0), rgba(230, 243, 245, 0.55) 46%, rgba(230, 243, 245, 0.9));
  content: "";
  filter: blur(9px);
  opacity: var(--ridge-fog-opacity, 0.62);
  pointer-events: none;
}

.ridge-card__art--flipped .ridge-art {
  transform: scaleX(-1);
}

.ridge-art {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  pointer-events: auto;
  user-select: none;
}

.ridge-card__info {
  position: absolute;
  top: 12%;
  left: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(78vw, 340px);
  min-height: 84px;
  padding: 12px 18px 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(246, 251, 251, 0.86), rgba(218, 235, 238, 0.66));
  box-shadow:
    0 14px 28px rgba(45, 84, 101, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: var(--label-opacity, 1);
  transform: translateX(-50%) scale(var(--info-scale, 1));
  text-align: center;
  pointer-events: auto;
  cursor: pointer;
  overflow: visible;
  transition:
    opacity 220ms ease,
    transform 320ms cubic-bezier(0.22, 0.72, 0.25, 1),
    border-color 220ms ease,
    background 220ms ease;
}

.ridge-card__info::before {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: 32px;
  background: linear-gradient(180deg, rgba(39, 82, 104, 0.58), rgba(39, 82, 104, 0.12));
  content: "";
  transform: translateX(-50%);
}

.ridge-card__info::after {
  position: absolute;
  top: calc(100% + 27px);
  left: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(45, 120, 134, 0.78);
  border-radius: 50%;
  background: rgba(238, 248, 249, 0.94);
  box-shadow:
    0 0 0 5px rgba(45, 120, 134, 0.14),
    0 4px 12px rgba(21, 64, 86, 0.14);
  content: "";
  transform: translateX(-50%);
}

.ridge-card__status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: rgba(27, 67, 91, 0.72);
  font-size: clamp(0.54rem, 0.66vw, 0.7rem);
  font-weight: 720;
  letter-spacing: 0.22em;
  line-height: 1;
  text-transform: uppercase;
}

.ridge-card__status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.ridge-card--stickem .ridge-card__status {
  color: #2d7886;
}

.ridge-card__title {
  margin: 0;
  color: rgba(15, 49, 73, 0.92);
  font-size: clamp(1.2rem, 3.6vw, 2.8rem);
  font-weight: 650;
  letter-spacing: 0.18em;
  line-height: 1;
  text-indent: 0.18em;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(247, 252, 252, 0.92),
    0 4px 14px rgba(19, 56, 79, 0.2);
}

.ridge-card.is-active .ridge-card__info {
  --info-scale: 1.04;
  border-color: rgba(45, 120, 134, 0.56);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(220, 240, 241, 0.78));
  box-shadow:
    0 16px 34px rgba(45, 84, 101, 0.2),
    0 0 0 4px rgba(45, 120, 134, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.ridge-card.is-active .ridge-card__title {
  color: rgba(10, 44, 68, 0.9);
  text-shadow:
    0 2px 0 rgba(242, 250, 251, 0.82),
    0 5px 20px rgba(25, 65, 88, 0.28);
}

.ridge-card__action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  padding: 8px 13px;
  border: 1px solid rgba(28, 73, 98, 0.24);
  border-radius: 999px;
  background: rgba(237, 246, 247, 0.6);
  color: rgba(23, 59, 86, 0.82);
  font-size: clamp(0.62rem, 0.78vw, 0.76rem);
  font-weight: 680;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.ridge-card__action:hover {
  transform: translateY(-1px);
}

.ridge-card.is-active .ridge-card__action {
  border-color: rgba(28, 73, 98, 0.38);
  background: rgba(255, 255, 255, 0.66);
  color: #173b56;
}

.ridge-card__action span {
  font-size: 1rem;
  line-height: 0.65;
}

.ridge-card__hit:hover .ridge-card__action,
.ridge-card__hit:focus-visible .ridge-card__action {
  border-color: rgba(28, 73, 98, 0.45);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.game-preview {
  display: none;
  width: min(47vw, 220px);
  height: clamp(46px, 7vh, 76px);
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid rgba(37, 81, 103, 0.18);
  border-radius: 14px;
  background: rgba(203, 224, 228, 0.17);
  opacity: 0.74;
}

.ridge-card.is-active .game-preview {
  border-color: rgba(37, 81, 103, 0.3);
  background: rgba(210, 229, 233, 0.34);
  opacity: 0.9;
}

.game-preview__ground,
.game-preview__track {
  position: absolute;
  right: 9%;
  bottom: 16%;
  left: 9%;
  height: 1px;
  background: rgba(27, 69, 92, 0.35);
}

.game-preview__sun,
.game-preview__moon {
  position: absolute;
  top: 15%;
  right: 15%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.52);
}

.game-preview__runner {
  position: absolute;
  bottom: 19%;
  left: 38%;
  width: 34px;
  height: 9px;
  border-radius: 999px 4px 4px 999px;
  background: rgba(27, 69, 92, 0.56);
  transform: rotate(-20deg);
}

.game-preview__runner::before,
.game-preview__runner::after {
  position: absolute;
  bottom: 0;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: inherit;
  content: "";
}

.game-preview__runner::before {
  left: 4px;
  transform: rotate(42deg);
  transform-origin: left center;
}

.game-preview__runner::after {
  right: -3px;
  transform: rotate(-32deg);
  transform-origin: right center;
}

.game-preview--hollow .game-preview__moon {
  top: 18%;
  right: 18%;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background: transparent;
}

.game-preview__ridge {
  position: absolute;
  right: -5%;
  bottom: 18%;
  left: -5%;
  height: 50%;
  border-radius: 50% 50% 0 0;
  background: rgba(75, 110, 127, 0.18);
  transform: rotate(-4deg);
}

.game-preview--trail .game-preview__track {
  height: 18px;
  border: 1px solid rgba(27, 69, 92, 0.28);
  border-color: rgba(27, 69, 92, 0.28) transparent;
  border-radius: 50%;
  background: transparent;
}

.game-preview__marker {
  position: absolute;
  bottom: 28%;
  left: 54%;
  width: 8px;
  height: 8px;
  border: 2px solid rgba(27, 69, 92, 0.56);
  border-radius: 50%;
  background: rgba(237, 246, 247, 0.8);
}

.game-preview--fogline .game-preview__lighthouse {
  position: absolute;
  bottom: 18%;
  left: 28%;
  width: 9px;
  height: 26px;
  border-radius: 2px 2px 0 0;
  background: rgba(27, 69, 92, 0.42);
}

.game-preview__lighthouse::before {
  position: absolute;
  top: -5px;
  left: -4px;
  width: 17px;
  height: 6px;
  border-radius: 50%;
  background: rgba(27, 69, 92, 0.42);
  content: "";
}

.game-preview__beam {
  position: absolute;
  top: 26%;
  left: 31%;
  width: 54%;
  height: 1px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 0 18px 5px rgba(255, 255, 255, 0.26);
  transform: rotate(-12deg);
  transform-origin: left center;
}

.trail-progress {
  position: absolute;
  top: 50%;
  right: max(20px, calc(18px + env(safe-area-inset-right)));
  z-index: 42;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(28px, 5.5vh, 58px);
  transform: translateY(-50%);
}

.trail-progress__line {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 1px;
  background: rgba(39, 82, 104, 0.2);
  transform: translateX(-50%);
}

.trail-progress__stop {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  padding: 0;
  border: 1px solid rgba(35, 78, 101, 0.45);
  border-radius: 50%;
  background: rgba(237, 246, 247, 0.88);
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.trail-progress__stop:hover,
.trail-progress__stop:focus-visible {
  border-color: var(--ink);
  transform: scale(1.25);
}

.trail-progress__stop.is-active {
  border-color: #2d7886;
  background: #2d7886;
  box-shadow: 0 0 0 6px rgba(45, 120, 134, 0.12);
}

.trail-progress__stop:focus-visible {
  outline: 2px solid rgba(45, 120, 134, 0.65);
  outline-offset: 4px;
}

.scroll-cue {
  position: absolute;
  bottom: calc(clamp(18px, 4.5vh, 42px) + var(--safe-bottom));
  left: 50%;
  z-index: 42;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(31, 76, 99, 0.62);
  transform: translateX(-50%);
  pointer-events: none;
  transition: opacity 300ms ease;
}

.scroll-cue__arrow {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(31, 76, 99, 0.45);
  border-radius: 50%;
}

.scroll-cue__arrow::before,
.scroll-cue__arrow::after {
  position: absolute;
  top: 9px;
  width: 8px;
  height: 1px;
  background: currentColor;
  content: "";
}

.scroll-cue__arrow::before {
  left: 6px;
  transform: rotate(42deg);
}

.scroll-cue__arrow::after {
  right: 6px;
  transform: rotate(-42deg);
}

.scroll-cue__label {
  font-size: 0.57rem;
  font-weight: 720;
  letter-spacing: 0.22em;
  line-height: 1;
  text-transform: uppercase;
}

.scene__mist {
  position: absolute;
  right: -8%;
  bottom: -10%;
  left: -8%;
  z-index: 35;
  height: 16%;
  background: linear-gradient(180deg, rgba(230, 242, 244, 0), rgba(230, 242, 244, 0.58) 56%, rgba(230, 242, 244, 0.86));
  filter: blur(1px);
  pointer-events: none;
}

@media (max-width: 720px) {
  .explore__track {
    height: 330svh;
  }

  .scene {
    min-height: 100vh;
  }

  .brand {
    top: calc(clamp(18px, 4svh, 34px) + var(--safe-top));
    width: min(74vw, 224px);
  }

  .brand__plate {
    padding: 7px 14px;
    border-radius: 18px;
  }

  .brand__logo {
    width: clamp(126px, 38vw, 168px);
    max-height: 14svh;
  }

  .ridge-stack {
    top: 50%;
  }

  .ridge-card {
    transform-origin: 50% 42%;
    transition: none;
  }

  .ridge-card__art {
    bottom: -1svh;
    width: min(var(--art-width, 640vw), 2700px);
    height: auto;
  }

  .ridge-card__info {
    top: 10%;
    width: min(82vw, 320px);
    min-height: 76px;
    padding: 10px 14px 12px;
    border-radius: 16px;
  }

  .ridge-card__info::before {
    height: 29px;
  }

  .ridge-card__info::after {
    top: calc(100% + 24px);
  }

  .ridge-card__status {
    margin-bottom: 7px;
    font-size: 0.5rem;
    letter-spacing: 0.18em;
  }

  .ridge-card__title {
    font-size: clamp(1.15rem, 6.4vw, 1.85rem);
    letter-spacing: 0.15em;
    text-indent: 0.15em;
  }

  .ridge-card__action {
    margin-top: 9px;
    padding: 7px 11px;
    font-size: 0.6rem;
  }

  .trail-progress {
    top: auto;
    right: auto;
    bottom: calc(clamp(20px, 8vh, 54px) + var(--safe-bottom));
    left: 50%;
    flex-direction: row;
    gap: 27px;
    transform: translateX(-50%);
  }

  .trail-progress__line {
    top: 50%;
    right: 8px;
    bottom: auto;
    left: 8px;
    width: auto;
    height: 1px;
    transform: translateY(-50%);
  }

  .trail-progress__stop {
    width: 10px;
    height: 10px;
  }

  .scroll-cue {
    bottom: calc(clamp(74px, 16vh, 112px) + var(--safe-bottom));
  }

  .scroll-cue__label {
    font-size: 0.5rem;
  }

  .scene__mist {
    height: 14%;
  }
}

@media (max-width: 380px) {
  .brand {
    width: min(70vw, 204px);
  }

  .brand__logo {
    width: 124px;
  }

  .ridge-card__title {
    font-size: clamp(1.7rem, 9.2vw, 3rem);
  }

  .scroll-cue {
    bottom: calc(72px + var(--safe-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ridge-card,
  .trail-progress__stop,
  .ridge-card__action,
  .scroll-cue {
    transition: none;
  }

  .scene__grain {
    display: none;
  }
}
