@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif.woff2") format("woff2");
}

:root {
  --canvas: #050409;
  --ink: #efedf7;
  --ink-muted: #b4b1c9;
  --ink-faint: #75728d;
  --blue: #3d8bfd;
  --violet: #8f3df5;
  --magenta: #f038c7;
  --teal: #2ad4dc;
  --glow: linear-gradient(100deg, #7fb2ff 0%, #b48cff 42%, #ff8ad8 100%);
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --vh: 100vh;
  --mark: 0;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
}

::selection {
  background: rgba(180, 140, 255, 0.35);
}

h1,
h2,
p {
  margin: 0;
}

/* Chrome that is always there */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 18px max(22px, env(safe-area-inset-left));
  pointer-events: none;
}

.mark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.6rem;
  line-height: 1;
  text-decoration: none;
  opacity: var(--mark);
  transform: translateY(calc((1 - var(--mark)) * -6px));
  pointer-events: auto;
}

.signin {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-muted);
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(239, 237, 247, 0.14);
  background: rgba(10, 8, 20, 0.35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  pointer-events: auto;
}

.signin:hover,
.signin:focus-visible {
  color: var(--ink);
  border-color: rgba(180, 140, 255, 0.55);
  background: rgba(60, 30, 120, 0.3);
}

:focus-visible {
  outline: 2px solid #b48cff;
  outline-offset: 3px;
}

/* The readable column: no motion, no canvases. Used with reduced motion,
   without WebGL, and if the story fails to start. */

.layer,
.vignette,
.grain,
.rail,
.whisper,
.spacer,
.cue {
  display: none;
}

.story {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 18vh 24px 10vh;
  text-align: center;
}

html:not(.story-mode) body {
  background:
    radial-gradient(60vmax 50vmax at 50% 8%, rgba(143, 61, 245, 0.22), transparent 65%),
    radial-gradient(50vmax 40vmax at 80% 70%, rgba(240, 56, 199, 0.1), transparent 70%),
    radial-gradient(50vmax 40vmax at 10% 90%, rgba(61, 139, 253, 0.1), transparent 70%),
    var(--canvas);
}

html:not(.story-mode) .mark {
  opacity: 1;
  transform: none;
}

.scene {
  padding: 9vh 0;
}

.static-orb {
  width: min(42vmin, 260px);
  margin: 0 auto 6vh;
  filter: drop-shadow(0 0 60px rgba(143, 61, 245, 0.45));
}

.static-orb svg {
  display: block;
  width: 100%;
  height: auto;
}

.wordmark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(5rem, 17vw, 10rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.tagline {
  margin-top: 1.1rem;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3.6vw, 1.9rem);
  line-height: 1.25;
  color: var(--ink-muted);
}

.numeral {
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.4em;
  margin-bottom: 1rem;
  padding-left: 0.4em;
  color: #b48cff;
}

.scene h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.3rem, 7vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.scene h2 + p,
.scene .numeral + h2 + p {
  margin: 1.2rem auto 0;
  max-width: 30rem;
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: var(--ink-muted);
  text-wrap: pretty;
}

.acronym {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.32em;
}

