@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --ink: #0c0d10;
  --elevated: #15161b;
  --gold: #c9a35c;
  --light-gold: #e8ca8a;
  --crimson: #762b2b;
  --text: #f1ede4;
  --muted: #a5a29c;
  --rule: rgb(201 163 92 / 28%);
  --display: "Cinzel", Georgia, serif;
  --body: "Inter", system-ui, sans-serif;
  --gutter: clamp(1.25rem, 4.5vw, 5rem);
  --header: 5.25rem;
  background: var(--ink);
  color: var(--text);
  font: 400 1rem/1.6 var(--body);
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header) + 1.25rem); }
body, h1, h2, h3, p, ul { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .25em; }
button, summary { font: inherit; cursor: pointer; }
button { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--light-gold); outline-offset: .28rem; }
::selection { background: var(--gold); color: var(--ink); }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 10; top: 1rem; left: 1rem; padding: .5rem 1rem; background: var(--ink); }
.shell { width: min(100% - var(--gutter) * 2, 82rem); margin-inline: auto; }
.section { padding-block: clamp(4.5rem, 8vw, 8rem); }
.label { color: var(--light-gold); font-size: .7rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.availability { color: var(--light-gold); font-size: .73rem; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.1; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 4vw, 3.3rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 2rem); }
.section-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.text-link { color: var(--light-gold); font-size: .84rem; font-weight: 600; }
.text-link:hover { color: var(--text); }

