:root {
  --color-primary: #11692B;
  --color-accent: #147800;
  --color-cta: #C8102E;
  --font-target-lang: 'Noto Sans KR', 'Pretendard Variable', 'Pretendard', sans-serif;
}

html,
body {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  background-color: #F4F9F5;
  background-image:
    radial-gradient(circle at 8% 0%, rgba(20, 120, 0, 0.08), transparent 34%),
    radial-gradient(circle at 92% 2%, rgba(200, 16, 46, 0.06), transparent 30%);
}

.font-kr,
.font-target {
  font-family: var(--font-target-lang), 'Noto Sans KR', 'Be Vietnam Pro', sans-serif;
  word-break: keep-all;
  line-height: 1.78;
  letter-spacing: -0.01em;
}

.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Header Navigation Active Pills */
.nav-link {
  position: relative;
}

.nav-link.active {
  background-color: #ffffff;
  color: #11692B !important;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.mobile-nav-link.active {
  color: #147800;
  font-weight: 800;
}

/* Vibrant Visalink Full-Bleed Hero Surface (Warm Gold + Emerald + Crimson Energy) */
.full-bleed-hero {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: -1.25rem;
}

@media (min-width: 640px) {
  .full-bleed-hero {
    margin-top: -1.75rem;
  }
}

.visalink-hero-vibrant {
  background:
    radial-gradient(circle at 14% 18%, rgba(251, 191, 36, 0.18) 0%, transparent 36%),
    radial-gradient(circle at 82% 24%, rgba(251, 191, 36, 0.32) 0%, transparent 44%),
    radial-gradient(circle at 96% 85%, rgba(200, 16, 46, 0.22) 0%, transparent 36%),
    linear-gradient(122deg, #09481B 0%, #11692B 38%, #147800 70%, #0D6E52 100%);
  position: relative;
}

.visalink-hero-vibrant::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

/* Signature TOPIK 1-6 Emerald Mastery Cards */
.topik-mastery-card {
  background: linear-gradient(155deg, #137A2E 0%, #0E6128 100%);
  color: #ffffff;
  border-radius: 1.35rem;
  border: 2px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 28px -10px rgba(17, 105, 43, 0.38);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease, border-color 0.2s ease;
}

.topik-mastery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 36px -10px rgba(17, 105, 43, 0.48);
  border-color: #FBBF24;
}

.topik-mastery-card.selected-level {
  border-color: #FBBF24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.45), 0 18px 36px -10px rgba(17, 105, 43, 0.5);
}

/* Interactive 5-Card 3D Fanning Showcase */
.fan-deck-grid {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.75rem;
}

.fan-mockup-card {
  transition: all 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

@media (min-width: 1024px) {
  .fan-mockup-card.fan-pos-left-2 {
    transform: scale(0.88) translateX(18px) rotate(-2deg);
    opacity: 0.76;
    z-index: 10;
  }
  .fan-mockup-card.fan-pos-left-1 {
    transform: scale(0.94) translateX(8px) rotate(-1deg);
    opacity: 0.9;
    z-index: 20;
  }
  .fan-mockup-card.fan-pos-center {
    transform: scale(1.03);
    opacity: 1;
    z-index: 30;
    box-shadow: 0 24px 48px -12px rgba(15, 65, 30, 0.28);
  }
  .fan-mockup-card.fan-pos-right-1 {
    transform: scale(0.94) translateX(-8px) rotate(1deg);
    opacity: 0.9;
    z-index: 20;
  }
  .fan-mockup-card.fan-pos-right-2 {
    transform: scale(0.88) translateX(-18px) rotate(2deg);
    opacity: 0.76;
    z-index: 10;
  }
}

/* Full-bleed Emerald Feature Banner */
.visalink-emerald-band {
  background: linear-gradient(120deg, #0E6227 0%, #147800 50%, #0F766E 100%);
}

/* Official IBT Top Strip in Visalink Deep Green-Teal */
.ibt-official-bar {
  background: linear-gradient(90deg, #0D5922 0%, #147800 60%, #0F766E 100%);
}

/* Floating Mascot gentle bob animation */
@keyframes mascotFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

.mascot-float {
  animation: mascotFloat 3.6s ease-in-out infinite;
}

/* Loading skeleton shimmer */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: haru-shimmer 1.35s infinite linear;
}

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

@keyframes haruSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Pure CSS audio waveform while recording */
.wave-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
}

.wave-bar {
  width: 4px;
  border-radius: 9999px;
  background-color: #C8102E;
  animation: haru-wave 0.9s ease-in-out infinite;
}

.wave-bar:nth-child(2) { animation-delay: 0.12s; }
.wave-bar:nth-child(3) { animation-delay: 0.24s; }
.wave-bar:nth-child(4) { animation-delay: 0.36s; }
.wave-bar:nth-child(5) { animation-delay: 0.48s; }

@keyframes haru-wave {
  0%, 100% { height: 6px; opacity: 0.55; }
  50% { height: 24px; opacity: 1; }
}

/* Soft explanation blur gate */
.locked-blur {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}

/* Korean Wongoji (원고지) 20-column manuscript grid */
.wongoji-grid {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  border-top: 2px solid #C8102E;
  border-left: 2px solid #C8102E;
  background: #fffdf9;
}

@media (max-width: 640px) {
  .wongoji-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
}

.wongoji-cell {
  aspect-ratio: 1 / 1;
  border-right: 1px solid rgba(200, 16, 46, 0.35);
  border-bottom: 1px solid rgba(200, 16, 46, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
}

.wongoji-cell:nth-child(20n) {
  border-right: 2px solid #C8102E;
}

/* IBT Exam Room Font Scaling */
.ibt-scale-sm .font-kr { font-size: 0.92rem; }
.ibt-scale-md .font-kr { font-size: 1.04rem; }
.ibt-scale-lg .font-kr { font-size: 1.2rem; line-height: 1.9; }

.srs-card-surface {
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
}

.srs-card-surface:hover {
  transform: translateY(-2px);
}

/* Horizontal pill strip without ugly scrollbars on mobile */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Tap-to-lookup interactive Korean words */
.tap-word-btn {
  display: inline-block;
  padding: 2px 5px;
  margin: 1px 0;
  border-radius: 6px;
  border-bottom: 2px dashed rgba(20, 120, 0, 0.45);
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
  cursor: pointer;
}

.tap-word-btn:hover,
.tap-word-btn:focus-visible {
  background-color: #DCFCE7;
  color: #11692B;
  border-bottom-color: #147800;
  outline: none;
}

.pron-highlight {
  color: #C8102E;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #a7f3d0;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #147800;
}

@media print {
  header,
  footer,
  nav,
  #pwa-install-root,
  #toast-root {
    display: none !important;
  }
}
