@import 'tailwindcss';
:root {
  --ink: #0b0b0b;
  --paper: #f0ece4;
  --red: #a51f1f;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: #111;
  color: #eee;
  font-family: var(--font-sans), sans-serif;
}
button,
select {
  font: inherit;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(16px, 4vw, 58px);
  background: rgba(8, 8, 8, 0.95);
  border-bottom: 1px solid #333;
  backdrop-filter: blur(12px);
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0.16em;
}
.logo b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: #eee;
  color: #111;
  font:
    800 19px var(--font-serif),
    serif;
  transform: rotate(-3deg);
}
.chapter-id {
  text-align: center;
}
.chapter-id small {
  display: block;
  color: #777;
  font-size: 8px;
  letter-spacing: 0.16em;
}
.chapter-id strong {
  display: block;
  margin-top: 3px;
  font:
    600 13px var(--font-serif),
    serif;
}
.topbar nav {
  justify-self: end;
  display: flex;
  gap: 18px;
}
.topbar nav button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 0;
  background: none;
  color: #777;
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.topbar nav button.active,
.topbar nav button:hover {
  color: #fff;
  border-color: var(--red);
}
.reader-tools {
  position: sticky;
  top: 64px;
  z-index: 45;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 11px clamp(14px, 4vw, 58px);
  background: #f1eee8;
  color: #111;
  border-bottom: 1px solid #bbb;
  box-shadow: 0 4px 16px #0005;
}
.chapter-nav,
.view-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.reader-tools button {
  border: 1px solid #bbb;
  background: #fff;
  color: #222;
  padding: 9px 13px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.reader-tools button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.reader-tools button.active {
  background: #111;
  color: #fff;
  border-color: #111;
}
.chapter-nav label {
  display: flex;
  align-items: center;
  gap: 9px;
}
.chapter-nav label > span {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.14em;
}
.chapter-nav select {
  max-width: 330px;
  border: 1px solid #aaa;
  background: #fff;
  padding: 9px 32px 9px 11px;
  font-size: 11px;
  font-weight: 700;
}
.view-tools > span:not(.tool-sep) {
  min-width: 42px;
  text-align: center;
  font-size: 9px;
  font-weight: 800;
}
.tool-sep {
  width: 1px;
  height: 25px;
  background: #bbb;
  margin: 0 4px;
}
.chapter-intro {
  text-align: center;
  padding: 85px 20px 70px;
  background: #111;
}
.chapter-intro > span {
  color: #d1524e;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.22em;
}
.chapter-intro h1 {
  max-width: 950px;
  margin: 14px auto 18px;
  font:
    800 clamp(48px, 7vw, 102px)/0.9 var(--font-serif),
    serif;
  letter-spacing: -0.055em;
}
.chapter-intro p {
  max-width: 680px;
  margin: 0 auto;
  color: #aaa;
  font:
    400 17px/1.65 var(--font-serif),
    serif;
}
.chapter-intro small {
  display: block;
  margin-top: 24px;
  color: #666;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.15em;
}
.manga-stream {
  position: relative;
  background: #181818;
  padding: 0 0 100px;
}
.manga-stream.vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.manga-stream.horizontal {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  overflow-x: auto;
  padding: 35px 35px 75px;
  scroll-snap-type: x mandatory;
}
.manga-page {
  position: relative;
  margin: 0;
  width: var(--page-width);
  max-width: 1180px;
  aspect-ratio: 1.42;
  background: var(--paper);
  color: #111;
  overflow: hidden;
  border: 1px solid #333;
  box-shadow: 0 20px 60px #0008;
}
.vertical .manga-page + .manga-page {
  margin-top: 18px;
}
.horizontal .manga-page {
  width: min(82vw, 1050px);
  min-width: min(82vw, 1050px);
  scroll-snap-align: center;
}
.manga-page > figcaption {
  position: absolute;
  z-index: 15;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 12px;
  background: #050505;
  color: #ddd;
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.15em;
}
.manga-page > figcaption em {
  justify-self: end;
  font-style: normal;
  color: #777;
}
.cover-page img,
.end-page > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover-page img {
  filter: contrast(1.08);
}
.panel-page {
  display: grid;
  gap: 6px;
  padding: 10px 10px 40px;
  background: #111;
}
.paper-shadow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
  box-shadow: inset 0 0 70px #0004;
}
.panel {
  position: relative;
  min-height: 0;
  background-repeat: no-repeat;
  background-color: #222;
  border: 3px solid #f2eee7;
  overflow: hidden;
  filter: contrast(1.05) saturate(0.82);
}
.panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    #0007 0,
    transparent 27%,
    transparent 62%,
    #000a 100%
  );
  pointer-events: none;
}
.panel-title {
  position: absolute;
  z-index: 3;
  left: 12px;
  top: 11px;
  padding: 6px 8px;
  background: #0a0a0ae6;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.panel p {
  position: absolute;
  z-index: 3;
  left: 12px;
  right: 12px;
  bottom: 10px;
  margin: 0;
  padding: 7px 9px;
  background: #0a0a0ad9;
  color: #fff;
  font:
    600 clamp(9px, 1vw, 13px)/1.35 var(--font-serif),
    serif;
}
.panel blockquote {
  position: absolute;
  z-index: 4;
  right: 7%;
  top: 18%;
  max-width: 46%;
  margin: 0;
  padding: 10px 13px;
  background: #fff;
  color: #111;
  border: 2px solid #111;
  border-radius: 52% 48% 55% 45%;
  font:
    700 clamp(10px, 1.2vw, 16px)/1.2 var(--font-serif),
    serif;
  text-align: center;
  box-shadow: 3px 3px 0 #111;
}
.panel.danger blockquote {
  background: #111;
  color: #fff;
  border-color: #fff;
}
.panel.quiet blockquote {
  top: auto;
  bottom: 21%;
}
.layout-quad {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.layout-lead {
  grid-template-columns: 1.25fr 0.75fr;
  grid-template-rows: 1fr 1fr;
}
.layout-lead .panel:first-of-type {
  grid-row: 1/3;
}
.layout-cinema {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1.15fr 0.85fr;
}
.layout-cinema .panel:first-of-type {
  grid-column: 1/3;
}
.layout-cinema .panel:last-of-type {
  grid-column: 2/4;
}
.layout-impact {
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
}
.layout-impact .panel {
  min-height: 0;
}
.end-page > div {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px;
  background: linear-gradient(90deg, #000d, #0007);
}
.end-page > div > span {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: #ddd;
}
.end-page h2 {
  max-width: 820px;
  margin: 22px 0 32px;
  color: #fff;
  font:
    italic 800 clamp(38px, 6vw, 88px)/1 var(--font-serif),
    serif;
  letter-spacing: -0.05em;
}
.end-page button {
  border: 1px solid #fff;
  background: #fff;
  color: #111;
  padding: 13px 18px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.characters-screen {
  background: #eae5dc;
  color: #111;
  min-height: 100vh;
}
.characters-screen > header {
  text-align: center;
  padding: 100px 20px 70px;
}
.characters-screen > header span {
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.2em;
}
.characters-screen h1 {
  max-width: 900px;
  margin: 16px auto;
  font:
    800 clamp(52px, 7vw, 100px)/0.92 var(--font-serif),
    serif;
  letter-spacing: -0.055em;
}
.characters-screen > header p {
  font:
    400 18px var(--font-serif),
    serif;
}
.cast-image {
  margin: 0;
  border-block: 6px solid #111;
}
.cast-image img {
  display: block;
  width: 100%;
  height: auto;
}
.characters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.characters-grid article {
  position: relative;
  min-height: 350px;
  padding: 55px clamp(28px, 6vw, 90px);
  border-right: 1px solid #aaa;
  border-bottom: 1px solid #aaa;
}
.characters-grid article:nth-child(4n + 1),
.characters-grid article:nth-child(4n + 2) {
  background: #151515;
  color: #eee;
}
.characters-grid small {
  color: var(--red);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.characters-grid h2 {
  margin: 24px 0 18px;
  font:
    800 clamp(38px, 4vw, 58px)/1 var(--font-serif),
    serif;
  letter-spacing: -0.04em;
}
.characters-grid p {
  max-width: 620px;
  margin: 0;
  font:
    400 16px/1.7 var(--font-serif),
    serif;
}
.characters-grid strong {
  display: inline-block;
  margin-top: 30px;
  border: 1px solid currentColor;
  padding: 6px 9px;
  color: var(--red);
  font-size: 8px;
  letter-spacing: 0.14em;
}
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px clamp(20px, 5vw, 70px);
  background: #070707;
  color: #777;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
}
footer button {
  border: 0;
  background: none;
  color: #aaa;
  cursor: pointer;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}
@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }
  .chapter-id {
    display: none;
  }
  .topbar nav {
    gap: 10px;
  }
  .reader-tools {
    align-items: stretch;
    flex-direction: column;
  }
  .chapter-nav {
    justify-content: center;
  }
  .chapter-nav label > span {
    display: none;
  }
  .chapter-nav select {
    width: 100%;
    max-width: none;
  }
  .view-tools {
    justify-content: center;
  }
  .manga-page,
  .horizontal .manga-page {
    width: 100%;
    min-width: 92vw;
    aspect-ratio: 0.82;
  }
  .manga-stream.vertical .manga-page {
    max-width: 100%;
    border-inline: 0;
  }
  .layout-quad {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
  }
  .layout-lead {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1.2fr 0.8fr 0.8fr;
  }
  .layout-lead .panel:first-of-type {
    grid-column: 1/3;
    grid-row: auto;
  }
  .layout-lead .panel:last-of-type {
    grid-column: 1/3;
  }
  .layout-cinema {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
  }
  .layout-cinema .panel:first-of-type {
    grid-column: 1/3;
  }
  .layout-cinema .panel:last-of-type {
    grid-column: 1/3;
  }
  .panel p {
    font-size: 10px;
  }
  .panel blockquote {
    font-size: 11px;
  }
  .characters-grid {
    grid-template-columns: 1fr;
  }
  .characters-grid article {
    min-height: 0;
  }
  .manga-stream.horizontal {
    padding-inline: 15px;
  }
}
@media (max-width: 480px) {
  .logo span {
    display: none;
  }
  .topbar {
    padding-inline: 12px;
  }
  .reader-tools button {
    padding: 8px;
  }
  .chapter-nav button {
    font-size: 0;
  }
  .chapter-nav button:first-child::after {
    content: '←';
    font-size: 14px;
  }
  .chapter-nav button:last-child::after {
    content: '→';
    font-size: 14px;
  }
  .chapter-intro {
    padding-top: 65px;
  }
  .chapter-intro h1 {
    font-size: 48px;
  }
  .manga-page {
    aspect-ratio: 0.74;
  }
  .panel {
    border-width: 2px;
  }
  .panel-title {
    font-size: 7px;
  }
  .end-page > div {
    padding: 24px;
  }
}
