:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: rgba(0, 0, 0, 0.55);
  --line: rgba(255, 255, 255, 0.14);
  --accent: #3b69f3;
  --accent-b: #e3feff;
  --grad: linear-gradient(220.55deg, #3b69f3 0%, #e3feff 100%);
  --steps: 9;
  --font-display: "Clash Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Clash Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Clash Grotesk", ui-sans-serif, system-ui, sans-serif;
  --gutter: clamp(24px, 5.5vw, 104px);
}

* { box-sizing: border-box; }

html { background: var(--bg); color-scheme: light; scroll-behavior: auto; scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- scroll track */
#scroll {
  position: relative;
  height: calc(var(--steps) * 100vh);
  height: calc(var(--steps) * 100svh);
}

/* ---------------------------------------------------------------- fixed stage */
#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

#stage #scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* white page; the brand-gradient 20% spawn column sits in the middle of the 30 / 20 / 50 layout.
   Both are under the canvas so parts spawn on top of them. */
.texture {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #fff;
}

.column {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 30%;
  width: 20%;
  height: 100%;
  z-index: 0;
  display: block;
  image-rendering: pixelated;      /* low-res canvas: the dissolve reads as film grain */
}

/* very fine animated film grain over everything, multiplied so it reads on white */
.grain {
  position: absolute;
  inset: -100%;
  width: 300%;
  height: 300%;
  pointer-events: none;
  z-index: 3;
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n' x='0' y='0'><feTurbulence type='fractalNoise' baseFrequency='1.25' numOctaves='1' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/><feComponentTransfer><feFuncR type='gamma' amplitude='1' exponent='0.6'/><feFuncG type='gamma' amplitude='1' exponent='0.6'/><feFuncB type='gamma' amplitude='1' exponent='0.6'/></feComponentTransfer></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 300px 300px;
  animation: grain 0.9s steps(6) infinite;
}

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

/* ---------------------------------------------------------------- header */
.header {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  animation: header-in 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.6s backwards;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.header.is-away {
  opacity: 0;
  transform: translateY(-18px);
  pointer-events: none;
}

@keyframes header-in {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: none; }
}

.header__bar {
  width: 100%;
  max-width: 1240px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 6px 0 22px;
  background: rgba(8, 8, 9, 0.62);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.header__logo { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.header__logo .header__mark { display: block; height: 22px; width: auto; }
.header__logo .header__word { display: block; height: 18px; width: auto; }

.header__nav { display: flex; align-items: center; gap: 6px; height: 100%; }

.header__nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #000;
  background: #fff;
  transition: background 0.25s, color 0.25s;
}

.header__nav a:hover { background: #e9e9e9; color: #000; }

.header__nav a.cta span { font-size: 12px; transition: transform 0.25s; }
.header__nav a.cta:hover span { transform: translate(2px, -2px); }

/* ---------------------------------------------------------------- copy (left 30%) */
.copy {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  will-change: transform;
}

/* one sentence per step; every sentence starts at the same anchor (left gutter, 30% from the top) */
.step {
  position: absolute;
  left: var(--gutter);
  top: 30vh;
  width: calc(30vw - var(--gutter) - 20px);
  opacity: 0;
  visibility: hidden;
}

.step h1,
.step h2 {
  margin: 0;
  font-family: var(--font-display);
  font-feature-settings: "ss02" 1;
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: #0a0a0a;
  font-size: clamp(2rem, 3.4vw, 4.2rem);
  text-wrap: balance;
}

/* word-reveal wrappers (added by JS): plain rise + fade, no clipping, so glyphs are never cropped */
.step h1 .w,
.step h2 .w { display: inline-block; vertical-align: baseline; }

.step h1 .w > span,
.step h2 .w > span { display: inline-block; will-change: transform, opacity; }

/* ---------------------------------------------------------------- step title (right edge) */
.mark {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  pointer-events: none;
}

.mark span {
  font-family: var(--font-display);
  font-feature-settings: "ss02" 1;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: #0a0a0a;
  white-space: nowrap;
}

.mark__steps {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  margin-top: 10px;
  pointer-events: auto;
}

.mark__steps button {
  appearance: none;
  border: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  padding: 1px 0;
  line-height: 1;
  transition: color 0.2s, transform 0.2s;
}

.mark__steps button:hover { color: #0a0a0a; }
.mark__steps button.is-on {
  color: var(--accent);
  background-image: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transform: translateX(-2px);
}

.part-tip {
  position: fixed;
  z-index: 22;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0a0a0a;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 6px 10px;
  border-radius: 6px;
  transform: translate(14px, -50%);
  white-space: nowrap;
}

#stage #scene { cursor: grab; }
#stage #scene.is-hold { cursor: grabbing; }

/* ---------------------------------------------------------------- final CTA */
.launch {
  position: fixed;
  left: 0;
  right: 0;
  top: 50%;
  margin: -26px auto 0;             /* half the height: dead centre of the frame */
  width: fit-content;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 28px;
  border-radius: 10px;
  background: #fff;
  color: #000;
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  font-family: var(--font-display);
  font-feature-settings: "ss02" 1;
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.01em;
  opacity: 0;
  visibility: hidden;
  transition: background 0.25s;
}

.launch:hover { background: #f0f0f0; }
.launch span { font-size: 14px; transition: transform 0.25s; }
.launch:hover span { transform: translate(2px, -2px); }

/* ---------------------------------------------------------------- scroll hint */
.hint {
  position: fixed;
  left: 75%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.5);
  transition: opacity 0.5s;
}

.hint i {
  display: block;
  width: 9px;
  height: 9px;
  margin-top: 2px;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(45deg);
  animation: hint-arrow 1.35s ease-in-out infinite;
}

@keyframes hint-arrow {
  0%, 100% { transform: translateY(0) rotate(45deg); opacity: 0.4; }
  50%      { transform: translateY(7px) rotate(45deg); opacity: 1; }
}

.hint.hidden { opacity: 0; pointer-events: none; }

/* ---------------------------------------------------------------- loader */
.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.9s ease, visibility 0.9s;
}

.loader.done { opacity: 0; visibility: hidden; }

.loader__inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }

.loader__inner img { height: 34px; width: auto; opacity: 0.95; }

.loader__bar {
  width: 180px;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.loader__bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--grad);
  transition: width 0.25s ease-out;
}

