/* ==========================================================================
   Kali A. Larsson — first chapter reader
   Long-form reading page. Everything here serves legibility.
   ========================================================================== */

:root {
  --ink:      #0c0a12;
  --deep:     #16101f;
  --card:     #1e172b;
  --border:   rgba(200, 170, 120, 0.16);
  --gold:     #c8aa78;
  --gold-dim: rgba(200, 170, 120, 0.5);
  --rose:     #c47a7a;
  --violet:   #a37fc4;
  --violet-glow: rgba(132, 88, 176, 0.22);
  --text:     #e8e0d4;
  --muted:    rgba(232, 224, 212, 0.55);
  --serif:    'Cormorant Garamond', Georgia, serif;
  --sans:     'Raleway', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  /* soft purple bloom at the top of the read, fading out as you go down */
  background:
    radial-gradient(ellipse 120% 60% at 50% 0%, rgba(132, 88, 176, 0.22), transparent 62%),
    var(--ink);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* --------------------------------------------------------------------------
   Reading progress
   -------------------------------------------------------------------------- */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--gold);
  z-index: 200;
  transition: width 0.1s linear;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.reader-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 13, 26, 0.93);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.reader-nav {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.back-link {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s ease;
}

.back-link:hover { color: var(--gold); }

.lang-switch { display: flex; align-items: center; gap: 8px; }

.lang-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 6px 4px;
  cursor: pointer;
  transition: color 0.25s ease;
}

.lang-btn.active,
.lang-btn:hover { color: var(--gold); }

.lang-divider { color: var(--gold-dim); font-size: 0.78rem; }

/* --------------------------------------------------------------------------
   Chapter
   -------------------------------------------------------------------------- */

.reader {
  max-width: 660px;
  margin: 0 auto;
  padding: 70px 26px 40px;
}

.notice {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
  text-align: center;
  margin-bottom: 54px;
}

.chapter[hidden] { display: none; }

.chapter-num {
  font-family: var(--serif);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  margin-bottom: 18px;
}

.chapter-name {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 300;
  line-height: 1.1;
  text-align: center;
  margin-bottom: 12px;
}

.chapter-sub {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 300;
  color: var(--muted);
  text-align: center;
  margin-bottom: 56px;
}

/* Body prose: serif, generous, ~62 characters a line */
.chapter p {
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 400;
  line-height: 1.8;
  color: rgba(232, 224, 212, 0.9);
  margin-bottom: 1.15em;
}

/* first line of the chapter gets a raised cap */
.chapter > p:first-of-type::first-letter {
  float: left;
  font-size: 3.6em;
  line-height: 0.82;
  padding: 0.08em 0.1em 0 0;
  color: var(--gold);
}

.chapter-image {
  display: block;
  width: 120px;
  height: auto;
  margin: 52px auto;
  opacity: 0.4;
}

/* Scene break headings inside the chapter (Saturday morning, etc.) */
.chapter h3:not(.chapter-sub) {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  font-style: italic;
  color: var(--gold);
  text-align: center;
  margin: 48px 0 32px;
}

/* --------------------------------------------------------------------------
   Message-thread passages (the dating-app exchange)
   -------------------------------------------------------------------------- */

.dialog-grid {
  margin: 0 0 16px;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--gold-dim);
}

.dialog-name {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.dialog-text,
.dialog-text1,
.dialog-text2 {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.7;
  color: rgba(232, 224, 212, 0.86);
}

/* second speaker sits opposite, so a long exchange stays readable */
.dialog-grid:has(.dialog-text2) {
  border-left: none;
  border-right: 2px solid var(--rose);
  margin-left: 32px;
}

.dialog-grid:has(.dialog-text2) .dialog-name { color: var(--rose); }

/* --------------------------------------------------------------------------
   End of chapter
   -------------------------------------------------------------------------- */

.chapter-end {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 26px 100px;
  text-align: center;
}

.end-rule {
  width: 60px;
  height: 1px;
  background: var(--gold-dim);
  margin: 0 auto 40px;
}

.end-title {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 14px;
}

.end-text {
  color: var(--muted);
  margin: 0 auto 34px;
  max-width: 46ch;
}

.end-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 16px 32px;
  border: 1px solid var(--gold-dim);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.btn-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.btn-primary:hover { background: transparent; color: var(--gold); }

.btn-ghost { color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* --------------------------------------------------------------------------
   Newsletter offer, after the chapter
   -------------------------------------------------------------------------- */

.end-offer {
  margin-top: 64px;
  padding: 40px 34px;
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse 110% 80% at 50% 0%, rgba(132, 88, 176, 0.16), transparent 70%),
    var(--card);
}

.offer-label {
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.offer-title {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 300;
  margin-bottom: 12px;
}

.offer-text {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 46ch;
  margin: 0 auto 26px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.reader-footer {
  border-top: 1px solid var(--border);
  padding: 30px 26px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .reader { padding: 46px 22px 30px; }

  .chapter p { font-size: 1.2rem; line-height: 1.75; }

  .dialog-grid { padding: 16px 16px; }

  .dialog-grid:has(.dialog-text2) { margin-left: 14px; }

  .notice { margin-bottom: 38px; }

  .chapter-sub { margin-bottom: 38px; }
}
