/* ══════════════════════════════════════════════════
   CLAUDE CODE QUEST (EN) — Styles
   Fresh dark theme: slate base, cyan + violet accent
   ══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* base */
  --bg:        #0b0e14;
  --bg2:       #0e131c;
  --surface:   #141a25;
  --surface2:  #1a2230;
  --line:      rgba(255, 255, 255, .07);
  --line2:     rgba(255, 255, 255, .12);

  /* text */
  --cream1:    #e9eef5;
  --cream2:    #c2ccd8;
  --cream3:    #97a3b4;
  --stone:     #677183;

  /* accents */
  --cyan:      #2dd4bf;
  --cyan-br:   #5eead4;
  --violet:    #a78bfa;
  --violet-br: #c4b5fd;
  --gold:      #fbbf24;
  --emerald:   #34d399;
  --rose:      #fb7185;
  --sky:       #38bdf8;
  --claude:    #2dd4bf;        /* alias used by mechanics */
  --claude-bright: #5eead4;

  --r:   14px;
  --r-s: 10px;
  --r-l: 20px;

  --grad: linear-gradient(135deg, var(--cyan) 0%, var(--violet) 100%);
  --shadow: 0 8px 30px rgba(0, 0, 0, .45);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(167, 139, 250, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(45, 212, 191, .08), transparent 55%),
    var(--bg);
  color: var(--cream1);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(45, 212, 191, .25); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2a3547; }

/* ══════════ TOPBAR ══════════ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: rgba(11, 14, 20, .72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s, background .25s;
}
.topbar.scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, .4); background: rgba(11, 14, 20, .9); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.menu-btn {
  background: var(--surface); color: var(--cream1);
  border: 1px solid var(--line2); border-radius: var(--r-s);
  width: 40px; height: 40px; font-size: 1.2rem; cursor: pointer;
  display: grid; place-items: center; transition: .2s;
}
.menu-btn:hover { background: var(--surface2); transform: translateY(-1px); }

.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; letter-spacing: -.02em; font-size: 1.02rem;
}
.brand .logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--grad); display: grid; place-items: center;
  font-size: .95rem; box-shadow: 0 2px 10px rgba(45, 212, 191, .35);
}
.brand .gr {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.xp-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line2);
  padding: 7px 14px; border-radius: 999px;
}
.xp-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: pulseDot 2s infinite; }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.xp-bar { width: 90px; height: 7px; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.xp-fill { height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width .6s cubic-bezier(.4, 0, .2, 1); }
#xpNum { font-size: .8rem; font-weight: 600; color: var(--cream2); white-space: nowrap; }

.btn-reset {
  background: transparent; color: var(--stone); border: 1px solid var(--line2);
  border-radius: var(--r-s); padding: 8px 12px; font-size: .8rem; cursor: pointer; transition: .2s;
}
.btn-reset:hover { color: var(--rose); border-color: var(--rose); }

/* ══════════ SIDEBAR ══════════ */
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px); z-index: 60; opacity: 0; pointer-events: none; transition: .25s;
}
.sidebar-backdrop.open { opacity: 1; pointer-events: auto; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 320px; max-width: 85vw;
  background: var(--bg2); border-right: 1px solid var(--line); z-index: 70;
  transform: translateX(-100%); transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto; padding: 22px 16px 40px;
}
.sidebar.open { transform: translateX(0); box-shadow: 12px 0 40px rgba(0, 0, 0, .5); }
.sidebar-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--stone); font-weight: 700; padding: 6px 10px 14px;
}
.nav-list { list-style: none; position: relative; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--r-s); cursor: pointer;
  color: var(--cream2); transition: .18s; font-size: .9rem; margin-bottom: 2px;
}
.nav-item:hover { background: var(--surface); color: var(--cream1); }
.nav-item.active { background: var(--surface2); color: var(--cream1); box-shadow: inset 3px 0 0 var(--cyan); }
.nav-item.done { color: var(--cream3); }
.nav-item.locked { opacity: .4; cursor: not-allowed; }
.nav-item.locked:hover { background: transparent; }

