/* ====== Nekogiri — manga visit-card ====== */

:root {
  --ink: #1a1815;
  --ink-soft: #3a3631;
  --paper: #f6f1e3;
  --paper-bright: #fffaec;
  --nori: #2c4a37;
  --nori-bright: #3c6649;
  --blush: #f5b7b0;
  --sakura: #ffd9e2;
  --rice: #f9e9bd;
  --leaf: #cfe5c1;
  --line: 4px solid var(--ink);
  --shadow-hard: 8px 8px 0 var(--ink);
  --shadow-soft: 4px 4px 0 var(--ink);
}

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

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.neko {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Halftone + paper grain background */
.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(26, 24, 21, .07) 1px, transparent 1.5px),
    radial-gradient(circle at 70% 80%, rgba(26, 24, 21, .05) 1px, transparent 1.5px),
    radial-gradient(circle at 45% 55%, rgba(26, 24, 21, .04) 1px, transparent 1.5px);
  background-size: 28px 28px, 36px 36px, 22px 22px;
  background-position: 0 0, 14px 18px, 7px 11px;
  opacity: .9;
}

/* Floating decoration */
.deco-rice, .deco-nori {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}
.deco-rice {
  width: 22px;
  height: 14px;
  background: var(--paper-bright);
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink);
}
.deco-nori {
  width: 26px;
  height: 26px;
  background: var(--nori);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 2px 2px 0 var(--ink);
}

/* ====== Top bar ====== */
.neko-topbar {
  position: relative;
  z-index: 10;
  max-width: 1100px;
  margin: 24px auto 8px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.neko-brand {
  display: block;
  flex-shrink: 0;
}
.neko-brand img {
  height: 56px;
  width: auto;
  display: block;
  transition: transform .2s;
}
.neko-brand:hover img { transform: translate(-2px, -2px); }

.neko-socials-mini {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.neko-socials-mini a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-bright);
  border: 2.5px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.neko-socials-mini a:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
  background: var(--blush);
}
.neko-socials-mini svg {
  width: 20px;
  height: 20px;
}

/* ====== Project switcher ====== */
.proj-switch {
  position: relative;
  z-index: 10;
  width: max-content;
  max-width: 100%;
  background: var(--paper-bright);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 8px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--shadow-soft);
}
.proj-switch .ps-item {
  color: var(--ink);
  text-decoration: none;
  opacity: .5;
  transition: opacity .15s, transform .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.proj-switch .ps-item:hover { opacity: 1; }
.proj-switch .ps-item.active { opacity: 1; }
.proj-switch .ps-sep { opacity: .3; font-weight: 400; }
.proj-switch .ps-mark { font-size: 18px; line-height: 1; }

/* ====== Page layout ====== */
.manga-page {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 22px 60px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ====== Panel base ====== */
.panel {
  position: relative;
  background: #fff;
  border: var(--line);
  padding: 36px 32px;
  box-shadow: var(--shadow-hard);
  border-radius: 4px;
}

/* ====== HERO panel ====== */
.panel--hero {
  text-align: center;
  transform: rotate(-.7deg);
  padding: 56px 32px 36px;
  overflow: hidden;
}
.panel--hero .speed-lines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    115deg,
    transparent 0,
    transparent 16px,
    rgba(26, 24, 21, .06) 16px,
    rgba(26, 24, 21, .06) 17px
  );
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 28%, black 75%);
          mask-image: radial-gradient(ellipse at center, transparent 28%, black 75%);
}

.kana {
  font-family: 'Yuji Mai', 'Noto Serif JP', serif;
  color: var(--ink);
  letter-spacing: .04em;
  line-height: 1;
}
.kana--top {
  position: absolute;
  top: 14px;
  left: 24px;
  font-size: clamp(40px, 6vw, 64px);
  opacity: .14;
  transform: rotate(-4deg);
}
.kana--side {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 52px;
  opacity: .12;
}

.title-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 18px 0 24px;
  position: relative;
  z-index: 2;
}
.title-cyr {
  font-family: 'Bagel Fat One', 'Manrope', sans-serif;
  font-size: clamp(56px, 11vw, 120px);
  line-height: .95;
  color: var(--ink);
  text-shadow: 6px 6px 0 var(--rice);
  letter-spacing: .02em;
}

.hero-art {
  position: relative;
  margin: 8px auto 4px;
  width: clamp(220px, 48%, 360px);
}
.hero-img {
  display: block;
  width: 100%;
  height: auto;
}
.hero-img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  background: var(--rice);
  border: 3px dashed var(--ink);
  border-radius: 12px;
  font-family: 'Yuji Mai', serif;
  color: var(--ink-soft);
  font-size: 18px;
  text-align: center;
  padding: 24px;
}

