/* ============================================
   KAKOTA SUPERIOR - Comic Book Romantic Page
   ============================================ */

:root {
  --color-bg: #0a0a0a;
  --color-bg-light: #1a1a1a;
  --color-red: #DC2626;
  --color-red-dark: #991B1B;
  --color-text: #F5F5F5;
  --color-text-muted: #A3A3A3;
  --color-panel: #FAFAFA;
  --color-panel-border: #000000;

  --gem-purple: #A855F7;
  --gem-green: #22C55E;
  --gem-blue: #3B82F6;
  --gem-orange: #F97316;
  --gem-yellow: #EAB308;
  --gem-red: #EF4444;

  --font-comic: 'Bangers', cursive;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   ENTRY SCREEN
   ============================================ */

.entry-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.8s ease;
}

.entry-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.entry-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
}

.halftone-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.025) 1px, transparent 1.5px);
  background-size: 6px 6px;
  pointer-events: none;
}

.speed-lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 12px,
    rgba(255,255,255,0.008) 12px,
    rgba(255,255,255,0.008) 13px
  );
  pointer-events: none;
}

/* Spider webs */
.web {
  position: absolute;
  width: 180px;
  height: 180px;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.web.visible {
  opacity: 1;
}

.web-tl { top: 0; left: 0; }
.web-tr { top: 0; right: 0; }
.web-bl { bottom: 0; left: 0; }
.web-br { bottom: 0; right: 0; }

/* Entry content */
.entry-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem;
}

.entry-date {
  font-family: var(--font-comic);
  font-size: 1.2rem;
  color: var(--color-text-muted);
  letter-spacing: 0.15em;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.6s ease;
}

.entry-date.visible {
  opacity: 1;
  transform: translateY(0);
}

.entry-para {
  font-family: var(--font-comic);
  font-size: 2.5rem;
  color: var(--color-text);
  margin-top: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.entry-para.visible {
  opacity: 1;
  transform: translateY(0);
}

.entry-title-wrapper {
  position: relative;
  margin-top: 1rem;
}

.entry-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle, rgba(220,38,38,0.25) 0%, transparent 70%);
  border-radius: 50%;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.entry-burst.visible {
  transform: translate(-50%, -50%) scale(1);
}

.entry-title {
  position: relative;
  font-family: var(--font-comic);
  font-size: clamp(3rem, 12vw, 6rem);
  line-height: 0.95;
  color: var(--color-text);
  text-shadow:
    3px 3px 0 var(--color-red),
    -1px -1px 0 var(--color-red),
    1px -1px 0 var(--color-red),
    -1px 1px 0 var(--color-red),
    1px 1px 0 var(--color-red),
    6px 6px 0 rgba(0,0,0,0.5);
  opacity: 0;
  transform: scale(0.5) rotate(-3deg);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.entry-title.visible {
  opacity: 1;
  transform: scale(1) rotate(-1deg);
}

.entry-gatota {
  font-family: var(--font-comic);
  font-size: 1.8rem;
  color: var(--color-text-muted);
  margin-top: 1.5rem;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.5s ease;
}

.entry-gatota.visible {
  opacity: 1;
  transform: translateY(0);
}

.entry-skip {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  opacity: 0.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.3s ease;
  z-index: 20;
}

.entry-skip:hover {
  opacity: 0.8;
}

/* ============================================
   MESSAGE SCREEN
   ============================================ */

.message-screen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem 1rem 4rem;
  opacity: 0;
  transition: opacity 1s ease;
}

.message-screen.visible {
  opacity: 1;
}

.message-bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #0a0a0a 0%, #111111 50%, #0a0a0a 100%);
  z-index: -2;
}

/* City skyline */
.city-skyline {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  z-index: -1;
  opacity: 0.6;
}

.city-skyline svg {
  width: 100%;
  height: 100%;
}

/* ============================================
   PANELS
   ============================================ */

.panels-container {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-top: 1rem;
}

.panel {
  position: relative;
  background: var(--color-panel);
  border: 3px solid var(--color-panel-border);
  padding: 2rem 1.5rem 1.5rem;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.panel.visible {
  opacity: 1;
  transform: translateY(0);
}

.panel-1 {
  transform: translateY(30px) rotate(-1deg);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.4);
}

.panel-1.visible {
  transform: translateY(0) rotate(-1deg);
}

.panel-2 {
  transform: translateY(30px) rotate(0.5deg);
  box-shadow: -6px 6px 0 rgba(0,0,0,0.4);
}

