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

:root {
  --bg: #0b0c11;
  --bg-elevated: #14161e;
  --bg-card: #181b25;
  --text: #f1f2f6;
  --text-dim: #8b8fa3;
  --accent: #ff5c39;
  --accent-2: #ffb340;
  --accent-glow: rgba(255, 92, 57, 0.28);
  --border: #262a37;
  --radius: 12px;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-head: "Poppins", -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); }

body {
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

a { color: inherit; text-decoration: none; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 12, 17, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-dim);
}

.site-icon {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
}

.site-header nav {
  display: flex;
  gap: 24px;
}

.site-header nav a {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.site-header nav a:hover { color: var(--text); }

/* ---------- hero banner ---------- */
/* Full-bleed backdrop built from the manga's own cover image (color extracted
   at build time into --accent/--accent-2). Darkened well past a raw blur so
   the title text and genre pills stay crisp on top of it. */

.hero {
  position: relative;
  padding: 64px 24px 48px;
  overflow: hidden;
}

.backdrop {
  position: absolute;
  inset: -60px;
  background-size: cover;
  background-position: center 25%;
  filter: blur(36px) brightness(0.16) saturate(1.2);
  transform: scale(1.15);
  z-index: 0;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 12, 17, 0.35) 0%, var(--bg) 92%);
  z-index: 1;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--font-head);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.15;
  margin-bottom: 18px;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  max-width: 20ch;
}

/* ---------- layout ---------- */

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 64px;
  position: relative;
  z-index: 1;
}

.site-footer { position: relative; z-index: 1; }

/* ---------- manga info card ---------- */

.manga-header {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin: -24px auto 40px;
  padding: 24px;
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.manga-header img {
  width: 160px;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  align-self: flex-start;
}

.manga-header > div {
  min-width: 0;
  flex: 1;
}

.manga-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--text-dim);
  font-size: 13.5px;
  margin-bottom: 14px;
}

.manga-meta strong { color: var(--accent-2); font-weight: 600; }

.alt-titles {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 14px;
}

.alt-titles strong { color: var(--accent-2); font-weight: 600; }

.genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.genre-tag {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: color-mix(in srgb, var(--accent-2) 80%, white);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.hero .genre-tag {
  background: color-mix(in srgb, var(--accent) 20%, rgba(0, 0, 0, 0.3));
  backdrop-filter: blur(4px);
}

.manga-header p.synopsis {
  color: var(--text-dim);
  font-size: 14.5px;
  max-width: 62ch;
}

/* ---------- info sections (genres / tags / demographics / formats / authors / artists) ---------- */

.info-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
  margin-bottom: 40px;
  background: var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
  border-radius: var(--radius);
}

.info-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dim);
}

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

/* ---------- chapter grid ---------- */

.section-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  display: inline-block;
}

.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 40px;
}

.chapter-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
  border-left: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.chapter-list a:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-card));
  transform: translateX(2px);
}

.chapter-list .chapter-num {
  flex-shrink: 0;
  background: color-mix(in srgb, var(--accent) 22%, var(--bg-elevated));
  color: var(--accent-2);
  font-weight: 700;
  font-size: 12px;
  min-width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.chapter-list .chapter-name {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
  white-space: normal;
  line-height: 1.4;
}

.chapter-list .date {
  color: var(--text-dim);
  font-size: 12px;
  flex-shrink: 0;
  white-space: nowrap;
}

.tag-chip {
  color: var(--text-dim) !important;
  border-color: var(--border) !important;
  background: var(--bg-card) !important;
  text-transform: uppercase;
  font-size: 10.5px !important;
  letter-spacing: 0.4px;
}

/* ---------- reader page (full-bleed, letterboxed) ---------- */

body.reader-page { background: #000; }

.reader-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(11, 12, 17, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.reader-home {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: 8px;
  font-size: 16px;
  color: var(--text-dim);
}

.reader-home:hover { color: var(--text); }

.reader-thumb {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
}

.reader-title {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.reader-manga-name {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-chapter-name {
  font-weight: 700;
  font-size: 14px;
}

.reader {
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 90px;
}

.reader img {
  max-width: 900px;
  width: 100%;
  display: block;
}

.reader-bottombar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(20, 22, 30, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.reader-nav-btn { border-radius: 10px; padding: 9px 20px; }

.reader-select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  max-width: 160px;
}

.reader-footer { background: var(--bg); margin-top: 0; }

@media (max-width: 640px) {
  .reader-manga-name { max-width: 140px; }
}

.not-found {
  text-align: center;
  padding: 100px 24px;
}

.not-found h1 {
  font-family: var(--font-head);
  font-size: 72px;
  font-weight: 800;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.not-found p {
  color: var(--text-dim);
  margin: 12px 0 24px;
}

/* ---------- buttons ---------- */

.btn {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #14141c;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.btn:hover { opacity: 0.88; }

.btn-read {
  display: inline-block;
  margin-top: 6px;
  padding: 11px 22px;
  font-size: 14px;
}

/* ---------- chapter list extras ---------- */

.chapter-search {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13.5px;
  margin-bottom: 12px;
}

.chapter-search:focus {
  outline: none;
  border-color: var(--accent);
}

.chapter-thumb {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.badge-new {
  display: inline-block;
  margin-left: 8px;
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

/* ---------- FAQ ---------- */

.faq-item {
  background: var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 8px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  outline: none;
}

.faq-item summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  color: var(--accent-2);
  font-weight: 700;
  flex-shrink: 0;
}

.faq-item[open] summary::after { content: "\2212"; }

.faq-item p {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.6;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 48px;
}

.site-footer a { color: var(--text-dim); margin: 0 10px; transition: color 0.15s ease; }
.site-footer a:hover { color: var(--text); }

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .hero h1 { font-size: 28px; }
  .manga-header { flex-direction: column; margin-top: -40px; }
  .manga-header img { width: 130px; }
  .chapter-list { grid-template-columns: 1fr 1fr; }
}
