#front-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.front-page {
  min-height: 100vh;
}

.front-wrap {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 36px));
  margin: 0 auto 80px;
  padding-top: calc(var(--bar-h) + clamp(30px, 7vh, 70px));
}

.front-hero {
  position: relative;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--hair);
  background: linear-gradient(135deg, rgba(143, 123, 255, .18), var(--card) 58%, rgba(77, 48, 137, .18));
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
}

.front-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: .82rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.front-hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 1.05;
}

.front-state {
  display: inline-flex;
  margin: 24px 0 8px;
  padding: 7px 20px;
  background: var(--accent-soft);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.front-copy {
  max-width: 54ch;
  color: var(--ink-soft);
  line-height: 1.65;
}

.front-routes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.front-route {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 18px;
  border: 1px solid var(--hair);
  background: linear-gradient(120deg, rgba(143, 123, 255, .13), var(--card) 72%);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .16s, filter .16s, transform .16s;
}

.front-route:hover,
.front-route:focus-visible {
  background: linear-gradient(120deg, color-mix(in srgb, var(--route-primary) 42%, transparent), var(--card) 76%);
  filter: drop-shadow(0 0 10px var(--glow));
  transform: translateY(-2px);
  outline: none;
}

.front-route > span:nth-child(2) {
  display: grid;
  gap: 4px;
  flex: 1;
}

.front-route small {
  color: var(--ink-faint);
  line-height: 1.35;
}

.front-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  background: rgba(143, 123, 255, .18);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  color: var(--accent);
  font-size: 1.35rem;
}

@media (max-width: 600px) {
  .front-wrap {
    width: min(100% - 24px, 480px);
    padding-top: calc(var(--bar-h) + 24px);
  }

  .front-hero h1 {
    font-size: clamp(1.55rem, 7.4vw, 2rem);
    overflow-wrap: anywhere;
  }

  .front-routes {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .front-route {
    min-height: 68px;
  }

  .front-hero {
    padding: 24px;
  }
}

/* Destination color worlds: all textures/effects stay decorative and non-interactive. */
.front-route {
  --route-primary: #bbaaff;
  --route-highlight: #e7e0ff;
  --route-shadow: #4a3479;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(125deg, color-mix(in srgb, var(--route-primary) 30%, transparent), var(--card) 78%);
  border-color: color-mix(in srgb, var(--route-primary) 55%, var(--hair));
}

.front-route > * {
  position: relative;
  z-index: 1;
}

.front-route::before,
.front-route::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
}

.front-route::before {
  --paint-grain: linear-gradient(153deg, transparent 0 25%, rgba(255,255,255,.075) 26% 27%, transparent 28% 55%, rgba(0,0,0,.045) 56% 57%, transparent 58%),
    linear-gradient(27deg, transparent 0 31%, rgba(255,255,255,.05) 32% 34%, transparent 35% 63%, rgba(0,0,0,.035) 64% 65%, transparent 66%),
    radial-gradient(ellipse 38px 2px at 21% 36%, rgba(255,255,255,.12), transparent 85%),
    radial-gradient(ellipse 27px 2px at 73% 68%, rgba(0,0,0,.08), transparent 85%);
  background-image: var(--paint-grain);
  opacity: .38;
  mix-blend-mode: soft-light;
}

.front-route .front-icon {
  color: var(--route-highlight);
  background: color-mix(in srgb, var(--route-primary) 34%, transparent);
  text-shadow: 0 0 12px color-mix(in srgb, var(--route-primary) 65%, transparent);
}

.front-route--starmap {
  --route-primary: #e8b83f;
  --route-highlight: #fff1a6;
  --route-shadow: #65400a;
  background: linear-gradient(128deg, rgba(255,220,104,.34), var(--card) 62%, rgba(117,75,11,.26));
  border-color: rgba(255,222,123,.68);
  box-shadow: inset 0 0 24px rgba(255,211,82,.08);
}

.front-route--starmap::after {
  inset: -70% -35%;
  background: linear-gradient(112deg, transparent 42%, rgba(255,248,205,.36) 49%, transparent 56%);
  animation: route-shimmer 8s ease-in-out infinite;
}

