/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0f;
  --bg-light: #12121a;
  --text: #f5f5f7;
  --text-dim: #888;
  --accent: #a855f7;
  --accent-pink: #f472b6;
  --accent-cyan: #22d3ee;
  --mono: 'Space Mono', monospace;
  --sans: 'Space Grotesk', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  /* Cat paw cursor - using emoji as data URI */
  cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><text y='24' font-size='24'>🐾</text></svg>") 8 8, auto;
}

/* Pointer cursor for clickable elements */
a, button, .connect-btn, .mint-btn, .qty-btn, details summary, .reason {
  cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><text y='24' font-size='24'>😺</text></svg>") 8 8, pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

/* On-chain verification link */
.on-chain-link {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.on-chain-link:hover {
  color: var(--accent);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 {
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--mono);
  font-size: 1rem;
  text-transform: lowercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

p {
  color: var(--text-dim);
  max-width: 50ch;
}

.big-text {
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--text);
  margin-bottom: 1rem;
  max-width: 30ch;
}

/* ===== LAYOUT ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 100px 0;
}

/* ===== NAV ===== */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.connect-btn {
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.connect-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.connect-btn.connected {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}

/* ===== KALEIDOSCOPE ===== */
.kaleidoscope-container {
  flex: 1;
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: 60px;
}

/* ===== TWINKLING STARS ===== */
.stars-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--twinkle-duration, 2s) ease-in-out infinite;
  animation-delay: var(--twinkle-delay, 0s);
}

.star.small {
  width: 2px;
  height: 2px;
  opacity: 0.6;
}

.star.large {
  width: 4px;
  height: 4px;
  box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.3);
}

.star.colored {
  background: var(--accent);
  box-shadow: 0 0 8px 2px rgba(168, 85, 247, 0.4);
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.2;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.kaleidoscope {
  position: relative;
  width: min(90vw, 55vh);
  height: min(90vw, 55vh);
  animation: kaleidoscopeRotate 30s linear infinite;
}

@keyframes kaleidoscopeRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Each segment is a 30-degree pizza slice for 12 segments */
.k-segment {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overflow: hidden;
  /* 30-degree slice with overlap to eliminate gaps */
  /* For 30deg: tan(15) = 0.268, so at 50% from center, edge is at 50 + 50*0.268 = 63.4% */
  clip-path: polygon(50% 50%, 36.6% 0%, 63.4% 0%);
}

/* Rotate each segment, alternating mirror for kaleidoscope effect */
.k-segment[data-segment="0"] { transform: rotate(0deg); }
.k-segment[data-segment="1"] { transform: rotate(30deg) scaleX(-1); }
.k-segment[data-segment="2"] { transform: rotate(60deg); }
.k-segment[data-segment="3"] { transform: rotate(90deg) scaleX(-1); }
.k-segment[data-segment="4"] { transform: rotate(120deg); }
.k-segment[data-segment="5"] { transform: rotate(150deg) scaleX(-1); }
.k-segment[data-segment="6"] { transform: rotate(180deg); }
.k-segment[data-segment="7"] { transform: rotate(210deg) scaleX(-1); }
.k-segment[data-segment="8"] { transform: rotate(240deg); }
.k-segment[data-segment="9"] { transform: rotate(270deg) scaleX(-1); }
.k-segment[data-segment="10"] { transform: rotate(300deg); }
.k-segment[data-segment="11"] { transform: rotate(330deg) scaleX(-1); }

.k-cat {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border: none;
}

/* Counter-rotate and flip the cat content */
.k-segment[data-segment="0"] .k-cat { transform: rotate(0deg); }
.k-segment[data-segment="1"] .k-cat { transform: scaleX(-1) rotate(-30deg); }
.k-segment[data-segment="2"] .k-cat { transform: rotate(-60deg); }
.k-segment[data-segment="3"] .k-cat { transform: scaleX(-1) rotate(-90deg); }
.k-segment[data-segment="4"] .k-cat { transform: rotate(-120deg); }
.k-segment[data-segment="5"] .k-cat { transform: scaleX(-1) rotate(-150deg); }
.k-segment[data-segment="6"] .k-cat { transform: rotate(-180deg); }
.k-segment[data-segment="7"] .k-cat { transform: scaleX(-1) rotate(-210deg); }
.k-segment[data-segment="8"] .k-cat { transform: rotate(-240deg); }
.k-segment[data-segment="9"] .k-cat { transform: scaleX(-1) rotate(-270deg); }
.k-segment[data-segment="10"] .k-cat { transform: rotate(-300deg); }
.k-segment[data-segment="11"] .k-cat { transform: scaleX(-1) rotate(-330deg); }

/* Glow effect in center */
.kaleidoscope::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15%;
  height: 15%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--bg) 0%, transparent 70%);
  pointer-events: none;
  z-index: 10;
  border-radius: 50%;
}

