:root {
  --teal: #6EA8A6;
  --indigo: #071B33;
  --bronze: #D8C39B;
  --old-gold: #9C7A3B;
  --paper: #F4E8D0;
  --ink: #0B0908;
  --vermilion: #C83A2C;
  --warm-paper: #FFF7E6;
  --slate: #4C5965;
  --mincho: "Shippori Mincho", serif;
  --serif-jp: "Noto Serif JP", serif;
  --gothic: "Zen Kaku Gothic New", sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); }

body {
  font-family: var(--serif-jp);
  cursor: none;
}

button { font: inherit; color: inherit; cursor: none; }

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: .34;
  mix-blend-mode: multiply;
  background:
    radial-gradient(circle at 18% 12%, rgba(156,122,59,.2) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 46%, rgba(11,9,8,.12) 0 1px, transparent 2px),
    linear-gradient(90deg, rgba(255,247,230,.3), rgba(216,195,155,.16), rgba(255,247,230,.24));
  background-size: 19px 23px, 31px 29px, 100% 100%;
}

.ink-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50% 46% 55% 38%;
  background: rgba(7,27,51,.72);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 50;
  filter: blur(.4px);
  box-shadow: 0 0 0 8px rgba(110,168,166,.12);
}

.voyage-nav {
  position: fixed;
  left: 28px;
  top: 50%;
  z-index: 35;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.nav-label {
  writing-mode: vertical-rl;
  font-family: var(--gothic);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(7,27,51,.62);
  margin-bottom: 8px;
}

.nav-knot {
  width: 17px;
  height: 17px;
  border: 2px solid var(--old-gold);
  border-radius: 50%;
  background: var(--paper);
  padding: 0;
  position: relative;
  transition: transform .5s ease, background .5s ease, border-color .5s ease;
}

.nav-knot::before, .nav-knot::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 2px;
  height: 15px;
  background: repeating-linear-gradient(var(--old-gold) 0 3px, rgba(156,122,59,.4) 3px 5px);
  transform: translateX(-50%);
}

.nav-knot::before { bottom: 100%; }
.nav-knot::after { top: 100%; }
.nav-knot:first-of-type::before, .nav-knot:last-of-type::after { display: none; }

.nav-knot span {
  position: absolute;
  left: 25px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  white-space: nowrap;
  font-family: var(--gothic);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--indigo);
  transition: opacity .35s ease;
}

.nav-knot:hover span, .nav-knot.is-active span { opacity: 1; }
.nav-knot.is-active { transform: scale(1.45) rotate(28deg); background: var(--vermilion); border-color: var(--vermilion); }

.tide-progress {
  position: fixed;
  left: 0;
  bottom: 0;
  height: 8px;
  width: 0%;
  z-index: 45;
  background: linear-gradient(90deg, var(--indigo), var(--teal), var(--vermilion));
  box-shadow: 0 -10px 35px rgba(7,27,51,.3);
}

.handscroll {
  height: 100vh;
  display: flex;
  width: 700vw;
  will-change: transform;
  transition: transform 1s cubic-bezier(.2,.7,.16,1);
}

.scroll-island {
  width: 100vw;
  min-width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 8vw, 110px);
  background:
    linear-gradient(90deg, rgba(216,195,155,.22), transparent 18%, transparent 82%, rgba(156,122,59,.18)),
    var(--paper);
}

.scroll-island::before {
  content: attr(data-scene);
  position: absolute;
  right: 42px;
  top: 38px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  color: rgba(7,27,51,.38);
  text-transform: uppercase;
}

.scene-copy { position: relative; z-index: 3; max-width: 680px; }
.eyebrow { font-family: var(--gothic); font-size: 12px; letter-spacing: .25em; text-transform: uppercase; color: var(--old-gold); margin: 0 0 18px; }
h1, h2 { font-family: var(--mincho); font-weight: 700; line-height: .92; margin: 0; color: var(--indigo); }
h1 { font-size: clamp(62px, 12vw, 176px); letter-spacing: -.055em; }
h2 { font-size: clamp(50px, 7.2vw, 118px); letter-spacing: -.04em; }
p { font-size: clamp(18px, 1.6vw, 25px); line-height: 1.8; }
.quiet-note { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--slate); text-transform: uppercase; max-width: 520px; }

