/* ============================================
   PROJECT 30AE — Manga Codex
   Aesthetic: Initial D / Japanese motorsport zine.
   Black & white with racing orange accent,
   monospaced technical labels, bold display type.
   ============================================ */

:root {
  --ink: #0e0e10;
  --paper: #f5f3ee;
  --paper-2: #ebe7dd;
  --rule: #1a1a1d;
  --orange: #ff5a1f;
  --orange-deep: #d63f08;
  --muted: #6c6a64;
  --halftone: radial-gradient(circle at 1px 1px, rgba(0,0,0,0.18) 1px, transparent 1px);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image: var(--halftone);
  background-size: 6px 6px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  padding: clamp(60px, 10vw, 140px) 24px 80px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--halftone);
  background-size: 4px 4px;
  opacity: 0.4;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent 0,
      transparent 60px,
      rgba(255, 90, 31, 0.06) 60px,
      rgba(255, 90, 31, 0.06) 62px
    );
  pointer-events: none;
}

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

.hero-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--orange);
  margin-bottom: 28px;
  display: inline-block;
  border: 1px solid var(--orange);
  padding: 6px 14px;
  background: rgba(255, 90, 31, 0.08);
}

.hero-title {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: clamp(56px, 11vw, 156px);
  line-height: 0.92;
  letter-spacing: 0.005em;
  margin-bottom: 28px;
  text-transform: uppercase;
}

.hero-title .accent {
  color: var(--orange);
  position: relative;
  display: inline-block;
}

.hero-title .accent::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 6px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  animation: stripeIn 0.9s 0.3s cubic-bezier(.7,.1,.3,1) forwards;
}

@keyframes stripeIn {
  to { transform: scaleX(1); }
}

.hero-sub {
  font-size: clamp(16px, 1.6vw, 19px);
  max-width: 640px;
  color: rgba(245, 243, 238, 0.78);
  margin-bottom: 48px;
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  gap: clamp(20px, 5vw, 60px);
  flex-wrap: wrap;
  border-top: 1px solid rgba(245, 243, 238, 0.15);
  padding-top: 28px;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1;
  color: var(--orange);
}

.meta-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(245, 243, 238, 0.55);
  margin-top: 6px;
  text-transform: uppercase;
}

.hero-stripe {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 16px;
  background: repeating-linear-gradient(
    90deg,
    var(--orange) 0,
    var(--orange) 40px,
    var(--ink) 40px,
    var(--ink) 80px
  );
}

/* ============================================
   CHAPTER NAV (sticky)
   ============================================ */
.chapter-nav {
  position: sticky;
  top: 0;
  background: var(--ink);
  border-bottom: 2px solid var(--orange);
  z-index: 50;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chapter-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  padding: 0 12px;
}

.chapter-nav a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: rgba(245, 243, 238, 0.55);
  padding: 16px 18px;
  border-right: 1px solid rgba(245, 243, 238, 0.08);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.chapter-nav a:hover {
  color: var(--paper);
  background: rgba(255, 90, 31, 0.08);
}

.chapter-nav a.active {
  color: var(--orange);
  background: rgba(255, 90, 31, 0.12);
}

/* ============================================
   CHAPTERS
   ============================================ */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.chapter {
  padding: 80px 0 60px;
  border-bottom: 1px solid rgba(14, 14, 16, 0.08);
}

.chapter:last-of-type {
  border-bottom: none;
}

.chapter-header {
  margin-bottom: 56px;
  max-width: 760px;
}

.chapter-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--orange);
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.chapter-num::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--orange);
}

.chapter-header h2 {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 16px;
}

.chapter-header p {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 600px;
}

/* ============================================
   MANGA CARD
   ============================================ */
.manga-card {
  margin-bottom: 80px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.manga-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink);
  background: var(--paper-2);
  padding: 6px 12px;
  border: 1px solid var(--ink);
}

.card-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 5px 10px;
  text-transform: uppercase;
}

.tag-clean {
  background: rgba(14, 14, 16, 0.06);
  color: var(--muted);
  border: 1px solid rgba(14, 14, 16, 0.15);
}

.tag-redo {
  background: var(--orange);
  color: var(--ink);
  border: 1px solid var(--orange-deep);
  font-weight: 700;
}

.manga-card h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.05;
  letter-spacing: 0.005em;
  margin-bottom: 14px;
  text-transform: uppercase;
  max-width: 800px;
}

.card-blurb {
  font-size: 16px;
  line-height: 1.7;
  color: #2a2a2e;
  max-width: 760px;
  margin-bottom: 28px;
}

.card-blurb strong {
  color: var(--orange-deep);
  font-weight: 700;
}

.manga-frame {
  display: block;
  background: var(--paper-2);
  padding: 14px;
  border: 2px solid var(--ink);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  max-width: 920px;
  cursor: zoom-in;
}

.manga-frame::before {
  content: 'TAP TO ENLARGE';
  position: absolute;
  top: -1px;
  right: -1px;
  background: var(--orange);
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 5px 9px;
  z-index: 2;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.3s;
}

.manga-frame:hover {
  transform: translateY(-4px);
  box-shadow: 8px 8px 0 var(--orange);
}

.manga-frame:hover::before {
  opacity: 1;
}

.manga-frame img {
  width: 100%;
  display: block;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  background: var(--ink);
  color: var(--paper);
  padding: 80px 24px 0;
  margin-top: 60px;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--halftone);
  background-size: 5px 5px;
  opacity: 0.3;
  pointer-events: none;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 48px;
  position: relative;
  z-index: 2;
}

.footer-col p {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(245, 243, 238, 0.7);
}

.footer-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--orange);
  margin-bottom: 14px;
}

.footer-bar {
  margin-top: 60px;
  padding: 22px 24px;
  border-top: 1px solid rgba(245, 243, 238, 0.1);
  display: flex;
  justify-content: center;
  gap: clamp(16px, 4vw, 60px);
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(245, 243, 238, 0.55);
  position: relative;
  z-index: 2;
}

.footer-bar span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-bar span::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--orange);
  border-radius: 50%;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 720px) {
  .chapter { padding: 56px 0 40px; }
  .manga-card { margin-bottom: 56px; }
  .manga-frame { padding: 8px; }
  .manga-frame:hover { transform: none; box-shadow: none; }
  .hero { padding: 50px 20px 60px; }
  main { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .manga-card { opacity: 1; transform: none; }
}
