/* ============================================
   AI3 / AI EVOLUTION PANORAMA THEME
   Full-viewport slides with bg images + glitch
   (Based on Google AI Studio reference)
   ============================================ */

[data-theme="ai3"] {
  --bg-dark: #050505;
  --bg-darker: #020202;
  --bg-panel: rgba(15, 15, 20, 0.6);
  --crt-bg: rgba(10, 10, 15, 0.8);
  --border-panel: rgba(0, 255, 65, 0.12);

  --cyan: #00ff41;
  --red: #ff00c1;
  --crimson: #ff2d55;
  --gold: #ffb800;
  --green: #00ff41;
  --magenta: #ff00c1;
  --orange: #ff6d00;
  --purple: #4b70e2;

  --text-primary: #e0e0e0;
  --text-secondary: #808080;
  --text-pixel: #00ff41;
  --speech-bg: rgba(10, 10, 15, 0.95);
  --speech-text: #e0e0e0;

  --hp-color: #00ff41;
  --mp-color: #4b70e2;
  --exp-color: #ffb800;

  --font-pixel: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* --- Body --- */
[data-theme="ai3"] body,
body[data-theme="ai3"] {
  background: #050505;
  background-image: none;
}

[data-theme="ai3"] .scanline-overlay { display: none; }

[data-theme="ai3"] .float-btn.active {
  border-color: #00ff41;
  color: #00ff41;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
  background: rgba(0, 255, 65, 0.1);
}

/* ============================================
   HERO — FULL VIEWPORT SLIDER
   ============================================ */

[data-theme="ai3"] #title-screen.section {
  padding: 0;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  width: 100vw;
  max-width: none;
  margin: 0;
  margin-left: calc(-50vw + 50%);
}

[data-theme="ai3"] .crt-frame {
  background: #050505;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
  position: relative;
  min-height: 100vh;
  display: block;
  width: 100%;
}

[data-theme="ai3"] .crt-screen {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  max-width: none;
  width: 100%;
  height: 100vh;
  border-radius: 0;
  position: static;
  overflow: visible;
}

[data-theme="ai3"] .crt-screen::before,
[data-theme="ai3"] .crt-screen::after { content: none; }

[data-theme="ai3"] .crt-content { display: none; }

/* ============================================
   PANORAMA — Hidden by default
   ============================================ */

.ai3-panorama { display: none; }

[data-theme="ai3"] .ai3-panorama {
  display: block;
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  overflow: hidden;
}

/* --- Slider Track --- */
.ai3-slider-track {
  display: flex;
  width: 700vw; /* 7 slides × 100vw */
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

/* --- Individual Slide --- */
.ai3-slide {
  width: 100vw;
  height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* --- Slide Background Image --- */
.ai3-slide-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  filter: grayscale(50%) brightness(40%);
  z-index: 0;
  transition: transform 1.2s ease-out;
}

/* Placeholder backgrounds (Unsplash) — replace with local images later */
#ai3-bg-1 { background-image: url('https://images.unsplash.com/photo-1529697210530-8c4bb1358ce7?auto=format&fit=crop&w=1600&q=80'); }
#ai3-bg-2 { background-image: url('https://images.unsplash.com/photo-1678382154203-d01170587792?auto=format&fit=crop&w=1600&q=80'); }
#ai3-bg-3 { background-image: url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=1600&q=80'); }
#ai3-bg-4 { background-image: url('https://images.unsplash.com/photo-1518433278988-d9b7b950f92e?auto=format&fit=crop&w=1600&q=80'); }
#ai3-bg-5 { background-image: url('https://images.unsplash.com/photo-1550751827-4bd374c3f58b?auto=format&fit=crop&w=1600&q=80'); }
#ai3-bg-6 { background-image: url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&w=1600&q=80'); }
#ai3-bg-7 { background-image: url('https://images.unsplash.com/photo-1504384308090-c894fdcc538d?auto=format&fit=crop&w=1600&q=80'); }

/* --- Slide Content (centered text) --- */
.ai3-content {
  z-index: 5;
  text-align: center;
  position: relative;
}

.ai3-year {
  font-size: 1.2rem;
  font-family: 'Space Grotesk', monospace;
  letter-spacing: 5px;
  color: #00ff41;
  margin-bottom: 10px;
}

.ai3-title {
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 900;
  font-family: 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  line-height: 0.9;
  margin: 0;
  color: #fff;
}

.ai3-desc {
  font-size: 1.1rem;
  font-family: 'Inter', sans-serif;
  margin-top: 20px;
  color: #ccc;
  max-width: 500px;
  line-height: 1.6;
}

/* ============================================
   GLITCH FLASH (참고HTML 방식 그대로)
   ============================================ */

.ai3-glitch-flash {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: white;
  opacity: 0;
  z-index: 10;
  pointer-events: none;
}

.ai3-panorama.active-glitch .ai3-glitch-flash {
  animation: ai3-flash-anim 0.4s ease-out;
}

@keyframes ai3-flash-anim {
  0%   { opacity: 0; }
  20%  { opacity: 0.3; transform: scaleY(0.1) skew(10deg); }
  40%  { opacity: 0.1; }
  60%  { opacity: 0.4; transform: scaleY(0.5) skew(-20deg); }
  100% { opacity: 0; }
}

/* ============================================
   TIMELINE (하단 네온 프로그레스)
   ============================================ */

.ai3-timeline {
  display: none;
}

[data-theme="ai3"] .ai3-timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  max-width: 800px;
  z-index: 100;
}

