<style>
* { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior:smooth; }
html, body { width:100%; height:100%; }

body { background:#fff; overflow:hidden; }

/* ----------  PHASE 1 : ink reveal  ---------- */
#phase1 {
  position:fixed;
  inset:0;
  z-index:10;
  top:0;
}

#text-stage {
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:2;
  background:#fff;
}

#text-stage p {
  font-family:system-ui, sans-serif;
  font-size:clamp(1.5rem, 4vw, 3rem);
  color:#000;
  opacity:0;
  transition:opacity 1s ease;
}

#text-stage p.fade-in  { opacity:1; }
#text-stage p.fade-out { opacity:0; }

.art {
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1;
  background:#000;
  -webkit-mask-image:none;
  mask-image:none;
}

.art img { object-fit:contain; }

@media (orientation: portrait) { .art img { width:auto; height:100vh; } }
@media (orientation: landscape)  { .art img { width:100vw; height:auto; } }

.art.reveal {
  -webkit-mask-image:url("img/blot.gif");
  mask-image:url("img/blot.gif");
  -webkit-mask-repeat:no-repeat;
  mask-repeat:no-repeat;
  -webkit-mask-position:center;
  mask-position:center;
  -webkit-mask-size:cover;
  mask-size:cover;
}

/* ----------  next button  ---------- */
#next-btn {
  position:fixed;
  top:50%;
  left:50%;
  transform:translate(-50%, -50%);
  z-index:20;
  opacity:0;
  cursor:pointer;
  transition:opacity 1s ease;
  pointer-events:none;
}

#next-btn.show { opacity:1; pointer-events:auto; }

#next-btn img {
  width:300px;
  height:165px;
  display:block;
  transition:filter 0.3s ease;
}

#next-btn:hover img {
  filter:drop-shadow(0 0 20px rgba(255,255,255,0.8))
         drop-shadow(0 0 40px rgba(255,255,255,0.6));
}

#phase1.slide-up { transition:top 1s ease; top:-100vh; }

/* ----------  PHASE 2 : gallery  ---------- */
#phase2 {
  position:fixed;
  inset:0;
  top:100vh;
  background:#0a0a0a;
  z-index:15;
  transition:top 1s ease;
  overflow:hidden;
}

#phase2.active { top:0; }

#ride-track {
  height:100vh;
  overflow-y:auto;
  overflow-x:hidden;
  scroll-snap-type:y mandatory;
  overscroll-behavior:contain;
  scroll-behavior:smooth;
}

/* ----------  HUD  ---------- */
#hud {
  position:fixed;
  bottom:18px;
  right:18px;
  z-index:200;
  pointer-events:none;
  font-family:system-ui, sans-serif;
  mix-blend-mode:difference;
  color:#fff;
  opacity:0;
  transition:opacity 0.4s ease;
  text-align:right;
}

#phase2.active #hud,
.show-hud #hud {
  opacity:1;
  pointer-events:auto;
}

#hud .hud-title {
  font-size:12px;
  letter-spacing:0.16em;
  text-transform:uppercase;
  opacity:0.9;
}

#hud .hud-section {
  margin-top:6px;
  font-size:12px;
  opacity:0.75;
}

#hud .hud-progress {
  margin-top:10px;
  width:150px;
  height:2px;
  background:rgba(255,255,255,0.25);
  border-radius:999px;
  overflow:hidden;
}

#hud .hud-progress > div {
  width:0%;
  height:100%;
  background:#fff;
  transition:width 0.2s ease;
}

#hud .hud-dots {
  margin-top:10px;
  display:flex;
  gap:6px;
}

#hud .dot {
  width:6px;
  height:6px;
  border-radius:999px;
  background:rgba(255,255,255,0.3);
}

#hud .dot.active { background:#fff; }

/* ----------  gallery header  ---------- */
.gallery-header {
  min-height:100vh;
  scroll-snap-align:start;
  display:grid;
  place-items:center;
  padding:70px 18px 40px;
  background:#0a0a0a;
  position:relative;
}

.gallery-header .inner {
  text-align:center;
  width:min(900px, 92vw);
}

.gallery-header h1 {
  font-family:system-ui, sans-serif;
  font-size:clamp(34px, 6vw, 64px);
  font-weight:700;
  letter-spacing:-0.02em;
  color:#fff;
  margin-bottom:10px;
}