.panel-2.visible {
  transform: translateY(0) rotate(0.5deg);
}

.panel-3 {
  transform: translateY(30px) rotate(-0.5deg);
  box-shadow: 6px -6px 0 rgba(0,0,0,0.4);
}

.panel-3.visible {
  transform: translateY(0) rotate(-0.5deg);
}

.panel-4 {
  transform: translateY(30px) rotate(1deg);
  box-shadow: -6px -6px 0 rgba(0,0,0,0.4);
}

.panel-4.visible {
  transform: translateY(0) rotate(1deg);
}

.panel-number {
  position: absolute;
  top: -12px;
  left: -12px;
  width: 32px;
  height: 32px;
  background: var(--color-red);
  color: white;
  font-family: var(--font-comic);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #000;
  border-radius: 50%;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.panel-content {
  position: relative;
  z-index: 2;
}

.panel-text {
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  line-height: 1.6;
  color: #1a1a1a;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.panel-text:last-child {
  margin-bottom: 0;
}

/* Ink splatters */
.ink-splatter {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,0,0,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.splatter-1 {
  width: 80px;
  height: 60px;
  top: -10px;
  right: -15px;
  transform: rotate(15deg);
}

.splatter-2 {
  width: 60px;
  height: 80px;
  bottom: -15px;
  left: -10px;
  transform: rotate(-10deg);
}

.splatter-3 {
  width: 70px;
  height: 50px;
  top: 50%;
  right: -20px;
  transform: translateY(-50%) rotate(20deg);
}

.splatter-4 {
  width: 90px;
  height: 70px;
  bottom: -20px;
  right: -10px;
  transform: rotate(-15deg);
}

/* ============================================
   GEMS
   ============================================ */

.gem {
  display: inline-block;
  width: 1.3em;
  height: 1.3em;
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  vertical-align: middle;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.gem:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 4px;
  border-radius: 4px;
}

.gem:hover {
  transform: scale(1.15);
}

.gem:active {
  transform: scale(0.95);
}

.gem.clicked {
  animation: gemClick 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes gemClick {
  0% { transform: scale(1); }
  30% { transform: scale(1.4); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1.15); }
}

.gem-body {
  position: absolute;
  inset: 0;
  clip-path: polygon(
    50% 0%,
    85% 15%,
    100% 50%,
    85% 85%,
    50% 100%,
    15% 85%,
    0% 50%,
    15% 15%
  );
  transition: filter 0.3s ease;
}

.gem-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(255,255,255,0.5) 0%,
    transparent 40%,
    transparent 60%,
    rgba(0,0,0,0.3) 100%
  );
}

.gem-body::after {
  content: '';
  position: absolute;
  top: 18%;
  left: 22%;
  width: 28%;
  height: 18%;
  background: rgba(255,255,255,0.7);
  border-radius: 50%;
  filter: blur(1.5px);
}

/* Gem colors */
.gem-purple .gem-body {
  background: linear-gradient(135deg, #C084FC 0%, #A855F7 30%, #7C3AED 70%, #5B21B6 100%);
  filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.6));
}

.gem-green .gem-body {
  background: linear-gradient(135deg, #4ADE80 0%, #22C55E 30%, #16A34A 70%, #15803D 100%);
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.6));
}

.gem-blue .gem-body {
  background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 30%, #2563EB 70%, #1D4ED8 100%);
  filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.6));
}

.gem-orange .gem-body {
  background: linear-gradient(135deg, #FB923C 0%, #F97316 30%, #EA580C 70%, #C2410C 100%);
  filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.6));
}

.gem-yellow .gem-body {
  background: linear-gradient(135deg, #FDE047 0%, #EAB308 30%, #CA8A04 70%, #A16207 100%);
  filter: drop-shadow(0 0 6px rgba(234, 179, 8, 0.6));
}

.gem-red .gem-body {
  background: linear-gradient(135deg, #F87171 0%, #EF4444 30%, #DC2626 70%, #B91C1C 100%);
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.6));
}

/* Gem sparkles */
.gem-sparkle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.gem-sparkle.s1 {
  top: 10%;
  left: 30%;
  animation: twinkle 2s ease-in-out infinite;
}

.gem-sparkle.s2 {
  top: 40%;
  right: 15%;
  animation: twinkle 2s ease-in-out infinite 0.7s;
}