.kaleidoscope::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 25%;
  height: 25%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(168, 85, 247, 0.4) 0%, transparent 70%);
  pointer-events: none;
  z-index: 11;
  border-radius: 50%;
}

.hero-text {
  padding: 40px 24px;
  text-align: center;
}

.hero-text h1 {
  margin-bottom: 12px;
}

.tagline {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--text-dim);
  text-align: center;
  display: block;
  margin: 0 auto;
}

.blink {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.scroll-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: color 0.2s;
}

.scroll-cta:hover {
  color: var(--accent);
}

.scroll-cta .arrow {
  font-size: 1.5rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ===== SECTIONS ===== */
#what {
  background: var(--bg-light);
}

.stats-row {
  display: flex;
  gap: 48px;
  margin-top: 40px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat .num {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.stat .label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Why section */
.reasons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 32px;
  margin-top: 24px;
}

.reason {
  padding: 24px;
  background: var(--bg-light);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

.reason .emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 12px;
}

.reason h3 {
  color: var(--text);
}

.reason p {
  font-size: 0.95rem;
}

/* Cats section */
#cats {
  background: var(--bg-light);
}

#cats p {
  margin-bottom: 32px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.2s;
}

.gallery img:hover {
  transform: scale(1.05);
}

.empty-state {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text-dim);
  text-align: center;
  padding: 40px;
}

/* ===== MINT ===== */
.mint-box {
  max-width: 400px;
  margin: 0 auto;
  padding: 40px;
  background: var(--bg-light);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}

.mint-box h2 {
  margin-bottom: 24px;
}

.supply-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.supply-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent), var(--accent-pink));
  border-radius: 2px;
  transition: width 0.5s ease;
  width: 0%;
}

.supply-text {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.mint-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.qty-picker {
  display: flex;
  align-items: center;
  gap: 16px;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.qty-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

#qty-value {
  font-family: var(--mono);
  font-size: 1.2rem;
  min-width: 32px;
  text-align: center;
}

.price {
  font-family: var(--mono);
  font-size: 1.2rem;
}

.mint-btn {
  width: 100%;
  padding: 16px;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-pink));
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: lowercase;
}

.mint-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(168, 85, 247, 0.3);
}

.mint-btn:disabled {
  background: rgba(255,255,255,0.1);
  color: var(--text-dim);
  cursor: not-allowed;
}

.notice {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.notice.info {
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-cyan);
}

.notice.warning {
  background: rgba(244, 114, 182, 0.1);
  color: var(--accent-pink);
}

.tx-status {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.85rem;
  text-align: left;
}

.tx-status.pending {
  background: rgba(168, 85, 247, 0.1);
  color: var(--accent);
}

.tx-status.success {
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-cyan);
}

.tx-status.error {
  background: rgba(244, 114, 182, 0.1);
  color: var(--accent-pink);
}

.tx-status a {
  display: block;
  margin-top: 8px;
  color: inherit;
  text-decoration: underline;
}

.mint-result {
  margin-top: 24px;
}

.mint-result p {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 16px;
  max-width: none;
}

.mint-result iframe {
  width: 100%;
  aspect-ratio: 1;
  border: none;
  border-radius: 12px;
  margin-bottom: 16px;
}

.result-links {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.result-links a {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: color 0.2s;
}

.result-links a:hover {
  color: var(--accent);
}

/* ===== FAQ ===== */
#faq {
  background: var(--bg-light);
}

details {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 20px 0;
}

details:last-child {
  border-bottom: none;
}

summary {
  font-family: var(--mono);
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--text-dim);
  transition: transform 0.2s;
}

details[open] summary::after {
  transform: rotate(45deg);
}

