@font-face {
  font-family: "Instrument Serif";
  src: url("/static/fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/Manrope.ttf") format("truetype");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #eef3f8;
  --surface: #ffffff;
  --ink: #0d1a26;
  --ink-secondary: #2c3f50;
  --muted: #4b5e70;
  --line: rgba(13, 26, 38, 0.12);
  --line-strong: rgba(13, 26, 38, 0.26);
  --accent: #c83a1e;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

body[data-active-world="snow"] {
  --ground: #ecf2f8;
  --accent: #c83a1e;
}
body[data-active-world="cycling"] {
  --ground: #eff3ed;
  --accent: #185a3f;
}
body[data-active-world="tools"] {
  --ground: #f5f0e7;
  --accent: #b85314;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: rgba(13, 26, 38, 0.28) transparent;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: rgba(13, 26, 38, 0.24);
  border-radius: 4px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--ground);
  color: var(--ink);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  transition: background-color 520ms var(--ease-spring);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
}

h1,
h2,
h3,
p {
  margin: 0;
}
p {
  text-wrap: pretty;
}

h1,
.world-title,
.manifesto-head h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.98;
}
h1 {
  font-size: clamp(46px, 5.4vw, 76px);
}
h2 {
  font-size: clamp(32px, 3.6vw, 48px);
}
h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-underline-offset: 4px;
}
button {
  font: inherit;
  cursor: pointer;
}
a,
button {
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
}
::selection {
  background: rgba(13, 26, 38, 0.14);
  color: var(--ink);
}

.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
}
.skip:focus {
  top: 12px;
}

/* ---- Top Edition Bar ---- */
.edition-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.edition-bar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
}
.brand-emblem {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ink);
  color: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.world-dock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(13, 26, 38, 0.05);
  border: 1px solid var(--line);
}
.dock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 220ms var(--ease-spring), color 220ms var(--ease-spring);
}
.dock-num {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dock-pill:hover,
.dock-pill.is-current {
  background: var(--ink);
  color: #ffffff;
}

.header-telemetry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1c7c4c;
}

/* ---- Gallery Stage & Horizontal Scroll-Snap Reel ---- */
.gallery-stage {
  padding-top: 28px;
  padding-bottom: 44px;
}
.stage-masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.masthead-copy p {
  margin-top: 10px;
  max-width: 58ch;
  font-size: 15.5px;
  color: var(--ink-secondary);
}

.reel-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.reel-counter {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 48px;
}
.reel-progress {
  width: 84px;
  height: 3px;
  border-radius: 999px;
  background: rgba(13, 26, 38, 0.14);
  overflow: hidden;
}
.reel-progress span {
  display: block;
  height: 100%;
  width: 33.33%;
  background: var(--ink);
  border-radius: 999px;
  transform-origin: left center;
  transition: width 260ms var(--ease-spring);
}
.reel-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  display: grid;
  place-items: center;
  transition: background-color 180ms var(--ease-spring), color 180ms var(--ease-spring), transform 180ms var(--ease-spring);
}
.reel-arrow:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
  transform: scale(1.04);
}

.worlds-reel {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-left: max(40px, calc((100vw - 1360px) / 2));
  padding: 6px max(40px, calc((100vw - 1360px) / 2)) 22px;
  scrollbar-width: none;
  cursor: grab;
}
.worlds-reel::-webkit-scrollbar {
  display: none;
}
.worlds-reel.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.world-monolith {
  position: relative;
  flex: 0 0 clamp(340px, 41vw, 540px);
  height: clamp(510px, 68vh, 660px);
  scroll-snap-align: start;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 28px 26px;
  color: #f7fafc;
  background: #101b24;
  box-shadow: 0 18px 42px rgba(13, 26, 38, 0.14), 0 4px 12px rgba(13, 26, 38, 0.06);
  transform: translate3d(0, 0, 0) scale(0.982);
  transition: transform 420ms var(--ease-spring), box-shadow 420ms var(--ease-spring);
}
.world-monolith.is-active,
.world-monolith:hover {
  transform: translate3d(0, -4px, 0) scale(1);
  box-shadow: 0 28px 60px rgba(13, 26, 38, 0.22), 0 6px 16px rgba(13, 26, 38, 0.08);
}

