:root {
  --paper: #f4f0e8;
  --paper-soft: #ebe5da;
  --ink: #282724;
  --muted: #777168;
  --line: rgba(40, 39, 36, 0.14);
  --panel: rgba(255, 253, 248, 0.78);
  --header: rgba(244, 240, 232, 0.86);
  --accent: #7771a8;
  --accent-soft: #d9d2ef;
  --accent-deep: #514c79;
  --reader-size: 19px;
  --header-height: 74px;
  color-scheme: light;
  font-synthesis: none;
}

body[data-season="spring"] {
  --accent: #7d9c70;
  --accent-soft: #d9e6cf;
  --accent-deep: #4d6845;
}

body[data-season="summer"] {
  --accent: #cb8d45;
  --accent-soft: #f1d8aa;
  --accent-deep: #8c5a24;
}

body[data-season="autumn"] {
  --accent: #a85d3e;
  --accent-soft: #e8c2ad;
  --accent-deep: #753821;
}

body[data-season="winter"] {
  --accent: #668ba4;
  --accent-soft: #cbdce6;
  --accent-deep: #3d6077;
}

body[data-season="epilogue"] {
  --accent: #756b90;
  --accent-soft: #d7d0e3;
  --accent-deep: #4f4668;
}

body[data-theme="dark"] {
  --paper: #171817;
  --paper-soft: #20221f;
  --ink: #ece8df;
  --muted: #aaa59b;
  --line: rgba(236, 232, 223, 0.14);
  --panel: rgba(29, 31, 29, 0.82);
  --header: rgba(23, 24, 23, 0.88);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 18%, color-mix(in srgb, var(--accent-soft) 42%, transparent), transparent 30rem),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background-color 280ms ease, color 280ms ease;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: 3px;
  background: transparent;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 80ms linear, background-color 280ms ease;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--header);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transform: rotate(45deg);
}

.brand-mark i {
  display: block;
  border-radius: 100% 0 100% 0;
}

