@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

/* Base */
:root {
  color-scheme: dark;
  --bg: #080d1d;
  --panel: #10182c;
  --line: #26334c;
  --text: #f5f7ff;
  --muted: #adb9cd;
  --cyan: #79dcef;
  --violet: #8c6beb;
  font-family: 'DM Sans', Arial, sans-serif;
  font-size: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

.shell {
  width: min(1160px, calc(100% - 48px));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid #29354b;
  background: #080d1df2;
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 34px;
  height: 78px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: Outfit, Arial, sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.04;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 41px;
  height: 41px;
  border-radius: 10px;
  background: linear-gradient(145deg, #9eeaf0, #7477ec);
  color: #11162c;
  font-size: 25px;
  letter-spacing: 0;
}

.brand-sub {
  display: block;
  margin-top: 4px;
  color: var(--cyan);
  font-size: 10px;
  letter-spacing: .38em;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 31px;
  margin-left: auto;
}

.top-nav a {
  color: #c7d0e0;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.top-nav a:hover {
  color: var(--cyan);
}

.menu-toggle {
  display: none;
}

/* Homepage */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(245px, 365px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(48px, 8vw, 110px);
  min-height: 650px;
  padding-block: 72px 83px;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 36% 50% at 25% 48%, #3b317a70, transparent 80%),
    radial-gradient(ellipse 40% 48% at 78% 30%, #11406455, transparent 85%);
}

.art-frame {
  position: relative;
  justify-self: center;
  width: min(100%, 356px);
  padding: 8px;
  border: 1px solid #7989bc7d;
  border-radius: 18px;
  background: linear-gradient(145deg, #58739166, #17223c, #6e5fa355);
  box-shadow: 0 38px 70px #030612ad, 0 0 90px #4d4d9970;
  transform: rotate(-2deg);
}

.cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 720 / 1030;
  object-fit: cover;
  border-radius: 11px;
}

.cover-caption {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 17px;
  border: 1px solid #506684;
  border-radius: 5px;
  background: #0b1224;
  color: #b8c7de;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2em;
  white-space: nowrap;
}

.hero-content {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .19em;
}

.hero h1,
h2,
.reader-heading h1,
.policy-page h1 {
  font-family: Outfit, Arial, sans-serif;
}

.hero h1 {
  max-width: 730px;
  margin: 0 0 21px;
  font-size: clamp(2.5rem, 4.6vw, 4.6rem);
  line-height: 1.06;
  letter-spacing: -.035em;
}

.hero h1 em {
  display: block;
  color: var(--cyan);
  font-style: normal;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags span {
  padding: 7px 12px;
  border: 1px solid #354761;
  border-radius: 5px;
  background: #1a2a43b8;
  color: #d9e2f3;
  font-size: 12px;
  font-weight: 700;
}

.synopsis {
  max-width: 630px;
  margin: 27px 0 29px;
  color: #bdc8d9;
  font-size: 16px;
  line-height: 1.78;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 19px;
  min-height: 47px;
  padding: 12px 19px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.button-primary {
  background: var(--cyan);
  color: #0a1628;
  box-shadow: 0 12px 35px #43c3e229;
}

.button-primary:hover {
  background: #a6edfa;
}

.button-quiet {
  border-color: #53627c;
  background: #151e33;
  color: #e1e8f6;
}

.button-quiet:hover {
  border-color: var(--cyan);
}

.story-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 36px;
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid #26334c;
}

.story-facts div {
  min-width: 100px;
  padding: 0;
  border: 0;
  background: transparent;
}

.story-facts small {
  display: block;
  margin-bottom: 7px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.story-facts strong {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.story-facts .status-text {
  color: var(--cyan);
}

/* Chapter list */
.chapters-section {
  padding: 74px 0 95px;
  border-top: 1px solid #25334b;
  background: #0d1528;
}

.section-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.section-top .eyebrow {
  margin-bottom: 11px;
}

.section-top h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

.chapter-count {
  padding-bottom: 6px;
  color: #a7b4ca;
  font-size: 14px;
}

.chapter-tools {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-wrap input {
  width: 100%;
  height: 52px;
  padding: 0 18px 0 47px;
  border: 1px solid #3a4861;
  border-radius: 8px;
  background: #151e32;
  color: var(--text);
}

.search-wrap input::placeholder {
  color: #8998b1;
}

.search-wrap input:focus {
  border-color: var(--cyan);
}

.search-icon {
  position: absolute;
  top: 7px;
  left: 17px;
  color: var(--cyan);
  font-size: 27px;
  pointer-events: none;
}

.sort-button {
  min-width: 164px;
  padding: 0 16px;
  border: 1px solid #3a4861;
  border-radius: 8px;
  background: #151e32;
  color: #dce5f3;
  font-size: 14px;
  font-weight: 700;
}

.sort-button span {
  margin-left: 9px;
  color: var(--cyan);
}

.chapter-list {
  display: grid;
  gap: 10px;
}

.chapter-link {
  display: block;
  min-height: 64px;
  padding: 18px 21px;
  border: 1px solid #293950;
  border-radius: 8px;
  background: #141e32;
  color: var(--text);
  font-family: Outfit, Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .16s, background .16s, transform .16s;
}

.chapter-link:hover {
  border-color: #70bcd3;
  background: #1c2b44;
  transform: translateY(-2px);
}

.empty-state {
  padding: 48px 25px;
  border: 1px dashed #40506b;
  border-radius: 9px;
  background: #121c30;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  font-family: Outfit, Arial, sans-serif;
  font-size: 21px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.source-credit {
  margin: 27px 0 0;
  color: #8898af;
  font-size: 13px;
}

.source-credit a {
  color: #a8dce8;
}

/* Chapter reader */
.reader-main {
  min-height: 80vh;
}

.reader-heading {
  padding-block: 49px 29px;
  text-align: center;
}

.breadcrumb {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  color: #9aabc3;
  font-size: 14px;
  line-height: 1.5;
}

.breadcrumb a {
  color: #e2ebf8;
  text-decoration: none;
}

.breadcrumb a:hover,
.breadcrumb [aria-current="page"] {
  color: var(--cyan);
}

.reader-heading h1 {
  max-width: 900px;
  margin: 18px auto 4px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
}

.reader-heading p {
  margin: 0 0 26px;
  color: var(--muted);
}

.reader-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 1px solid #465677;
  border-radius: 12px;
  overflow: hidden;
  background: #10192f;
}

#nav-top {
  margin: 20px auto 0;
}

#nav-bottom {
  margin: 28px auto 40px;
}

.reader-nav .button,
.reader-nav .reader-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cyan);
  box-shadow: none;
  font-size: 24px;
  line-height: 1;
  text-decoration: none;
}

.reader-nav .button:hover,
.reader-nav .reader-arrow:hover:not(:disabled) {
  background: #223451;
}

.reader-nav .reader-arrow:disabled,
.reader-nav .is-disabled {
  color: #64748b;
  opacity: .45;
  cursor: default;
  pointer-events: none;
}

.reader-nav select {
  width: 180px;
  max-width: calc(100vw - 140px);
  height: 48px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-inline: 1px solid #465677;
  border-radius: 0;
  background: #17243e;
  color: var(--text);
  font-size: 15px;
  text-align: center;
  outline: none;
  box-shadow: none;
}

.reader-nav select:focus,
.reader-nav select:focus-visible {
  outline: none;
  box-shadow: none;
  background: #20314f;
}

.reader-nav option {
  background: var(--panel);
  color: var(--text);
}

.reader-pages {
  max-width: 920px;
  min-height: 140px;
  margin-inline: auto;
  background: #050912;
}

.reader-pages img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.reader-pages img.page-reveal {
  animation: pageFade .3s ease-out;
}

@keyframes pageFade {
  from { opacity: .55; }
  to { opacity: 1; }
}

.reader-error {
  padding: 45px 24px;
  color: #d5dfed;
  text-align: center;
}

.reader-error a {
  color: var(--cyan);
}

/* Policy pages */
.policy-page {
  max-width: 800px;
  min-height: 70vh;
  padding-top: 65px;
  padding-bottom: 90px;
  color: #bdc8d9;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.policy-back {
  color: var(--cyan);
  text-decoration: none;
}

.policy-page h1 {
  margin: 20px 0 24px;
  color: var(--text);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.2;
}

.policy-page h2 {
  margin-top: 36px;
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1.4;
}

.policy-page a {
  color: var(--cyan);
}

.policy-page li {
  margin-bottom: 8px;
}

/* Footer */
.site-footer {
  border-top: 1px solid #29354b;
  background: var(--bg);
}

.footer-content {
  padding-top: 36px;
  padding-bottom: 28px;
  text-align: center;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid #29354b;
}

.footer-brand {
  color: #e7eef9;
  font-family: Outfit, Arial, sans-serif;
  font-weight: 800;
  letter-spacing: .12em;
}

.footer-brand span {
  color: var(--cyan);
}

.footer-back {
  color: #b0bfd1;
  text-decoration: none;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 26px 0;
}

.footer-links a {
  color: #e2eaf7;
  font-size: 14px;
  text-decoration: none;
}

.footer-back:hover,
.footer-links a:hover,
.footer-links [aria-current="page"] {
  color: var(--cyan);
}

.footer-disclaimer {
  max-width: 850px;
  margin: 0 auto 20px;
  color: #99a9c0;
  font-size: 13px;
  line-height: 1.7;
}

.footer-disclaimer a {
  color: var(--cyan);
}

.footer-copyright {
  margin: 0;
  color: #7989a3;
  font-size: 12px;
  line-height: 1.6;
}

/* Mobile */
@media (max-width: 760px) {
  .shell {
    width: min(540px, calc(100% - 34px));
  }

  .header-inner {
    height: 67px;
    gap: 16px;
  }

  .brand {
    font-size: 13px;
  }

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

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 0;
    border: 1px solid #42546c;
    border-radius: 8px;
    background: #151e33;
    color: var(--cyan);
    font-size: 25px;
    line-height: 1;
  }

  .top-nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 10;
    margin: 0;
    padding: 12px;
    border: 1px solid #354761;
    border-radius: 10px;
    background: var(--panel);
    box-shadow: 0 12px 30px #0006;
  }

  .top-nav.is-open {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }

  .top-nav a {
    padding: 12px;
    border-radius: 6px;
  }

  .top-nav a:hover {
    background: #1a2a43;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 45px;
    padding-block: 43px 66px;
  }

  .art-frame {
    width: min(65%, 270px);
  }

  .hero h1 {
    font-size: clamp(2.3rem, 8vw, 3.6rem);
  }

  .story-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chapters-section {
    padding: 54px 0 70px;
  }

  .reader-heading {
    padding-top: 35px;
  }

  .policy-page {
    padding-top: 40px;
    padding-bottom: 60px;
  }
}

@media (max-width: 600px) {
  .footer-top {
    flex-direction: column;
  }
}

@media (max-width: 470px) {
  .brand {
    letter-spacing: .07em;
  }

  .hero h1 {
    font-size: 2.3rem;
  }

  .art-frame {
    width: min(75%, 255px);
  }

  .story-facts {
    grid-template-columns: 1fr;
  }

  .chapter-tools {
    flex-direction: column;
  }

  .sort-button {
    height: 47px;
  }

  .section-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .breadcrumb {
    font-size: 13px;
  }

  .footer-brand {
    font-size: 13px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .chapter-link {
    transition: none;
  }

  .reader-pages img.page-reveal {
    animation: none;
  }
}
.about-section {
  padding: 56px 0;
  background: var(--bg);
}

.about-section h2 {
  max-width: 850px;
  margin: 0 0 22px;
  color: var(--text);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.3;
}

.about-copy {
  max-width: 850px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.about-copy p {
  margin: 0 0 18px;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.about-copy a {
  color: var(--cyan);
  text-underline-offset: 4px;
}

@media (max-width: 760px) {
  .about-section {
    padding: 38px 0;
  }
}