/* ─── Phuulia.fr — Main Stylesheet (Mobile-First) ─────────────────────────── */

/* ── Custom Properties ─────────────────────────────────────────────────────── */
:root {
  --primary: #6d28d9;
  --primary-dark: #5b21b6;
  --accent: #ec4899;
  --bg: #f8f7ff;
  --surface: #ffffff;
  --surface2: #f1f0fb;
  --border: #e5e3f0;
  --text: #1e1b3a;
  --text-muted: #6b7280;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(109,40,217,.08);
  --shadow-md: 0 8px 32px rgba(109,40,217,.12);
  --font: 'Inter', 'Noto Sans KR', system-ui, sans-serif;
  --max-w: 1120px;
  --nav-h: 60px;
}

/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background-color: #f1f5f9;
  background-image: 
    radial-gradient(at 10% 10%, rgba(244, 114, 182, 0.3) 0px, transparent 60%),
    radial-gradient(at 90% 10%, rgba(2, 132, 199, 0.3) 0px, transparent 60%),
    radial-gradient(at 50% 90%, rgba(15, 118, 110, 0.3) 0px, transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.65;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h);
  padding: 0 1.25rem;
  background: rgba(255, 255, 255, 0.2); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.navbar-brand {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: 1.15rem; color: var(--text);
}
.brand-flag { font-size: 1.3rem; }
.nav-links {
  display: none; flex-direction: column;
  position: absolute; top: var(--nav-h); left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .5rem 0;
  list-style: none;
  gap: 0;
}
.nav-links.open { display: flex; }
.nav-link {
  display: block; padding: .75rem 1.25rem;
  font-weight: 500; color: var(--text);
  transition: background .15s;
}
.nav-link:hover, .nav-link.active { background: var(--surface2); color: var(--primary); text-decoration: none; }
.nav-toggle {
  display: flex; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-dropdown { position: relative; }
.dropdown-menu {
  display: none; list-style: none;
  background: var(--surface2);
  padding: .25rem 0 .25rem 1.5rem;
}
.dropdown-menu li a { display: block; padding: .5rem 1rem; font-size: .9rem; color: var(--text); }
.dropdown-menu li a:hover { color: var(--primary); }
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu { display: block; }

/* ── Tablet+ Nav ───────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .nav-links {
    display: flex; flex-direction: row; position: static;
    background: none; border: none; padding: 0; gap: .25rem;
    align-items: center;
  }
  .nav-link { padding: .4rem .75rem; border-radius: var(--radius-sm); }
  .dropdown-menu {
    position: absolute; top: 100%; left: 0; min-width: 280px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-md);
    padding: .5rem 0; z-index: 200;
  }
  .dropdown-menu li a { padding: .6rem 1rem; font-size: .9rem; border-radius: 0; }
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.main-content { flex: 1; }
.section { padding: 3rem 0; }
.section-alt { background: var(--surface2); }
.section-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--text); }
.section-desc { color: var(--text-muted); margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.text-center { text-align: center; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.4rem;
  font-family: var(--font); font-size: .95rem; font-weight: 600;
  border-radius: 999px;
  border: none; cursor: pointer;
  text-decoration: none; transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-secondary { background: var(--surface2); color: var(--primary); border: 2px solid var(--primary); }
.btn-secondary:hover { background: var(--primary); color: #fff; text-decoration: none; }
.btn-outline { background: transparent; color: var(--text); border: 2px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero {  position: relative;

  background: linear-gradient(rgba(15, 23, 42, 0.4), rgba(15, 23, 42, 0.8)), url('/static/images/gyeongju_hero_bg.jpg') center/cover no-repeat;
  color: white;
  padding: 5rem 1.25rem;
  text-align: center;
}


  65%, 100% { opacity: 1; }
}









  33%, 58% { opacity: 1; }
  66%, 100% { opacity: 0; }
}


  66%, 92% { opacity: 1; }
  100% { opacity: 0; }
}








@-webkit-keyframes slideSeoraksan {
  0%, 25% { opacity: 0; }
  33%, 66% { opacity: 1; }
  75%, 100% { opacity: 0; }
}
@keyframes slideSeoraksan {
  0%, 25% { opacity: 0; }
  33%, 66% { opacity: 1; }
  75%, 100% { opacity: 0; }
}

@-webkit-keyframes slideHallasan {
  0%, 58% { opacity: 0; }
  66%, 91% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes slideHallasan {
  0%, 58% { opacity: 0; }
  66%, 91% { opacity: 1; }
  100% { opacity: 0; }
}

.hero-inner { position: relative; z-index: 2; max-width: 680px; margin: 0 auto; }
.hero-badge {
  display: inline-block; background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px; padding: .35rem 1rem;
  font-size: .8rem; font-weight: 600; letter-spacing: .04em;
  margin-bottom: 1.25rem; backdrop-filter: blur(4px);
}
.hero-title { font-size: clamp(2rem, 6vw, 3.25rem); font-weight: 800; line-height: 1.2; margin-bottom: .75rem; }
.hero-subtitle-en { display: block; font-size: clamp(1.1rem, 3vw, 1.6rem); opacity: .85; font-weight: 400; }
.hero-desc { font-size: 1.05rem; opacity: .85; margin-bottom: 2rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Cards Grid ────────────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 480px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: flex; align-items: center; gap: 1rem;
  background: rgba(255, 255, 255, 0.2); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius); padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.8); border-right: 1px solid rgba(255, 255, 255, 0.3); border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  text-decoration: none; color: var(--text);
  border-left: 4px solid var(--accent, var(--primary));
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.card-emoji { font-size: 2rem; flex-shrink: 0; }
.card-body { flex: 1; }
.card-title { font-size: 1rem; font-weight: 700; }
.card-subtitle { font-size: .85rem; color: var(--text-muted); }
.card-tag { display: inline-block; font-size: .75rem; background: var(--surface2); padding: .2rem .6rem; border-radius: 999px; margin-top: .4rem; }
.card-arrow { color: var(--text-muted); font-size: 1.2rem; flex-shrink: 0; }

/* ── Quick Grid ────────────────────────────────────────────────────────────── */
.quick-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 600px) { .quick-grid { grid-template-columns: repeat(2, 1fr); } }
.quick-card {
  display: flex; align-items: center; gap: 1rem;
  background: rgba(255, 255, 255, 0.2); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius); padding: 1.1rem 1.25rem;
  text-decoration: none; color: var(--text);
  transition: all .15s;
}
.quick-card:hover { border-color: var(--primary); transform: translateY(-1px); text-decoration: none; }
.quick-icon { font-size: 1.8rem; flex-shrink: 0; }
.quick-card strong { display: block; font-weight: 600; }
.quick-card p { font-size: .85rem; color: var(--text-muted); margin: 0; }

