/* The Understory — shared styles for every issue */

html, body { margin: 0; height: 100%; overflow: hidden; background: #140d09; }
body { font-family: "EB Garamond", Georgia, "Times New Roman", serif; color: #2b1f17; }

/* ---------- sky / background layers (fade per view) ---------- */
.sky { position: fixed; inset: 0; opacity: 0; transition: opacity 1.8s ease; pointer-events: none; z-index: 0; }
.sky.home      { background: radial-gradient(ellipse at 50% 30%, #4a2f1e 0%, #1c120c 60%, #0e0906 100%); }
.sky.floor     { background: radial-gradient(ellipse at 50% 50%, #3a2414 0%, #1a100a 70%); }
.sky.trees     { background: linear-gradient(#26324a 0%, #5b5a6a 45%, #c98a4e 80%, #7a4524 100%); }
.sky.creatures { background: linear-gradient(#120e24 0%, #2e2142 50%, #5a3352 85%, #2a1726 100%); }
body[data-view="home"] .sky.home,
body[data-view="floor"] .sky.floor,
body[data-view="trees"] .sky.trees,
body[data-view="creatures"] .sky.creatures { opacity: 1; }

/* overlay atmospherics */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 5; opacity: 0; transition: opacity 2.2s ease; overflow: hidden; }
body[data-view="floor"] .fx.falling,
body[data-view="home"] .fx.falling { opacity: .8; }
body[data-view="trees"] .fx.mist { opacity: 1; }
body[data-view="creatures"] .fx.fireflies { opacity: 1; }
#loading { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: #140d09; color: #e8cfa6; font-style: italic; font-size: 22px; transition: opacity 1.2s ease; }
#loading small { font-size: 14px; color: #9c7d5a; margin-top: 8px; font-style: normal; letter-spacing: 2px; }
#loading.done { opacity: 0; pointer-events: none; }

.fx.falling i { position: absolute; top: -40px; width: 22px; height: 22px; animation: fall linear infinite; }
@keyframes fall {
  0%   { transform: translate(0, -5vh) rotate(0deg); }
  25%  { transform: translate(40px, 25vh) rotate(90deg); }
  50%  { transform: translate(-20px, 55vh) rotate(200deg); }
  75%  { transform: translate(50px, 80vh) rotate(290deg); }
  100% { transform: translate(0, 110vh) rotate(380deg); }
}
.fx.mist b { position: absolute; width: 90vw; height: 50vh; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(225,230,240,.30), rgba(225,230,240,0) 70%);
  animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(40vw); } }
.fx.fireflies i { position: absolute; width: 5px; height: 5px; border-radius: 50%;
  width: 18px; height: 18px; background: radial-gradient(circle, #ffe9a8 0 2px, rgba(255,200,90,.55) 3px, rgba(255,200,90,0) 9px);
  animation: float 9s ease-in-out infinite alternate, blink 3s ease-in-out infinite; }
@keyframes float { from { transform: translate(0,0); } to { transform: translate(60px,-80px); } }
@keyframes blink { 0%,100% { opacity: .15; } 50% { opacity: 1; } }

/* ---------- the 3D world ---------- */
#impress { z-index: 2; }
.decor { position: absolute; transform-style: preserve-3d; backface-visibility: visible; pointer-events: none; }
.decor svg { width: 100%; height: 100%; display: block; overflow: visible; }
.decor { display: block; user-select: none; will-change: transform; transform-origin: 50% 50%; }
.step:not(.active) { pointer-events: none; }
body.hide-trees .tree, body.hide-creatures .creature { visibility: hidden; }
body.moving .fx * { animation-play-state: paused; }

.step { transition: opacity 1.2s ease; }
.step:not(.active) { opacity: .22; }
.step#home:not(.active) { opacity: 0; }

/* dream cards: paper slips */
.card { background: #f4ead6; border-radius: 3px; padding: 44px 52px 40px;
  box-shadow: 0 10px 22px rgba(0,0,0,.4);
  background-image: radial-gradient(ellipse at 20% 10%, rgba(255,255,255,.5), transparent 60%),
                    radial-gradient(ellipse at 90% 90%, rgba(170,120,60,.15), transparent 60%); }
.card h2 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 46px; margin: 0 0 4px; color: #3a2516; letter-spacing: .5px; }
.card .meta { font-style: italic; font-size: 18px; color: #8a6a4c; margin-bottom: 22px; }
.card p { font-size: 22px; line-height: 1.5; margin: 0 0 14px; }
.card p:last-child { margin-bottom: 0; }
.card.two-col .body { column-count: 2; column-gap: 46px; }
.card.two-col p { font-size: 19.5px; line-height: 1.45; }
.card .view-tag { position: absolute; top: 18px; right: 22px; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: #a68363; }

/* journal art that fades in as a substep */
.art { position: absolute; background: #efe2c6; padding: 16px 16px 12px; box-shadow: 0 8px 18px rgba(0,0,0,.4);
  transition: opacity 1.4s ease, transform 1.4s ease; }
.art figcaption { font-style: italic; font-size: 15px; color: #7d5f43; margin-top: 8px; text-align: center; }
.substep { opacity: 0; transform: translateY(24px) rotate(var(--tilt, 0deg)); }
.substep.substep-visible { opacity: 1; transform: translateY(0) rotate(var(--tilt, 0deg)); }

/* home / contents */
#home { width: 1100px; color: #f3e6cc; text-align: center; text-shadow: 0 2px 18px rgba(0,0,0,.85); }
#home .kicker { letter-spacing: 6px; text-transform: uppercase; font-size: 15px; color: #e3b77c; }
#home h1 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; font-size: 104px; margin: 6px 0 0; line-height: 1; }
#home .issue { font-style: italic; font-size: 24px; color: #e8cfa6; margin: 10px 0 34px; }
#home ol { list-style: none; padding: 0; margin: 0 auto; width: 640px; text-align: left;
  background: rgba(20,12,8,.55); border: 1px solid rgba(227,183,124,.35); border-radius: 4px; padding: 22px 34px; }
#home li { display: flex; align-items: baseline; gap: 14px; font-size: 24px; padding: 6px 0; border-bottom: 1px dotted rgba(227,183,124,.25); }
#home li:last-child { border-bottom: 0; }
#home li a { color: #f6e8cd; text-decoration: none; flex: 1; }
#home li a:hover { color: #ffc977; }
#home li .n { font-family: "Cormorant Garamond", serif; color: #e3b77c; width: 28px; }
#home li .v { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: #b8946a; }

/* ---------- floating navigation frame ---------- */
#nav { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 999px;
  background: rgba(24,15,10,.9); border: 1px solid rgba(227,183,124,.35); font-family: "EB Garamond", Georgia, serif; }
#nav button { background: none; border: 0; color: #f1e2c6; font: inherit; font-size: 18px; padding: 8px 18px; border-radius: 999px; cursor: pointer; }
#nav button:hover { background: rgba(227,183,124,.18); }
#nav .sep { width: 1px; height: 20px; background: rgba(227,183,124,.35); }
#nav .count { color: #c9a779; font-size: 15px; padding: 0 12px 0 6px; min-width: 52px; text-align: center; font-style: italic; }
#proto { position: fixed; top: 14px; left: 16px; z-index: 10; color: rgba(240,220,190,.6); font-size: 14px; font-style: italic; }
