/* ── FOUNDATIONS ─────────────────────────────────────────────────────────────── */
:root {
  --ink: #000000;
  --surface: #080808;
  --surface2: #0e0e0e;
  --border: rgba(255, 255, 255, 0.06);
  --gold: #d4a843;
  --gold2: #f0c866;
  --gold-glow: rgba(212, 168, 67, 0.15);
  --red: #e03535;
  --red2: #ff4040;
  --red-glow: rgba(224, 53, 53, 0.18);
  --green: #2dca73;
  --text: #ededf5;
  --muted: rgba(237, 237, 245, 0.40);
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --serif-ja: 'Noto Serif JP', serif;
  --radius: 14px;
  --radius-sm: 8px;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* Subtle noise texture for non-flat black */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ── CANVAS BACKGROUND ─────────────────────────────────────────────────────── */
#canvas-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

/* ── SCROLLBAR ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--ink);
}

::-webkit-scrollbar-thumb {
  background: rgba(212, 168, 67, 0.35);
  border-radius: 3px;
}

/* ── NAVBAR ──────────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem var(--gutter);
  background: rgba(0, 0, 0, 0.80);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(212, 168, 67, 0.12);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

/* Ninja mask logo — idle: subtle crimson eye pulse; hover: sharp scale flash */
.nav-shuriken {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 8px rgba(224, 53, 53, 0.5)) drop-shadow(0 0 18px rgba(212, 168, 67, 0.3));
  animation: mask-idle 4s ease-in-out infinite;
  transition: filter 0.25s;
}

.nav-logo:hover .nav-shuriken {
  animation: mask-flick 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  filter: drop-shadow(0 0 14px rgba(224, 53, 53, 0.9)) drop-shadow(0 0 28px rgba(212, 168, 67, 0.6));
}

@keyframes mask-idle {

  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(224, 53, 53, 0.45)) drop-shadow(0 0 16px rgba(212, 168, 67, 0.25));
  }

  50% {
    filter: drop-shadow(0 0 14px rgba(224, 53, 53, 0.8)) drop-shadow(0 0 24px rgba(212, 168, 67, 0.4));
  }
}

@keyframes mask-flick {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.18);
  }

  70% {
    transform: scale(0.96);
  }

  100% {
    transform: scale(1);
  }
}

.nav-title {
  font-family: var(--serif-ja);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-shadow: 0 0 20px rgba(212, 168, 67, 0.25);
}

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

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--gold);
}

.nav-badge {
  background: var(--gold);
  color: var(--ink);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

/* ── HERO ─────────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 1;
  min-height: 95vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8rem var(--gutter) 4rem;
  overflow: hidden;
}

/* Dual glow — gold centre + subtle red tint */
.hero::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  height: 80vw;
  max-width: 900px;
  max-height: 900px;
  background: radial-gradient(ellipse at center,
      rgba(212, 168, 67, 0.10) 0%,
      rgba(212, 168, 67, 0.04) 35%,
      rgba(224, 53, 53, 0.025) 60%,
      transparent 75%);
  pointer-events: none;
  animation: hero-glow-pulse 5s ease-in-out infinite;
}

/* Sweeping horizontal scan-line for HUD feel */
.hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 25%;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      rgba(212, 168, 67, 0.07) 20%,
      rgba(224, 53, 53, 0.05) 50%,
      rgba(212, 168, 67, 0.07) 80%,
      transparent);
  pointer-events: none;
  animation: scan-line 9s ease-in-out infinite;
}

@keyframes scan-line {

  0%,
  100% {
    opacity: 0;
    top: 25%;
  }

  50% {
    opacity: 1;
    top: 72%;
  }
}

@keyframes hero-glow-pulse {

  0%,
  100% {
    opacity: 0.8;
    transform: translateX(-50%) scale(1);
  }

  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.03);
  }
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
  width: 100%;
}

.kana-decoration {
  font-family: var(--serif-ja);
  font-size: clamp(6rem, 20vw, 14rem);
  line-height: 1;
  color: rgba(212, 168, 67, 0.04);
  position: absolute;
  top: -2rem;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  user-select: none;
  z-index: -1;
}

.hero-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fade-up 0.8s 0.2s forwards;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.eyebrow-star {
  font-size: 0.6em;
  animation: eyebrow-spin 8s linear infinite;
  display: inline-block;
}

@keyframes eyebrow-spin {
  to {
    transform: rotate(360deg);
  }
}