.front-route--atlas {
  --route-primary: #c04de5;
  --route-highlight: #f2b7ff;
  --route-shadow: #461660;
  background: linear-gradient(128deg, rgba(174,49,205,.27), var(--card) 67%, rgba(102,31,145,.22));
  border-color: rgba(223,123,255,.48);
}

.front-route--atlas::after {
  background-image: radial-gradient(circle at 13% 28%, #ffe5ff 0 1px, transparent 2px),
    radial-gradient(circle at 66% 72%, #f4b2ff 0 1px, transparent 2px),
    radial-gradient(circle at 84% 21%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 45% 45%, #de8bff 0 1px, transparent 2px);
  animation: atlas-sparkle 4.8s steps(2, end) infinite;
}

.front-route--spell {
  --route-primary: #ee8737;
  --route-highlight: #ffd09b;
  --route-shadow: #77351a;
  background: linear-gradient(128deg, rgba(239,127,43,.32), var(--card) 68%, rgba(130,62,29,.2));
  border-color: rgba(255,164,93,.5);
}

.front-route--spell::after {
  inset: 6px 10px auto auto;
  width: 72px;
  height: 48px;
  overflow: visible;
  color: #b66ae9;
  content: "✦";
  font-size: 27px;
  line-height: 1;
  text-shadow: -25px 16px 0 rgba(160,79,218,.68), 30px 9px 0 rgba(194,112,241,.6);
  animation: spell-star-spin 11s linear infinite, spell-star-flicker 4.7s steps(2, end) infinite;
}

.front-route--library {
  --route-primary: #438b55;
  --route-highlight: #b8ef9c;
  --route-shadow: #163a26;
  background: linear-gradient(128deg, rgba(48,125,68,.34), var(--card) 66%, rgba(22,69,43,.26));
  border-color: rgba(135,197,118,.46);
}

.front-route--library::after {
  inset: auto 12px 4px auto;
  color: rgba(210,255,177,.82);
  content: "𓂀 ᚠ 𓆣";
  font-family: serif;
  font-size: 19px;
  letter-spacing: .38em;
  text-shadow: 0 0 8px rgba(133,222,112,.3);
  white-space: nowrap;
  animation: library-glyph-fade 7s ease-in-out infinite;
}

.front-route--profile {
  --route-primary: #36b7b2;
  --route-highlight: #aafff0;
  --route-shadow: #155d60;
  background: linear-gradient(128deg, rgba(37,174,168,.32), var(--card) 68%, rgba(21,102,115,.23));
  border-color: rgba(118,239,223,.48);
}

.front-route--profile::after {
  inset: -35%;
  background: radial-gradient(circle at center, transparent 0 24%, rgba(162,255,242,.28) 25% 26%, transparent 27% 43%, rgba(90,224,215,.2) 44% 45%, transparent 46% 62%, rgba(111,242,226,.13) 63% 64%, transparent 65%);
  animation: profile-wave 6s ease-out infinite;
}

@keyframes route-shimmer {
  0%, 25% { transform: translateX(-44%); opacity: .18; }
  65%, 100% { transform: translateX(44%); opacity: .68; }
}

@keyframes atlas-sparkle {
  0%, 100% { opacity: .18; }
  37% { opacity: .62; }
  68% { opacity: .32; }
}

@keyframes spell-star-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spell-star-flicker {
  0%, 100% { opacity: .2; }
  31% { opacity: .75; }
  58% { opacity: .32; }
  79% { opacity: .9; }
}

@keyframes library-glyph-fade {
  0%, 100% { opacity: .08; transform: translateY(3px); }
  43% { opacity: .7; transform: translateY(-1px); }
  71% { opacity: .25; }
}

@keyframes profile-wave {
  0% { transform: scale(.72); opacity: .2; }
  52% { opacity: .55; }
  100% { transform: scale(1.06); opacity: .08; }
}

@media (prefers-reduced-motion: reduce) {
  .front-route--starmap::after,
  .front-route--atlas::after,
  .front-route--spell::after,
  .front-route--library::after,
  .front-route--profile::after {
    animation: none;
  }
}

/* F2: the hero is the center of a responsive pentagonal route ring. */
.front-wrap {
  width: min(1120px, calc(100% - 36px));
}

.front-magic {
  position: relative;
  width: min(100%, var(--front-magic-size, 820px));
  aspect-ratio: 1 / 1;
  min-height: 0;
  margin-inline: auto;
  isolation: isolate;
}

.front-circle-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: var(--front-circle-opacity, .13);
  pointer-events: none;
}

.front-circle-ring,
.front-circle-star,
.front-circle-pentagon {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 82%, var(--route-primary, #c04de5));
  stroke-width: var(--front-circle-line-width, 1.2px);
  vector-effect: non-scaling-stroke;
}

.front-circle-ring--inner {
  stroke-dasharray: 2 12;
  stroke-width: calc(var(--front-circle-line-width, 1.2px) * .75);
}

.front-circle-star {
  stroke: color-mix(in srgb, var(--accent) 68%, #c04de5);
  stroke-dasharray: 3 7;
}

.front-hero {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 30%;
  width: min(600px, 75%);
  padding: 12px 16px;
  text-align: center;
  transform: translateX(-50%);
}

.front-kicker,
.front-copy {
  display: none;
}

.front-hero h1 {
  font-size: clamp(1.6rem, 3.1vw, 2.25rem);
}

.front-state {
  margin: 8px 0 0;
}

.front-routes {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  margin: 0;
  pointer-events: none;
}

.front-route {
  --spk-hue: var(--route-primary, var(--accent));
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 190px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  clip-path: none;
  overflow: visible;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: filter .18s ease, transform .18s ease;
}

.front-route::before,
.front-route::after {
  display: none;
}

.front-route:hover,
.front-route:focus-visible {
  background: transparent;
  filter: drop-shadow(0 0 12px var(--glow));
  transform: translate(-50%, -50%) scale(1.045);
  outline: none;
}

.front-route:focus-visible .front-route__surface {
  filter: brightness(1.22);
}

.front-route--starmap { left: 50%; top: 16%; }
.front-route--atlas { left: 82.33%; top: 39.49%; }
.front-route--spell { left: 69.98%; top: 77.51%; }
.front-route--library { left: 30.02%; top: 77.51%; }
.front-route--profile { left: 17.66%; top: 39.49%; }

.front-route__hex {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--front-node-size, 140px);
  aspect-ratio: 2 / 1.7320508;
  flex: none;
}

.front-route__surface {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: var(--route-primary, #8f7bff);
  --paint-grain:
    repeating-linear-gradient(146deg, transparent 0 11px, rgba(255,255,255,var(--front-route-texture-alpha,.23)) 11px 12px, transparent 12px 31px),
    repeating-linear-gradient(34deg, transparent 0 18px, rgba(0,0,0,var(--front-route-texture-alpha,.23)) 18px 19px, transparent 19px 41px),
    radial-gradient(ellipse at 24% 18%, rgba(255,255,255,var(--front-route-texture-alpha,.23)), transparent 42%),
    radial-gradient(ellipse at 79% 81%, rgba(0,0,0,var(--front-route-texture-alpha,.23)), transparent 44%);
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--route-primary, #8f7bff) 35%, transparent));
  pointer-events: none;
}

.front-route__surface::before,
.front-route__surface::after {
  position: absolute;
  inset: 3px;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  pointer-events: none;
  content: "";
}

.front-route__surface::before {
  background-image: var(--paint-grain),
    radial-gradient(ellipse at 28% 19%, color-mix(in srgb, var(--route-highlight) 26%, transparent), transparent 48%),
    linear-gradient(136deg,
      color-mix(in srgb, var(--route-primary) 76%, var(--card)),
      color-mix(in srgb, var(--route-primary) 34%, var(--card)) 48%,
      color-mix(in srgb, var(--route-shadow) 68%, var(--card)));
}

.front-route__surface::after {
  background-image: none;
}

.front-route .front-icon {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: transparent;
  clip-path: none;
  color: var(--route-highlight, var(--accent));
  font-size: 2rem;
  text-shadow: 0 0 16px color-mix(in srgb, var(--route-primary) 70%, transparent);
  pointer-events: none;
}

.front-route__hex .front-sigil {
  position: absolute;
  z-index: 1;
  inset: -9%;
  width: 118%;
  height: 118%;
  opacity: calc(.12 + var(--front-sigil-progress, 0) * .88);
  transform: scale(calc(.92 + var(--front-sigil-progress, 0) * .08));
  transition: opacity .14s ease, transform .14s ease;
  pointer-events: none;
}

.front-route__label {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 3px;
  max-width: 100%;
  flex: none;
  color: var(--ink);
  text-align: center;
}

.front-route__label b {
  color: var(--route-highlight, var(--ink));
  font-size: 1rem;
  line-height: 1.25;
}

.front-route__label small {
  max-width: 22ch;
  color: var(--ink-faint);
  font-size: .78rem;
  line-height: 1.3;
}

.front-route--starmap .front-route__surface::after {
  background-image: linear-gradient(112deg, transparent 42%, rgba(255,248,205,.34) 49%, transparent 56%);
  animation: route-shimmer 8s ease-in-out infinite;
}

.front-route--atlas .front-route__surface::after {
  background-image: radial-gradient(circle at 13% 28%, #ffe5ff 0 1px, transparent 2px),
    radial-gradient(circle at 66% 72%, #f4b2ff 0 1px, transparent 2px),
    radial-gradient(circle at 84% 21%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 45% 45%, #de8bff 0 1px, transparent 2px);
  animation: atlas-sparkle 4.8s steps(2, end) infinite;
}

.front-route--spell .front-route__surface::after {
  background-image: radial-gradient(circle at 72% 31%, #d494ff 0 3px, transparent 4px),
    radial-gradient(circle at 30% 67%, #b66ae9 0 3px, transparent 4px),
    radial-gradient(circle at 76% 73%, #e7a7ff 0 2px, transparent 3px);
  animation: spell-star-spin 11s linear infinite, spell-star-flicker 4.7s steps(2, end) infinite;
}

.front-route--library .front-route__surface::after {
  inset: auto 8px 8px;
  height: 34%;
  clip-path: none;
  background-image: none;
  color: rgba(210,255,177,.82);
  content: "𓂀 ᚠ 𓆣";
  font-family: serif;
  font-size: .9rem;
  letter-spacing: .38em;
  line-height: 1;
  text-align: right;
  text-shadow: 0 0 8px rgba(133,222,112,.3);
  white-space: nowrap;
  animation: library-glyph-fade 7s ease-in-out infinite;
}

.front-route--profile .front-route__surface::after {
  inset: 0;
  background-image: radial-gradient(circle at center, transparent 0 24%, rgba(162,255,242,.28) 25% 26%, transparent 27% 43%, rgba(90,224,215,.2) 44% 45%, transparent 46% 62%, rgba(111,242,226,.13) 63% 64%, transparent 65%);
  animation: profile-wave 6s ease-out infinite;
}

@media (max-width: 600px) {
  .front-wrap {
    width: min(100% - 24px, 480px);
    padding-top: calc(var(--bar-h) + 16px);
  }

  .front-magic {
    width: 100%;
  }

  .front-hero {
    top: 29%;
    width: 44%;
    padding: 3px 2px;
  }

  .front-kicker,
  .front-copy {
    display: none;
  }

  .front-hero h1 {
    font-size: clamp(.75rem, 3.2vw, .9rem);
    overflow-wrap: normal;
  }

  .front-state {
    margin: 4px 0 0;
    padding: 2px 6px;
    font-size: .55rem;
  }

  .front-route {
    width: min(110px, 27vw);
    gap: 5px;
  }

  .front-route__hex {
    width: min(var(--front-mobile-node-size, 82px), 22vw);
  }

  .front-route__label small {
    display: none;
  }


  .front-circle-art {
    opacity: calc(var(--front-circle-opacity, .13) * .8);
  }
}

@media (prefers-reduced-motion: reduce) {
  .front-route__surface::after,
  .front-route__hex .front-sigil,
  .front-route__hex .front-sigil * {
    animation: none;
    transition: none;
  }
}

/* hex.css styles native buttons site-wide; this destination already draws its
   own hex inside the control, so keep the shared frame on the account chip only. */
.front-page button.front-route {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  clip-path: none;
  color: var(--ink);
  font: inherit;
}

.front-page button.front-route::before,
.front-page button.front-route::after {
  display: none;
  content: none;
}

.front-page button.front-route:hover,
.front-page button.front-route:focus-visible {
  background: transparent;
  border: 0;
  filter: drop-shadow(0 0 12px var(--glow));
  transform: translate(-50%, -50%) scale(1.045);
  outline: none;
}
