:root {
  --bg: #f4f1ea;
  --bg-2: #ece8df;
  --surface: #fffcf7;
  --ink: #161412;
  --muted: #5c564e;
  --faint: #8a8378;
  --accent: #0f5c4c;
  --accent-soft: rgba(15, 92, 76, 0.1);
  --line: rgba(22, 20, 18, 0.1);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 4.6rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 0.4rem 0.7rem;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 40;
  transform-origin: left;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: max(0.85rem, env(safe-area-inset-top)) max(6vw, env(safe-area-inset-right)) 0.85rem max(6vw, env(safe-area-inset-left));
  background: rgba(244, 241, 234, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  border-bottom-color: var(--line);
}

.nav-brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 1rem;
  height: 1.5px;
  background: var(--ink);
  margin: 0 auto;
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

.nav-links {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-links a {
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.nav-cta {
  color: var(--accent) !important;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.5rem, 5vw, 4.5rem);
  align-items: center;
  padding: 7vh 6vw 8vh;
}

.hero-copy,
.hero-visual {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.rail-dots {
  display: none;
}

.kicker {
  margin: 0 0 1.2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6.4vw, 5.6rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.035em;
}

.lede {
  max-width: 34rem;
  margin: 1.35rem 0 0;
  font-size: clamp(1.08rem, 1.8vw, 1.35rem);
  color: var(--faint);
  line-height: 1.5;
}

.portrait-wrap {
  width: min(260px, 72vw);
  transform: rotate(2.4deg);
  filter: drop-shadow(0 16px 28px rgba(22, 20, 18, 0.16));
}

.portrait-wrap img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 18%;
  border-radius: 2px;
  border: 7px solid #fff;
  background: #fff;
}

.bridge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 1.1fr) minmax(0, 1fr);
  gap: 1.2rem 2rem;
  align-items: center;
  padding: 1.6rem 6vw;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}

.bridge-side {
  min-width: 0;
}

.bridge-side strong {
  display: block;
  color: var(--ink);
  font-weight: 550;
  margin-bottom: 0.25rem;
}

.bridge-side p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.bridge-side-end {
  text-align: right;
}

.bridge-core {
  text-align: center;
}