.masthead { position: fixed; z-index: 5; top: 0; width: 100%; background: linear-gradient(#0c0d10f0, #0c0d1075 76%, transparent); transition: background-color .2s; }
.masthead.scrolled { background: var(--ink); box-shadow: 0 1px 0 var(--rule); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; min-height: var(--header); padding-inline: var(--gutter); max-width: 110rem; margin: auto; }
.brand { flex: none; width: clamp(6.5rem, 10vw, 9.4rem); }
.brand img, .footer-brand img { width: 100%; height: auto; }
.brand, .footer-brand a { mix-blend-mode: screen; }
.brand img, .footer-brand img {
  mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent), linear-gradient(transparent, black 9%, black 88%, transparent);
  mask-composite: intersect;
}
.desktop-nav, .guest-actions { display: flex; align-items: center; gap: clamp(.75rem, 1.65vw, 1.8rem); }
.masthead a, .masthead summary { text-decoration: none; }
.desktop-nav > a, .nav-dropdown > summary, .guest-actions { font-size: .8rem; font-weight: 600; }
.desktop-nav a[aria-current], .masthead a:hover, .masthead summary:hover { color: var(--light-gold); }
.guest-actions { gap: .95rem; white-space: nowrap; }
.join { padding: .52rem .72rem; border: 1px solid var(--gold); color: var(--light-gold); }
.nav-dropdown { position: relative; }
.nav-dropdown > summary { display: flex; align-items: center; gap: .45rem; }
.nav-dropdown > summary::after { content: ""; width: .4rem; height: .4rem; border: solid currentColor; border-width: 0 1px 1px 0; rotate: 45deg; }
.nav-panel, .mobile-nav nav { position: absolute; min-width: 13rem; padding: .95rem; border: 1px solid var(--rule); background: var(--elevated); }
.nav-panel { top: calc(100% + .7rem); }
.nav-panel a, .mobile-nav nav a { display: block; padding: .38rem .4rem; font-size: .87rem; }
.account .nav-panel { right: 0; width: min(18rem, 84vw); }
.account img, #avatar-letter { border-radius: 50%; width: 2rem; height: 2rem; }
#avatar-letter { display: grid; place-items: center; border: 1px solid var(--gold); background: var(--elevated); }
.account-future { list-style: none; padding: 0; margin-block: .8rem; }
.account-future li { display: flex; justify-content: space-between; gap: .6rem; font-size: .84rem; padding-block: .25rem; }
.account-future small, #account-name { color: var(--muted); overflow-wrap: anywhere; }
.text-button { border: 0; background: transparent; padding: .45rem 0; color: var(--light-gold); text-decoration: underline; }
.mobile-nav { display: none; }

.hero { position: relative; isolation: isolate; display: grid; min-height: max(42rem, 94svh); align-items: end; }
.hero-art { position: absolute; z-index: -1; inset: 0; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 48% 28%; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--ink), transparent 28%), radial-gradient(ellipse 55% 58% at 94% 79%, #0c0d10eb 12%, #0c0d10bd 53%, transparent 100%), linear-gradient(0deg, #0c0d1080, transparent 66%); }
.hero-inner { width: min(100% - var(--gutter) * 2, 95rem); margin-inline: auto; padding: calc(var(--header) + 8rem) 0 clamp(2.5rem, 5vw, 4.8rem); }
.hero-copy { width: min(100%, 33rem); margin-left: auto; }
.hero h1 { font-size: clamp(2.1rem, 4.1vw, 4.5rem); letter-spacing: -.032em; margin-top: .5rem; text-wrap: initial; }
.hero-tagline { color: var(--light-gold); font: 500 clamp(1.2rem, 2.5vw, 2rem)/1.25 var(--display); margin-top: .5rem; }
.hero-description { max-width: 43ch; margin-top: 1rem; font-size: .92rem; }
.hero-note { margin-top: 1rem; font-size: .76rem; color: #c9c2b6; }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.3rem; }
.button { display: inline-flex; gap: .7rem; align-items: center; justify-content: center; min-height: 2.9rem; padding: .55rem 1rem; text-decoration: none; border: 1px solid transparent; background: transparent; font-size: .82rem; font-weight: 700; transition: background-color .18s, border-color .18s; }
.primary { background: var(--gold); color: var(--ink); }
.primary:hover { background: var(--light-gold); }
.outline { border-color: var(--gold); color: var(--text); background: #0c0d10a0; }
.outline:hover { background: var(--elevated); border-color: var(--light-gold); }

.manga { padding-top: clamp(2.7rem, 5vw, 5rem); }
.chapter-empty { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: clamp(15rem, 28vw, 22rem); border-block: 1px solid var(--rule); background: var(--elevated); }
.chapter-empty > img { position: absolute; z-index: -2; inset: 0 0 0 auto; width: 66%; height: 100%; object-fit: cover; object-position: 20% 49%; }
.chapter-empty::after { content: ""; z-index: -1; position: absolute; inset: 0; background: linear-gradient(90deg, var(--elevated) 32%, #15161bcf 49%, transparent 84%); }
.chapter-empty > div { padding: clamp(1.3rem, 4.5vw, 4rem); }
.chapter-empty h3 { max-width: 15ch; margin-block: .5rem .65rem; }
.chapter-empty p:not(.availability) { max-width: 32ch; color: #d6d1c7; }
.chapter-grid, .character-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chapter, .resume-item { padding: 1.25rem; border: 1px solid var(--rule); background: var(--elevated); }
.chapter img { width: 100%; height: auto; }
.resume-item { display: flex; gap: 1.25rem; margin-top: 1.25rem; }
.resume-item img { object-fit: cover; align-self: start; }
.resume-item progress { display: block; margin-top: .75rem; accent-color: var(--gold); }
.resume-item .button { margin-top: .75rem; }

.universe { background: var(--elevated); border-block: 1px solid var(--rule); }
.section-intro { max-width: 42rem; }
.section-intro h2 { margin: .55rem 0 .75rem; }
.section-intro > p:last-child, .dispatch > p:not(.label, .availability), .commitment-inner > p:not(.label) { color: var(--muted); }
.archive { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(1.5rem, 5vw, 5rem); margin-top: 2rem; }
.archive details { border-top: 1px solid var(--rule); align-self: start; }
.archive details:nth-last-child(-n+2) { border-bottom: 1px solid var(--rule); }
.archive summary { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .92rem 0; font: 600 clamp(.95rem, 1.7vw, 1.2rem)/1.2 var(--display); }
.archive summary::after { content: "+"; font: 400 1.35rem var(--body); color: var(--gold); }
.archive details[open] summary::after { content: "−"; }
.archive summary:hover { color: var(--light-gold); }
.archive details p { padding: 0 .55rem .85rem 0; max-width: 45ch; color: var(--muted); font-size: .88rem; }
.archive details a { color: var(--light-gold); }
.featured { padding-top: clamp(3rem, 7vw, 6rem); }
.character-card { display: grid; grid-template-columns: minmax(6rem, 42%) 1fr; border: 1px solid var(--rule); min-width: 0; background: var(--ink); }
.character-card img { width: 100%; height: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.character-card div { padding: clamp(.9rem, 2.5vw, 2rem); align-self: end; }
.character-card h4 { margin: 0 0 .3rem; font: 600 clamp(1.15rem, 2.2vw, 1.8rem)/1.15 var(--display); }
.character-card p:not(.label) { margin-top: .6rem; font-size: .87rem; color: var(--muted); }

.dispatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 5vw, 4rem); }
.dispatch { padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.dispatch h2 { font-size: clamp(1.5rem, 3vw, 2.55rem); margin: .6rem 0 .85rem; }
.dispatch .availability { margin-top: 1.45rem; }
.commitment { border-block: 1px solid var(--rule); background: radial-gradient(ellipse at top, #762b2b38, transparent 68%), var(--elevated); text-align: center; }
.commitment-inner { max-width: 49rem; }
.commitment h2 { margin: .6rem auto 1.2rem; max-width: 25ch; }
.commitment h2 em { color: var(--light-gold); font-style: normal; }
.commitment-inner > p:not(.label) { margin: .65rem auto 0; max-width: 62ch; }
.commitment-inner > .commitment-promise { color: var(--text); font-weight: 700; }
.commitment-inner > .account-note { font-size: .82rem; margin-top: 1.25rem; }
.footer { padding: 3rem 0 2rem; font-size: .83rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1.5rem; }
.footer-brand a { display: inline-block; width: 8rem; }
.footer-brand p { max-width: 32ch; margin-top: .75rem; color: var(--muted); }
.footer nav, .footer-info { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }
.footer-info p, .disclaimer, .copyright { color: var(--muted); }
.disclaimer { border-top: 1px solid var(--rule); padding-top: 1.2rem; margin-top: 1.6rem; }
.copyright { margin-top: .65rem; }

dialog { position: fixed; width: min(29rem, 100% - 2rem); padding: clamp(1.35rem, 5vw, 2.4rem); border: 1px solid var(--gold); background: var(--elevated); color: var(--text); }
dialog::backdrop { background: #08080bce; }
dialog h2 { font-size: clamp(1.55rem, 5vw, 2.4rem); margin: .5rem 0 .65rem; }
dialog #auth-description { color: var(--muted); }
.dialog-close { position: absolute; right: .65rem; top: .65rem; display: grid; place-items: center; width: 2rem; height: 2rem; border: 0; background: transparent; font-size: 1.4rem; }
.auth-options { margin-top: 1.35rem; display: grid; gap: .65rem; }
.google { background: #fff; color: #1f1f1f; }
.google:disabled { background: #d6d1c7; cursor: wait; }
.status { font-size: .82rem; color: var(--light-gold); }
.status:not(:empty) { margin-top: .7rem; }

@media (min-width: 108rem) {
  .hero-art img { object-position: center 38%; }
  .hero-inner { width: min(100% - var(--gutter) * 2, 108rem); }
}
@media (max-width: 67rem) {
  .desktop-nav { display: none; }
  .mobile-nav { display: block; margin-left: auto; }
  .mobile-nav summary { font-size: .83rem; font-weight: 600; }
  .mobile-nav nav { right: var(--gutter); top: var(--header); }
}
@media (max-width: 57rem) {
  :root { --header: 4rem; }
  .masthead { background: var(--ink); }
  .masthead-inner { gap: .65rem; }
  .brand { width: 5.6rem; }
  .guest-actions { gap: .55rem; font-size: .69rem; }
  .join { padding: .36rem .44rem; }
  .hero { display: block; min-height: 0; padding-top: var(--header); }
  .hero-art { position: relative; z-index: auto; }
  .hero-art img { width: 100%; height: auto; }
  .hero-art::after { background: linear-gradient(0deg, var(--ink), transparent 19%); }
  .hero-inner { padding-block: .4rem 2.5rem; }
  .hero-copy { margin: 0; }
  .hero h1 { font-size: clamp(1.95rem, 7.3vw, 3.3rem); }
  .hero-break { display: none; }
  .hero-description { font-size: .86rem; }
  .manga { padding-top: 1.65rem; }
  .chapter-empty > img { width: 76%; }
  .chapter-empty::after { background: linear-gradient(90deg, var(--elevated) 25%, #15161bde 58%, #15161b62); }
  .character-card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .character-card img { height: auto; }
}
@media (max-width: 34rem) {
  .archive, .dispatches, .chapter-grid { grid-template-columns: 1fr; }
  .archive details:nth-last-child(2) { border-bottom: 0; }
  .character-grid { gap: .65rem; }
  .character-card div { padding: .75rem; align-self: start; }
  .character-card .label { letter-spacing: .08em; font-size: .63rem; }
  .character-card p:not(.label) { font-size: .77rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 23rem) {
  .masthead-inner { padding-inline: .8rem; }
  .brand { width: 4.8rem; }
  .mobile-nav summary { font-size: .73rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.reader { max-width: 56rem; padding-block: 2rem 5rem; }
.reader h1 { margin-block: .75rem; font-size: clamp(1.6rem, 4vw, 3rem); }
.reader-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; margin-block: 1rem; }
.reader-controls input { width: 4rem; padding: .32rem; font: inherit; }
.reader-controls button:disabled { opacity: .6; cursor: default; }
#reader-sign-in { margin-top: 1rem; }
#reader-save-status { color: var(--light-gold); }
#chapter-image { width: 100%; height: auto; background: var(--elevated); }
