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

:root {
  --color-bg: #1a1a2e;
  --color-text: #e8e6e3;
  --color-accent: #ff6b6b;
  --color-muted: #999;
  --color-border: #2d2d44;
  --color-card-bg: #16213e;
  --font-body: system-ui, -apple-system, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
  --max-width: 1100px;
  --reader-width: 800px;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  border-bottom: 2px solid var(--color-border);
  padding: 1rem 0;
  background: var(--color-card-bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-text);
}

.site-logo:hover {
  text-decoration: none;
  color: var(--color-accent);
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--color-text);
  font-size: 0.95rem;
}

nav a:hover {
  color: var(--color-accent);
}

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--color-card-bg);
  border-bottom: 2px solid var(--color-border);
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--color-muted);
  font-size: 1.15rem;
}

/* Comic Grid */
section.container > h1,
section.container > h2 {
  font-family: var(--font-heading);
  margin: 2rem 0 1rem;
}

.comic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Comic Card */
.comic-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.comic-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.comic-card-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--color-border);
}

.comic-card-body {
  padding: 1rem;
}

.comic-card-body h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.comic-card-body h3 a {
  color: var(--color-text);
}

.comic-card-body h3 a:hover {
  color: var(--color-accent);
}

.comic-card-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.view-all {
  text-align: center;
  margin: 1rem 0 3rem;
  font-size: 1.05rem;
}

/* Comic Reader */
.comic-reader {
  max-width: var(--reader-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.comic-header {
  margin-bottom: 2rem;
}

.comic-header h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.comic-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.author-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.comic-date {
  color: var(--color-muted);
}

.comic-date::before {
  content: "\00b7";
  margin-right: 0.5rem;
}

.comic-description {
  color: var(--color-muted);
  font-style: italic;
}

.comic-pages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comic-page {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  cursor: zoom-in;
}

/* Zoom Overlay */
body.zoom-active {
  overflow: hidden;
}

.zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.zoom-overlay.visible {
  opacity: 1;
}

.zoom-overlay img {
  width: 90vw;
  height: 90vh;
  object-fit: contain;
}

.zoom-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}

.comic-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* Author Page */
.author-profile {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem 0;
}

.author-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-border);
}

.author-profile h1 {
  font-family: var(--font-heading);
  margin-bottom: 0.25rem;
}

/* Footer */
.site-footer {
  border-top: 2px solid var(--color-border);
  padding: 1.5rem 0;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-top: 3rem;
}