.bridge-diagram {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.bridge-pole {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.bridge-rail {
  position: relative;
  flex: 1;
  height: 2px;
  background: var(--line);
  overflow: hidden;
}

.bridge-bead {
  position: absolute;
  top: 50%;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  animation: bead-out-left 2.8s ease-in-out infinite;
}

.bridge-bead-out {
  animation-name: bead-out-right;
}

@keyframes bead-out-left {
  0% { left: 100%; opacity: 0.3; }
  45% { opacity: 1; }
  100% { left: 0; opacity: 0.25; }
}

@keyframes bead-out-right {
  0% { left: 0; opacity: 0.3; }
  45% { opacity: 1; }
  100% { left: 100%; opacity: 0.25; }
}

.bridge-node {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex-shrink: 0;
  animation: node 2.8s ease-in-out infinite;
}

.bridge-caption {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

@keyframes node {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

section {
  padding: clamp(4rem, 8vw, 7.2rem) 6vw;
}

.wrap {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.4fr) minmax(0, 0.6fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}

.split > * {
  min-width: 0;
}

.idx {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.8rem;
}

h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.85rem, 3.6vw, 3.1rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.prose p {
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 40rem;
}

.prose-space {
  margin-top: 2.2rem;
}

.pull {
  margin: 2rem 0 0;
  padding: 1.3rem 0 0;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.28;
  color: var(--ink);
  font-style: italic;
}

.grid-3,
.loop,
.companies {
  display: grid;
  gap: 1rem;
  margin-top: 2.3rem;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.company,
.loop {
  background: var(--surface);
  border: 1px solid var(--line);
}

.card {
  border-radius: 14px;
  padding: 1.3rem 1.2rem 1.4rem;
}

.card h3,
.step h3,
.company h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.card p,
.step p,
.company p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.loop {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-radius: 14px;
  overflow: hidden;
}

.step {
  padding: 1.4rem 1.2rem 1.5rem;
}

.step + .step {
  border-left: 1px solid var(--line);
}

.n {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
}

.panel {
  margin-top: 2.2rem;
  padding: 1.5rem 1.6rem;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(15, 92, 76, 0.16);
}

.panel p {
  margin: 0;
  color: #21443c;
}

.panel p + p {
  margin-top: 0.9rem;
}

.panel a {
  color: var(--accent);
}

.path {
  background: var(--surface);
}

.companies {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.company {
  min-height: 200px;
  padding: 1.4rem;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.company > div > span {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.company h3 {
  margin: 0.75rem 0 0.4rem;
  font-size: 1.22rem;
  text-wrap: pretty;
}

.company h3 .entity {
  white-space: nowrap;
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;
  color: inherit;
}

.mail {
  display: inline-block;
  margin-top: 1.3rem;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  text-decoration: none;
  border-bottom: 1px solid rgba(15, 92, 76, 0.35);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.mail:hover {
  color: var(--accent);
}

.site-foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  padding: 1.3rem 6vw 2rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-foot a {
  text-decoration: none;
  color: var(--muted);
}

.js-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.js-reveal.is-in {
  opacity: 1;
  transform: none;
}

.prose-space {
  margin-top: 2.2rem;
}

.panel-follow {
  margin-top: 0.9rem;
}

.origin {
  padding-top: clamp(1.6rem, 4vw, 2.8rem);
  padding-bottom: clamp(1.6rem, 4vw, 2.8rem);
}

.origin-stage {
  position: relative;
  background: #fffef9;
  color: var(--ink);
  border-radius: 4px 14px 14px 4px;
  padding: clamp(1.2rem, 3vw, 2rem) clamp(1.2rem, 3.5vw, 2.2rem) clamp(1.2rem, 3vw, 2rem) clamp(1.5rem, 4vw, 2.4rem);
  box-shadow:
    0 10px 28px rgba(22, 20, 18, 0.06),
    0 0 0 1px rgba(22, 20, 18, 0.06);
}

.origin-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  background:
    radial-gradient(circle at 50% 18%, #fffef9 2.5px, transparent 3px),
    radial-gradient(circle at 50% 50%, #fffef9 2.5px, transparent 3px),
    radial-gradient(circle at 50% 82%, #fffef9 2.5px, transparent 3px),
    #c5ddd4;
  border-radius: 4px 0 0 4px;
}

.origin-file {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.origin-head .idx {
  color: var(--accent);
}

.origin-file-no {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.origin-mark {
  margin: 0 0 0.7rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.origin-stage h2 {
  color: var(--ink);
  font-size: clamp(1.45rem, 2.6vw, 2.05rem);
  letter-spacing: -0.02em;
}

.origin-path {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, 1fr);
  align-items: center;
  gap: 0.25rem;
  margin: 1.15rem 0 1.05rem;
  padding: 0.7rem 0.2rem 0.1rem;
  border-top: 1px dashed rgba(22, 20, 18, 0.14);
}

.origin-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 0.35rem 0.2rem;
}

.origin-ico {
  width: min(100%, 3.6rem);
  height: auto;
  display: block;
}

.origin-tab.is-on {
  color: var(--accent);
}

.origin-join {
  height: 1px;
  background: rgba(22, 20, 18, 0.14);
  align-self: center;
  margin-bottom: 1.15rem;
}

.origin-copy {
  display: grid;
  gap: 1.15rem;
}

.origin-beat p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 40rem;
}

.origin-stage.is-live .origin-copy {
  gap: 0;
}

.origin-stage.is-live .origin-beat {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 0;
  transform: translateX(12px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
}

.origin-stage.is-live .origin-beat.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
  transform: none;
}

.origin-ctrl {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1rem;
}

.origin-step {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  touch-action: manipulation;
}

.origin-step:hover,
.origin-tab:hover {
  color: var(--accent);
}

.origin-tab:focus-visible,
.origin-step:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.origin-count {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.origin-pull {
  margin: 1.15rem 0 0;
  padding-top: 0.95rem;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-size: clamp(1.12rem, 1.8vw, 1.35rem);
  line-height: 1.35;
  font-style: italic;
  color: var(--muted);
}

.origin-stage:not(.is-live) .origin-ctrl {
  display: none;
}

@media (max-width: 980px) {
  .origin-path {
    grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr) 16px minmax(0, 1fr);
  }
  .hero,
  .split,
  .bridge,
  .grid-3,
  .loop,
  .companies {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    justify-self: start;
  }

  .portrait-wrap {
    transform: rotate(1.4deg);
  }

  .bridge-side-end {
    text-align: left;
  }

  .bridge-core {
    order: -1;
  }

  .step + .step {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 5.2rem;
  }

  body {
    font-size: 1.02rem;
  }

  .nav {
    padding: max(0.7rem, env(safe-area-inset-top)) max(5vw, env(safe-area-inset-right)) 0.7rem max(5vw, env(safe-area-inset-left));
  }

  .nav-toggle {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    touch-action: manipulation;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.25rem 0 calc(0.4rem + env(safe-area-inset-bottom));
    box-shadow: 0 16px 32px rgba(22, 20, 18, 0.08);
  }

  .nav.is-open .nav-links {
    display: flex;
  }

  .nav-links a {
    padding: 0.95rem 5vw;
    border-bottom: 0;
    min-height: 2.75rem;
  }

  body.nav-open {
    overflow: hidden;
  }

  .hero {
    padding: 1.35rem max(5vw, env(safe-area-inset-right)) 2.4rem max(5vw, env(safe-area-inset-left));
    gap: 1.5rem;
  }

  h1 {
    font-size: clamp(2.2rem, 12vw, 2.85rem);
    line-height: 1.02;
  }

  .lede {
    font-size: 1.08rem;
    margin-top: 1.15rem;
  }

  .hero-copy::after {
    content: "Scroll";
    display: inline-flex;
    align-items: center;
    margin-top: 0.9rem;
    padding-left: 0.7rem;
    border-left: 1px solid var(--accent);
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
  }

  .portrait-wrap {
    width: min(196px, 56vw);
  }

  .portrait-wrap img {
    border-width: 5px;
  }

  .bridge {
    padding: 1.25rem 5vw;
    gap: 1.15rem;
  }

  .bridge-diagram {
    min-height: 2.4rem;
  }

  section {
    padding: 3.1rem max(5vw, env(safe-area-inset-right)) 3.1rem max(5vw, env(safe-area-inset-left));
  }

  h2 {
    font-size: clamp(1.7rem, 8.4vw, 2.15rem);
  }

  .prose p {
    font-size: 1.02rem;
  }

  .origin {
    padding-top: 1.2rem;
    padding-bottom: 1.2rem;
  }

  .origin-stage {
    padding: 1.15rem 1.1rem 1.2rem 1.25rem;
  }

  .origin-path {
    margin: 1rem 0 0.9rem;
    gap: 0.1rem;
  }

  .origin-ico {
    width: min(100%, 2.7rem);
  }

  .origin-tab {
    font-size: 0.7rem;
    min-height: 3.2rem;
    touch-action: manipulation;
  }

  .origin-beat p {
    font-size: 0.98rem;
  }

  .grid-3,
  .loop,
  .companies {
    margin-top: 1.5rem;
    gap: 0.75rem;
  }

  .company {
    min-height: 0;
    padding: 1.2rem;
  }

  .mail {
    font-size: clamp(1.35rem, 7.4vw, 1.85rem);
    overflow-wrap: break-word;
    max-width: 100%;
  }

  .site-foot {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.2rem 5vw calc(1.6rem + env(safe-area-inset-bottom));
  }

  .js-reveal {
    transform: translateY(10px);
  }
}

@media (max-width: 480px) {
  .origin-file {
    flex-direction: column;
    gap: 0.15rem;
  }

  .origin-join {
    margin-bottom: 1.3rem;
  }
}

@media (max-width: 980px) {
  .progress {
    height: 3px;
    box-shadow: 0 0 12px rgba(15, 92, 76, 0.45);
  }

  .hero {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    min-height: min(88svh, 46rem);
    padding: 0 0 1.4rem;
    gap: 0;
    overflow: hidden;
  }

  .hero-visual {
    grid-column: 1;
    grid-row: 1 / 3;
    justify-self: stretch;
    height: auto;
    min-height: min(72svh, 38rem);
    overflow: hidden;
  }

  .hero-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 52%, rgba(244, 241, 234, 0.38) 76%, var(--bg) 100%);
    pointer-events: none;
    z-index: 1;
  }

  .portrait-wrap {
    width: 100%;
    height: 100%;
    min-height: min(72svh, 38rem);
    transform: none;
    filter: none;
  }

  .portrait-wrap img {
    width: 100%;
    height: 100%;
    min-height: min(72svh, 38rem);
    aspect-ratio: auto;
    object-fit: cover;
    object-position: 50% 18%;
    border: 0;
    border-radius: 0;
    background: #6d6d6d;
    animation: hero-drift 22s ease-in-out infinite alternate;
  }

  .hero-copy {
    grid-column: 1;
    grid-row: 2;
    z-index: 2;
    padding: 5.5rem max(5vw, env(safe-area-inset-right)) 0.35rem max(5vw, env(safe-area-inset-left));
  }

  .hero-copy .kicker {
    color: #e9f7f2;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(22, 20, 18, 0.55), 0 0 12px rgba(22, 20, 18, 0.28);
  }

  .hero-copy h1,
  .hero-copy .lede {
    color: var(--ink);
    text-shadow: 0 1px 0 rgba(244, 241, 234, 0.7);
  }

  .path .split {
    position: relative;
    padding-left: 1.15rem;
  }

  .path .split::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.35rem;
    bottom: 0.35rem;
    width: 2px;
    background: linear-gradient(var(--accent), var(--line));
    border-radius: 2px;
  }

  .path .split::after {
    content: "";
    position: absolute;
    left: -3px;
    top: 0.2rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 6px var(--accent-soft);
  }

  .bridge {
    position: relative;
    overflow: hidden;
  }

  .bridge::before {
    content: "";
    position: absolute;
    width: 12rem;
    height: 12rem;
    right: -4rem;
    top: -5rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 92, 76, 0.14), transparent 68%);
    pointer-events: none;
  }

  .bridge-node {
    width: 16px;
    height: 16px;
    box-shadow: 0 0 0 5px var(--accent-soft), 0 0 18px rgba(15, 92, 76, 0.35);
  }

  .rail {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 5vw;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    margin-inline: -5vw;
    padding: 0.2rem 5vw 0.85rem;
    scrollbar-width: none;
  }

  .rail::-webkit-scrollbar {
    display: none;
  }

  .rail > * {
    flex: 0 0 min(78vw, 19.5rem);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .loop.rail {
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .loop.rail .step {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.25rem 1.15rem 1.3rem;
  }

  .loop.rail .step + .step {
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
  }

  .card,
  .company {
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(22, 20, 18, 0.05);
  }

  .grid-3 {
    counter-reset: gap-card;
  }

  .grid-3 .card {
    counter-increment: gap-card;
    padding-top: 1.1rem;
  }

  .grid-3 .card h3::before {
    content: counter(gap-card, decimal-leading-zero);
    display: block;
    margin-bottom: 0.55rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    color: var(--accent);
  }

  .company {
    position: relative;
    overflow: hidden;
    min-height: 11.5rem;
  }

  .company::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
  }

  .company:nth-child(2)::before { background: #1d3d73; }
  .company:nth-child(3)::before { background: #8a3d1c; }

  .n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.7rem;
    border-radius: 50%;
    border: 1px solid rgba(15, 92, 76, 0.28);
    background: var(--accent-soft);
    animation: node 2.8s ease-in-out infinite;
  }

  .step:nth-child(2) .n { animation-delay: 0.35s; }
  .step:nth-child(3) .n { animation-delay: 0.7s; }
  .step:nth-child(4) .n { animation-delay: 1.05s; }

  .rail-dots {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.15rem 0 0.4rem;
  }

  .rail-dot {
    width: 6px;
    height: 6px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(22, 20, 18, 0.18);
    cursor: pointer;
  }

  .rail-dot.is-on {
    width: 1.15rem;
    border-radius: 99px;
    background: var(--accent);
  }

  .origin-stage {
    overflow: hidden;
  }

  .origin-stage.is-live .origin-beat.is-on {
    animation: beat-in 0.45s ease;
  }

  .contact {
    background:
      radial-gradient(90% 80% at 100% 0%, rgba(15, 92, 76, 0.35), transparent 42%),
      var(--ink);
    color: #f4f1ea;
  }

  .contact .idx {
    color: #9fd4c4;
  }

  .contact h2 {
    color: #fffef9;
  }

  .contact .mail {
    color: #fffef9;
    border-bottom-color: rgba(159, 212, 196, 0.55);
  }

  .js-reveal {
    transform: translateY(22px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

@keyframes hero-drift {
  from { transform: scale(1); }
  to { transform: scale(1.08) translate3d(1.5%, -1%, 0); }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .bridge-bead,
  .bridge-node,
  .n,
  .portrait-wrap img {
    animation: none;
  }
  .bridge-bead {
    left: 50%;
  }
  .origin-stage.is-live .origin-beat {
    transform: none;
    transition: none;
    animation: none;
  }
}