.nav-dot {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
  background: var(--surface2); color: var(--cream3); border: 1px solid var(--line2);
}
.nav-item.active .nav-dot { background: var(--grad); color: #06141a; border-color: transparent; }
.nav-item.done .nav-dot { background: rgba(52, 211, 153, .15); color: var(--emerald); border-color: rgba(52, 211, 153, .4); }
.nav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══════════ MAIN ══════════ */
.main-wrapper { display: flex; justify-content: center; }
.main { width: 100%; max-width: 760px; padding: 32px 20px 120px; }

.view { display: none; animation: fade .4s ease; }
.view.on { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ── chapter heading ── */
.ch-tag {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--cyan-br); background: rgba(45, 212, 191, .1); border: 1px solid rgba(45, 212, 191, .25);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}
.ch-h { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin-bottom: 8px; }
.ch-sub { color: var(--cream3); font-size: 1.02rem; margin-bottom: 26px; }

/* ── cards ── */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; margin-bottom: 16px; transition: border-color .2s;
}
.card:hover { border-color: var(--line2); }
.card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; letter-spacing: -.01em; }
.card p { color: var(--cream2); margin-bottom: 4px; }
.card ul { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.card ul li { color: var(--cream2); padding-left: 4px; }
.card-icon { font-size: 1.7rem; display: block; margin-bottom: 8px; }

.about-card { background: linear-gradient(135deg, var(--surface), var(--surface2)); }

/* ── highlights ── */
.hl  { color: var(--cyan-br); font-weight: 600; }
.hlg { color: var(--gold); font-weight: 600; }
.hlv { color: var(--violet-br); font-weight: 600; }
a { color: var(--cyan-br); }
code {
  font-family: 'JetBrains Mono', monospace; font-size: .88em;
  background: var(--surface2); border: 1px solid var(--line2);
  padding: 2px 7px; border-radius: 6px; color: var(--cyan-br);
}

/* ── insight ── */
.insight {
  background: linear-gradient(135deg, rgba(167, 139, 250, .08), rgba(45, 212, 191, .05));
  border: 1px solid rgba(167, 139, 250, .2); border-radius: var(--r);
  padding: 20px; margin-bottom: 16px;
}
.insight h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 8px; color: var(--violet-br); }
.insight p { color: var(--cream2); }
.insight ul { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

/* ── steps ── */
.step { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: none; }
.step-n {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--grad); color: #06141a; font-weight: 800; font-size: .9rem;
  display: grid; place-items: center;
}
.step-body h4 { font-size: .96rem; font-weight: 700; margin-bottom: 3px; }
.step-body p { font-size: .9rem; color: var(--cream3); }

