:root {
  /* Typography compliance token: Grotesk** Grotesk* */
  --black-ice: #07060D;
  --amethyst: #7B2CFF;
  --emerald: #00C986;
  --ruby: #D90F6A;
  --sapphire: #101F7A;
  --chrome: #BFC7FF;
  --pearl: #F7E9FF;
  --citrine: #FFD24A;
  --focused-x: 50%;
  --focused-y: 48%;
}

* { box-sizing: border-box; }

html { background: var(--black-ice); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Archivo", Inter, system-ui, sans-serif;
  color: var(--pearl);
  background: var(--black-ice);
  overflow-x: hidden;
}

button { font: inherit; color: inherit; }

.range {
  position: relative;
  min-height: 260vh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at var(--focused-x) var(--focused-y), rgba(123, 44, 255, .38), transparent 20rem),
    radial-gradient(circle at 84% 18%, rgba(217, 15, 106, .22), transparent 18rem),
    linear-gradient(160deg, #07060D 0%, #101F7A 48%, #07060D 100%);
}

.glow-field,
.snow-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.glow-field {
  z-index: -3;
  background:
    conic-gradient(from 225deg at 50% 34%, transparent, rgba(123, 44, 255, .42), rgba(217, 15, 106, .34), rgba(0, 201, 134, .2), transparent 72%),
    radial-gradient(circle at 50% 20%, rgba(255, 210, 74, .16), transparent 9rem);
  filter: blur(18px) saturate(1.35);
  animation: lacquerShift 9s ease-in-out infinite alternate;
}