.loader__pct {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(0, 0, 0, 0.5);
}

/* ---------------------------------------------------------------- footer strip */
.foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 28px 22px var(--gutter);
  font-size: 11px;
  color: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.foot__brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: foot-in 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) 0.9s both;
}

@keyframes foot-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* the wordmark, big - same lettering as the Olora mark */
.foot__brand img {
  display: block;
  height: clamp(30px, 3.4vw, 56px);
  width: auto;
}

.foot__brand span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: rgba(0, 0, 0, 0.5); }

/* $OLORA contract address - copy on click */
.ca {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 0;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.ca:hover { border-color: var(--accent); }
.ca b { font-weight: 600; letter-spacing: 0.1em; color: rgba(0, 0, 0, 0.5); white-space: nowrap; }
.ca code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ca i {
  font-style: normal;
  white-space: nowrap;
  color: var(--accent);
  background-image: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.foot__links { display: flex; gap: 18px; padding-bottom: 4px; }
.foot__links a { pointer-events: auto; transition: color 0.2s; }
.foot__links a:hover { color: var(--accent); }
.foot__links .foot__credit { opacity: 0.55; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .step {
    left: max(20px, env(safe-area-inset-left));
    right: max(20px, env(safe-area-inset-right));
    top: calc(78px + env(safe-area-inset-top));
    width: auto;
    max-width: none;
  }
  .step h1, .step h2 {
    font-size: clamp(1.55rem, 6.4vw, 2.35rem);
    line-height: 1.08;
    letter-spacing: -0.025em;
  }
  .hint { left: 50%; }
  .mark { display: none; }
  .foot {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .foot__links { display: none; }
  .foot__brand img { height: 28px; }
  .column { display: none; }
}

/* portrait / phone stack: headline owns the top, PC lives underneath (.is-narrow from JS) */
html.is-narrow .step {
  top: calc(72px + env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  max-width: none;
  padding-bottom: 22px;
  background: linear-gradient(180deg, #fff 0 72%, rgba(255, 255, 255, 0) 100%);
}
html.is-narrow .step h1,
html.is-narrow .step h2 {
  font-size: clamp(1.28rem, 5.6vw, 1.7rem);
  line-height: 1.12;
  text-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
}

html.is-narrow .hint {
  left: 50%;
  top: 31%;
  bottom: auto;
  transform: translateX(-50%);
  z-index: 30;
  gap: 6px;
  padding: 10px 16px 12px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 13px;
  letter-spacing: 0.12em;
}
html.is-narrow .hint i {
  width: 12px;
  height: 12px;
  border-right-width: 2px;
  border-bottom-width: 2px;
}
html.is-narrow .foot__brand img { height: 22px; }
html.is-narrow .foot__brand span { font-size: 10px; }
html.is-narrow .launch {
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  top: auto;
  bottom: calc(70px + env(safe-area-inset-bottom));
  margin: 0 auto;
  width: auto;
  max-width: 420px;
  height: 48px;
  padding: 0 22px;
  font-size: 16px;
  justify-content: center;
}

@media (max-width: 720px) {
  .header {
    top: max(10px, env(safe-area-inset-top));
    padding: 0 max(12px, env(safe-area-inset-left)) 0 max(12px, env(safe-area-inset-right));
  }
  .header__bar {
    height: 46px;
    padding: 0 4px 0 14px;
    border-radius: 11px;
  }
  .header__logo .header__mark { height: 22px; }
  .header__logo .header__word { height: 16px; }
  .header__nav { gap: 4px; }
  .header__nav a {
    padding: 0 11px;
    height: 30px;
    font-size: 12px;
    border-radius: 7px;
  }
  .header__nav a.cta span { display: none; }
  /* Docs is secondary on a phone — keep Launch + X */
  .header__nav a:not(.cta):first-of-type { display: none; }
}

@media (max-width: 390px) {
  .header__nav a:not(.cta) { padding: 0 10px; }
  html.is-narrow .step h1,
  html.is-narrow .step h2 { font-size: 1.35rem; }
  .foot__brand img { height: 24px; }
  .foot__brand span { font-size: 10px; letter-spacing: 0.1em; }
}

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .hint i { animation: none; opacity: 1; }
}

@supports (-webkit-touch-callout: none) {
  body { overscroll-behavior-y: none; }
  #scroll { height: calc(var(--steps) * 100dvh); }
}