.gem-sparkle.s3 {
  bottom: 20%;
  left: 20%;
  animation: twinkle 2s ease-in-out infinite 1.4s;
}

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

/* Gem glow on hover */
.gem:hover .gem-body {
  filter: drop-shadow(0 0 12px currentColor) brightness(1.2);
}

.gem-purple:hover .gem-body { filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.8)) brightness(1.2); }
.gem-green:hover .gem-body { filter: drop-shadow(0 0 12px rgba(34, 197, 94, 0.8)) brightness(1.2); }
.gem-blue:hover .gem-body { filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.8)) brightness(1.2); }
.gem-orange:hover .gem-body { filter: drop-shadow(0 0 12px rgba(249, 115, 22, 0.8)) brightness(1.2); }
.gem-yellow:hover .gem-body { filter: drop-shadow(0 0 12px rgba(234, 179, 8, 0.8)) brightness(1.2); }
.gem-red:hover .gem-body { filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.8)) brightness(1.2); }

/* ============================================
   WORD HIGHLIGHTS
   ============================================ */

.word-highlight {
  position: relative;
  transition: all 0.4s ease;
  padding: 0 2px;
}

.word-highlight.active {
  color: var(--color-red);
  text-shadow: 0 0 8px rgba(220, 38, 38, 0.5);
}

.word-highlight.active[data-word="purple"] {
  color: var(--gem-purple);
  text-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}

.word-highlight.active[data-word="green"] {
  color: var(--gem-green);
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.word-highlight.active[data-word="blue"] {
  color: var(--gem-blue);
  text-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.word-highlight.active[data-word="orange"] {
  color: var(--gem-orange);
  text-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
}

.word-highlight.active[data-word="yellow"] {
  color: var(--gem-yellow);
  text-shadow: 0 0 8px rgba(234, 179, 8, 0.5);
}

.word-highlight.active[data-word="red"] {
  color: var(--gem-red);
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* ============================================
   PARTICLES
   ============================================ */

.gem-particle {
  position: fixed;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  animation: particleBurst 0.8s ease-out forwards;
}

@keyframes particleBurst {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0);
  }
}

/* ============================================
   MESSAGE FOOTER
   ============================================ */

.message-footer {
  text-align: center;
  margin-top: 3rem;
  padding-bottom: 2rem;
}

.footer-date {
  font-family: var(--font-comic);
  font-size: 1rem;
  color: var(--color-text-muted);
  letter-spacing: 0.2em;
  opacity: 0.5;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 480px) {
  .entry-content {
    padding: 1.5rem;
  }

  .entry-para {
    font-size: 2rem;
  }

  .entry-title {
    font-size: clamp(2.5rem, 15vw, 4rem);
  }

  .entry-gatota {
    font-size: 1.5rem;
  }

  .message-screen {
    padding: 1.5rem 0.75rem 3rem;
  }

  .panels-container {
    gap: 1.5rem;
  }

  .panel {
    padding: 1.5rem 1rem 1.25rem;
  }

  .panel-text {
    font-size: 1.1rem;
    line-height: 1.5;
  }

  .gem {
    width: 1.4em;
    height: 1.4em;
  }

  .web {
    width: 120px;
    height: 120px;
  }

  .city-skyline {
    height: 80px;
  }
}

@media (max-width: 360px) {
  .entry-title {
    font-size: 2.2rem;
  }

  .panel-text {
    font-size: 1rem;
  }
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (min-width: 481px) and (max-width: 768px) {
  .panels-container {
    max-width: 500px;
  }

  .entry-title {
    font-size: clamp(3rem, 10vw, 5rem);
  }
}

/* ============================================
   RESPONSIVE - DESKTOP
   ============================================ */

@media (min-width: 769px) {
  .panels-container {
    max-width: 650px;
  }

  .panel {
    padding: 2.5rem 2rem 2rem;
  }

  .panel-text {
    font-size: 1.3rem;
  }

  .web {
    width: 220px;
    height: 220px;
  }
}

/* ============================================
   SAFE AREAS (iOS)
   ============================================ */

@supports (padding-top: env(safe-area-inset-top)) {
  .entry-screen {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .message-screen {
    padding-top: calc(2rem + env(safe-area-inset-top));
    padding-bottom: calc(4rem + env(safe-area-inset-bottom));
  }

  .entry-skip {
    bottom: calc(2rem + env(safe-area-inset-bottom));
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .gem-sparkle {
    animation: none;
    opacity: 0.5;
  }
}