.world-plate {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04) translate3d(var(--parallax-x, 0px), 0, 0);
  transition: transform 540ms var(--ease-spring);
  pointer-events: none;
}
.world-monolith:hover .world-plate {
  transform: scale(1.075) translate3d(var(--parallax-x, 0px), 0, 0);
}

.world-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.world--snow .world-scrim {
  background: linear-gradient(
    180deg,
    rgba(8, 24, 42, 0.46) 0%,
    rgba(8, 24, 42, 0.12) 34%,
    rgba(7, 21, 36, 0.78) 68%,
    rgba(6, 17, 30, 0.95) 100%
  );
}
.world--cycling .world-scrim {
  background: linear-gradient(
    180deg,
    rgba(10, 31, 23, 0.48) 0%,
    rgba(10, 31, 23, 0.12) 34%,
    rgba(9, 27, 20, 0.8) 68%,
    rgba(7, 21, 15, 0.95) 100%
  );
}
.world--tools .world-scrim {
  background: linear-gradient(
    180deg,
    rgba(28, 21, 15, 0.48) 0%,
    rgba(28, 21, 15, 0.14) 34%,
    rgba(24, 18, 13, 0.82) 68%,
    rgba(18, 14, 10, 0.96) 100%
  );
}

.world-top,
.world-content {
  position: relative;
  z-index: 2;
}

.world-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.world-index {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(10, 18, 26, 0.56);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}
.world-floor {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #ffffff;
}

.world-title {
  font-size: clamp(44px, 4.4vw, 60px);
  color: #ffffff;
  margin-bottom: 6px;
}
.world-cover-link {
  text-decoration: none;
  color: inherit;
}
.world-cover-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.world-headline {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}
.world-desc {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(244, 248, 252, 0.86);
  max-width: 44ch;
  margin-bottom: 16px;
}

.world-live-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.live-cut {
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}
.world--snow .live-cut {
  background: #b82f14;
  color: #ffffff;
}
.world--cycling .live-cut {
  background: #cef255;
  color: #0d241b;
}
.world--tools .live-cut {
  background: #ffad47;
  color: #1c1610;
}
.live-item {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-price {
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
}

.world-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.world-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.world-tag {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 160ms var(--ease-spring), border-color 160ms var(--ease-spring);
}
.world-tag:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: #ffffff;
}

.world-enter {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 999px;
  background: #ffffff;
  color: #0d1a26;
  font-size: 13.5px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms var(--ease-spring), background-color 180ms var(--ease-spring);
}
.world--cycling .world-enter {
  background: #cef255;
  color: #0d241b;
}
.world--tools .world-enter {
  background: #ffad47;
  color: #1c1610;
}
.world-enter:hover {
  transform: translateX(3px);
}

/* ---- Manifesto Strip ---- */
.manifesto-strip {
  padding-top: 40px;
  padding-bottom: 64px;
  border-top: 1px solid var(--line);
}
.manifesto-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin-bottom: 28px;
}
.manifesto-head p {
  max-width: 50ch;
  font-size: 14.5px;
  color: var(--ink-secondary);
}
.manifesto-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.manifesto-columns p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-secondary);
}

/* ---- Footer ---- */
.edition-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}
.footer-row {
  padding-top: 28px;
  padding-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 32px;
}
.footer-left p {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  max-width: 58ch;
}
.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.footer-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-secondary);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.back-top {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
}

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .shell {
    padding-left: 22px;
    padding-right: 22px;
  }
  .header-telemetry {
    display: none;
  }
  .worlds-reel {
    padding-left: 22px;
    padding-right: 22px;
    scroll-padding-left: 22px;
  }
  .world-monolith {
    flex: 0 0 min(78vw, 440px);
  }
  .manifesto-columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 680px) {
  .shell {
    padding-left: 16px;
    padding-right: 16px;
  }
  .edition-bar {
    height: auto;
    min-height: 60px;
    padding-top: 8px;
    padding-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .world-dock {
    width: 100%;
    justify-content: space-between;
  }
  .dock-pill {
    flex: 1;
    justify-content: center;
    padding: 6px 8px;
    font-size: 12px;
  }
  .stage-masthead {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .worlds-reel {
    gap: 14px;
    padding-left: 16px;
    padding-right: 16px;
    scroll-padding-left: 16px;
  }
  .world-monolith {
    flex: 0 0 86vw;
    height: 500px;
    padding: 20px;
    border-radius: 20px;
  }
  .world-tags {
    display: none;
  }
  .world-enter {
    width: 100%;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