.sparkle {
  position: absolute;
  font-family: 'Mochiy Pop One', sans-serif;
  color: var(--nori);
  font-size: 28px;
  animation: twinkle 2.6s ease-in-out infinite;
}
.sparkle--1 { top: 4%;  left: -8%; }
.sparkle--2 { top: 26%; right: -6%; animation-delay: .5s; }
.sparkle--3 { bottom: 14%; left: -2%; animation-delay: 1s; font-size: 22px; }

@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0); opacity: .55; }
  50%      { transform: scale(1.3) rotate(8deg); opacity: 1; }
}

.sfx {
  position: absolute;
  font-family: 'Mochiy Pop One', sans-serif;
  line-height: 1;
}
.sfx--nya {
  top: -2%;
  right: -14%;
  font-size: clamp(28px, 4vw, 44px);
  color: var(--blush);
  -webkit-text-stroke: 1.5px var(--ink);
  transform: rotate(14deg);
  text-shadow: 3px 3px 0 var(--ink);
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: rotate(14deg) translateY(0); }
  50%      { transform: rotate(10deg) translateY(-6px); }
}

.tagline {
  font-size: clamp(15px, 1.6vw, 19px);
  color: var(--ink);
  opacity: .8;
  margin-top: 14px;
  position: relative;
  z-index: 2;
  letter-spacing: 0.2em;
}

/* ====== Generic panel headings ====== */
.panel-title {
  font-family: 'Bagel Fat One', 'Manrope', sans-serif;
  font-size: clamp(22px, 2.6vw, 30px);
  color: var(--ink);
  margin-bottom: 16px;
  display: inline-block;
  position: relative;
}
.panel-title::after {
  content: '';
  display: block;
  height: 5px;
  background: var(--blush);
  border-radius: 4px;
  margin-top: 4px;
  border: 2px solid var(--ink);
  border-top: none;
  border-radius: 0 0 6px 6px;
}

/* ====== ABOUT panel (speech bubble) ====== */
.panel--about {
  transform: rotate(.5deg);
}
.speech-bubble {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 22px 26px;
  position: relative;
  font-size: clamp(15px, 1.7vw, 17px);
  line-height: 1.7;
  box-shadow: var(--shadow-soft);
  margin-top: 6px;
}
.speech-bubble::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 36px;
  width: 26px;
  height: 18px;
  background: var(--paper);
  border-left: 3px solid var(--ink);
  border-top: 3px solid var(--ink);
  border-right: 3px solid var(--ink);
  transform: skewX(-18deg);
  border-top-right-radius: 6px;
  border-top-left-radius: 6px;
}
.speech-bubble p + p { margin-top: 12px; }
.speech-bubble strong {
  color: var(--nori);
  font-weight: 800;
}

/* ====== Two small side-by-side panels ====== */
.panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.panel--small {
  padding: 28px 24px;
  overflow: hidden;
}
.panel-row .panel--small:first-child { transform: rotate(-.8deg); }
.panel-row .panel--small:last-child  { transform: rotate(.7deg); }

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.tag {
  background: var(--rice);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 2px 2px 0 var(--ink);
}
.tag:nth-child(2) { background: var(--sakura); }
.tag:nth-child(3) { background: var(--blush); }
.tag:nth-child(4) { background: var(--leaf); }

.tags--about {
  margin-top: 18px;
  justify-content: flex-start;
}

.big-num {
  font-family: 'Bagel Fat One', 'Manrope', sans-serif;
  font-size: clamp(56px, 8vw, 88px);
  line-height: 1;
  color: var(--nori);
  text-shadow: 4px 4px 0 var(--ink);
  margin-top: 6px;
}
.small-cap {
  color: var(--ink);
  opacity: .7;
  font-size: 14px;
  margin-top: 6px;
  font-weight: 500;
}

/* ====== CTA panel ====== */
.panel--cta {
  text-align: center;
  background: var(--nori);
  color: var(--paper-bright);
  transform: rotate(-.4deg);
  padding: 44px 32px 40px;
  position: relative;
  overflow: hidden;
}
.panel--cta .coming {
  font-family: 'Bagel Fat One', 'Manrope', sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  color: var(--paper-bright);
  line-height: 1.1;
}
.panel--cta .follow-text {
  margin-top: 6px;
  opacity: .85;
  font-size: 15px;
}
.neko-socials {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}
.neko-socials a {
  color: var(--ink);
  background: var(--paper-bright);
  text-decoration: none;
  font-weight: 700;
  padding: 10px 22px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .15s, box-shadow .15s;
  font-size: 14px;
}
.neko-socials a:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}
.sfx--mogu {
  position: absolute;
  bottom: 30px;
  right: 15px;
  color: rgba(255, 255, 255, .14);
  transform: rotate(-8deg);
  z-index: 1;
  font-size: 50px;
}