.ai3-time-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 10px;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.8rem;
  color: #666;
}

.ai3-progress-rail {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
}

.ai3-progress-fill {
  position: absolute;
  height: 100%;
  background: #00ff41;
  width: 0%;
  transition: width 0.8s, background 0.5s;
  box-shadow: 0 0 10px #00ff41;
}

/* ============================================
   NAV
   ============================================ */

[data-theme="ai3"] .game-hud {
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(0, 255, 65, 0.1);
}

[data-theme="ai3"] .hud-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #e0e0e0;
  letter-spacing: 2px;
  text-shadow: none;
}

[data-theme="ai3"] .hud-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  border-radius: 20px;
  padding: 6px 16px;
}

[data-theme="ai3"] .hud-link:hover,
[data-theme="ai3"] .hud-link.active {
  color: #00ff41;
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

/* ============================================
   PORTFOLIO SECTION
   ============================================ */

[data-theme="ai3"] .portfolio-section { background: #0a0a0a; }

[data-theme="ai3"] .section-header .stage-label {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.85rem;
  color: #00ff41;
  border: 1px solid rgba(0, 255, 65, 0.2);
  background: rgba(0, 255, 65, 0.05);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
  letter-spacing: 5px;
}

[data-theme="ai3"] .section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: #e0e0e0;
  text-shadow: none;
  -webkit-text-stroke: 0;
  letter-spacing: 3px;
}

[data-theme="ai3"] .cat-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 22px;
}

[data-theme="ai3"] .cat-btn:hover {
  border-color: rgba(0, 255, 65, 0.3);
  color: #00ff41;
}

[data-theme="ai3"] .cat-btn.active {
  background: rgba(0, 255, 65, 0.1);
  border-color: #00ff41;
  color: #00ff41;
  font-weight: 700;
}

[data-theme="ai3"] .pf-card {
  background: rgba(15, 15, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  box-shadow: none;
}

[data-theme="ai3"] .pf-card:hover {
  border-color: rgba(0, 255, 65, 0.2);
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.05);
  transform: translateY(-4px);
}

[data-theme="ai3"] .pf-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #e0e0e0;
}

[data-theme="ai3"] .pf-desc {
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.7;
}

[data-theme="ai3"] .tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  background: rgba(0, 255, 65, 0.08);
  color: #00ff41;
  border: 1px solid rgba(0, 255, 65, 0.15);
  border-radius: 12px;
  padding: 5px 12px;
}

[data-theme="ai3"] .pf-tags .tag {
  font-size: 0.75rem;
  padding: 5px 12px;
}

[data-theme="ai3"] .pf-thumb {
  background: linear-gradient(135deg, #0a0f14 0%, #0f1a24 100%);
  border: none;
}

[data-theme="ai3"] .pf-badge {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 8px;
}

/* ============================================
   CONTACT — Speech Bubble & NPC
   ============================================ */

[data-theme="ai3"] #save-point {
  background: #080808;
}

[data-theme="ai3"] .contact-panel {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 255, 65, 0.08);
}

[data-theme="ai3"] .speech-bubble {
  background: rgba(10, 12, 18, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 255, 65, 0.12);
  border-radius: 12px;
  color: #e0e0e0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="ai3"] .speech-bubble::after {
  border-top-color: rgba(10, 12, 18, 0.92);
}

[data-theme="ai3"] .speech-bubble strong {
  color: #00ff41;
}

[data-theme="ai3"] .speech-bubble.npc {
  background: rgba(8, 10, 14, 0.95);
  border-color: rgba(0, 255, 65, 0.18);
}

[data-theme="ai3"] .speech-bubble.npc::after {
  border-top-color: rgba(8, 10, 14, 0.95);
}

