/* ========================================================
   MANGA PORTFOLIO | Stylesheet
   Abinash Basa  |  GitHub Pages Ready
   ======================================================== */

/* ---------- 1. Design Tokens ---------- */
:root {
  --ink:           #111111;
  --ink-light:     #333333;
  --ink-faint:     rgba(17, 17, 17, 0.06);
  --paper:         #f5f1e8;
  --paper-dark:    #e8e4db;
  --accent:        #e63946;
  --white:         #ffffff;

  --border-w:      3px;
  --border-thick:  4px;
  --shadow-x:      5px;
  --shadow-y:      5px;
  --panel-radius:  2px;

  --font-heading:  'Bangers', cursive;
  --font-body:     'Inter', sans-serif;

  --ease-pop:      cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth:   cubic-bezier(0.4, 0, 0.2, 1);

  --container-max: 1200px;
  --section-pad-y: 5rem;
  --section-pad-x: 1.5rem;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img   { max-width: 100%; height: auto; display: block; }
a     { color: inherit; text-decoration: none; }
button{ font-family: inherit; cursor: pointer; border: none; background: none; }
ul,ol { list-style: none; }

/* Focus styles for keyboard accessibility */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- 3. Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
  line-height: 1.1;
}

/* ---------- 4. Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--section-pad-x);
  padding-right: var(--section-pad-x);
}

.panel-border {
  border: var(--border-w) solid var(--ink);
  border-radius: var(--panel-radius);
}

.hard-shadow {
  box-shadow: var(--shadow-x) var(--shadow-y) 0 var(--ink);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Halftone dot texture overlay */
.halftone-bg {
  position: relative;
}
.halftone-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--ink) 0.6px, transparent 0.6px);
  background-size: 10px 10px;
  opacity: 0.045;
  pointer-events: none;
  z-index: 0;
}

/* ---------- 5. Navigation ---------- */
.manga-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--ink);
  color: var(--paper);
  border-bottom: var(--border-thick) solid var(--accent);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--section-pad-x);
  height: 56px;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
}

.nav-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--accent);
  box-shadow: 2px 2px 0 var(--paper);
  display: block;
  transition: transform 0.2s var(--ease-pop), box-shadow 0.2s var(--ease-smooth);
}

.nav-logo:hover .nav-logo-img,
.nav-logo:focus-visible .nav-logo-img {
  transform: scale(1.06) rotate(-2deg);
  box-shadow: 3px 3px 0 var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.75rem;
  color: var(--paper);
  border-radius: 3px;
  transition: background 0.2s var(--ease-smooth), color 0.2s;
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-link:hover,
.nav-link.active {
  background: var(--accent);
  color: var(--paper);
}

.nav-link .ch-num {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-right: 0.2rem;
}

/* Burger menu */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  cursor: pointer;
  z-index: 1001;
  background: transparent;
  border: none;
}

.burger span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--paper);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.burger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- 6. Hero / Cover ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--paper);
}

.speed-lines {
  position: absolute;
  inset: 0;
  background: repeating-conic-gradient(
    from 0deg at 50% 55%,
    transparent 0deg,
    transparent 1.8deg,
    var(--ink-faint) 1.8deg,
    var(--ink-faint) 3.6deg
  );
  pointer-events: none;
  z-index: 0;
}

.speed-lines::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 55%, transparent 25%, var(--paper) 65%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: center;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.hero-portrait {
  justify-self: center;
}

.portrait-frame {
  width: 260px;
  height: 340px;
  background: var(--paper-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--ink);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.portrait-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--ink-light);
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

.portrait-placeholder .sfx {
  font-family: var(--font-heading);
  font-size: 4rem;
  color: var(--accent);
  line-height: 1;
}

.portrait-placeholder .placeholder-text {
  opacity: 0.5;
  font-size: 0.75rem;
}

.volume-tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: var(--paper);
  background: var(--ink);
  padding: 0.3rem 1rem;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: clamp(3.5rem, 10vw, 7rem);
  line-height: 0.95;
  color: var(--ink);
  margin-bottom: 1.25rem;
  text-shadow: 3px 3px 0 var(--accent);
}