.gallery-header .subtext {
  font-family:system-ui, sans-serif;
  font-size:16px;
  color:rgba(255,255,255,0.65);
  margin-bottom:18px;
}

.section-links {
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  justify-content:center;
}

.section-links a {
  pointer-events:auto;
  font-family:system-ui, sans-serif;
  font-size:12px;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:rgba(255,255,255,0.85);
  text-decoration:none;
  border:1px solid rgba(255,255,255,0.22);
  padding:10px 14px;
  border-radius:999px;
  transition:all 0.25s ease;
}

.section-links a:hover {
  border-color:rgba(255,255,255,0.55);
  color:#fff;
}

/* ----------  panels  ---------- */
.gallery-section { margin:0; padding:0; }

.panel {
  min-height:100vh;
  scroll-snap-align:start;
  display:grid;
  place-items:center;
  padding:70px 18px 40px;
  position:relative;
  opacity:0;
  transform:translateY(18px);
  transition:opacity 0.9s ease, transform 0.9s ease;
}

.panel.in-view {
  opacity:1;
  transform:translateY(0);
}

.panel-inner {
  width:min(1200px, 92vw);
  display:grid;
  gap:16px;
  align-items:center;
  justify-items:center;
  position:relative;
  max-width:1200px;
  margin:0 auto;
  justify-content:center;
  scroll-snap-align:start;
}

.panel-image {
  max-width:100%;
  max-height:74vh;
  object-fit:contain;
  border-radius:16px;
  opacity:0;
  transform:translateY(10px);
  transition:opacity 0.9s ease, transform 0.9s ease;
  will-change:opacity, transform;
  display:block;
  z-index:1;
}

.panel.in-view .panel-image {
  opacity:1;
  transform:translateY(0);
}

.panel-title {
  color:#fff;
  font-family:system-ui, sans-serif;
  font-size:clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight:500;
  letter-spacing:0.3px;
  margin:0 0 8px 0;
  text-shadow:0 2px 18px rgba(0,0,0,0.85);
}

.panel-caption {
  color:rgba(255,255,255,0.82);
  font-family:system-ui, sans-serif;
  font-size:clamp(0.95rem, 1.4vw, 1.05rem);
  line-height:1.55;
  margin:0;
  text-shadow:0 2px 16px rgba(0,0,0,0.85);
}

.panel.in-view .panel-title,
.panel.in-view .panel-caption {
  opacity:1;
  transform:translateY(0);
}

.panel-meta {
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  z-index:2;
  padding:22px 22px 18px;
  background:linear-gradient(to top, rgba(0,0,0,0.78), rgba(0,0,0,0.5), rgba(0,0,0,0));
  pointer-events:none;
}

.hint {
  position:absolute;
  bottom:18px;
  left:0;
  right:0;
  text-align:center;
  font-family:system-ui, sans-serif;
  font-size:12px;
  opacity:0.45;
  pointer-events:none;
}

/* ----------  section colours  ---------- */
#experiments .panel { background:#0a0a0a; color:#fff; }
#worlds .panel       { background:#080808; color:#fff; }
#seeds .panel        { background:#111827; color:#fff; }
#artifacts .panel    { background:#0f0f0f; color:#fff; }

/* ----------  unlock / artifacts  ---------- */
#unlock-artifacts {
  width:100%;
  min-height:100vh;
  scroll-snap-align:start;
  display:grid;
  place-items:center;
  border:none;
  background:#0a0a0a;
  color:#fff;
  font-family:system-ui, sans-serif;
  cursor:pointer;
  font-size:clamp(22px, 4vw, 46px);
  letter-spacing:-0.02em;
  padding:70px 18px 40px;
  position:relative;
}

#unlock-artifacts::after {
  content:"Click to unlock";
  display:block;
  margin-top:14px;
  font-size:12px;
  letter-spacing:0.12em;
  text-transform:uppercase;
  opacity:0.5;
}

#unlock-artifacts:hover::after { opacity:0.9; }

#artifacts { display:none; }
body.artifacts-mode #artifacts { display:block; }

/* ----------  exit  ---------- */
#exit {
  min-height:100vh;
  scroll-snap-align:start;
  display:grid;
  place-items:center;
  padding:70px 18px 40px;
  background:#0a0a0a;
  color:#fff;
  position:relative;
}

