/* ─── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ─── PAGE FRAME (intro + nav) ──────────────────────────────── */
body {
  background: #050505;
  color: #fafafa;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Sticky direction nav */
.rsm-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: rgba(5,5,5,.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.rsm-nav__brand { color: #fafafa; }
.rsm-nav__brand b { font-weight: 600; }
.rsm-nav__brand span { color: #6b6b6b; margin-left: 8px; }
.rsm-nav__links { display: flex; gap: 4px; }
.rsm-nav__links a {
  padding: 6px 12px;
  color: #888;
  border-radius: 999px;
  transition: color .25s, background .25s;
}
.rsm-nav__links a:hover { color: #fafafa; background: rgba(255,255,255,.06); }
.rsm-nav__links a.is-active { color: #fafafa; background: rgba(255,255,255,.08); }

/* Intro panel */
.rsm-intro {
  max-width: 1180px;
  margin: 0 auto;
  padding: 120px 28px 80px;
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
}
.rsm-intro__kicker {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: #6b6b6b; margin-bottom: 32px;
}
.rsm-intro h1 {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 920px;
  margin-bottom: 32px;
  color: #fafafa;
}
.rsm-intro h1 em {
  font-style: normal;
  color: #6b6b6b;
}
.rsm-intro__lede {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: #b8b8b8;
  max-width: 660px;
  margin-bottom: 56px;
}
.rsm-intro__lede + .rsm-intro__lede { margin-top: -32px; }

.rsm-intro__dirs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
}
@media (max-width: 800px) { .rsm-intro__dirs { grid-template-columns: 1fr; } }
.rsm-intro__dir {
  background: #050505;
  padding: 32px 28px;
  display: flex; flex-direction: column; gap: 14px;
  transition: background .3s;
}
.rsm-intro__dir:hover { background: #0a0a0a; }
.rsm-intro__dir-num {
  font-size: 11px; letter-spacing: 0.2em;
  color: #6b6b6b;
}
.rsm-intro__dir-name {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.rsm-intro__dir-line { color: #b8b8b8; font-size: 14px; font-family: ui-sans-serif, system-ui, sans-serif; line-height: 1.5; }
.rsm-intro__dir-swatch {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px;
  font-size: 11px; color: #6b6b6b;
}
.rsm-intro__dir-swatch i {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15);
}

/* Outro */
.rsm-outro {
  max-width: 1180px;
  margin: 0 auto;
  padding: 120px 28px 160px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.rsm-outro__kicker {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: #6b6b6b; margin-bottom: 24px;
}
.rsm-outro h2 {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: #fafafa;
}
.rsm-outro p {
  font-size: 16px; line-height: 1.6; color: #b8b8b8; max-width: 640px;
}

/* ─── DIRECTION FRAME (shared by all 3) ─────────────────────── */
.dir {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.dir-header {
  position: relative;
  z-index: 2;
  padding: 80px 28px 40px;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.dir-header__left { display: flex; flex-direction: column; gap: 12px; }
.dir-header__tag {
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  opacity: 0.6;
}
.dir-header__name {
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.dir-header__line {
  font-size: 16px; line-height: 1.5; max-width: 540px; opacity: 0.7;
}
.dir-header__sys {
  display: grid; grid-template-columns: repeat(3, auto); gap: 24px 28px;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.dir-header__sys dt { opacity: 0.45; margin-bottom: 4px; }
.dir-header__sys dd { letter-spacing: 0.05em; }

/* Section base */
.dir section {
  position: relative;
  z-index: 1;
  padding: 56px 28px;
}
.dir section > .wrap {
  max-width: 1180px;
  margin: 0 auto;
}

/* Scroll-in reveal — shared mechanic, each direction tunes it */
.reveal {
  opacity: 0;
  transition: opacity .9s cubic-bezier(.2,.6,.2,1), transform .9s cubic-bezier(.2,.6,.2,1);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

.reveal--up { transform: translateY(28px); }
.reveal--right { transform: translateX(-32px); }
.reveal--blur { filter: blur(8px); transform: scale(0.98); }
.reveal--blur.is-in { filter: blur(0); transform: scale(1); }

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s cubic-bezier(.2,.6,.2,1), transform .7s cubic-bezier(.2,.6,.2,1);
}
.reveal-stagger.is-in > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.is-in > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.is-in > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.is-in > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.is-in > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.is-in > * { opacity: 1; transform: none; }

/* Timeline-fill (scroll-driven progress) */
.tl-rail { position: relative; }
.tl-rail__line {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: rgba(255,255,255,.08);
}
.tl-rail__fill {
  position: absolute; top: 0; width: 1px;
  height: var(--fill, 0%);
  background: var(--tl-color, #fff);
  transition: height .15s linear;
}

/* Cursor field — ambient hover light (per direction styles its color) */
.ambient-cursor {
  position: absolute; inset: 0; pointer-events: none;
  z-index: 0; opacity: 0;
  transition: opacity .4s;
}
.dir:hover .ambient-cursor { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * { opacity: 1; transform: none; filter: none; transition: none; }
}
