/* Pillars of Heaven: the colours and type are the game's own (ink, paper, old gold, seal red). */
:root {
  --ink: #1a1410;
  --ink-2: #241b15;
  --paper: #efe6d2;
  --paper-dim: #c9bda3;
  --gold: #c9a24a;
  --gold-bright: #e2bf6a;
  --seal: #a8261c;
  --seal-deep: #7e1a13;
  --jade: #8fd1b8;
  --wood: #4a2c18;
  --brush: "Ma Shan Zheng", "STKaiti", "KaiTi", serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --measure: 34rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 500 1.25rem/1.6 var(--serif);
  /* a faint paper grain over the ink */
  background-image: radial-gradient(ellipse at 70% -10%, #3a1a0e55, transparent 60%), radial-gradient(ellipse at 0% 100%, #10201c66, transparent 55%);
  background-attachment: fixed;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-bright); text-underline-offset: 0.18em; }
a:hover { color: var(--paper); }
:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 3px; }

h1, h2, h3 { font-weight: 700; line-height: 1.12; margin: 0; color: var(--gold-bright); }
h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem); text-align: center; }
h3 { font-size: 1.6rem; }
.section-lede { text-align: center; max-width: var(--measure); margin: 0.6rem auto 0; color: var(--paper-dim); font-style: italic; }

/* ---------- Hero: the hanging scroll ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 25rem);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  max-width: 70rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) 1.25rem clamp(3rem, 7vw, 6rem);
}
.hero-text { position: relative; padding-left: clamp(4.5rem, 9vw, 7.5rem); }
/* the title in brush calligraphy, written top to bottom beside the English */
.brush-title {
  position: absolute; left: 0; top: -0.3rem; margin: 0;
  writing-mode: vertical-rl; text-orientation: upright;
  font: 400 clamp(4rem, 9vw, 7rem)/1 var(--brush);
  color: var(--seal);
  text-shadow: 0 0 1px #0006, 0 0 40px #a8261c40;
  letter-spacing: 0.05em;
}
.hero h1 { font-size: clamp(2.8rem, 1.6rem + 4.6vw, 5.2rem); letter-spacing: 0.01em; }
.lede { max-width: var(--measure); margin: 1.1rem 0 1.8rem; font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.45rem); }
.platforms { margin: 1.4rem 0 0; color: var(--paper-dim); font-size: 1.05rem; }