.gate-island { background: linear-gradient(135deg, var(--warm-paper), var(--paper) 58%, rgba(7,27,51,.08)); }
.hero-copy { position: absolute; left: 11vw; top: 23vh; }
.brush-word { display: inline-block; opacity: 0; filter: blur(16px); transform: translateY(28px) skewX(-8deg); animation: brushIn 2s .35s forwards cubic-bezier(.2,.8,.1,1); }
.waka { max-width: 560px; margin: 28px 0 32px 3vw; color: rgba(11,9,8,.78); }

.seal-button, .final-seal {
  border: 1px solid var(--vermilion);
  background: rgba(200,58,44,.12);
  color: var(--vermilion);
  padding: 15px 22px;
  font-family: var(--gothic);
  letter-spacing: .14em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255,247,230,.5);
  transition: transform .35s ease, background .35s ease;
}
.seal-button:hover, .final-seal:hover { transform: rotate(-2deg) translateY(-4px); background: rgba(200,58,44,.2); }
.intro-seal { animation: sealLand .7s 2.1s both cubic-bezier(.1,1.2,.3,1); }
.vermilion-seal {
  position: absolute;
  left: 58vw;
  top: 39vh;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  font-family: var(--mincho);
  font-size: 52px;
  color: var(--warm-paper);
  background: var(--vermilion);
  transform: rotate(8deg);
  border-radius: 8px 3px 10px 2px;
  opacity: .92;
  mix-blend-mode: multiply;
}

.ink-tide {
  position: absolute;
  right: -18vw;
  bottom: -24vh;
  width: 70vw;
  height: 62vh;
  background: radial-gradient(ellipse at 50% 60%, var(--indigo), rgba(7,27,51,.9) 50%, rgba(7,27,51,0) 72%);
  border-radius: 48% 52% 0 0;
  animation: tideCreep 7s ease-in-out infinite alternate;
}

.moon-reflection { position: absolute; right: 16vw; top: 13vh; width: 180px; height: 260px; opacity: .9; }
.moon-reflection::before { content: ""; position: absolute; inset: 0 24px auto; height: 132px; border-radius: 50%; background: var(--warm-paper); box-shadow: 0 0 50px rgba(255,247,230,.75); }
.moon-reflection span, .moon-reflection::after { content: ""; position: absolute; left: 0; right: 0; height: 16px; border-radius: 50%; border-top: 3px solid rgba(110,168,166,.7); }
.moon-reflection span { top: 152px; transform: rotate(-3deg); }
.moon-reflection::after { top: 184px; transform: rotate(4deg); }
.gate-mark { position: absolute; left: 7vw; bottom: 8vh; width: 190px; height: 170px; border: 24px solid rgba(200,58,44,.72); border-bottom: 0; opacity: .24; }

