:root {
  --ink: #2b2825;
  --muted: #6c625c;
  --brand: #d32f2f;
  --line: #e8e1da;
  --surface: #fffdf9;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 16px/1.75 Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
.wrap { width: min(1050px, calc(100% - 40px)); margin: auto; }

.site-header { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line); background: var(--surface); }
.nav { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--brand); font-size: 19px; font-weight: 800; letter-spacing: -.7px; line-height: 1; }
.logo { width: 42px; height: 42px; border-radius: 11px; object-fit: cover; }
nav { display: flex; gap: 25px; }
nav a:hover, .footer-links a:hover { color: var(--brand); }
.button { display: inline-block; border-radius: 24px; padding: 11px 18px; background: var(--brand); color: #fff; font-weight: 700; }

.hero { position: relative; isolation: isolate; overflow: hidden; padding: 58px 44% 58px 0; border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; z-index: -1; inset: 0 0 0 56%; background: linear-gradient(90deg, var(--surface) 0%, rgba(255, 253, 249, .82) 18%, rgba(255, 253, 249, .08) 100%), url("assets/images/mangadex-reader-logo.webp") center / cover no-repeat; }
h1 { margin: 0; font-size: clamp(27px, 4vw, 43px); line-height: 1.15; }
h2 { margin: 40px 0 12px; line-height: 1.25; }
h3 { margin: 25px 0 5px; font-size: 20px; }
.rating { margin: 10px 0 0; color: #f17d4f; font-weight: 700; }
.lead { max-width: 760px; margin: 28px 0 20px; color: var(--muted); font-size: 19px; }

.page-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 38px; }
.toc { order: 2; position: sticky; top: 88px; height: max-content; margin-top: 36px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.toc a { display: block; padding: 5px 0; color: var(--muted); }
.content-visual { margin: 24px 0 36px; }
.content-visual img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 25px rgba(43, 40, 37, .08); }
figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.feature-copy { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
details { padding: 14px 0; border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 700; }

.page-main { padding: 42px 0 60px; }
.page-article { max-width: 760px; }
.page-article h1 { margin-bottom: 18px; }
.page-article a, .guide-content a { color: var(--brand); }
.page-note { margin: 28px 0; padding: 15px 18px; border-left: 4px solid var(--brand); border-radius: 5px; background: #fff3ed; }
.checklist { padding: 18px 22px; border: 1px solid var(--line); border-radius: 11px; }
.guide-hero { padding: 55px 0 30px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.guide-hero h1 { margin: 10px 0 18px; font-size: clamp(32px, 6vw, 52px); }
.guide-content { max-width: 780px; padding: 18px 0 60px; }
.guide-content p, .guide-content li { color: #463f3a; }
.article-meta { margin: 10px 0 24px; color: var(--muted); font-size: 14px; }
.answer-box { margin: 24px 0 32px; padding: 20px 22px; border: 1px solid #f1c1b5; border-left: 5px solid var(--brand); border-radius: 10px; background: #fff4ef; }
.table-wrap { overflow-x: auto; margin: 20px 0 28px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f8f3ed; }
.source-note { padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.guide-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 8px 22px rgba(43, 40, 37, .06); }
.guide-card:hover { border-color: #e6a693; transform: translateY(-2px); }
.guide-card strong { font-size: 18px; line-height: 1.35; }
.guide-card > span:last-child { color: var(--muted); }

.site-footer { margin-top: 45px; padding: 28px 0; border-top: 1px solid var(--line); background: #f8f3ed; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; }
.footer-copy { max-width: 580px; }
.footer-name { margin: 0 0 5px; color: var(--ink); font-size: 16px; font-weight: 700; }
.footer-copy p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 20px; }
.footer-links a { white-space: nowrap; }

@media (max-width: 700px) {
  .wrap { width: min(100% - 36px, 1050px); }
  .brand span, nav, .toc { display: none; }
  .hero { padding: 38px 0; }
  .hero::before {
    inset: 0;
    background:
      linear-gradient(90deg, rgba(255, 253, 249, .96) 0%, rgba(255, 253, 249, .88) 58%, rgba(255, 253, 249, .72) 100%),
      url("assets/images/mangadex-reader-logo.webp") 72% top / auto 140% no-repeat;
  }
  .hero-copy, .hero .lead { max-width: 90%; }
  .lead { margin: 30px 0 18px; font-size: 18px; line-height: 1.72; }
  .hero > .button { display: table; margin: 0 auto; }
  .page-layout { display: block; }
  .feature-copy { display: block; }
  .guide-grid { grid-template-columns: 1fr; }
  h2 { margin-top: 34px; font-size: 24px; }
  .site-footer { margin-top: 36px; }
  .footer-inner { flex-direction: column; gap: 18px; }
  .footer-links { justify-content: flex-start; }
}
