/* ---------- Base ---------- */
:root {
  --bg: #070707;
  --fg: #f2f2f2;
  --muted: #8a8a8a;
  --accent-1: #ff4d6d;
  --accent-2: #c9184a;
  --accent-3: #6a040f;
  --accent-grad: linear-gradient(135deg, #ff4d6d, #c9184a, #6a040f);
  --serif: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Flat near-black. Radial glows cause heavy color banding on phone screens,
   so the warmth comes only from the accent elements (title, divider, button). */
body {
  position: relative;
  background: var(--bg);
  opacity: 0;
  animation: fadeIn 1.6s ease-out forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Layout ---------- */
.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem;
}

.frame {
  width: 100%;
  max-width: 620px;
  text-align: center;
}

.chapter-frame {
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: 6rem 1.5rem 6rem;
}

/* ---------- Type ---------- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.005em;
  margin: 0;
}

/* Title gets the gradient via background-clip:text. Italic serif feels
   handwritten / intimate rather than editorial. */
.title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 4rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin-bottom: 3rem;
  background: var(--accent-grad);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}

.rules {
  color: var(--fg);
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.9;
  margin: 0 auto 3rem;
  max-width: 30rem;
  letter-spacing: 0.01em;
}
.rules p { margin: 0 0 1.25rem; }
.rules p:last-child {
  margin-bottom: 0;
  font-style: italic;
  color: #d8d8d8;
}

/* The emphasis block is the heart of the page — set in italic serif, more air,
   each line styled like a stanza. */
.emphasis {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.25rem, 2.6vw, 1.5rem);
  line-height: 1.85;
  margin: 3.5rem auto;
  max-width: 33rem;
  color: #ececec;
  letter-spacing: 0.005em;
}
.emphasis p { margin: 0 0 1.6rem; }
.emphasis p:last-child {
  margin-bottom: 0;
  /* gradient on the closing line lands the punch */
  background: var(--accent-grad);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  font-weight: 500;
}

.footnote {
  margin-top: 4.5rem;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

/* ---------- Divider ---------- */
/* Ornate divider: gradient line on each side of a small gradient diamond.
   Built with a single <hr> styled via a flex wrapper — but since hr is solo,
   we use ::before and ::after on a span container instead. We render the
   ornament with a CSS-only approach: the hr keeps its gradient line, and we
   stamp a diamond on top via a wrapper class. */
.divider {
  position: relative;
  height: 1px;
  border: 0;
  margin: 3rem auto;
  width: 75%;
  max-width: 24rem;
  background: linear-gradient(90deg,
    rgba(255,77,109,0) 0%,
    rgba(255,77,109,0.6) 30%,
    rgba(201,24,74,0.9) 50%,
    rgba(255,77,109,0.6) 70%,
    rgba(255,77,109,0) 100%);
  overflow: visible;
}
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--accent-grad);
}

/* ---------- Button ---------- */
/* Gradient-bordered pill with a soft idle glow that gently breathes,
   so the button feels alive and inviting rather than static. */
.btn {
  display: inline-block;
  position: relative;
  margin-top: 2.5rem;
  padding: 1.05rem 2.6rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(#0a0a0a, #0a0a0a) padding-box,
    var(--accent-grad) border-box;
  transition:
    background 0.6s ease,
    color 0.4s ease,
    transform 0.3s ease,
    letter-spacing 0.5s ease;
}
.btn:hover,
.btn:focus-visible {
  background:
    linear-gradient(rgba(7,7,7,0), rgba(7,7,7,0)) padding-box,
    var(--accent-grad) border-box;
  color: #fff;
  transform: translateY(-1px);
  letter-spacing: 0.26em;
  outline: none;
}
/* On touch devices, hover doesn't fire — give the resting button the filled
   look so it still feels alive without relying on glow. */
@media (hover: none) {
  .btn {
    background:
      linear-gradient(rgba(10,10,10,0.55), rgba(10,10,10,0.55)) padding-box,
      var(--accent-grad) border-box;
  }
}

/* ---------- Chapter page ---------- */
.chapter-eyebrow {
  text-align: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.chapter-title {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.2rem, 5.5vw, 3.2rem);
  line-height: 1.15;
  margin-bottom: 4rem;
  background: var(--accent-grad);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}

.chapter-body {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.85;
  text-align: left;
  color: #ececec;
}
.chapter-body p {
  margin: 0 0 1.5rem;
  text-indent: 0;
}
/* Drop cap on the first paragraph — feels like a real novel. */
.chapter-body p:first-of-type::first-letter {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 3.6rem;
  line-height: 0.85;
  float: left;
  margin-top: -0.4rem;
  padding: 0.2rem 0.6rem 0 0;
  background: var(--accent-grad);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}

.chapter-end {
  margin-top: 5rem;
  text-align: center;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

/* Locked future-chapter sentinel. Shimmering metallic — looks alive, but
   on hover/tap reveals a teasing message instead of opening anything. */
.locked-wrap {
  margin-top: 2.75rem;
  text-align: center;
  cursor: pointer;
  user-select: none;
}
.locked {
  display: inline-block;
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  background: linear-gradient(
    90deg,
    #6a040f 0%,
    #c9184a 20%,
    #ff4d6d 40%,
    #ffb3c1 50%,
    #ff4d6d 60%,
    #c9184a 80%,
    #6a040f 100%
  );
  background-size: 250% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  animation: shimmer 5s linear infinite;
  transition: opacity 0.4s ease;
}
.locked::before { content: "✦  "; }
.locked::after  { content: "  ✦"; }

@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.locked-msg {
  margin: 0.7rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: #9a9a9a;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.locked-wrap:hover .locked,
.locked-wrap.show .locked {
  opacity: 0.55;
}
.locked-wrap:hover .locked-msg,
.locked-wrap.show .locked-msg {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .locked { animation: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  html, body { font-size: 16px; }
  .stage { padding: 3rem 1.1rem; }
  .frame { max-width: 100%; }
  .chapter-frame { padding: 3.5rem 1.1rem 4rem; max-width: 100%; }
  .title { margin-bottom: 2rem; }
  .rules { font-size: 1.1rem; line-height: 1.8; max-width: 100%; }
  .emphasis { font-size: 1.15rem; line-height: 1.75; margin: 2.5rem auto; max-width: 100%; }
  .divider { width: 65%; margin: 2.25rem auto; }
  .btn {
    margin-top: 2rem;
    padding: 0.95rem 2rem;
    font-size: 0.85rem;
    letter-spacing: 0.18em;
  }
  .footnote { margin-top: 3rem; font-size: 0.9rem; }
  .chapter-title { margin-bottom: 2.75rem; }
  .chapter-body { font-size: 1.08rem; line-height: 1.8; }
  .chapter-body p:first-of-type::first-letter {
    font-size: 2.8rem;
    margin-top: -0.3rem;
    padding: 0.2rem 0.45rem 0 0;
  }
  .chapter-end { margin-top: 3.5rem; }
}

@media (max-width: 360px) {
  .stage { padding: 2.5rem 0.9rem; }
  .chapter-frame { padding: 3rem 0.9rem 3.5rem; }
  .rules { font-size: 1.05rem; }
  .emphasis { font-size: 1.08rem; }
  .btn { padding: 0.9rem 1.6rem; letter-spacing: 0.14em; }
}

/* Respect reduced-motion users: no breathing button, no fade. */
@media (prefers-reduced-motion: reduce) {
  body { animation: none; opacity: 1; }
  .btn { animation: none; }
}