.hero-title {
  font-family: var(--serif-ja);
  font-size: clamp(3rem, 9vw, 7rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1em;
}

.title-word {
  display: block;
  opacity: 0;
  animation: fade-up 0.8s forwards;
}

.title-word:nth-child(1) {
  animation-delay: 0.35s;
}

.title-word:nth-child(2) {
  animation-delay: 0.5s;
}

.title-word:nth-child(3) {
  animation-delay: 0.65s;
}

.title-word.accent {
  background: linear-gradient(120deg, var(--gold), var(--gold2), #fff6c8, var(--gold));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fade-up 0.8s 0.5s forwards, shimmer-text 5s 1.2s linear infinite;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fade-up 0.8s 0.8s forwards;
}

/* ── SEARCH BOX ─────────────────────────────────────────────────────────────── */
.search-wrap {
  opacity: 0;
  animation: fade-up 0.8s 1s forwards;
  margin-bottom: 1.5rem;
}

.search-box-outer {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 60px;
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  gap: 0.75rem;
  backdrop-filter: blur(10px);
  transition: border-color 0.3s, box-shadow 0.3s;
  max-width: 660px;
  margin: 0 auto 0.75rem;
}

.search-box-outer:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 30px var(--gold-glow);
}

.search-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.search-icon svg {
  width: 100%;
  height: 100%;
}

#search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1.05rem;
  font-family: var(--font);
  caret-color: var(--gold);
}

#search-input::placeholder {
  color: rgba(232, 232, 240, 0.3);
}

.search-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--ink);
  border: none;
  border-radius: 50px;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.search-btn svg {
  width: 16px;
  height: 16px;
}

.search-btn:hover {
  opacity: 0.92;
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(212, 168, 67, 0.4);
}

.search-btn:active {
  transform: scale(0.98);
}

.search-hint {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* ── STATUS STRIP ────────────────────────────────────────────────────────────── */
.status-strip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--muted);
  opacity: 0;
  animation: fade-up 0.8s 1.2s forwards;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.3s;
}

.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.status-dot.error {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

/* ── SECTION LABEL ──────────────────────────────────────────────────────────── */
.section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--gold);
  margin-bottom: 1rem;
}

/* ── COLLECTION TILES ─────────────────────────────────────────────────────────── */
.collections-section {
  position: relative;
  z-index: 1;
  padding: 2rem var(--gutter) 5rem;
  text-align: center;
}

.tiles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.tile-skeleton {
  width: 200px;
  height: 110px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.collection-tile {
  position: relative;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.8rem;
  min-width: 180px;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  text-align: left;
  transform-style: preserve-3d;
}

.collection-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(224, 53, 53, 0.05), rgba(212, 168, 67, 0.04) 60%, transparent);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: inherit;
}

.collection-tile:hover::before {
  opacity: 1;
}

.collection-tile::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gold), transparent 60%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}

.collection-tile:hover {
  border-color: rgba(212, 168, 67, 0.45);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7), 0 0 20px var(--gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: translateY(-4px);
}

.collection-tile.active {
  border-color: var(--gold);
  background: rgba(212, 168, 67, 0.06);
  box-shadow: 0 0 28px var(--gold-glow);
}

.tile-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: rgba(212, 168, 67, 0.15);
  color: var(--gold);
  border: 1px solid rgba(212, 168, 67, 0.3);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.tile-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.tile-count {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--mono);
}

.tile-glyph {
  position: absolute;
  bottom: -0.5rem;
  right: 0.5rem;
  font-family: var(--serif-ja);
  font-size: 3.5rem;
  color: rgba(212, 168, 67, 0.06);
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

/* ── RESULTS ──────────────────────────────────────────────────────────────────── */
.results-section {
  position: relative;
  z-index: 1;
  padding: 1rem var(--gutter) 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

.results-section.hidden {
  display: none;
}

.results-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.results-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
}

.results-meta {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--mono);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.result-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
  opacity: 0;
  animation: card-in 0.5s forwards;
}