.mirror-island { background: radial-gradient(circle at 70% 50%, rgba(216,195,155,.62), transparent 34%), var(--paper); }
.narrow-copy { margin-left: 8vw; margin-top: 12vh; max-width: 560px; }
.bronze-mirror {
  position: absolute;
  right: 13vw;
  top: 23vh;
  width: min(42vw, 510px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 38% 28%, #FFF7E6, #D8C39B 18%, #9C7A3B 48%, #0B0908 100%);
  box-shadow: inset 0 0 0 18px rgba(7,27,51,.12), inset 0 0 40px rgba(11,9,8,.5), 0 38px 80px rgba(7,27,51,.26);
  transition: transform .8s ease;
}
.bronze-mirror.is-revealed { transform: rotate(7deg) scale(1.03); }
.mirror-shine { position: absolute; inset: 14%; border-radius: 50%; border: 1px dashed rgba(255,247,230,.45); animation: slowSpin 24s linear infinite; }
.hidden-name { font-family: var(--mincho); font-size: clamp(56px, 8vw, 108px); text-align: center; color: rgba(255,247,230,.08); transition: color .8s ease, text-shadow .8s ease; }
.hidden-name small { font-family: var(--gothic); font-size: 13px; letter-spacing: .25em; text-transform: uppercase; }
.bronze-mirror.is-revealed .hidden-name { color: var(--warm-paper); text-shadow: 0 0 22px rgba(255,247,230,.75); }
.artifact-caption { position: absolute; right: 10vw; bottom: 12vh; font-family: var(--mono); font-size: 12px; color: var(--slate); }

.rope-island { background: linear-gradient(180deg, var(--paper), #FFF7E6 48%, rgba(7,27,51,.95) 49%, var(--indigo)); color: var(--warm-paper); }
.rope-island h2, .rope-island .eyebrow { color: var(--warm-paper); }
.province-copy { position: absolute; right: 8vw; top: 16vh; max-width: 560px; }
.province-copy p:not(.eyebrow) { color: rgba(255,247,230,.8); }
.rope-bridge { position: absolute; left: 9vw; top: 48vh; width: 66vw; height: 100px; border-top: 16px double var(--old-gold); transform: rotate(-6deg); }
.rope-bridge::before { content: ""; position: absolute; inset: -26px 0 auto; height: 22px; background: repeating-linear-gradient(90deg, transparent 0 16px, rgba(216,195,155,.55) 16px 22px); }
.rope-node { position: absolute; top: -43px; width: 72px; height: 72px; border-radius: 50%; border: 5px solid var(--bronze); background: var(--paper); color: var(--indigo); font-family: var(--mincho); font-size: 21px; box-shadow: 0 13px 25px rgba(0,0,0,.28); transition: transform .35s ease, background .35s ease; }
.rope-node:nth-child(1) { left: 4%; } .rope-node:nth-child(2) { left: 31%; } .rope-node:nth-child(3) { left: 58%; } .rope-node:nth-child(4) { left: 84%; }
.rope-node.is-lit, .rope-node:hover { transform: scale(1.18) rotate(8deg); background: var(--vermilion); color: var(--warm-paper); }
.fan-folds { position: absolute; right: 0; bottom: 0; width: 46vw; height: 44vh; opacity: .18; background: conic-gradient(from 210deg at 100% 100%, var(--warm-paper), transparent 8deg, var(--warm-paper) 10deg, transparent 18deg, var(--warm-paper) 21deg, transparent 31deg); }

.lantern-island { background: linear-gradient(120deg, var(--indigo), #0B0908); color: var(--warm-paper); }
.lantern-island h2 { color: var(--warm-paper); }
.lantern-copy { margin: 12vh 0 0 10vw; max-width: 600px; }
.lantern-copy p:not(.eyebrow) { color: rgba(255,247,230,.76); }
.lantern-field span { position: absolute; display: grid; place-items: center; }
.lantern { width: 86px; height: 122px; border-radius: 42% 42% 48% 48%; background: radial-gradient(circle at 50% 28%, #FFF7E6, #D8C39B 45%, rgba(200,58,44,.8)); color: var(--indigo); font-family: var(--mincho); box-shadow: 0 0 45px rgba(216,195,155,.45); animation: floatLantern 6s ease-in-out infinite; }
.l1 { right: 26vw; top: 16vh; } .l2 { right: 12vw; top: 48vh; animation-delay: -2s; } .l3 { left: 45vw; bottom: 15vh; animation-delay: -4s; }
.poem-slip { width: 260px; min-height: 56px; padding: 14px 18px; background: rgba(255,247,230,.9); color: var(--ink); font-size: 15px; line-height: 1.45; box-shadow: 0 10px 25px rgba(0,0,0,.18); transform: rotate(var(--r)); animation: driftSlip 12s ease-in-out infinite; }
.p1 { --r: -8deg; right: 30vw; bottom: 24vh; } .p2 { --r: 7deg; right: 7vw; top: 24vh; animation-delay: -5s; } .p3 { --r: -4deg; left: 39vw; top: 18vh; animation-delay: -8s; }

.shell-island { background: radial-gradient(circle at 50% 100%, rgba(110,168,166,.45), transparent 43%), var(--warm-paper); }
.shell-copy { position: absolute; left: 12vw; top: 12vh; max-width: 690px; }
.shell-archive { position: absolute; right: 10vw; top: 28vh; display: flex; gap: 28px; align-items: flex-end; }
.shell { width: 160px; height: 220px; border: 0; border-radius: 55% 45% 62% 38% / 48% 40% 60% 52%; background: radial-gradient(circle at 40% 26%, var(--warm-paper), var(--bronze) 42%, var(--old-gold)); color: var(--indigo); font-family: var(--mono); font-size: 14px; box-shadow: inset -22px -22px 35px rgba(11,9,8,.18), 0 24px 50px rgba(7,27,51,.22); transition: transform .45s ease, filter .45s ease; }
.shell:nth-child(2) { height: 178px; transform: rotate(9deg); } .shell:nth-child(3) { height: 205px; transform: rotate(-6deg); }
.shell:hover, .shell.is-selected { filter: saturate(1.35); transform: translateY(-16px) rotate(3deg); }
.route-marks { position: absolute; left: 16vw; bottom: 14vh; width: 58vw; border-top: 2px dashed rgba(7,27,51,.32); }
.route-marks i { position: absolute; top: -8px; width: 14px; height: 14px; border-radius: 50%; background: var(--teal); }
.route-marks i:nth-child(1){left:0}.route-marks i:nth-child(2){left:22%}.route-marks i:nth-child(3){left:46%}.route-marks i:nth-child(4){left:71%}.route-marks i:nth-child(5){left:100%; background:var(--vermilion)}

.bell-island { background: linear-gradient(180deg, var(--paper) 0 38%, var(--teal) 39%, var(--indigo) 100%); }
.bell-copy { margin: 10vh auto 0; text-align: center; max-width: 760px; }
.bell { margin-top: 22px; width: 150px; height: 165px; border: 0; background: linear-gradient(135deg, var(--bronze), var(--old-gold)); clip-path: polygon(29% 0, 71% 0, 86% 73%, 100% 90%, 0 90%, 14% 73%); box-shadow: 0 22px 60px rgba(7,27,51,.28); transition: transform .3s ease; }
.bell span { display: block; width: 28px; height: 28px; margin: 103px auto 0; border-radius: 50%; background: var(--indigo); }
.bell.is-ringing { animation: ringBell .7s ease-in-out; }
.wake-lines { position: absolute; left: 0; right: 0; bottom: 10vh; height: 34vh; background: repeating-radial-gradient(ellipse at 50% 0%, rgba(255,247,230,.24) 0 2px, transparent 3px 34px); opacity: .65; }
.tide-code { position: absolute; left: 9vw; bottom: 8vh; font-family: var(--mono); font-size: 12px; color: rgba(255,247,230,.7); }

.seal-island { background: radial-gradient(circle at 78% 26%, rgba(200,58,44,.13), transparent 25%), var(--paper); }
.final-copy { position: absolute; left: 11vw; top: 17vh; max-width: 690px; }
.final-seal { width: 132px; height: 132px; margin-top: 18px; padding: 0; background: var(--vermilion); color: var(--warm-paper); font-family: var(--mincho); font-size: 34px; border-radius: 8px 3px 11px 2px; }
.seal-reveal { position: absolute; right: 12vw; top: 32vh; width: min(38vw, 480px); height: 360px; display: grid; place-items: center; border: 1px solid rgba(156,122,59,.36); background: rgba(255,247,230,.55); transform: rotate(-3deg) scale(.92); opacity: .35; transition: opacity .7s ease, transform .7s ease, background .7s ease; }
.seal-reveal span { font-family: var(--mincho); font-size: clamp(34px, 4vw, 64px); color: var(--indigo); text-align: center; max-width: 360px; }
.seal-reveal.is-open { opacity: 1; transform: rotate(1deg) scale(1); background: rgba(255,247,230,.92); box-shadow: 0 30px 90px rgba(7,27,51,.18); }

@keyframes brushIn { to { opacity: 1; filter: blur(0); transform: translateY(0) skewX(0); } }
@keyframes sealLand { from { opacity: 0; transform: translateY(-70px) scale(1.7) rotate(-18deg); } to { opacity: .92; transform: translateY(0) scale(1) rotate(8deg); } }
@keyframes tideCreep { from { transform: translate(12vw, 12vh) scale(.9); } to { transform: translate(-5vw, -6vh) scale(1.08); } }
@keyframes slowSpin { to { transform: rotate(360deg); } }
@keyframes floatLantern { 50% { transform: translateY(-28px) rotate(3deg); } }
@keyframes driftSlip { 50% { transform: translate(18px, -20px) rotate(calc(var(--r) * -1)); } }
@keyframes ringBell { 0%,100% { transform: rotate(0); } 20% { transform: rotate(8deg); } 45% { transform: rotate(-7deg); } 70% { transform: rotate(4deg); } }

@media (max-width: 760px) {
  body { overflow: auto; cursor: auto; }
  button { cursor: pointer; }
  .ink-cursor, .voyage-nav, .tide-progress { display: none; }
  .handscroll { width: 100%; height: auto; display: block; transform: none !important; }
  .scroll-island { width: 100%; min-width: 100%; min-height: 100vh; height: auto; padding: 86px 28px; }
  .hero-copy, .narrow-copy, .province-copy, .lantern-copy, .shell-copy, .bell-copy, .final-copy { position: relative; inset: auto; margin: 0; }
  .bronze-mirror, .rope-bridge, .shell-archive, .seal-reveal { position: relative; inset: auto; margin: 42px auto 0; width: 82vw; }
  .rope-bridge { height: 180px; transform: none; }
  .shell-archive { flex-direction: column; align-items: center; }
}