[data-theme="ai3"] .npc-name {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: #00ff41;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

/* --- Save Crystal — Neon Data Core --- */
[data-theme="ai3"] .save-crystal::before {
  background: linear-gradient(135deg, #00ff41, #00cc33, #33ff6a);
  box-shadow:
    0 0 30px rgba(0, 255, 65, 0.4),
    0 0 60px rgba(0, 255, 65, 0.15);
  border-radius: 50%;
  animation: ai3-core-pulse 4s ease-in-out infinite;
}

[data-theme="ai3"] .save-crystal::after {
  background: rgba(0, 255, 65, 0.5);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

@keyframes ai3-core-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.4), 0 0 60px rgba(0, 255, 65, 0.15);
  }
  50% {
    transform: translate(-50%, -50%) rotate(180deg) scale(1.08);
    box-shadow: 0 0 50px rgba(0, 255, 65, 0.5), 0 0 90px rgba(0, 255, 65, 0.2);
  }
}

/* --- Form --- */
[data-theme="ai3"] .rpg-label {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: #00ff41;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.2);
}

[data-theme="ai3"] .rpg-input,
[data-theme="ai3"] .rpg-textarea {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  background: rgba(10, 12, 18, 0.8);
  border: 1px solid rgba(0, 255, 65, 0.1);
  border-radius: 8px;
  color: #e0e0e0;
  padding: 14px 18px;
  letter-spacing: 0;
  transition: border-color 0.3s, box-shadow 0.3s;
}

[data-theme="ai3"] .rpg-input::placeholder,
[data-theme="ai3"] .rpg-textarea::placeholder {
  color: rgba(0, 255, 65, 0.25);
}

[data-theme="ai3"] .rpg-input:focus,
[data-theme="ai3"] .rpg-textarea:focus {
  border-color: rgba(0, 255, 65, 0.5);
  box-shadow: 0 0 16px rgba(0, 255, 65, 0.12);
  outline: none;
}

[data-theme="ai3"] .pixel-btn {
  font-family: 'Space Grotesk', sans-serif;
  background: #00ff41;
  color: #0a0a0a;
  border: none;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.15);
  transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
}

[data-theme="ai3"] .pixel-btn:hover {
  background: #33ff6a;
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.35);
  transform: translateY(-2px);
}

/* --- Contact Links --- */
[data-theme="ai3"] .contact-link {
  color: #808080;
  transition: color 0.3s;
}

[data-theme="ai3"] .contact-link:hover {
  color: #00ff41;
}

[data-theme="ai3"] .link-icon {
  border-color: rgba(0, 255, 65, 0.15);
  transition: border-color 0.3s, box-shadow 0.3s;
}

[data-theme="ai3"] .contact-link:hover .link-icon {
  border-color: rgba(0, 255, 65, 0.4);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.15);
}

/* ============================================
   FOOTER / SCROLLBAR
   ============================================ */

[data-theme="ai3"] .game-footer {
  background: #050505;
  border-top: 1px solid rgba(0, 255, 65, 0.08);
}

[data-theme="ai3"] .game-footer p {
  color: #606060;
  font-family: 'Inter', sans-serif;
}

[data-theme="ai3"] .game-footer .blink {
  color: #00ff41;
}

[data-theme="ai3"] ::-webkit-scrollbar-track { background: #0a0a0a; }
[data-theme="ai3"] ::-webkit-scrollbar-thumb { background: rgba(0, 255, 65, 0.2); border-radius: 4px; }
[data-theme="ai3"] ::-webkit-scrollbar-thumb:hover { background: rgba(0, 255, 65, 0.4); }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
  [data-theme="ai3"] .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  [data-theme="ai3"] .contact-container {
    padding: 0 20px;
  }
  .ai3-timeline { width: 80%; }
}

@media (max-width: 600px) {
  [data-theme="ai3"] .portfolio-grid {
    grid-template-columns: 1fr;
  }
  .ai3-title { font-size: clamp(2.5rem, 10vw, 4rem); }
  .ai3-desc { font-size: 0.95rem; max-width: 85vw; }
  .ai3-timeline { width: 90%; }
  .ai3-time-labels { font-size: 0.6rem; }
  [data-theme="ai3"] .category-filter {
    flex-wrap: wrap;
    gap: 6px;
  }
  [data-theme="ai3"] .cat-btn {
    font-size: 0.8rem;
    padding: 8px 16px;
  }
  [data-theme="ai3"] .section-title {
    font-size: 1.8rem;
  }
  [data-theme="ai3"] .pf-title {
    font-size: 1rem;
  }
  [data-theme="ai3"] .tag,
  [data-theme="ai3"] .pf-tags .tag {
    font-size: 0.7rem;
  }
}