details p {
  margin-top: 12px;
  font-size: 0.95rem;
}

/* ===== FOOTER ===== */
footer {
  padding: 60px 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}

footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

footer .logo {
  display: block;
  margin-bottom: 16px;
}

footer .links {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 16px;
}

footer .links a {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: color 0.2s;
}

footer .links a:hover {
  color: var(--accent);
}

footer .contract,
footer .footer-tag {
  display: block;
  width: 100%;
  text-align: center;
}

.contract {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  word-break: break-all;
  margin-bottom: 16px;
}

.footer-tag {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  section {
    padding: 60px 0;
  }

  .stats-row {
    gap: 24px;
  }

  .stat .num {
    font-size: 1.5rem;
  }

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

  .mint-box {
    padding: 24px;
  }

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

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

section > .container {
  animation: fadeIn 0.6s ease-out;
}

/* Hover glow on interactive elements */
.mint-btn:hover:not(:disabled),
.connect-btn:hover,
.qty-btn:hover {
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

/* ===== MICRO-INTERACTIONS ===== */

/* Reason cards wiggle on hover */
.reason {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.reason:hover {
  transform: rotate(-1deg) scale(1.02);
  box-shadow: 0 10px 40px rgba(168, 85, 247, 0.15);
}

.reason:nth-child(2):hover {
  transform: rotate(1deg) scale(1.02);
}

.reason:nth-child(3):hover {
  transform: rotate(-0.5deg) scale(1.02);
}

/* Emoji bounce on card hover */
.reason:hover .emoji {
  animation: wiggle 0.5s ease;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

/* Stats counter subtle pulse */
.stat .num {
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.stat:hover .num {
  color: var(--accent);
  text-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

/* FAQ details open/close animation */
details p {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Connect button pulse when connected */
.connect-btn.connected {
  animation: subtlePulse 2s ease infinite;
}

@keyframes subtlePulse {
  0%, 100% { box-shadow: 0 0 0 rgba(168, 85, 247, 0); }
  50% { box-shadow: 0 0 15px rgba(168, 85, 247, 0.3); }
}

/* Gallery images stagger animation */
.gallery img {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.gallery img:nth-child(1) { animation-delay: 0s; }
.gallery img:nth-child(2) { animation-delay: 0.05s; }
.gallery img:nth-child(3) { animation-delay: 0.1s; }
.gallery img:nth-child(4) { animation-delay: 0.15s; }
.gallery img:nth-child(5) { animation-delay: 0.2s; }
.gallery img:nth-child(6) { animation-delay: 0.25s; }
.gallery img:nth-child(7) { animation-delay: 0.3s; }
.gallery img:nth-child(8) { animation-delay: 0.35s; }
.gallery img:nth-child(9) { animation-delay: 0.4s; }
.gallery img:nth-child(10) { animation-delay: 0.45s; }
.gallery img:nth-child(11) { animation-delay: 0.5s; }
.gallery img:nth-child(12) { animation-delay: 0.55s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mint button minting state */
.mint-btn.minting {
  background: linear-gradient(90deg, var(--accent), var(--accent-pink), var(--accent-cyan), var(--accent));
  background-size: 300% 100%;
  animation: gradientShift 1.5s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Logo hover effect */
.logo {
  transition: color 0.3s ease;
}

.logo:hover {
  color: var(--accent);
}

/* Footer links playful hover */
footer .links a {
  position: relative;
}

footer .links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

footer .links a:hover::after {
  width: 100%;
}

/* Section fade-in on scroll - start visible, JS adds animation */
section.fade-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

section.fade-in.animate-ready {
  opacity: 0;
  transform: translateY(30px);
}

section.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero text entrance animation */
.hero-text {
  animation: heroTextIn 1s ease 0.5s both;
}

@keyframes heroTextIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll CTA delayed entrance */
.scroll-cta {
  animation: heroTextIn 1s ease 1s both;
}

/* Supply bar shimmer effect */
.supply-fill {
  position: relative;
  overflow: hidden;
}

.supply-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s ease infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Qty buttons click feedback */
.qty-btn:active {
  transform: scale(0.95);
}

/* Nav scrolled state */
#nav.scrolled {
  background: rgba(10, 10, 15, 0.95);
  border-bottom-color: rgba(168, 85, 247, 0.2);
}