.brand-mark i:nth-child(1) { background: #9cb88e; }
.brand-mark i:nth-child(2) { background: #e4b45f; transform: rotate(90deg); }
.brand-mark i:nth-child(3) { background: #b46d4b; transform: rotate(-90deg); }
.brand-mark i:nth-child(4) { background: #7da4b8; transform: rotate(180deg); }

.brand-copy {
  display: grid;
  line-height: 1.05;
}

.brand-copy strong {
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  font-weight: 500;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.header-actions,
.toc-trigger,
.language-switch,
.icon-button {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 12px;
}

.toc-trigger,
.icon-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.toc-trigger {
  display: none;
  gap: 9px;
  padding: 8px;
  font-size: 13px;
  font-weight: 650;
}

.menu-icon {
  width: 19px;
  display: grid;
  gap: 5px;
}

.menu-icon i {
  height: 1px;
  display: block;
  background: currentColor;
}

.menu-icon i:last-child {
  width: 70%;
}

.language-switch {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-soft) 70%, transparent);
}

.language-switch button {
  min-width: 39px;
  padding: 7px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.language-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 3px 10px rgba(20, 20, 20, 0.12);
}

.icon-button {
  width: 38px;
  height: 38px;
  justify-content: center;
  border-radius: 50%;
}

.icon-button:hover {
  background: var(--paper-soft);
}

.icon-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.moon-icon,
body[data-theme="dark"] .sun-icon {
  display: none;
}

body[data-theme="dark"] .moon-icon {
  display: block;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: var(--header-height) auto 0 0;
  width: 294px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(18px);
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 29px 27px 17px;
}

.sidebar-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.sidebar-close {
  display: none;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: "Times New Roman", Times, serif;
  font-size: 27px;
  font-weight: 300;
}

.chapter-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 15px 20px;
}

.chapter-link {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 10px;
  padding: 13px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.chapter-link:hover {
  background: var(--paper-soft);
}

.chapter-link[aria-current="page"] {
  background: color-mix(in srgb, var(--accent-soft) 58%, transparent);
}

.chapter-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  bottom: 15px;
  width: 3px;
  border-radius: 4px;
  background: var(--accent);
}

.chapter-link > span:first-child {
  color: var(--muted);
  font-family: "Times New Roman", Times, serif;
  font-size: 12px;
  font-style: italic;
}

.chapter-link-copy {
  display: grid;
  gap: 3px;
}

.chapter-link-copy small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chapter-link-copy strong {
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  font-weight: 500;
}

.sidebar-tools {
  display: grid;
  gap: 12px;
  padding: 17px 20px 21px;
  border-top: 1px solid var(--line);
}

.font-control,
.pdf-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.font-control > span,
.pdf-link {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.font-control > div {
  display: flex;
  gap: 5px;
}

.font-control button {
  min-width: 33px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-family: "Times New Roman", Times, serif;
}

.font-control button:hover {
  background: var(--paper-soft);
}

.pdf-link {
  justify-content: flex-start;
  gap: 9px;
  padding: 9px 0 2px;
  color: inherit;
  text-decoration: none;
}

.pdf-link svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.main-content {
  min-height: 100vh;
  margin-left: 294px;
  padding-top: var(--header-height);
}

.story-home {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 78px 42px 110px;
}

.story-home::before {
  content: "";
  position: absolute;
  inset: 7% 7%;
  border: 1px solid var(--line);
  pointer-events: none;
}

.story-home::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8%;
  bottom: 8%;
  width: 1px;
  background: linear-gradient(transparent, var(--line), transparent);
  pointer-events: none;
}

.home-copy {
  position: relative;
  z-index: 3;
  width: min(720px, 100%);
  text-align: center;
}

.overline {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.home-copy h1 {
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(66px, 9vw, 138px);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.78;
}

.home-copy h1 em {
  display: block;
  margin-top: 0.22em;
  color: var(--accent-deep);
  font-weight: 400;
}

.author-line {
  margin: 32px 0 0;
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  font-style: italic;
}

.tagline {
  width: min(510px, 100%);
  margin: 24px auto 0;
  color: var(--muted);
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.65;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: 32px;
  padding: 14px 20px 14px 23px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(25, 24, 22, 0.16);
}

.primary-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.season-index {
  position: absolute;
  z-index: 3;
  right: 4%;
  bottom: 34px;
  left: 4%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-family: "Times New Roman", Times, serif;
  font-size: 10px;
  font-style: italic;
}

.season-index i {
  width: 24px;
  height: 1px;
  background: var(--line);
}

.season-orbit {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: min(66vw, 780px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  opacity: 0.8;
  pointer-events: none;
}

.orbit-line {
  position: absolute;
  inset: 8%;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.orbit-two {
  inset: 19%;
  border-style: dashed;
  opacity: 0.65;
}

.season-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50% 0 50% 50%;
  box-shadow: 0 0 0 7px color-mix(in srgb, currentColor 12%, transparent);
}

.dot-spring { left: 8%; top: 44%; color: #8aa77d; background: currentColor; transform: rotate(42deg); }
.dot-summer { right: 18%; top: 14%; color: #dda44d; background: currentColor; transform: rotate(118deg); }
.dot-autumn { right: 7%; bottom: 35%; color: #b96846; background: currentColor; transform: rotate(195deg); }
.dot-winter { left: 28%; bottom: 10%; color: #7da3b8; background: currentColor; transform: rotate(282deg); }

.reader {
  width: min(820px, calc(100% - 70px));
  margin: 0 auto;
  padding: clamp(64px, 8vw, 104px) 0 100px;
}

.chapter-header {
  position: relative;
  padding: 18px 0 55px;
  text-align: center;
}

.chapter-number {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: -22px;
  color: color-mix(in srgb, var(--accent-soft) 62%, transparent);
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(110px, 18vw, 180px);
  font-style: italic;
  line-height: 1;
  transform: translateX(-50%);
  user-select: none;
}

.chapter-eyebrow {
  margin: 0 0 11px;
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.chapter-header h1 {
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(44px, 7vw, 78px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.chapter-ornament {
  position: relative;
  width: 90px;
  height: 15px;
  display: block;
  margin: 28px auto 0;
}

.chapter-ornament::before,
.chapter-ornament::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 35px;
  height: 1px;
  background: var(--line);
}

.chapter-ornament::before { left: 0; }
.chapter-ornament::after { right: 0; }

.chapter-ornament i {
  position: absolute;
  left: 50%;
  top: 3px;
  width: 9px;
  height: 9px;
  border: 1px solid var(--accent);
  border-radius: 50% 0 50% 50%;
  transform: translateX(-50%) rotate(45deg);
}

.story-text {
  font-family: "Times New Roman", Times, serif;
  font-size: var(--reader-size);
  line-height: 1.88;
  letter-spacing: 0.006em;
}

.story-text p {
  margin: 0 0 1.16em;
  text-wrap: pretty;
}

.story-text p:first-child::first-letter {
  float: left;
  margin: 0.09em 0.1em 0 0;
  color: var(--accent-deep);
  font-size: 4.1em;
  line-height: 0.72;
}

.story-text p.scene-break {
  margin: 2.4em 0;
  color: var(--accent);
  font-size: 0;
  text-align: center;
}

.story-text p.scene-break::after {
  content: "◆  ◇  ◆";
  font-size: 11px;
  letter-spacing: 0.7em;
}

.story-text p.scene-caption {
  margin: 3.1em 0;
  color: var(--accent-deep);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68em;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
}

.story-text p.scene-caption::before,
.story-text p.scene-caption::after {
  content: "";
  width: 30px;
  height: 1px;
  display: inline-block;
  margin: 0 13px 0.25em;
  background: var(--line);
}

.reader-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 76px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.chapter-nav-button {
  min-height: 84px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
}

.chapter-nav-button:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 26%, var(--panel));
}

.chapter-nav-button.next {
  justify-content: flex-end;
  text-align: right;
}

.chapter-nav-button svg {
  width: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--accent-deep);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.chapter-nav-button span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.chapter-nav-button small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.chapter-nav-button strong {
  overflow: hidden;
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-toc,
.drawer-overlay {
  display: none;
}

@media (max-width: 900px) {
  .site-header {
    padding: 0 18px;
  }

  .toc-trigger {
    display: flex;
  }

  .sidebar {
    z-index: 80;
    top: 0;
    width: min(340px, 88vw);
    transform: translateX(-102%);
    transition: transform 240ms ease;
  }

  .sidebar-heading {
    padding-top: 27px;
  }

  .sidebar-close {
    display: block;
  }

  body.drawer-open {
    overflow: hidden;
  }

  body.drawer-open .sidebar {
    transform: translateX(0);
  }

  .drawer-overlay {
    position: fixed;
    z-index: 70;
    inset: 0;
    display: block;
    background: rgba(15, 15, 14, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }

  body.drawer-open .drawer-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-toc {
    position: fixed;
    z-index: 40;
    right: 18px;
    bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1px solid color-mix(in srgb, var(--ink) 78%, transparent);
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    box-shadow: 0 10px 28px rgba(20, 20, 18, 0.22);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }
}

@media (max-width: 620px) {
  :root {
    --header-height: 66px;
    --reader-size: 18px;
  }

  .site-header {
    padding: 0 13px;
  }

  .brand-copy small,
  .toc-trigger span:last-child {
    display: none;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .header-actions {
    gap: 5px;
  }

  .toc-trigger {
    padding: 7px 5px;
  }

  .language-switch button {
    min-width: 34px;
    padding: 6px 8px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
  }

  .story-home {
    min-height: calc(100svh - var(--header-height));
    padding: 60px 25px 90px;
  }

  .story-home::before {
    inset: 20px 14px;
  }

  .story-home::after {
    display: none;
  }

  .home-copy h1 {
    font-size: clamp(61px, 23vw, 94px);
    line-height: 0.83;
  }

  .overline {
    margin-bottom: 18px;
  }

  .author-line {
    margin-top: 25px;
  }

  .tagline {
    margin-top: 18px;
    font-size: 15px;
  }

  .primary-button {
    margin-top: 25px;
  }

  .season-orbit {
    width: 128vw;
  }

  .season-index {
    gap: 7px;
    bottom: 30px;
    font-size: 8px;
  }

  .season-index i {
    width: 8px;
  }

  .reader {
    width: calc(100% - 38px);
    padding-top: 57px;
  }

  .chapter-header {
    padding-bottom: 42px;
  }

  .chapter-number {
    top: -10px;
    font-size: 112px;
  }

  .chapter-header h1 {
    font-size: clamp(42px, 14vw, 60px);
  }

  .story-text {
    line-height: 1.78;
  }

  .story-text p {
    margin-bottom: 1.12em;
  }

  .reader-navigation {
    grid-template-columns: 1fr;
    margin-top: 56px;
  }

  .chapter-nav-button.next {
    grid-row: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .sidebar,
  .mobile-toc,
  .reader-navigation,
  .reading-progress {
    display: none !important;
  }

  .main-content {
    margin: 0;
    padding: 0;
  }

  .reader {
    width: 100%;
    padding: 0;
  }
}

/* Paywall edition */
.account-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
}

.account-button:hover {
  background: var(--paper-soft);
}

.account-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.account-button.is-signed-in {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 35%, transparent);
}

.chapter-link.is-locked .chapter-link-copy strong {
  color: var(--muted);
}

.chapter-lock {
  position: absolute;
  right: 11px;
  top: 50%;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  color: var(--muted);
}

.chapter-lock svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.unlock-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-soft) 25%, transparent);
}

.unlock-card.is-unlocked {
  border-color: color-mix(in srgb, #4f9b68 45%, var(--line));
  background: color-mix(in srgb, #9bc9a9 20%, transparent);
}

.tiny-lock {
  color: var(--accent-deep);
  font-size: 17px;
}

.unlock-card > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.unlock-card small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.unlock-card strong {
  font-family: "Times New Roman", Times, serif;
  font-size: 17px;
}

.unlock-card button {
  padding: 7px 9px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-top: 32px;
}

.home-actions .primary-button {
  margin-top: 0;
}

.purchase-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  padding: 9px 19px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms ease, transform 180ms ease;
}

.purchase-button:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.purchase-button span {
  display: grid;
  gap: 2px;
}

.purchase-button small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.purchase-button strong {
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  font-weight: 600;
}

.story-loading {
  padding: 80px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
}

.modal-backdrop {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 22px;
  background: rgba(20, 20, 19, 0.64);
  backdrop-filter: blur(9px);
}

body.modal-open {
  overflow: hidden;
}

.paywall-modal,
.auth-modal {
  position: relative;
  width: min(510px, 100%);
  padding: 44px clamp(25px, 6vw, 48px) 35px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 80% 0%, color-mix(in srgb, var(--accent-soft) 52%, transparent), transparent 18rem),
    var(--paper);
  box-shadow: 0 28px 90px rgba(8, 8, 8, 0.3);
  color: var(--ink);
  text-align: center;
}

.auth-modal {
  width: min(460px, 100%);
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 13px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: "Times New Roman", Times, serif;
  font-size: 26px;
}

.modal-close:hover {
  background: var(--paper-soft);
}

.modal-lock {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 17px;
  border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--line));
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-soft) 45%, transparent);
  color: var(--accent-deep);
}

.modal-lock svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.modal-overline {
  margin: 0 0 9px;
  color: var(--accent-deep);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.paywall-modal h2,
.auth-modal h2 {
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(31px, 7vw, 43px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.modal-description,
.auth-modal > p:not(.modal-overline) {
  margin: 17px 0 0;
  color: var(--muted);
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.55;
}

.paywall-modal ul {
  width: min(330px, 100%);
  display: grid;
  gap: 10px;
  margin: 24px auto 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.paywall-modal li {
  position: relative;
  padding-left: 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.paywall-modal li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-deep);
  font-weight: 900;
}

.modal-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 25px 0 18px;
}

.modal-price strong {
  font-family: "Times New Roman", Times, serif;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.modal-price span {
  color: var(--muted);
  font-size: 10px;
}

.modal-buy-button,
.auth-modal form button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.modal-buy-button:disabled,
.auth-modal form button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.modal-login-link,
.sign-out-button {
  margin-top: 13px;
  padding: 5px;
  border: 0;
  background: transparent;
  color: var(--accent-deep);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.payment-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.auth-modal form {
  display: grid;
  gap: 10px;
  margin-top: 25px;
  text-align: left;
}

.auth-modal label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.auth-modal input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

.auth-modal input:focus {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent-soft) 55%, transparent);
}

.toast {
  position: fixed;
  z-index: 150;
  left: 50%;
  bottom: 24px;
  max-width: min(430px, calc(100% - 30px));
  padding: 12px 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 12px 35px rgba(10, 10, 10, 0.22);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  transform: translateX(-50%);
}

@media (max-width: 900px) {
  .account-button span {
    display: none;
  }

  .account-button {
    width: 36px;
    justify-content: center;
    padding: 0;
  }
}

@media (max-width: 620px) {
  .account-button {
    width: 32px;
    min-height: 32px;
  }

  .home-actions {
    display: grid;
    justify-items: center;
    margin-top: 25px;
  }

  .purchase-button {
    min-height: 45px;
  }

  .paywall-modal,
  .auth-modal {
    padding: 40px 23px 29px;
    border-radius: 18px;
  }

  .paywall-modal h2,
  .auth-modal h2 {
    font-size: 34px;
  }
}