/* ── Page Header ───────────────────────────────────────────────────────────── */
.page-header {
  background: linear-gradient(120deg, var(--accent, var(--primary)) 0%, color-mix(in srgb, var(--accent, var(--primary)), #000 20%) 100%);
  color: white; padding: 2.5rem 1.25rem;
}
.page-header h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 800; margin-bottom: .5rem; }
.page-header p { opacity: .85; font-size: 1rem; }
.level-badge {
  display: inline-block; background: rgba(255,255,255,.2);
  border-radius: 999px; padding: .25rem .9rem;
  font-size: .8rem; font-weight: 600; margin-bottom: .75rem;
}
.back-link { color: rgba(255,255,255,.8); font-size: .9rem; display: inline-block; margin-bottom: .75rem; }
.back-link:hover { color: white; text-decoration: none; }

/* ── Two Column Layout ─────────────────────────────────────────────────────── */
.two-col { display: grid; gap: 2rem; }
@media (min-width: 768px) { .two-col { grid-template-columns: 1fr 1fr; } }
.col-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; }

/* ── Unit List ─────────────────────────────────────────────────────────────── */
.unit-list { display: flex; flex-direction: column; gap: .5rem; }
.unit-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text);
  transition: all .15s;
}
.unit-item:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.unit-item.unit-wb:hover { border-color: var(--accent); color: var(--accent); }
.unit-num { font-size: .75rem; font-weight: 700; color: var(--text-muted); min-width: 20px; }
.unit-title { flex: 1; font-size: .9rem; }
.unit-arrow { color: var(--text-muted); }