.result-card:hover {
  border-color: rgba(212, 168, 67, 0.35);
  background: rgba(212, 168, 67, 0.035);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.result-source {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  font-family: var(--mono);
}

.result-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.result-body {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-url {
  font-size: 0.7rem;
  color: rgba(212, 168, 67, 0.5);
  font-family: var(--mono);
  margin-top: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Loading skeleton for results */
.result-loading {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
}

.skel-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 0.6rem;
}

.skel-line.w-40 {
  width: 40%;
}

.skel-line.w-70 {
  width: 70%;
}

.skel-line.w-90 {
  width: 90%;
}

.skel-line.w-60 {
  width: 60%;
}

/* ── HOW IT WORKS ────────────────────────────────────────────────────────────── */
.how-section {
  position: relative;
  z-index: 1;
  padding: 6rem var(--gutter);
  background: linear-gradient(180deg, transparent 0%, rgba(212, 168, 67, 0.02) 50%, transparent 100%);
}

.how-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.how-title {
  font-family: var(--serif-ja);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 3rem;
  background: linear-gradient(120deg, #fff, var(--gold2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.step-card {
  position: relative;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: left;
  transition: var(--transition);
  animation: card-in 0.6s calc(var(--i) * 0.12s + 0.3s) both;
}

.step-card:hover {
  border-color: rgba(212, 168, 67, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--gold-glow);
}

.step-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(212, 168, 67, 0.5);
  margin-bottom: 0.75rem;
}

.step-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.step-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.step-card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ── ABOUT ────────────────────────────────────────────────────────────────────── */
.about-section {
  position: relative;
  z-index: 1;
  padding: 6rem var(--gutter);
  border-top: 1px solid var(--border);
}

.about-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4rem;
  align-items: center;
}

.about-kanji {
  font-family: var(--serif-ja);
  font-size: clamp(4rem, 10vw, 8rem);
  line-height: 1;
  color: rgba(212, 168, 67, 0.12);
  writing-mode: vertical-rl;
  letter-spacing: 0.1em;
  user-select: none;
}

.about-content h2 {
  font-family: var(--serif-ja);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 1rem;
}

.about-content p {
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.about-content strong {
  color: var(--text);
  font-weight: 600;
}

.about-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--mono);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  border: 1px solid rgba(212, 168, 67, 0.25);
  color: var(--gold);
  background: rgba(212, 168, 67, 0.06);
}

/* ── FOOTER ───────────────────────────────────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4rem var(--gutter);
  border-top: 1px solid var(--border);
}

.footer-shuriken {
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 1rem;
  animation: spin-slow 8s linear infinite;
  display: inline-block;
}

.footer-brand {
  font-family: var(--serif-ja);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.3em;
  margin-bottom: 0.5rem;
}

.footer-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.footer-copy {
  font-size: 0.75rem;
  color: rgba(232, 232, 240, 0.25);
  font-family: var(--mono);
}

/* ── ANIMATIONS ──────────────────────────────────────────────────────────────── */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes shimmer-text {
  0% {
    background-position: 0% center;
  }

  100% {
    background-position: 200% center;
  }
}

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .nav-links {
    gap: 1rem;
  }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-kanji {
    writing-mode: horizontal-tb;
    font-size: 4rem;
  }
}

/* ── LIVE COLLECTION BADGES ──────────────────────────────────────────────────── */
/* Pulsing green "LIVE" badge shown on live collection tiles */
.live-badge {
  display: inline-block;
  background: rgba(45, 202, 115, 0.18);
  color: var(--green);
  border: 1px solid rgba(45, 202, 115, 0.4);
  font-size: 0.5rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  margin-left: 0.4em;
  vertical-align: middle;
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 6px rgba(45, 202, 115, 0.4);
  }

  50% {
    opacity: 0.7;
    box-shadow: 0 0 14px rgba(45, 202, 115, 0.7);
  }
}

/* Per-result source badge (e.g. "Wikipedia · Hacker News") */
.result-source-badge {
  display: inline-block;
  background: rgba(212, 168, 67, 0.12);
  color: var(--gold2);
  border: 1px solid rgba(212, 168, 67, 0.25);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.4em;
  vertical-align: middle;
  text-transform: uppercase;
}

/* ── Mascot ─────────────────────────────────────────────────────────────────── */
.hero-mascot {
  position: absolute;
  right: clamp(2rem, 6vw, 8rem);
  bottom: -2rem;
  width: clamp(130px, 18vw, 260px);
  filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.5));
  animation: mascot-float 4s ease-in-out infinite, mascot-in 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 0s, 0.3s;
  pointer-events: none;
  z-index: 5;
}

@keyframes mascot-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

@keyframes mascot-in {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.8);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Make hero position:relative so absolute mascot is contained */
.hero {
  position: relative;
  overflow: visible;
}

.about-mascot {
  width: clamp(160px, 22vw, 300px);
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.4));
  flex-shrink: 0;
  animation: mascot-float 5s ease-in-out infinite;
}