.fold {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

.cap {
  display: inline-block;
  font-style: italic;
  font-size: 1.12em;
  background: var(--glow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.04em;
}

.rest {
  display: inline-block;
  font-style: italic;
  color: var(--ink);
}

.invite h2 {
  font-size: clamp(2.2rem, 6.4vw, 4rem);
}

.scene p.ask {
  margin: 0.1rem auto 0;
  max-width: none;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(3rem, 9vw, 5.6rem);
  line-height: 1.05;
  padding: 0 0.08em 0.06em;
}

.scene p.ask,
.ask .w {
  background: var(--glow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.scene p.ask.split {
  background: none;
}

.actions {
  margin-top: 2.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 11rem;
  padding: 0.95rem 2.2rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(110deg, var(--blue), var(--violet) 48%, var(--magenta));
  box-shadow: 0 10px 40px -8px rgba(143, 61, 245, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease;
}

.button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: sheen 5.5s ease-in-out 1.5s infinite;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 50px -8px rgba(240, 56, 199, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

@keyframes sheen {
  0%,
  70% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

.hint {
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.footer {
  margin-top: 4.5rem;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* The story */

html.story-mode,
html.story-mode body {
  background: var(--canvas);
  overscroll-behavior-y: none;
}

.story-mode .layer {
  display: block;
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: var(--vh);
  pointer-events: none;
}

.story-mode #sky {
  z-index: 0;
}

.story-mode #orb {
  z-index: 2;
}

.story-mode #stars {
  z-index: 1;
}

.story-mode .vignette {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(3, 2, 8, 0.75) 100%);
}

.story-mode .grain {
  display: block;
  position: fixed;
  inset: -50%;
  z-index: 4;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
  0% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-6%, 4%);
  }
  40% {
    transform: translate(5%, -7%);
  }
  60% {
    transform: translate(-3%, 8%);
  }
  80% {
    transform: translate(7%, 2%);
  }
  100% {
    transform: translate(0, 0);
  }
}

.story-mode .spacer {
  display: block;
}

.story-mode .story {
  position: static;
  max-width: none;
  margin: 0;
  padding: 0;
}

.story-mode .static-orb {
  display: none;
}

.story-mode .scene {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10;
  width: 100%;
  height: var(--vh);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(var(--vh) * 0.6) 24px 0;
  visibility: hidden;
  pointer-events: none;
  text-shadow: 0 0 28px rgba(5, 4, 9, 0.85);
  will-change: opacity, transform;
}

.story-mode .scene a,
.story-mode .scene button {
  pointer-events: auto;
}

.story-mode .hero {
  padding-top: calc(var(--vh) * 0.4 + var(--orb-d, 200px) * 0.62);
}

.story-mode .ability,
.story-mode .refuse {
  padding-top: calc(var(--vh) * 0.37 + var(--orb-d, 200px) * 0.68);
}

.story-mode .lower {
  justify-content: flex-end;
  padding: 0 24px calc(var(--vh) * 0.09);
}

.story-mode .invite {
  padding-top: calc(var(--vh) * 0.34 + var(--orb-d, 200px) * 0.66);
}

.story-mode .footer {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  margin: 0;
}

.split .w,
.split .ch,
.story-mode .cap {
  display: inline-block;
  will-change: opacity, transform, filter;
}

.story-mode .rise {
  will-change: opacity, transform;
}

.story-mode .rest {
  overflow: hidden;
  max-width: calc(var(--w, 6em) * var(--u, 1));
  opacity: var(--u, 1);
  filter: blur(calc((1 - var(--u, 1)) * 6px));
}

.story-mode .cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: absolute;
  bottom: max(26px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-left: 0.3em;
}

.cue i {
  display: block;
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, transparent, rgba(239, 237, 247, 0.7), transparent);
  background-size: 100% 200%;
  animation: drip 2.4s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

@keyframes drip {
  0% {
    background-position: 0 100%;
  }
  100% {
    background-position: 0 -100%;
  }
}

.story-mode.over-orb body {
  cursor: pointer;
}

.story-mode .whisper {
  display: block;
  position: fixed;
  left: 0;
  right: 0;
  z-index: 15;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  color: #f3e9ff;
  text-shadow: 0 0 18px rgba(180, 140, 255, 0.9);
  opacity: 0;
  transform: translateY(8px);
  filter: blur(6px);
  transition: opacity 0.6s ease, transform 0.6s ease, filter 0.6s ease;
  pointer-events: none;
}

.story-mode .whisper.show {
  opacity: 1;
  transform: none;
  filter: none;
}

.story-mode .rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  top: 50%;
  z-index: 20;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 1.2s ease 1.6s;
}

.story-ready .rail {
  opacity: 1;
}

.rail button {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--ink-faint);
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

.rail .label {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.4s ease;
  white-space: nowrap;
}

.rail .tick {
  width: 14px;
  height: 1px;
  background: currentColor;
  transition: width 0.4s ease, background 0.4s ease;
}

.rail:hover .label,
.rail button:focus-visible .label {
  opacity: 1;
  transform: none;
}

.rail button.active {
  color: var(--ink);
}

.rail button.active .tick {
  width: 28px;
  background: linear-gradient(90deg, #b48cff, #ff8ad8);
}

@media (max-width: 760px) {
  .story-mode .rail {
    display: none;
  }

  .acronym {
    flex-direction: column;
    align-items: flex-start;
    width: max-content;
    margin: 0 auto;
    gap: 0;
    line-height: 1.02;
  }

  .story-mode .lower {
    padding-bottom: calc(var(--vh) * 0.07);
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .story-mode .scene h2 {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
  }

  .story-mode .cue {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button::after,
  .grain,
  .cue i {
    animation: none;
  }
}