/* ── "say to Claude" box ── */
.say {
  background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r);
  padding: 14px 16px; margin-top: 10px; position: relative;
}
.say-label { font-size: .78rem; font-weight: 700; color: var(--cyan-br); display: block; margin-bottom: 10px; }
.say-tabs { position: absolute; top: 12px; right: 52px; display: flex; gap: 4px; }
.say-tab {
  background: var(--surface2); border: 1px solid var(--line2); color: var(--cream3);
  font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 6px; cursor: pointer; transition: .15s;
}
.say-tab.active { background: var(--grad); color: #06141a; border-color: transparent; }
.say-content { position: relative; }
.say-content p {
  font-family: 'JetBrains Mono', monospace; font-size: .9rem; line-height: 1.65;
  color: var(--cream1); white-space: pre-wrap; word-break: break-word;
}
.say-content mark { background: rgba(251, 191, 36, .2); color: var(--gold); padding: 1px 4px; border-radius: 4px; }
.say-copy {
  position: absolute; top: -2px; right: 0; background: var(--surface2);
  border: 1px solid var(--line2); border-radius: 7px; width: 34px; height: 30px;
  cursor: pointer; font-size: .9rem; color: var(--cream2); transition: .15s;
}
.say-copy:hover { background: var(--surface); color: var(--cyan-br); }
.say-copy.ok { color: var(--emerald); border-color: rgba(52, 211, 153, .4); }
.copy-tip {
  position: absolute; bottom: 120%; right: 0; background: var(--emerald); color: #06141a;
  font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap;
}

/* ── code preview ── */
.preview { border: 1px solid var(--line2); border-radius: var(--r); overflow: hidden; margin-top: 8px; }
.preview-top {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  background: var(--surface2); border-bottom: 1px solid var(--line);
}
.preview-dots { display: flex; gap: 6px; }
.preview-dots i { width: 11px; height: 11px; border-radius: 50%; background: #3a4456; }
.preview-dots i:nth-child(1) { background: #fb7185; }
.preview-dots i:nth-child(2) { background: #fbbf24; }
.preview-dots i:nth-child(3) { background: #34d399; }
.preview-label { font-size: .8rem; color: var(--cream3); font-family: 'JetBrains Mono', monospace; }
.preview-body {
  padding: 16px; background: var(--bg2); font-family: 'JetBrains Mono', monospace;
  font-size: .85rem; line-height: 1.7; color: var(--cream2); white-space: pre-wrap;
}
.preview-body .d { color: var(--stone); }
.preview-body .o { color: var(--cyan-br); }
.preview-body .v { color: var(--violet-br); }

/* ── skill chip ── */
.skill {
  background: var(--surface2); border: 1px solid var(--line2); border-radius: var(--r-s);
  padding: 12px 16px; margin-top: 10px;
}
.skill h4 { font-family: 'JetBrains Mono', monospace; color: var(--cyan-br); font-size: .95rem; margin-bottom: 3px; }
.skill p { font-size: .85rem; color: var(--cream3); margin: 0; }

/* ── quiz ── */
.quiz {
  background: linear-gradient(135deg, rgba(45, 212, 191, .06), rgba(167, 139, 250, .04));
  border: 1px solid rgba(45, 212, 191, .2); border-radius: var(--r); padding: 22px; margin-bottom: 16px;
}
.quiz-head { font-size: .82rem; font-weight: 700; color: var(--cyan-br); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.quiz-q { font-size: 1.05rem; font-weight: 600; color: var(--cream1); margin-bottom: 14px; }
.quiz-opts { display: flex; flex-direction: column; gap: 9px; }
.quiz-opt {
  background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r-s);
  padding: 13px 16px; cursor: pointer; transition: .18s; color: var(--cream2); font-size: .92rem;
}
.quiz-opt:hover { border-color: var(--cyan); transform: translateX(3px); }
.quiz-opt.yes { background: rgba(52, 211, 153, .12); border-color: var(--emerald); color: var(--cream1); }
.quiz-opt.no { background: rgba(251, 113, 133, .12); border-color: var(--rose); animation: shake .4s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.quiz-msg { display: none; margin-top: 12px; font-weight: 700; font-size: .92rem; }

/* ══════════ HERO ══════════ */
.hero { text-align: center; padding: 30px 0 24px; position: relative; overflow: hidden; }
.hero-particles { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.particle { position: absolute; background: var(--cyan); border-radius: 50%; opacity: .4; animation: float linear infinite; }
@keyframes float { to { transform: translateY(-460px); opacity: 0; } }
.hero > *:not(.hero-particles) { position: relative; z-index: 1; }
.hero-logo {
  width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 18px; display: grid; place-items: center;
  background: var(--grad); font-size: 2rem; box-shadow: 0 10px 36px rgba(45, 212, 191, .4);
}
.hero-label {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--violet-br); background: rgba(167, 139, 250, .1); border: 1px solid rgba(167, 139, 250, .25);
  padding: 5px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: 2.9rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.08; margin-bottom: 14px; }
.hero h1 .gr { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero .sub { color: var(--cream3); font-size: 1.12rem; max-width: 480px; margin: 0 auto 24px; }

.pipe {
  display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 6px;
  margin: 26px auto; max-width: 560px;
}
.pipe-item {
  display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--cream2);
  background: var(--surface); border: 1px solid var(--line2); padding: 7px 12px; border-radius: 999px;
}
.pipe-line { width: 14px; height: 2px; background: var(--line2); }

.hero-cta { margin: 24px 0 8px; }

/* ── buttons ── */
.btn {
  font-family: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
  border: none; border-radius: var(--r-s); padding: 15px 28px; transition: .2s;
}
.btn-start {
  background: var(--grad); color: #06141a;
  box-shadow: 0 8px 26px rgba(45, 212, 191, .35);
}
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(45, 212, 191, .5); }
.btn-go {
  display: block; width: 100%; margin-top: 8px;
  background: var(--grad); color: #06141a; box-shadow: 0 8px 26px rgba(45, 212, 191, .3);
}
.btn-go:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(45, 212, 191, .45); }
.pulse { animation: pulse 2.4s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 8px 26px rgba(45, 212, 191, .35); } 50% { box-shadow: 0 8px 26px rgba(45, 212, 191, .6); } }

/* ── support CTA ── */
.support-cta {
  position: relative; display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r);
  padding: 16px 18px; margin-top: 22px; overflow: hidden;
}
.support-cta__icon { font-size: 1.8rem; }
.support-cta__title { font-size: 1rem; font-weight: 700; }
.support-cta__sub { font-size: .85rem; color: var(--cream3); }
.support-cta__btn {
  margin-left: auto; background: var(--gold); color: #1a1206; font-weight: 700; font-size: .85rem;
  text-decoration: none; padding: 10px 16px; border-radius: var(--r-s); white-space: nowrap; transition: .2s;
}
.support-cta__btn:hover { transform: translateY(-2px); }

.about-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.about-link {
  font-size: .82rem; color: var(--cream2); text-decoration: none;
  background: var(--surface2); border: 1px solid var(--line2); padding: 7px 14px; border-radius: 999px; transition: .2s;
}
.about-link:hover { border-color: var(--cyan); color: var(--cyan-br); }

.hero-cta-notice { font-size: .82rem; color: var(--cream3); max-width: 460px; margin: 14px auto 0; line-height: 1.6; }

/* ══════════ ACHIEVEMENT TOAST ══════════ */
.ach {
  position: fixed; top: 76px; left: 50%; transform: translate(-50%, -160%);
  display: flex; align-items: center; gap: 14px; z-index: 90;
  background: var(--surface); border: 1px solid var(--cyan); border-radius: var(--r);
  padding: 14px 22px; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); transition: transform .5s cubic-bezier(.34, 1.56, .64, 1);
}
.ach.show { transform: translate(-50%, 0); }
.ach-i { font-size: 2rem; }
.ach-t { font-weight: 800; font-size: 1rem; }
.ach-d { font-size: .82rem; color: var(--cream3); }

/* ── floating xp popup ── */
.xpp {
  position: fixed; transform: translate(-50%, -50%); z-index: 95;
  background: var(--grad); color: #06141a; font-weight: 800; font-size: 1.1rem;
  padding: 12px 22px; border-radius: 999px; box-shadow: 0 10px 30px rgba(45, 212, 191, .5);
  animation: xpFloat 1.4s ease forwards; pointer-events: none;
}
@keyframes xpFloat { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -130%) scale(1); } }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; }

/* ══════════ RESPONSIVE ══════════ */
@media (max-width: 600px) {
  .hero h1 { font-size: 2.1rem; }
  .ch-h { font-size: 1.6rem; }
  .main { padding: 22px 14px 100px; }
  .xp-bar { width: 60px; }
  #xpNum { font-size: .72rem; }
  .grid-2col { grid-template-columns: 1fr !important; }
  .support-cta { flex-wrap: wrap; }
  .support-cta__btn { margin-left: 0; }
}