/* ── Quiz CTA Banner ───────────────────────────────────────────────────────── */
.quiz-cta {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  margin-top: 2.5rem;
  background: linear-gradient(120deg, var(--accent, var(--primary)), color-mix(in srgb, var(--accent, var(--primary)), #000 15%));
  color: white; border-radius: var(--radius); padding: 1.5rem 1.75rem;
}
.quiz-cta strong { display: block; font-size: 1.05rem; margin-bottom: .25rem; }
.quiz-cta p { opacity: .85; font-size: .9rem; margin: 0; }

/* ── Reader ────────────────────────────────────────────────────────────────── */
.reader-layout { max-width: 780px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.breadcrumb { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--text-muted); margin-bottom: 1.5rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--primary); }
.reader-title { font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 800; margin-bottom: .5rem; }
.reader-meta { font-size: .85rem; color: var(--text-muted); margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.workbook-badge { color: var(--accent); font-weight: 600; }
.reader-nav { display: flex; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; }

/* ── Markdown Content ──────────────────────────────────────────────────────── */
.md-content { line-height: 1.8; }
.md-content h1, .md-content h2 { font-size: 1.35rem; font-weight: 700; margin: 2rem 0 .75rem; color: var(--primary); border-bottom: 2px solid var(--border); padding-bottom: .4rem; }
.md-content h3 { font-size: 1.1rem; font-weight: 700; margin: 1.5rem 0 .5rem; }
.md-content p { margin-bottom: 1rem; }
.md-content ul, .md-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.md-content li { margin-bottom: .35rem; }
.md-content blockquote { border-left: 4px solid var(--primary); padding: .75rem 1rem; background: var(--surface2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1rem 0; font-style: italic; color: var(--text-muted); }
.md-content table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .9rem; overflow-x: auto; display: block; }
.md-content th { background: var(--primary); color: white; padding: .6rem .9rem; text-align: left; font-weight: 600; }
.md-content td { padding: .55rem .9rem; border-bottom: 1px solid var(--border); }
.md-content tr:nth-child(even) td { background: var(--surface2); }
.md-content code { font-family: 'Noto Sans Mono', monospace; background: var(--surface2); padding: .1em .35em; border-radius: 4px; font-size: .88em; color: var(--primary); }
.md-content pre { background: #1e1b3a; color: #e2e0f0; padding: 1rem 1.25rem; border-radius: var(--radius-sm); overflow-x: auto; margin: 1rem 0; }
.md-content pre code { background: none; color: inherit; font-size: .85rem; padding: 0; }
.md-content strong { font-weight: 700; }
.md-content hr { border: none; border-top: 2px solid var(--border); margin: 2rem 0; }
.md-content .admonition { border-left: 4px solid var(--primary); background: var(--surface2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: .75rem 1rem; margin: 1rem 0; }

/* ── Quiz Page ─────────────────────────────────────────────────────────────── */
.quiz-page { padding: 2rem 0 4rem; }
.quiz-header { margin-bottom: 1.5rem; }
.quiz-header h1 { font-size: clamp(1.3rem, 4vw, 2rem); font-weight: 800; }
.quiz-progress-wrap { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.quiz-progress-bar { flex: 1; height: 8px; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s ease; }
.quiz-progress-label { font-size: .85rem; color: var(--text-muted); white-space: nowrap; }
.quiz-loading { text-align: center; padding: 3rem; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }

.question-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow);
}
.question-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: .5rem; }
.q-category { font-size: .8rem; font-weight: 600; color: var(--primary); background: var(--surface2); padding: .2rem .7rem; border-radius: 999px; }
.q-counter { font-size: .85rem; color: var(--text-muted); }
.question-text { font-size: 1.05rem; font-weight: 600; line-height: 1.65; margin-bottom: 1.25rem; }

.options-list { display: flex; flex-direction: column; gap: .6rem; }
.option-btn {
  display: flex; align-items: flex-start; gap: .75rem;
  background: var(--surface2); border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: .85rem 1rem;
  font-family: var(--font); font-size: .95rem; text-align: left;
  cursor: pointer; transition: all .15s; width: 100%;
}
.option-btn:hover:not(:disabled) { border-color: var(--primary); background: #f5f3ff; }
.option-btn.correct { border-color: #059669; background: #ecfdf5; color: #065f46; }
.option-btn.wrong { border-color: #dc2626; background: #fef2f2; color: #991b1b; }
.option-btn:disabled { cursor: default; }
.opt-letter { font-weight: 700; color: var(--primary); min-width: 20px; }

.explanation-box { margin-top: 1.25rem; padding: 1rem 1.25rem; border-radius: var(--radius-sm); line-height: 1.7; }
.explanation-box.correct-exp { background: #ecfdf5; border-left: 4px solid #059669; }
.explanation-box.wrong-exp { background: #fef2f2; border-left: 4px solid #dc2626; }
.explanation-box strong { display: block; margin-bottom: .35rem; }

.results-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem 2rem; box-shadow: var(--shadow); text-align: center; }
.result-emoji { font-size: 4rem; margin-bottom: 1rem; }
.result-score { font-size: 2rem; font-weight: 800; color: var(--primary); margin: .75rem 0; }
.result-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }

/* ── Hanja Grid ────────────────────────────────────────────────────────────── */
.hanja-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
@media (min-width: 480px) { .hanja-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .hanja-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .hanja-grid { grid-template-columns: repeat(5, 1fr); } }

.hanja-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem .75rem;
  text-align: center; text-decoration: none; color: var(--text);
  transition: all .15s; box-shadow: var(--shadow);
}
.hanja-card:hover { border-color: #92400e; transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.hanja-char { font-size: 2.5rem; font-weight: 700; color: #92400e; line-height: 1; margin-bottom: .35rem; }
.hanja-hangul { font-size: 1rem; font-weight: 600; color: var(--text); }
.hanja-meaning { font-size: .75rem; color: var(--text-muted); margin: .25rem 0; line-height: 1.4; }
.hanja-cat { font-size: .7rem; color: var(--primary); background: var(--surface2); padding: .15rem .5rem; border-radius: 999px; display: inline-block; margin-bottom: .35rem; }
.hanja-count { font-size: .75rem; color: #92400e; font-weight: 600; }

/* ── Hanja Hero ────────────────────────────────────────────────────────────── */
.hanja-hero { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.hanja-hero-char { font-size: 5rem; font-weight: 800; color: rgba(255,255,255,.9); line-height: 1; }
.hanja-hero h1 { font-size: clamp(1.2rem, 3vw, 1.8rem); margin-bottom: .35rem; }
.badge { display: inline-block; background: rgba(255,255,255,.2); border-radius: 999px; padding: .25rem .9rem; font-size: .8rem; font-weight: 600; }

/* ── Vocabulary Table ──────────────────────────────────────────────────────── */
.vocab-table-wrap { overflow-x: auto; margin-bottom: 2rem; }
.vocab-table { width: 100%; border-collapse: collapse; }
.vocab-table th { background: #92400e; color: white; padding: .65rem 1rem; text-align: left; font-size: .9rem; }
.vocab-table td { padding: .65rem 1rem; border-bottom: 1px solid var(--border); font-size: .95rem; }
.vocab-table tr:nth-child(even) td { background: var(--surface2); }
.vocab-word { font-weight: 600; color: #92400e; }
.root-nav { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }

/* ── Idiom List ────────────────────────────────────────────────────────────── */
.idiom-list { display: grid; gap: 1rem; }
@media (min-width: 768px) { .idiom-list { grid-template-columns: repeat(2, 1fr); } }
.idiom-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; border-top: 4px solid #92400e; }
.idiom-header { display: flex; align-items: baseline; gap: .75rem; margin-bottom: .5rem; }
.idiom-hanja { font-size: 1rem; font-weight: 800; color: #92400e; }
.idiom-hangul { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.idiom-literal { font-size: .85rem; color: var(--text-muted); margin-bottom: .5rem; }
.idiom-meaning { font-size: .9rem; margin-bottom: .75rem; }
.idiom-example { border-left: 3px solid #92400e; padding: .5rem .75rem; background: var(--surface2); font-size: .88rem; color: var(--text-muted); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ── Footer ────────────────────────────────────────────────────────────────── */
.footer { background: var(--text); color: rgba(255,255,255,.7); padding: 1.5rem 1.25rem; text-align: center; font-size: .85rem; }
.footer strong { color: white; }
.footer-sub { margin-top: .35rem; font-size: .8rem; font-style: italic; }


/* ── Chocobo Footer Animation ────────────────────────────────────────────────── */
.chocobo {
  display: inline-block;
  font-size: 1.5rem;
  transition: transform 0.2s ease-in-out;
  cursor: pointer;
}
.chocobo:hover {
  animation: kweh 0.4s infinite alternate;
}
@keyframes kweh {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-10px) rotate(15deg); }
}