.scroll { margin: 0; position: relative; justify-self: center; width: min(100%, 25rem); }
.silk {
  background: linear-gradient(90deg, #d8c9a6, #efe3c4 12%, #efe3c4 88%, #d8c9a6);
  padding: 1.4rem 1.2rem 1.6rem;
  box-shadow: 0 30px 60px -20px #000c, inset 0 0 0 1px #8a6a3a55;
  overflow: hidden;
  transform-origin: top;
}
.silk img { border: 1px solid #5a3f24; box-shadow: 0 0 0 4px #e8dab8, 0 0 0 5px #8a6a3a; aspect-ratio: 9 / 16; object-fit: cover; width: 100%; }
.roller {
  display: block; height: 1.15rem; margin: 0 -1.3rem; border-radius: 0.6rem; position: relative; z-index: 1;
  background: linear-gradient(180deg, #7a4a28, #4a2c18 55%, #2d1a0e);
  box-shadow: 0 4px 10px #0009;
}
.roller::before, .roller::after {   /* the turned ends of the rod */
  content: ""; position: absolute; top: -0.2rem; width: 1.2rem; height: 1.55rem; border-radius: 0.5rem;
  background: linear-gradient(180deg, var(--gold-bright), #8a6a2a);
}
.roller::before { left: -0.6rem; }
.roller::after { right: -0.6rem; }
.roller-top::after { box-shadow: none; }

/* the scroll unrolls once when the page opens */
@media (prefers-reduced-motion: no-preference) {
  .silk { animation: unroll 1.6s cubic-bezier(.2, .7, .2, 1) 0.2s both; }
  .roller-bottom { animation: drop 1.6s cubic-bezier(.2, .7, .2, 1) 0.2s both; }
  .brush-title { animation: ink-in 1.4s ease-out 0.9s both; }
}
@keyframes unroll { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes drop { from { transform: translateY(calc(-1 * var(--drop, 38rem))); } to { transform: none; } }
@keyframes ink-in { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: none; } }

/* ---------- Sign-up ---------- */

.signup { display: flex; flex-wrap: wrap; gap: 0.6rem; max-width: 32rem; }
.field { flex: 1 1 15rem; display: flex; flex-direction: column; }
.field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.signup input[type=email] {
  font: 500 1.2rem var(--serif); color: var(--paper);
  background: #120d0a; border: 1px solid #6b5428; border-radius: 4px;
  padding: 0.8rem 1rem; min-height: 3.2rem;
}
.signup input[type=email]::placeholder { color: #8a7d68; }
.signup input[type=email]:focus { border-color: var(--gold-bright); outline: none; box-shadow: 0 0 0 3px #e2bf6a40; }
.signup button {
  font: 700 1.2rem var(--serif); color: #fff3d6; cursor: pointer;
  background: var(--seal); border: 1px solid #d9544a; border-radius: 4px;
  padding: 0.75rem 1.4rem; min-height: 3.2rem;
  box-shadow: inset 0 0 0 3px var(--seal), inset 0 0 0 4px #f3d27a66;   /* the double line of a seal stamp */
}
.signup button:hover { background: #bd2f23; }
.signup button:disabled { opacity: 0.6; cursor: progress; }
.consent { flex-basis: 100%; margin: 0.2rem 0 0; font-size: 1rem; color: var(--paper-dim); }
.status { flex-basis: 100%; margin: 0; min-height: 1.6em; font-weight: 600; }
.signup.ok .status { color: var(--jade); }
.signup.bad .status { color: #f2a08f; }
.signup.bad input[type=email] { border-color: #e4664f; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- The story, panel by panel ---------- */

main > section { padding: clamp(3.5rem, 8vw, 6rem) 1.25rem; }
.story { background: linear-gradient(180deg, transparent, #120d0a 12%, #120d0a 88%, transparent); }
.panels {
  list-style: none; margin: 2.5rem auto 0; padding: 0;
  max-width: 70rem;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.2rem 1.6rem;
  counter-reset: panel;
}
.panels li { counter-increment: panel; }
.panels img { border: 2px solid #0a0705; box-shadow: 0 0 0 1px #6b5428, 0 18px 40px -18px #000; aspect-ratio: 1; object-fit: cover; width: 100%; }
.panels p { margin: 0.9rem 0 0; font-style: italic; font-size: 1.2rem; max-width: 26rem; }
.panels p::before { content: counter(panel, cjk-ideographic); font: normal 400 1.35rem var(--brush); color: var(--gold); margin-right: 0.55rem; }

/* ---------- Four pillars ---------- */

.pillar-row {
  max-width: 70rem; margin: 3rem auto 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem;
}
.pillar {
  position: relative; text-align: center; padding: 1.6rem 1.2rem 2rem;
  border-left: 1px solid #6b542888; border-right: 1px solid #6b542888;
  background: linear-gradient(180deg, #2a1f17, var(--ink-2) 40%, #1d1611);
}
/* capital and base: a heavier band at the top and bottom of each column */
.pillar::before, .pillar::after { content: ""; position: absolute; left: -0.5rem; right: -0.5rem; height: 0.5rem; background: linear-gradient(180deg, #8a6a2a, var(--gold) 50%, #6b5428); border-radius: 2px; }
.pillar::before { top: 0; }
.pillar::after { bottom: 0; }
.pillar img { width: 100%; max-width: 12rem; aspect-ratio: 1; object-fit: contain; margin: 0 auto 0.6rem; filter: drop-shadow(0 14px 18px #000a); }
.pillar .glyph { font: 400 2.6rem/1 var(--brush); color: var(--seal); margin: 0 0 0.4rem; }
.pillar h3 { margin-bottom: 0.6rem; }
.pillar p:not(.glyph) { margin: 0; font-size: 1.15rem; color: var(--paper-dim); }
.seal {
  width: 9rem; height: 9rem; margin: 1.5rem auto 1.6rem; display: grid; place-items: center;
  font: 400 5.4rem/1 var(--brush); color: #fff3d6;
  background: var(--seal); border-radius: 0.6rem; transform: rotate(-4deg);
  box-shadow: inset 0 0 0 0.35rem var(--seal), inset 0 0 0 0.45rem #f3d27a99, 0 14px 24px -10px #000;
}

/* ---------- Bestiary ---------- */

.beasts {
  list-style: none; margin: 2.6rem auto 0; padding: 0.5rem 0.25rem 1.4rem;
  max-width: 76rem;
  display: flex; gap: 1.2rem; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-color: var(--gold) transparent;
}
.beasts li { flex: 0 0 10.5rem; scroll-snap-align: start; text-align: center; }
.beasts img { width: 10.5rem; height: 10.5rem; object-fit: contain; filter: drop-shadow(0 12px 14px #000b); margin-bottom: 0.4rem; }
.beasts .lv { display: block; font-size: 1rem; color: var(--paper-dim); }
.beasts b { display: block; font-size: 1.2rem; line-height: 1.2; color: var(--paper); }
.beasts .boss b { color: var(--gold-bright); }
.beasts .boss img { filter: drop-shadow(0 0 18px #ff6a3a55) drop-shadow(0 12px 14px #000b); }

/* ---------- Last call ---------- */

.last-call {
  position: relative; text-align: center;
  background: linear-gradient(180deg, var(--ink) 0%, #1a1410cc 30%, #1a1410e6 100%), url(img/vow.webp) center 30% / cover no-repeat;
}
.last-inner { max-width: 40rem; margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) 0; }
.last-inner > p { margin: 1rem auto 1.8rem; max-width: var(--measure); }
.last-call .signup { margin: 0 auto; justify-content: center; text-align: left; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; max-width: 70rem; margin: 0 auto; padding: 2rem 1.25rem 2.5rem; color: var(--paper-dim); font-size: 1rem; border-top: 1px solid #6b542855; }
.foot p { margin: 0; }

/* ---------- Narrower screens ---------- */

@media (max-width: 60rem) {
  .pillar-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.4rem; }
  .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 46rem) {
  .hero { grid-template-columns: 1fr; }
  .hero { padding-top: 1.6rem; gap: 1.6rem; }
  /* on a phone the scroll is smaller, so the title and sign-up still show on the first screen */
  .scroll { order: -1; width: min(52%, 13rem); --drop: 22rem; }
  .silk { padding: 0.8rem 0.7rem 0.9rem; }
  .roller { height: 0.8rem; margin: 0 -0.8rem; }
  .roller::before, .roller::after { width: 0.8rem; height: 1.1rem; top: -0.15rem; }
  .hero-text { padding-left: 0; }
  .hero h1 { padding-left: 3.9rem; min-height: 6.6rem; display: flex; align-items: center; }
  .brush-title { font-size: 3.2rem; }
  .lede { margin-top: 0.9rem; }
  .platforms { margin-top: 0.4rem; }
  .panels { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 1rem; margin-left: -1.25rem; margin-right: -1.25rem; padding: 0 1.25rem 1rem; }
  .panels li { flex: 0 0 82%; scroll-snap-align: center; }
}
@media (max-width: 34rem) {
  .pillar-row { grid-template-columns: 1fr; }
  .signup button { flex: 1 1 100%; }
}
