/* abyssheart.com: paper, the moon, and a world that rises out of the white.
   --p (0..1) is the scroll progress through #rise, --o (0..1) the fade of the opening;
   both are set by site.js. Without the script, or with reduced motion, nothing moves
   and every line is in place (the .motion class is only added when motion is wanted). */

:root {
  --paper: #f0eef0;
  --ink: #3a1c52;
  --plum: #5c1e4e;
  --dim: #7d6a8c;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--plum); }

/* the paper itself: the menu's texture and vignette, fixed behind everything */
.paper {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    url("img/paper-texture.webp") center / cover no-repeat,
    url("img/paper-vignette.webp") center / cover no-repeat;
  opacity: .9;
}

/* a vertical whisper on the right edge, as the reference sets its "share" */
.aside {
  position: fixed; right: 18px; top: 50%; z-index: 5; margin: 0;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  font: 500 11px/1 var(--sans); letter-spacing: .28em; text-transform: uppercase;
  color: var(--dim); opacity: .7;
}

/* ---- the opening ------------------------------------------------------------ */
#open {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: 8vh 6vw 14vh;
}
.open-inner {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  opacity: var(--o, 1);
  transform: translateY(calc((1 - var(--o, 1)) * -4vh));
}
.mark {
  width: clamp(110px, 13vw, 170px);
  filter: drop-shadow(0 0 36px rgba(200, 170, 230, .5));
  margin-bottom: 3vh;
}
h1 { margin: 0; line-height: 0; }
.wordmark { width: clamp(280px, 50vw, 620px); margin: 0 auto; filter: drop-shadow(0 1px 1px rgba(58, 28, 82, .28)) drop-shadow(0 6px 18px rgba(92, 30, 78, .12)); }
.tagline {
  margin: 2.4vh 0 0;
  font: italic 400 clamp(17px, 1.6vw, 22px)/1.4 var(--serif);
  letter-spacing: .02em;
  color: var(--plum);
}
.scroll-cue {
  position: absolute; left: 50%; bottom: 3vh; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font: 500 10px/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--dim);
  opacity: var(--o, 1);
}
.scroll-cue i { display: block; width: 1px; height: 64px; background: currentColor; transform-origin: top; }
.motion .scroll-cue i { animation: cue 2.4s ease-in-out infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---- the rise: still by default ----------------------------------------------- */
#rise { position: relative; }
.stage { position: relative; overflow: hidden; }
.land img { width: 100%; height: 62vh; object-fit: cover; }
.haze {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, var(--paper) 0%, rgba(240, 238, 240, 0) 22%, rgba(240, 238, 240, 0) 78%, var(--paper) 100%);
}
.fragments {
  list-style: none; margin: 0; padding: 7vh 8vw;
  display: grid; gap: 5vh; justify-items: center; text-align: center;
}
.frag {
  max-width: 22ch;
  font: italic 300 clamp(26px, 3.4vw, 50px)/1.25 var(--serif);
  color: var(--ink);
  text-wrap: balance;
}

/* ---- the rise: in motion -------------------------------------------------------- */
.motion #rise { height: 380vh; }
.motion .stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
}
.motion .land {
  position: absolute; inset: -18vh 0 0 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  opacity: var(--land, 0);
  transform: translateY(calc((1 - var(--p, 0)) * 14vh)) scale(calc(1.08 - var(--p, 0) * .08));
  will-change: transform, opacity;
}
.motion .land img { height: 100%; }
.motion .haze {
  background: var(--paper);
  opacity: calc(1 - var(--land, 0) * .82);
}
.motion .fragments { position: absolute; inset: 0; padding: 0 8vw; display: block; }
.motion .frag {
  position: absolute; left: 50%; top: 50%; width: min(90vw, 22ch);
  transform: translate(-50%, calc(-50% + (1 - var(--f, 0)) * 3vh));
  opacity: var(--f, 0);
  color: #fff;
  text-shadow: 0 2px 18px rgba(58, 28, 82, .55), 0 0 2px rgba(58, 28, 82, .4);
}

/* ---- other worlds --------------------------------------------------------------- */
#worlds {
  max-width: 980px; margin: 0 auto;
  padding: 18vh 6vw 10vh;
}
#worlds h2 {
  margin: 0; text-align: center;
  font: 500 12px/1 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--dim);
}
.worlds-lede {
  margin: 18px auto 7vh; max-width: 34ch; text-align: center;
  font: italic 400 clamp(18px, 1.7vw, 22px)/1.45 var(--serif); color: var(--ink);
}
.card {
  display: grid; grid-template-columns: minmax(160px, 240px) 1fr; gap: clamp(20px, 4vw, 48px);
  align-items: center;
  padding: clamp(18px, 3vw, 32px);
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(183, 155, 212, .45);
  border-radius: 28px;
  box-shadow: 0 20px 60px -30px rgba(58, 28, 82, .35);
}
.card img { border-radius: 18px; }
.card-game { margin: 0; font: 500 11px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }
.card h3 { margin: 12px 0 10px; font: 400 clamp(26px, 2.6vw, 34px)/1.1 var(--serif); color: var(--ink); }
.card p { margin: 0; line-height: 1.6; color: #4a3a58; }
.card .card-status, .card a.card-status {
  display: inline-block; margin-top: 18px; padding: 8px 14px;
  border: 1px solid rgba(92, 30, 78, .35); border-radius: 999px;
  font: 500 12px/1 var(--sans); letter-spacing: .08em; color: var(--plum);
}

/* ---- the close -------------------------------------------------------------------- */
footer {
  padding: 10vh 6vw 8vh; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.foot-mark { width: 180px; filter: drop-shadow(0 1px 1px rgba(58, 28, 82, .3)); }
.foot-line { margin: 4px 0 0; font: italic 400 16px/1.4 var(--serif); color: var(--plum); }
.foot-links { margin: 0; font: 500 12px/1 var(--sans); letter-spacing: .14em; color: var(--dim); display: flex; gap: 12px; }

/* ---- phones ------------------------------------------------------------------------- */
@media (max-width: 700px) {
  .aside { display: none; }
  .card { grid-template-columns: 1fr; text-align: center; }
  .card img { max-width: 220px; margin: 0 auto; }
  .motion #rise { height: 300vh; }
}

/* ---- reduced motion: nothing moves, everything is there ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  .scroll-cue i { animation: none !important; }
}

.card a.card-status { text-decoration: none; transition: background .2s, color .2s; }
.card a.card-status:hover { background: var(--plum); color: #fff; }