/* Speech bubble */
.speech-bubble {
  position: relative;
  display: inline-block;
  background: var(--white);
  border: var(--border-w) solid var(--ink);
  border-radius: 24px;
  padding: 0.85rem 1.5rem;
  margin-bottom: 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  max-width: 460px;
  box-shadow: 3px 3px 0 var(--ink);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 36px;
  width: 22px;
  height: 22px;
  background: var(--white);
  border-right: var(--border-w) solid var(--ink);
  border-bottom: var(--border-w) solid var(--ink);
  transform: rotate(45deg);
}

.hero-tagline {
  font-size: 1.15rem;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero-intro {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  max-width: 580px;
}

/* CTA sticker badges */
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.cta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  padding: 0.7rem 1.5rem;
  border: var(--border-w) solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.25s var(--ease-pop), box-shadow 0.25s var(--ease-smooth);
  position: relative;
  box-shadow: 4px 4px 0 var(--ink);
}

.cta-badge:hover {
  transform: rotate(-2deg) scale(1.05);
  box-shadow: 6px 6px 0 var(--ink);
}

.cta-badge:active {
  transform: rotate(0deg) scale(0.98);
  box-shadow: 2px 2px 0 var(--ink);
}

.cta-primary {
  background: var(--accent);
  color: var(--paper);
}

.cta-secondary {
  background: var(--paper);
  color: var(--ink);
}

/* ---------- 7. Shared Chapter Styles ---------- */
.chapter {
  position: relative;
  padding: var(--section-pad-y) 0;
}

.chapter-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3rem;
  position: relative;
}

.chapter-num {
  font-family: var(--font-heading);
  font-size: clamp(4rem, 8vw, 7rem);
  line-height: 1;
  color: var(--accent);
  opacity: 0.2;
  position: relative;
  top: -0.05em;
}

.chapter-title {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--ink);
  position: relative;
}

.chapter-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--accent);
}

/* ---------- 8. About Section ---------- */
.about {
  background: var(--paper);
}

.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  margin-bottom: 4rem;
}

.about-portrait {
  width: 260px;
  height: 320px;
  background: var(--paper-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-x) var(--shadow-y) 0 var(--ink);
  overflow: hidden;
  justify-self: center;
}

.about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.about-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.name-plate {
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  display: inline-flex;
  flex-direction: column;
  align-self: flex-start;
  box-shadow: 3px 3px 0 var(--accent);
}

.name-plate h3 {
  font-size: 1.6rem;
  letter-spacing: 0.08em;
}

.name-plate-sub {
  font-family: var(--font-body);
  font-size: 0.82rem;
  opacity: 0.85;
  letter-spacing: 0.03em;
  margin-top: 0.15rem;
}

/* Narration caption box */
.narration-box {
  background: var(--white);
  padding: 1.25rem 1.5rem;
  position: relative;
  box-shadow: 4px 4px 0 var(--ink);
}

.narration-box::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: -4px;
  bottom: -4px;
  border: 1px solid var(--ink-faint);
  pointer-events: none;
  z-index: -1;
}

.narration-box p {
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Stats block */
.stats-block {
  padding: 0.5rem 0;
}

.stats-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.stat-label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  width: 90px;
  flex-shrink: 0;
  text-align: right;
}

.stat-bar {
  flex: 1;
  height: 18px;
  background: var(--paper-dark);
  border: 2px solid var(--ink);
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}

.stat-fill {
  height: 100%;
  background: var(--ink);
  position: relative;
  transition: width 0.8s var(--ease-smooth);
}

/* Diagonal hatch fill for ink bars */
.stat-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 3px,
    rgba(245, 241, 232, 0.15) 3px,
    rgba(245, 241, 232, 0.15) 5px
  );
}

/* Origin story timeline */
.origin-story {
  margin-top: 2rem;
}