/* result source badge */
.result-source-badge {
  display: inline-block;
  background: rgba(212, 168, 67, 0.15);
  border: 1px solid rgba(212, 168, 67, 0.3);
  color: #d4a843;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  margin-left: 0.5em;
  vertical-align: middle;
  text-transform: uppercase;
}

/* ── PRIVACY MODE TOGGLE (navbar) ───────────────────────────────────────────── */
.privacy-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  backdrop-filter: blur(8px);
}

.ptog-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.ptog-btn:hover {
  color: var(--text);
}

.ptog-btn.active {
  background: var(--gold);
  color: #07070f;
  box-shadow: 0 2px 12px rgba(212, 168, 67, 0.35);
}

.ptog-btn.active .ptog-icon {
  filter: none;
}

#btn-smoke.active {
  background: linear-gradient(135deg, #3a4a8c 0%, #7b8abf 100%);
  color: #e8e8f8;
  box-shadow: 0 2px 16px rgba(91, 100, 180, 0.4);
}

.ptog-icon {
  font-size: 0.85em;
}

/* ── MODE BANNERS (above tiles) ─────────────────────────────────────────────── */
.mode-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.2rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-sm);
  background: rgba(212, 168, 67, 0.08);
  border: 1px solid rgba(212, 168, 67, 0.25);
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.55;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mode-banner.smoke {
  background: rgba(91, 100, 180, 0.1);
  border-color: rgba(91, 100, 180, 0.3);
}

.mode-banner-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.mode-banner-text em {
  color: var(--gold);
  font-style: normal;
  font-weight: 600;
}

.mode-banner.smoke .mode-banner-text em {
  color: #8899dd;
}

.mode-learn-more {
  display: inline-block;
  margin-left: 0.5rem;
  background: rgba(91, 100, 180, 0.2);
  border: 1px solid rgba(91, 100, 180, 0.4);
  color: #8899dd;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-learn-more:hover {
  background: rgba(91, 100, 180, 0.35);
  color: #c0c8f0;
}

/* ── SMOKE-LOCKED TILES ─────────────────────────────────────────────────────── */
.collection-tile.smoke-locked {
  opacity: 0.38;
  filter: grayscale(0.7);
  cursor: not-allowed;
}

.collection-tile.smoke-locked:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* ── MODE BADGES on tiles ───────────────────────────────────────────────────── */
.mode-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.45em;
  vertical-align: middle;
  text-transform: none;
}

.badge-smoke {
  background: rgba(91, 100, 180, 0.25);
  border: 1px solid rgba(91, 100, 180, 0.45);
  color: #9daae8;
}

.badge-locked {
  background: rgba(180, 180, 200, 0.08);
  border: 1px solid rgba(180, 180, 200, 0.2);
  color: rgba(180, 180, 200, 0.4);
}

/* ── SHAKE animation (locked tile click) ────────────────────────────────────── */
@keyframes shake {
  0% {
    transform: translateX(0);
  }

  15% {
    transform: translateX(-6px) rotate(-1deg);
  }

  35% {
    transform: translateX(6px) rotate(1deg);
  }

  55% {
    transform: translateX(-4px) rotate(-0.5deg);
  }

  75% {
    transform: translateX(4px) rotate(0.5deg);
  }

  100% {
    transform: translateX(0);
  }
}

.collection-tile.shake {
  animation: shake 0.45s ease !important;
}

/* ── SMOKE SCREEN EXPLAINER MODAL ───────────────────────────────────────────── */
.smoke-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.smoke-modal.hidden {
  display: none;
}

.smoke-modal-inner {
  position: relative;
  background: #12122a;
  border: 1px solid rgba(91, 100, 180, 0.35);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  max-width: 680px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0, 0, 20, 0.7);
}

.smoke-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.smoke-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.smoke-modal-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.smoke-modal-inner h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.9rem;
}

.smoke-modal-inner p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
  margin-bottom: 1.4rem;
}

.smoke-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.compare-col {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.compare-head {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 0.7rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.compare-head.good {
  color: var(--gold);
}

.compare-head.medium {
  color: #8899dd;
}

.compare-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.compare-col li {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  padding-left: 1rem;
  position: relative;
}

.compare-col li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--border);
}

.compare-col li strong {
  color: var(--text);
}

.smoke-tagline {
  margin-bottom: 0 !important;
  font-style: italic;
  color: rgba(232, 232, 240, 0.5) !important;
  border-top: 1px solid var(--border);
  padding-top: 1rem !important;
}