/* ====== Gallery / carousel ====== */
.panel--gallery {
  transform: rotate(-.3deg);
  padding: 32px 28px;
  overflow: hidden;
}
.panel--gallery .panel-title { margin-bottom: 4px; }
.gallery-hint {
  font-family: 'Yuji Mai', 'Noto Serif JP', serif;
  font-size: 15px;
  opacity: .65;
  margin-bottom: 22px;
}

.carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.carousel-track {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 6px 4px 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--ink) transparent;
}
.carousel-track::-webkit-scrollbar { height: 8px; }
.carousel-track::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 4px; }
.carousel-track::-webkit-scrollbar-track { background: transparent; }

.carousel-slide {
  flex: 0 0 calc((100% - 36px) / 3);
  scroll-snap-align: center;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 4px;
  box-shadow: var(--shadow-soft);
  padding: 0;
  cursor: zoom-in;
  overflow: hidden;
  transition: transform .18s, box-shadow .18s;
  font: inherit;
}
.carousel-slide:hover {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--ink);
}
.carousel-slide:focus-visible {
  outline: 3px solid var(--blush);
  outline-offset: 3px;
}
.carousel-slide img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.carousel-arrow {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--paper-bright);
  border: 3px solid var(--ink);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .15s, box-shadow .15s, background .15s, opacity .15s;
}
.carousel-arrow:hover:not(:disabled) {
  background: var(--blush);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}
.carousel-arrow:disabled {
  opacity: .3;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .carousel-slide { flex: 0 0 calc((100% - 18px) / 2); }
}
@media (max-width: 600px) {
  .carousel-slide { flex: 0 0 86%; }
  .carousel-arrow { width: 40px; height: 40px; }
}

/* ====== Lightbox ====== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 18, 16, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 72px;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox[hidden] { display: none; }

.lightbox-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  max-height: 100%;
}
.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  border: 4px solid var(--paper-bright);
  border-radius: 4px;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .55);
  cursor: zoom-out;
  background: #fff;
}
.lightbox-counter {
  color: var(--paper-bright);
  font-family: 'Yuji Mai', serif;
  font-size: 14px;
  opacity: .75;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: var(--paper-bright);
  border: 3px solid var(--ink);
  color: var(--ink);
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bagel Fat One', sans-serif;
  line-height: 1;
  box-shadow: 3px 3px 0 var(--ink);
  transition: background .15s, transform .15s, box-shadow .15s;
  padding: 0;
}
.lightbox-close {
  top: 22px;
  right: 22px;
  width: 46px;
  height: 46px;
  font-size: 30px;
}
.lightbox-nav {
  top: 50%;
  width: 52px;
  height: 52px;
  font-size: 36px;
  transform: translateY(-50%);
}
.lightbox-nav--prev { left: 18px; }
.lightbox-nav--next { right: 18px; }
.lightbox-close:hover,
.lightbox-nav:hover { background: var(--blush); box-shadow: 5px 5px 0 var(--ink); }
.lightbox-close:hover { transform: translate(-2px, -2px); }
.lightbox-nav:hover { transform: translateY(-50%) translate(-2px, -2px); }

@media (max-width: 600px) {
  .lightbox { padding: 16px 8px; }
  .lightbox-close { top: 12px; right: 12px; width: 40px; height: 40px; font-size: 26px; }
  .lightbox-nav { width: 42px; height: 42px; font-size: 28px; }
  .lightbox-nav--prev { left: 8px; }
  .lightbox-nav--next { right: 8px; }
}

/* ====== Footer ====== */
.neko-footer {
  text-align: center;
  padding: 32px 20px 40px;
  color: var(--ink);
  font-size: 13px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.neko-footer-logo {
  height: 56px;
  width: auto;
  opacity: .9;
}
.neko-footer p {
  opacity: .6;
  max-width: 540px;
}

/* ====== Responsive ====== */
@media (max-width: 720px) {
  .panel-row { grid-template-columns: 1fr; }
  .panel { padding: 28px 22px; box-shadow: 5px 5px 0 var(--ink); }
  .title-cyr { text-shadow: 4px 4px 0 var(--rice); }
  .kana--top { font-size: 42px; left: 16px; }
  .sfx--nya { right: -8%; }
  .manga-page { gap: 24px; padding: 8px 16px 50px; }

  .neko-topbar {
    justify-content: center;
    gap: 14px;
    padding: 0 16px;
  }
  .neko-brand img { height: 48px; }
  .neko-socials-mini a { width: 38px; height: 38px; }
  .neko-socials-mini svg { width: 18px; height: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .sparkle, .sfx--nya { animation: none; }
}