.origin-title {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.timeline-panel {
  background: var(--white);
  padding: 1.25rem;
  position: relative;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.3s var(--ease-pop), box-shadow 0.3s;
}

.timeline-panel:hover {
  transform: translateY(-4px);
  box-shadow: 6px 8px 0 var(--ink);
}

.timeline-year {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.4rem;
}

.timeline-panel h4 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.timeline-panel p {
  font-size: 0.85rem;
  color: var(--ink-light);
  line-height: 1.5;
}

/* Panel numbering */
.timeline-panel::before {
  content: attr(data-panel);
  position: absolute;
  top: -10px;
  right: 10px;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  background: var(--ink);
  color: var(--paper);
  padding: 2px 8px;
  letter-spacing: 0.1em;
}

/* How I Work section */
.how-i-work {
  margin-top: 3.5rem;
}

/* ---------- 9. Projects Section ---------- */
.projects {
  background: var(--paper-dark);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Panel sizing variations */
.project-panel.span-2 { grid-column: span 2; }
.project-panel.tall   { grid-row: span 2; }

.project-panel {
  position: relative;
  background: var(--white);
  border: var(--border-thick) solid var(--ink);
  border-radius: var(--panel-radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-x) var(--shadow-y) 0 var(--ink);
  transition: transform 0.3s var(--ease-pop), box-shadow 0.3s;
  overflow: hidden;
}

.project-panel:hover {
  transform: translateY(-6px);
  box-shadow: 8px 10px 0 var(--ink);
}

/* Title banner on corner */
.panel-title-banner {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  padding: 4px 14px;
}

.project-brand-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1rem;
}

.panel-brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.project-panel h3 {
  font-size: 1.4rem;
  margin-top: 1rem;
}

.project-brand-header h3 {
  margin-top: 0;
}

.project-caption {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.6;
  flex: 1;
}

.project-caption-extra {
  font-size: 0.85rem;
  color: var(--ink-light);
  line-height: 1.5;
  border-left: 3px solid var(--accent);
  padding-left: 0.6rem;
  margin-top: 0.25rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tech-tag {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  text-transform: uppercase;
  background: var(--paper);
}

.project-tag-pill {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--ink-light);
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 4px 10px;
  border-radius: 2px;
  margin-top: 0.35rem;
  align-self: flex-start;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding: 0.35rem 0;
  margin-top: 0.25rem;
  transition: gap 0.2s;
  align-self: flex-start;
}

.project-link:hover {
  gap: 0.6rem;
}

.project-link .arrow {
  transition: transform 0.2s;
}

.project-link:hover .arrow {
  transform: translateX(3px);
}

/* Future placeholder card */
.future-project-panel {
  background: var(--paper);
  border-style: dashed;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 220px;
}

.future-project-panel h3 {
  font-size: 1.8rem;
  letter-spacing: 0.1em;
  margin-top: 0;
  color: var(--accent);
}

.future-project-panel p {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: var(--ink-light);
}

/* Burst tag (POW!, ZAP!, BOOM!) */
.burst-tag {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  z-index: 2;
  transform: rotate(12deg) scale(0);
  transition: transform 0.35s var(--ease-pop);
  clip-path: polygon(
    50% 0%, 63% 20%, 93% 7%, 75% 33%,
    100% 50%, 75% 67%, 93% 93%, 63% 80%,
    50% 100%, 37% 80%, 7% 93%, 25% 67%,
    0% 50%, 25% 33%, 7% 7%, 37% 20%
  );
}

.project-panel:hover .burst-tag {
  transform: rotate(12deg) scale(1);
}

/* ---------- 10. Writing Section ---------- */
.writing {
  background: var(--paper);
}

.writing-intro-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  background: var(--white);
  border: var(--border-w) solid var(--ink);
  padding: 1.25rem 1.5rem;
  box-shadow: 4px 4px 0 var(--ink);
}

.writing-intro {
  flex: 1;
  min-width: 260px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.writing-toc {
  display: flex;
  flex-direction: column;
  border-top: var(--border-w) solid var(--ink);
}

.toc-entry {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1rem;
  border-bottom: var(--border-w) solid var(--ink);
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
}

.toc-entry:hover {
  background: var(--ink);
  color: var(--paper);
}

.toc-entry:hover .toc-date { color: rgba(245,241,232,0.6); }
.toc-entry:hover .toc-teaser { color: rgba(245,241,232,0.7); }

.toc-num {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  text-align: center;
}

.toc-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.toc-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.toc-teaser {
  font-size: 0.85rem;
  color: var(--ink-light);
  transition: color 0.25s;
  line-height: 1.4;
}

.toc-date {
  font-size: 0.8rem;
  color: var(--ink-light);
  font-variant-numeric: tabular-nums;
  transition: color 0.25s;
  white-space: nowrap;
}

/* Slide-in arrow */
.toc-arrow {
  position: absolute;
  right: 1rem;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.25s, transform 0.25s var(--ease-pop);
}

.toc-entry:hover .toc-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Substack Notes subsection */
.notes-section {
  margin-top: 3.5rem;
}

.notes-title {
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  letter-spacing: 0.08em;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.note-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--white);
  border: var(--border-w) solid var(--ink);
  padding: 1.1rem 1.35rem;
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.25s var(--ease-pop), box-shadow 0.25s, background 0.2s;
  position: relative;
}