/* ── RESULT ACTION BUTTONS ───────────────────────────────────────────────────── */
.result-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.result-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: 1px solid transparent;
  font-family: var(--font);
}

.ninja-view-btn {
  background: rgba(212, 168, 67, 0.12);
  border-color: rgba(212, 168, 67, 0.3);
  color: var(--gold);
}

.ninja-view-btn:hover {
  background: rgba(212, 168, 67, 0.22);
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.2);
}

.result-direct-btn {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--muted);
}

.result-direct-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* ── NINJA VIEW OVERLAY ──────────────────────────────────────────────────────── */
.ninja-view-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  background: #07070f;
}

.ninja-view-overlay.hidden {
  display: none;
}

.ninja-view-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: #0a0a1c;
  border-bottom: 1px solid rgba(212, 168, 67, 0.2);
  flex-shrink: 0;
  gap: 1rem;
}

.ninja-view-chrome-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.ninja-view-logo {
  font-size: 1.1rem;
}

.ninja-view-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gold);
  white-space: nowrap;
}

.ninja-privacy-pill {
  background: rgba(46, 200, 115, 0.1);
  border: 1px solid rgba(46, 200, 115, 0.25);
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.ninja-view-chrome-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.ninja-direct-link {
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.ninja-direct-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.ninja-close-btn {
  background: rgba(201, 58, 58, 0.12);
  border: 1px solid rgba(201, 58, 58, 0.3);
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font);
}

.ninja-close-btn:hover {
  background: rgba(201, 58, 58, 0.22);
}

/* ── SOURCE DROPDOWN ROW ────────────────────────────────────────────────────── */
.search-hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0.25rem;
  flex-wrap: wrap;
}

.search-hint {
  /* existing hint is now inside .search-hint-row */
  margin: 0 !important;
  flex: 1;
}

.source-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.source-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.source-select {
  background: rgba(10, 10, 28, 0.95);
  border: 1px solid rgba(212, 168, 67, 0.25);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.8rem;
  font-family: var(--font);
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  max-width: 220px;
}

.source-select:hover {
  border-color: rgba(212, 168, 67, 0.5);
}

.source-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.15);
}

.source-select optgroup {
  background: #0a0a1c;
  color: var(--muted);
  font-size: 0.7rem;
}

.source-select option {
  background: #0a0a1c;
  color: var(--text);
  padding: 4px 8px;
}

/* ── MODE BANNERS ROW (slim strip below hero) ─────────────────────────────── */
.mode-banners-row {
  max-width: 860px;
  margin: -0.5rem auto 1.5rem;
  padding: 0 1.5rem;
}

.mode-banners-row .mode-banner {
  margin: 0;
  border-radius: 10px;
}

/* ── HIDE legacy collections section gap ─────────────────────────────────── */
.collections-section {
  display: none;
}

/* ── NINJA VIEW FRAME ─────────────────────────────────────────────────────── */
.ninja-view-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

/* ══════════════════════════════════════════════════════════════════════
   LORE SECTION — Chunin / Name Behind the Mask
   ══════════════════════════════════════════════════════════════════════ */
.lore-section {
  position: relative;
  z-index: 1;
  padding: 7rem var(--gutter) 6rem;
  overflow: hidden;
}

/* Dramatic background — faint rising smoke effect */
.lore-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 10% 50%, rgba(212, 168, 67, 0.05) 0%, transparent 70%),
    linear-gradient(180deg, transparent 0%, rgba(212, 168, 67, 0.03) 50%, transparent 100%);
  pointer-events: none;
}

.lore-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.lore-title {
  font-family: var(--serif-ja);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  margin-bottom: 3rem;
  line-height: 1.15;
  color: var(--text);
}

.lore-accent {
  background: linear-gradient(120deg, var(--gold), var(--gold2), #fff6c8);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer-text 5s 0.5s linear infinite;
}

/* Two-column layout: big kanji left, text right */
.lore-grid {
  display: grid;
  grid-template-columns: minmax(90px, 130px) 1fr;
  gap: 3.5rem;
  align-items: start;
}

.lore-kanji {
  font-family: var(--serif-ja);
  font-size: clamp(4rem, 8vw, 7.5rem);
  line-height: 1;
  color: rgba(212, 168, 67, 0.15);
  writing-mode: vertical-rl;
  letter-spacing: 0.1em;
  user-select: none;
  transition: color 0.4s;
}

.lore-section:hover .lore-kanji {
  color: rgba(212, 168, 67, 0.25);
}

.lore-text p {
  color: var(--muted);
  font-size: clamp(0.92rem, 1.5vw, 1.05rem);
  line-height: 1.8;
  margin-bottom: 1.4rem;
}

.lore-text p strong {
  color: var(--text);
  font-weight: 600;
}

.lore-text p em {
  color: var(--gold2);
  font-style: normal;
}

/* Centre divider with kanji glyph */
.lore-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0 1.4rem;
  color: rgba(212, 168, 67, 0.3);
}