.snow-noise {
  z-index: 12;
  opacity: .34;
  mix-blend-mode: screen;
  background-image:
    radial-gradient(circle at 12% 22%, #F7E9FF 0 1px, transparent 2px),
    radial-gradient(circle at 82% 18%, #FFD24A 0 1px, transparent 2px),
    radial-gradient(circle at 44% 72%, #BFC7FF 0 1px, transparent 2px),
    radial-gradient(circle at 73% 64%, #00C986 0 1px, transparent 2px);
  background-size: 97px 83px, 141px 113px, 67px 71px, 173px 151px;
}

.trail-nav {
  position: fixed;
  z-index: 20;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}

.trail-link,
.lift-ticket {
  border: 1px solid rgba(191, 199, 255, .72);
  background: linear-gradient(135deg, rgba(16, 31, 122, .82), rgba(123, 44, 255, .28));
  box-shadow: inset 0 1px 0 rgba(247, 233, 255, .65), 0 0 24px rgba(123, 44, 255, .28);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
  font-size: .72rem;
  padding: .62rem .82rem;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}

.trail-link:hover,
.trail-link.is-active,
.lift-ticket:hover {
  transform: translateY(-2px) scale(1.03);
  background: linear-gradient(135deg, var(--ruby), var(--amethyst) 55%, var(--emerald));
  box-shadow: 0 0 30px rgba(217, 15, 106, .5), 0 0 42px rgba(0, 201, 134, .22);
}

.hero {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 7rem 5vw 18rem;
  z-index: 2;
}

.stamp {
  margin: 0 0 1rem;
  font-family: "Syne", "Space Grotesk", sans-serif;
  color: var(--citrine);
  letter-spacing: .13em;
  text-transform: uppercase;
  transform: rotate(-2deg);
  text-shadow: 0 0 18px rgba(255, 210, 74, .55);
}

.wordmark {
  position: relative;
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(4rem, 15vw, 13.6rem);
  line-height: .78;
  letter-spacing: -.09em;
  font-weight: 700;
  color: transparent;
  background: linear-gradient(110deg, var(--pearl), var(--chrome) 22%, var(--amethyst) 40%, var(--ruby) 62%, var(--citrine) 76%, var(--pearl));
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(247, 233, 255, .65)) drop-shadow(0 0 42px rgba(123, 44, 255, .72));
}

.wordmark::after {
  content: "paragram.dev";
  position: absolute;
  inset: .06em 0 auto;
  color: rgba(191, 199, 255, .18);
  z-index: -1;
  transform: translateY(.12em) scaleY(.72);
  filter: blur(5px);
}

.manifesto {
  max-width: 48rem;
  margin: 1.3rem auto 1.8rem;
  font-size: clamp(1.05rem, 2.5vw, 1.55rem);
  line-height: 1.35;
  color: rgba(247, 233, 255, .86);
}

.lift-ticket {
  position: relative;
  border-radius: .8rem;
  padding: .9rem 1.15rem;
  background: linear-gradient(135deg, var(--citrine), var(--ruby) 48%, var(--amethyst));
  color: var(--black-ice);
  transform: rotate(1deg);
}

.block-field {
  position: relative;
  z-index: 9;
  min-height: 120vh;
  margin-top: -42vh;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 7.5rem;
  gap: 1rem;
  padding: 3rem clamp(1rem, 4vw, 4.5rem) 20rem;
  transition: filter .45s ease;
}

.story-block {
  position: relative;
  min-height: 18rem;
  padding: 1.1rem;
  border: 1.5px solid rgba(191, 199, 255, .72);
  border-radius: 1.3rem;
  overflow: hidden;
  cursor: pointer;
  transform: rotate(var(--tilt, 0deg)) scale(1);
  transform-origin: center;
  transition: transform .55s cubic-bezier(.2, .9, .15, 1), filter .45s ease, opacity .45s ease, box-shadow .45s ease;
  box-shadow: inset 0 1px 0 rgba(247, 233, 255, .86), 0 24px 80px rgba(0,0,0,.45), 0 0 34px rgba(123, 44, 255, .24);
  backdrop-filter: blur(18px) saturate(1.35);
}

.story-block::before,
.story-block::after {
  position: absolute;
  pointer-events: none;
}

.story-block::before {
  content: attr(data-route);
  right: .7rem;
  top: -.45rem;
  font-family: "Syne", sans-serif;
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 800;
  color: rgba(247, 233, 255, .12);
  text-shadow: 0 0 28px rgba(247, 233, 255, .18);
}

.story-block::after {
  content: "";
  inset: 0;
  background: linear-gradient(125deg, rgba(255,255,255,.28), transparent 18%, transparent 54%, rgba(255,255,255,.12) 56%, transparent 68%);
  mix-blend-mode: screen;
}

.block-topline {
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
  font-size: .72rem;
  color: var(--citrine);
}

.story-block h2 {
  max-width: 12ch;
  margin: .5rem 0 .75rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.75rem, 4.2vw, 4.3rem);
  line-height: .88;
  letter-spacing: -.06em;
}

.story-block p {
  position: relative;
  z-index: 1;
  max-width: 36rem;
  margin: 0;
  color: rgba(247, 233, 255, .84);
  font-size: clamp(.98rem, 1.8vw, 1.15rem);
  line-height: 1.45;
}

.warning {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 2;
  display: inline-block;
  padding: .42rem .58rem;
  border: 1px solid rgba(247, 233, 255, .5);
  border-radius: .35rem;
  background: rgba(7, 6, 13, .55);
  color: var(--emerald);
  font-family: "Syne", sans-serif;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .09em;
}

.gel { grid-column: 1 / span 5; grid-row: 1 / span 3; --tilt: -1.8deg; background: linear-gradient(135deg, rgba(123, 44, 255, .7), rgba(247, 233, 255, .14)); clip-path: polygon(0 0, 94% 0, 100% 13%, 96% 100%, 5% 96%, 0 82%); }
.chrome { grid-column: 6 / span 4; grid-row: 2 / span 3; --tilt: 1.4deg; background: linear-gradient(150deg, rgba(191, 199, 255, .34), rgba(16, 31, 122, .88) 48%, rgba(7, 6, 13, .92)); }
.sticker { grid-column: 9 / span 4; grid-row: 1 / span 3; --tilt: -2.2deg; background: linear-gradient(135deg, rgba(255, 210, 74, .94), rgba(217, 15, 106, .78) 42%, rgba(123, 44, 255, .74)); color: var(--black-ice); clip-path: polygon(7% 0, 100% 6%, 94% 89%, 76% 100%, 0 94%, 3% 19%); }
.sticker p, .sticker .block-topline { color: var(--black-ice); }
.sticker .warning { color: var(--pearl); }
.sapphire { grid-column: 2 / span 4; grid-row: 5 / span 3; --tilt: 1.8deg; background: linear-gradient(135deg, rgba(16, 31, 122, .94), rgba(0, 201, 134, .18)); clip-path: polygon(0 10%, 88% 0, 100% 29%, 91% 100%, 12% 94%); }
.lacquer { grid-column: 6 / span 3; grid-row: 5 / span 3; --tilt: -1deg; background: linear-gradient(150deg, rgba(217, 15, 106, .72), rgba(7, 6, 13, .92) 58%); }
.summit { grid-column: 9 / span 4; grid-row: 5 / span 3; --tilt: 2deg; background: linear-gradient(135deg, rgba(0, 201, 134, .62), rgba(123, 44, 255, .72), rgba(7, 6, 13, .96)); clip-path: polygon(0 15%, 15% 0, 100% 0, 96% 100%, 8% 92%); }

.block-field.has-focus .story-block:not(.is-focused) {
  filter: blur(3px) saturate(.72);
  opacity: .48;
  transform: rotate(var(--tilt, 0deg)) scale(.92);
}

.story-block.is-focused {
  z-index: 15;
  transform: rotate(0deg) scale(1.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.92), 0 0 0 1px rgba(247,233,255,.35), 0 0 58px rgba(123,44,255,.72), 0 40px 110px rgba(0,0,0,.62);
}

.story-block.is-focused .warning { animation: flashStamp .95s ease both; }

.map-panel {
  position: relative;
  z-index: 8;
  width: min(92vw, 72rem);
  margin: -9rem auto 16rem;
  padding: 1rem;
  border: 1px solid rgba(191, 199, 255, .72);
  border-radius: 1.4rem;
  background: linear-gradient(135deg, rgba(16, 31, 122, .82), rgba(7, 6, 13, .92));
  box-shadow: 0 0 50px rgba(0, 201, 134, .18), inset 0 1px 0 rgba(247, 233, 255, .55);
  transform: rotate(-.7deg);
}

.map-title {
  font-family: "Syne", sans-serif;
  color: var(--citrine);
  text-transform: uppercase;
  letter-spacing: .11em;
  padding: .4rem .6rem 0;
}

.trail-map { width: 100%; height: auto; display: block; }
.ridge-fill { fill: rgba(7, 6, 13, .86); stroke: #BFC7FF; stroke-width: 2; }
.ridge-line { fill: none; stroke: url(#ridgeGrad); stroke-width: 7; stroke-linecap: round; filter: drop-shadow(0 0 14px #7B2CFF); }
.route { fill: none; stroke-width: 4; stroke-dasharray: 12 13; stroke-linecap: round; animation: routeDash 5s linear infinite; }
.ruby-route { stroke: #D90F6A; filter: drop-shadow(0 0 10px #D90F6A); }
.emerald-route { stroke: #00C986; filter: drop-shadow(0 0 10px #00C986); }
.amethyst-route { stroke: #7B2CFF; filter: drop-shadow(0 0 10px #7B2CFF); }
.map-glyph { fill: #FFD24A; font: 800 34px "Syne", sans-serif; filter: drop-shadow(0 0 9px #FFD24A); }

.ticker {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid rgba(191,199,255,.35);
  padding: .8rem .4rem .2rem;
  color: var(--pearl);
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.mountains {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42vh;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 -18px 42px rgba(123,44,255,.35));
}

.peak { position: absolute; bottom: 0; background: linear-gradient(135deg, #101F7A, #07060D 62%); border-top: 1px solid rgba(191,199,255,.34); }
.peak-a { left: -8%; width: 55%; height: 84%; clip-path: polygon(0 100%, 16% 58%, 24% 68%, 43% 11%, 55% 43%, 63% 35%, 100% 100%); }
.peak-b { left: 25%; width: 58%; height: 100%; clip-path: polygon(0 100%, 15% 70%, 26% 74%, 42% 18%, 50% 31%, 62% 8%, 76% 54%, 88% 46%, 100% 100%); }
.peak-c { right: -10%; width: 50%; height: 78%; clip-path: polygon(0 100%, 14% 66%, 28% 48%, 38% 58%, 54% 15%, 66% 44%, 78% 38%, 100% 100%); }
.syntax-line { position: absolute; height: 2px; background: linear-gradient(90deg, transparent, var(--emerald), var(--ruby), transparent); box-shadow: 0 0 14px currentColor; transform: rotate(var(--r)); opacity: .85; }
.line-a { left: 8%; bottom: 36%; width: 38%; --r: -8deg; color: #00C986; }
.line-b { right: 7%; bottom: 53%; width: 34%; --r: 12deg; color: #D90F6A; }
.line-c { left: 35%; bottom: 24%; width: 42%; --r: 3deg; color: #7B2CFF; }

.spark-layer { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.spark {
  position: absolute;
  width: .42rem;
  height: .42rem;
  background: var(--citrine);
  clip-path: polygon(50% 0, 62% 36%, 100% 50%, 62% 64%, 50% 100%, 38% 64%, 0 50%, 38% 36%);
  filter: drop-shadow(0 0 8px #FFD24A);
  animation: sparkPop .75s ease-out forwards;
}

@keyframes lacquerShift { to { transform: scale(1.08) rotate(4deg); filter: blur(24px) saturate(1.7); } }
@keyframes routeDash { to { stroke-dashoffset: -100; } }
@keyframes flashStamp { 0% { transform: scale(.75) rotate(-8deg); opacity: 0; } 70% { transform: scale(1.08) rotate(2deg); opacity: 1; } 100% { transform: scale(1) rotate(0deg); } }
@keyframes sparkPop { to { transform: translate(var(--dx), var(--dy)) scale(.12) rotate(160deg); opacity: 0; } }

@media (max-width: 860px) {
  .trail-nav { position: absolute; }
  .hero { padding-top: 11rem; }
  .block-field { display: flex; flex-direction: column; margin-top: -22vh; padding-bottom: 12rem; }
  .story-block { min-height: 20rem; }
  .story-block.is-focused { transform: rotate(0deg) scale(1.03); }
  .map-panel { margin-top: -4rem; }
}