.note-card:hover {
  transform: translateY(-3px);
  box-shadow: 6px 7px 0 var(--ink);
  background: var(--paper);
}

.note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.note-badge {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  background: var(--accent);
  color: var(--paper);
  padding: 2px 8px;
  border-radius: 2px;
}

.note-date {
  font-size: 0.78rem;
  color: var(--ink-light);
  font-variant-numeric: tabular-nums;
}

.note-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
}

.note-footer {
  display: flex;
  justify-content: flex-end;
}

.note-arrow {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

/* Topics subsection */
.topics-section {
  margin-top: 3.5rem;
}

.topics-title {
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  letter-spacing: 0.08em;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.topic-panel {
  background: var(--white);
  border: var(--border-w) solid var(--ink);
  padding: 1.25rem;
  box-shadow: 4px 4px 0 var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.25s var(--ease-pop), box-shadow 0.25s;
}

.topic-panel:hover {
  transform: translateY(-3px);
  box-shadow: 6px 6px 0 var(--ink);
}

.topic-panel .topic-num {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.topic-panel h4 {
  font-size: 1.1rem;
  line-height: 1.35;
}

/* ---------- 11. Contact Section ---------- */
.contact {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
}

.contact .chapter-num { color: var(--accent); opacity: 0.3; }
.contact .chapter-title { color: var(--paper); }
.contact .chapter-title::after { background: var(--accent); }
.contact .chapter-header {
  justify-content: center;
  margin-bottom: 2.5rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.sticker-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  padding: 0.65rem 1.4rem;
  background: var(--paper);
  color: var(--ink);
  border: var(--border-w) solid var(--paper);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--accent);
  transition: transform 0.25s var(--ease-pop), box-shadow 0.25s;
  cursor: pointer;
}

.sticker-btn:hover {
  transform: rotate(-3deg) scale(1.06);
  box-shadow: 6px 6px 0 var(--accent);
}

.sticker-btn:active {
  transform: rotate(0) scale(0.97);
  box-shadow: 2px 2px 0 var(--accent);
}

.sticker-btn .btn-icon {
  font-size: 1.2rem;
  line-height: 1;
}

/* ---------- 12. Footer ---------- */
.manga-footer {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 2.5rem var(--section-pad-x) 1.5rem;
  border-top: var(--border-thick) solid var(--accent);
}

.the-end {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
  position: relative;
  display: inline-block;
}

.the-end::before,
.the-end::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40px;
  height: 3px;
  background: var(--accent);
}

.the-end::before { right: calc(100% + 12px); }
.the-end::after  { left: calc(100% + 12px); }

.footer-copy {
  font-size: 0.8rem;
  opacity: 0.5;
  margin-top: 0.5rem;
}

/* ---------- 13. Scroll Reveal ---------- */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-smooth), transform 0.6s var(--ease-smooth);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.scroll-reveal-delay-1 { transition-delay: 0.1s; }
.scroll-reveal-delay-2 { transition-delay: 0.2s; }
.scroll-reveal-delay-3 { transition-delay: 0.3s; }
.scroll-reveal-delay-4 { transition-delay: 0.4s; }

/* ---------- 14. Click Effects ---------- */

/* Flash overlay */
.flash-overlay {
  position: fixed;
  inset: 0;
  background: var(--white);
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
}

.flash-overlay.flash {
  animation: flash-anim 0.2s ease-out;
}

@keyframes flash-anim {
  0%   { opacity: 0.5; }
  100% { opacity: 0; }
}

/* Screen shake */
.shake {
  animation: shake-anim 0.3s ease-out;
}

@keyframes shake-anim {
  0%, 100% { transform: translate(0); }
  10%      { transform: translate(-2px, 1px); }
  30%      { transform: translate(2px, -1px); }
  50%      { transform: translate(-1px, 2px); }
  70%      { transform: translate(1px, -2px); }
  90%      { transform: translate(-1px, 1px); }
}