.lore-divider::before,
.lore-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 168, 67, 0.25), transparent);
}

.lore-divider span {
  font-family: var(--serif-ja);
  font-size: 1.1rem;
  color: rgba(212, 168, 67, 0.5);
}

/* Pill row */
.lore-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.lore-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  border: 1px solid rgba(212, 168, 67, 0.28);
  color: var(--gold);
  background: rgba(212, 168, 67, 0.07);
  transition: background 0.25s, border-color 0.25s;
  cursor: default;
}

.lore-pill:hover {
  background: rgba(212, 168, 67, 0.14);
  border-color: rgba(212, 168, 67, 0.5);
}

@media (max-width: 640px) {
  .lore-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .lore-kanji {
    writing-mode: horizontal-tb;
    font-size: 3.5rem;
    letter-spacing: 0.5em;
  }
}

/* ── Also add "Lore" nav link if added later ──────────────────────────────── */

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET  (≤ 900px)
   ══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .nav-links {
    gap: 1.2rem;
  }

  .nav-link:not(.nav-badge-link) {
    display: none;
  }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .about-kanji {
    writing-mode: horizontal-tb;
    font-size: 3rem;
    letter-spacing: 0.4em;
  }

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

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE  (≤ 640px)
   ══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* Navbar */
  .navbar {
    padding: 0.75rem 1.25rem;
  }

  .nav-title {
    font-size: 1.1rem;
  }

  .nav-links {
    gap: 0.75rem;
  }

  .nav-link {
    display: none;
  }

  .nav-badge {
    display: inline-block;
  }

  /* Hero */
  .hero {
    padding: 7rem 1.25rem 3rem;
    min-height: 85vh;
  }

  /* Search box — stacked */
  .search-box-outer {
    flex-direction: column;
    align-items: stretch;
    border-radius: 18px;
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .search-box-outer .search-icon {
    display: none;
  }

  #search-input {
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
  }

  .search-btn {
    border-radius: 12px;
    justify-content: center;
    padding: 0.8rem 1rem;
  }

  #collection-select {
    width: 100%;
    max-width: 100%;
  }

  /* Collection tiles — 2 per row */
  .tiles-grid {
    gap: 0.75rem;
  }

  .collection-tile {
    min-width: calc(50% - 0.375rem);
    padding: 1rem 1.2rem;
  }

  /* Results — single column */
  .results-grid {
    grid-template-columns: 1fr;
  }

  .result-card-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .result-card-actions .btn-ninja,
  .result-card-actions .btn-direct {
    flex: 1;
    justify-content: center;
    font-size: 0.78rem;
    padding: 0.55rem 0.75rem;
  }

  /* How-it-works — single column */
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* About */
  .about-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: left;
  }

  .about-kanji {
    display: none;
  }

  /* Ninja View chrome */
  .ninja-bar {
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
  }

  .ninja-bar-url {
    width: 100%;
    font-size: 0.7rem;
    order: 3;
  }

  .ninja-bar-actions {
    gap: 0.35rem;
  }

  /* Status strip */
  .status-strip {
    font-size: 0.68rem;
    padding: 0.3rem 0.75rem;
  }

  /* Lore grid */
  .lore-grid {
    grid-template-columns: 1fr;
  }

  /* Privacy toggle shrinking */
  .privacy-toggle {
    padding: 2px;
  }

  .ptog-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.62rem;
    gap: 0.25rem;
  }

  .ptog-icon {
    font-size: 0.85em;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — EXTRA SMALL  (≤ 380px, e.g. iPhone SE)
   ══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .hero-title {
    font-size: clamp(2.4rem, 14vw, 3.5rem);
  }

  .collection-tile {
    min-width: 100%;
  }

  .nav-title {
    display: none;
  }

  /* icon only at narrowest width */

  .ptog-btn {
    padding: 0.25rem 0.4rem;
    font-size: 0.55rem;
  }
}