#exit .exit-inner {
  text-align:center;
  width:min(900px, 92vw);
}

#exit h2 {
  font-family:system-ui, sans-serif;
  font-size:clamp(28px, 5vw, 54px);
  letter-spacing:-0.02em;
  margin-bottom:12px;
}

#exit p {
  font-family:system-ui, sans-serif;
  opacity:0.7;
  font-size:16px;
}

#exit .links,
#exit .aside-link {
  margin-top:18px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  justify-content:center;
}

#exit .links a {
  pointer-events:auto;
  text-decoration:none;
  color:#fff;
  border:1px solid rgba(255,255,255,0.22);
  padding:10px 14px;
  border-radius:999px;
  font-family:system-ui, sans-serif;
  font-size:12px;
  letter-spacing:0.08em;
  text-transform:uppercase;
  opacity:0.9;
  transition:all 0.25s ease;
}

#exit .links a:hover {
  border-color:rgba(255,255,255,0.55);
  opacity:1;
}

#exit .aside-link a {
  pointer-events:auto;
  text-decoration:none;
  color:#dd0;
  border:1px solid rgba(255,255,255,0.22);
  padding:10px 14px;
  border-radius:999px;
  font-family:system-ui, sans-serif;
  font-size:20px;
  letter-spacing:0.08em;
  text-transform:uppercase;
  opacity:0.9;
  transition:all 0.25s ease;
}

#exit .aside-link a:hover {
  border-color:rgba(255,255,255,0.55);
  opacity:1;
}

/* ----------  zoom  ---------- */
.zoom-container { position:relative; display:inline-block; max-width:100%; max-height:74vh; }

.zoom-btn {
  position:absolute;
  top:16px;
  right:16px;
  width:44px;
  height:44px;
  border-radius:50%;
  background:rgba(0,0,0,0.7);
  border:2px solid rgba(255,255,255,0.3);
  color:#fff;
  font-size:20px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all 0.3s ease;
  z-index:10;
  pointer-events:auto;
  backdrop-filter:blur(8px);
}

.zoom-btn:hover {
  background:rgba(0,0,0,0.85);
  border-color:rgba(255,255,255,0.6);
  transform:scale(1.1);
}

.zoomed-view {
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.95);
  z-index:500;
  display:none;
  overflow:hidden;
  touch-action:none;
}

.zoomed-view.active { display:block; }

.zoomed-image-container {
  width:100%;
  height:100%;
  overflow:hidden;
  cursor:grab;
  display:flex;
  align-items:center;
  justify-content:center;
  touch-action:none;
}

.zoomed-image-container:active { cursor:grabbing; }

.zoomed-image {
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  user-select:none;
  -webkit-user-drag:none;
  transform-origin:center;
  transition:transform 0.1s ease-out;
  touch-action:none;
}

.zoom-close {
  position:fixed;
  top:20px;
  right:20px;
  width:50px;
  height:50px;
  border-radius:50%;
  background:rgba(0,0,0,0.7);
  border:2px solid rgba(255,255,255,0.3);
  color:#fff;
  font-size:24px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:501;
  backdrop-filter:blur(8px);
  transition:all 0.3s ease;
}

.zoom-close:hover {
  background:rgba(0,0,0,0.9);
  border-color:rgba(255,255,255,0.6);
  transform:scale(1.1);
}

/* ----------  reduced motion  ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior:auto; }
  #ride-track { scroll-snap-type:none; }
  .panel { scroll-snap-align:none; opacity:1; transform:none; }
  .panel-image,
  .panel-title,
  .panel-caption { transition:none; opacity:1; transform:none; }
  .art { -webkit-mask-image:none; mask-image:none; }
}

/* ----------  mute button  ---------- */
#mute-btn {
  position:fixed;
  top:18px;
  right:18px;
  z-index:200;
  width:44px;
  height:44px;
  border-radius:50%;
  background:rgba(0,0,0,0.7);
  border:2px solid rgba(255,255,255,0.3);
  color:#fff;
  font-size:20px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all 0.3s ease;
  backdrop-filter:blur(8px);
  pointer-events:auto;
}

#mute-btn:hover {
  background:rgba(0,0,0,0.85);
  border-color:rgba(255,255,255,0.6);
  transform:scale(1.1);
}

#mute-btn.muted {
  opacity:0.5;
}
</style>