/* Click burst particle */
.click-burst {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  width: 50px;
  height: 50px;
  transform: translate(-50%, -50%);
}

.click-burst::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  border-radius: 50%;
  animation: burst-anim 0.4s ease-out forwards;
}

@keyframes burst-anim {
  0%   { transform: scale(0); opacity: 0.7; }
  100% { transform: scale(2); opacity: 0; }
}

/* ---------- 15. Responsive ---------- */

/* Tablet and below */
@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .hero-portrait { order: -1; }
  .hero-ctas { justify-content: center; }

  .speech-bubble {
    margin-left: auto;
    margin-right: auto;
  }
  .speech-bubble::after {
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
  }

  .hero-intro {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-tagline { text-align: center; }

  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about-portrait { justify-self: center; }
  .name-plate { align-self: center; }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-panel.span-2 { grid-column: span 2; }

  .toc-entry {
    grid-template-columns: 50px 1fr;
    gap: 0.75rem;
  }

  .toc-date {
    grid-column: 2;
    justify-self: start;
    font-size: 0.75rem;
  }
}

/* Mobile */
@media (max-width: 600px) {
  :root {
    --section-pad-y: 3.5rem;
    --section-pad-x: 1rem;
  }

  .nav-links {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--ink);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease-smooth);
    z-index: 999;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-link {
    font-size: 1.3rem;
    padding: 0.6rem 1.5rem;
  }

  .burger {
    display: flex;
  }

  .hero-title {
    font-size: clamp(2.8rem, 12vw, 4.5rem);
  }

  .portrait-frame {
    width: 200px;
    height: 260px;
  }

  .about-portrait {
    width: 200px;
    height: 260px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-panel.span-2 { grid-column: span 1; }
  .project-panel.tall   { grid-row: span 1; }

  .timeline {
    grid-template-columns: 1fr;
  }

  .toc-entry {
    grid-template-columns: 45px 1fr;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
  }

  .contact-links {
    gap: 0.75rem;
  }

  .sticker-btn {
    font-size: 0.9rem;
    padding: 0.55rem 1rem;
  }

  .chapter-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .stat-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .stat-label {
    text-align: left;
    width: auto;
  }

  .stat-bar {
    width: 100%;
  }
}

/* ---------- 16. Anime Character Breakout Overlay ---------- */
.anime-breakout-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 920;
  overflow: hidden;
}

.anime-character {
  position: absolute;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}

/* Right-side entrance (Goku, Light) */
.anime-character.side-right {
  right: 0;
  justify-content: flex-end;
  transform: translate3d(105%, 0, 0) rotate(2.5deg);
  transition: transform 0.65s var(--ease-pop), opacity 0.4s var(--ease-smooth);
}

.anime-character.side-right.active {
  opacity: 1;
  transform: translate3d(0, 0, 0) rotate(0deg);
}

/* Left-side entrance (Eren, Naruto) */
.anime-character.side-left {
  left: 0;
  justify-content: flex-start;
  transform: translate3d(-105%, 0, 0) rotate(-2.5deg);
  transition: transform 0.65s var(--ease-pop), opacity 0.4s var(--ease-smooth);
}

.anime-character.side-left.active {
  opacity: 1;
  transform: translate3d(0, 0, 0) rotate(0deg);
}

/* Character figure wrapper */
.anime-figure-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.anime-char-img {
  display: block;
  width: 340px;
  max-height: 48vh;
  object-fit: contain;
  filter: drop-shadow(4px 4px 0 var(--ink));
  user-select: none;
  -webkit-user-drag: none;
}

.anime-char-img.flip-x {
  transform: scaleX(-1);
}

/* Identity Badge */
.anime-char-badge {
  position: absolute;
  bottom: 12px;
  display: inline-flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 4px 10px;
  border-radius: 2px;
  border-left: 4px solid var(--accent);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease-smooth), transform 0.3s var(--ease-pop);
  z-index: 2;
  white-space: nowrap;
}

.side-right .anime-char-badge {
  left: 12px;
}

.side-left .anime-char-badge {
  right: 12px;
}

.anime-character.bubble-visible .anime-char-badge {
  opacity: 1;
  transform: translateY(0);
}

.anime-char-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--paper);
}

.anime-char-series {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 2px;
}

/* Manga Speech Bubble */
.anime-speech-bubble {
  position: relative;
  background: var(--paper);
  border: var(--border-w) solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  border-radius: 4px;
  padding: 0.85rem 1.15rem;
  max-width: 290px;
  margin-bottom: 70px;
  opacity: 0;
  transform: scale(0.85) translateY(12px);
  transition: opacity 0.35s var(--ease-smooth), transform 0.35s var(--ease-pop);
  z-index: 3;
}

.side-right .anime-speech-bubble {
  margin-right: -35px;
}

.side-left .anime-speech-bubble {
  margin-left: -35px;
}

.anime-character.bubble-visible .anime-speech-bubble {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.anime-bubble-tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.anime-bubble-text {
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink);
  font-weight: 500;
  margin: 0;
}

/* Comic tails */
.anime-speech-bubble.tail-right::after {
  content: '';
  position: absolute;
  right: -13px;
  bottom: 22px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 13px solid var(--ink);
}

.anime-speech-bubble.tail-right::before {
  content: '';
  position: absolute;
  right: -9px;
  bottom: 22px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid var(--paper);
  z-index: 1;
}

.anime-speech-bubble.tail-left::after {
  content: '';
  position: absolute;
  left: -13px;
  bottom: 22px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-right: 13px solid var(--ink);
}

.anime-speech-bubble.tail-left::before {
  content: '';
  position: absolute;
  left: -9px;
  bottom: 22px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 10px solid var(--paper);
  z-index: 1;
}

/* Tablet breakpoint */
@media (max-width: 900px) {
  .anime-char-img {
    width: 270px;
    max-height: 40vh;
  }
  .anime-speech-bubble {
    max-width: 230px;
    padding: 0.75rem 1rem;
    margin-bottom: 50px;
  }
  .side-right .anime-speech-bubble { margin-right: -25px; }
  .side-left .anime-speech-bubble { margin-left: -25px; }
}

/* Mobile breakpoint (360px to 600px) */
@media (max-width: 600px) {
  .anime-character.side-right {
    flex-direction: column;
    align-items: flex-end;
  }
  .anime-character.side-left {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
  .anime-char-img {
    width: 160px;
    max-height: 25vh;
  }
  .anime-speech-bubble {
    max-width: 210px;
    padding: 0.55rem 0.8rem;
    margin-bottom: 8px;
  }
  .side-right .anime-speech-bubble {
    margin-right: 10px;
  }
  .side-left .anime-speech-bubble {
    margin-left: 10px;
  }
  .anime-bubble-text {
    font-size: 0.76rem;
    line-height: 1.35;
  }
  .anime-char-name {
    font-size: 0.95rem;
  }
  .anime-char-series {
    font-size: 0.6rem;
  }
  /* Mobile downward-pointing speech bubble tails */
  .anime-speech-bubble.tail-right::after,
  .anime-speech-bubble.tail-left::after {
    top: 100%;
    bottom: auto;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid var(--ink);
  }
  .anime-speech-bubble.tail-right::before,
  .anime-speech-bubble.tail-left::before {
    top: 100%;
    bottom: auto;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--paper);
    z-index: 1;
  }
  .anime-speech-bubble.tail-right::after { right: 28px; left: auto; }
  .anime-speech-bubble.tail-right::before { right: 30px; left: auto; }
  .anime-speech-bubble.tail-left::after { left: 28px; right: auto; }
  .anime-speech-bubble.tail-left::before { left: 30px; right: auto; }
}

/* ---------- 17. Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .scroll-reveal {
    opacity: 1;
    transform: none;
  }

  .speed-lines {
    opacity: 0.3;
  }

  .anime-character,
  .anime-character.side-right,
  .anime-character.side-left,
  .anime-speech-bubble,
  .anime-char-badge {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
  .anime-character.active {
    opacity: 1 !important;
  }
  .anime-character.bubble-visible .anime-speech-bubble,
  .anime-character.bubble-visible .anime-char-badge {
    opacity: 1 !important;
  }
}

/* ---------- 18. Print ---------- */
@media print {
  .manga-nav,
  .flash-overlay,
  .speed-lines,
  .burst-tag,
  .anime-breakout-stage { display: none; }

  .scroll-reveal { opacity: 1; transform: none; }

  body {
    background: white;
    color: black;
  }

  .contact {
    background: white;
    color: black;
  }
}
