/* =========================================================
   LoOPCode — Professional Design System
   ========================================================= */
:root {
  --bg: #0b0f14;
  --bg-elevated: #12181f;
  --bg-card: #161d27;
  --bg-soft: #1a2330;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --text: #e8eef6;
  --text-muted: #8b9bb0;
  --text-dim: #5c6b7e;
  --primary: #3b9eff;
  --primary-hover: #5cb0ff;
  --primary-soft: rgba(59,158,255,0.14);
  --accent: #00d4aa;
  --accent-soft: rgba(0,212,170,0.12);
  --html: #e44d26;
  --html-soft: rgba(228,77,38,0.15);
  --js: #f7df1e;
  --js-soft: rgba(247,223,30,0.12);
  --success: #34d399;
  --success-soft: rgba(52,211,153,0.15);
  --warning: #fbbf24;
  --danger: #f87171;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow: 0 8px 30px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.45);
  --font: 'Poppins', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --nav-h: 60px;
  --bottom-nav-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --focus: 0 0 0 3px rgba(59,158,255,0.45);
}

*, *::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: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 900px) {
  body { padding-bottom: 0; }
}
a { color: inherit; text-decoration: none; transition: color 0.2s var(--ease); }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea { font-family: inherit; }
ul { list-style: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 28px);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  font-weight: 600; font-size: 0.92rem; border: none; cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, box-shadow 0.2s, filter 0.2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, #3b9eff, #2b7de9);
  color: #fff; box-shadow: 0 8px 24px rgba(59,158,255,0.3);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 10px 28px rgba(59,158,255,0.4); }
.btn-secondary {
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-muted); height: 40px; }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.btn-accent {
  background: linear-gradient(135deg, #00d4aa, #00b894);
  color: #042f2e; box-shadow: 0 8px 24px rgba(0,212,170,0.25);
}

/* ---------- Nav ---------- */
.lc-nav {
  position: sticky; top: 0; z-index: 1000;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 28px);
  background: rgba(11, 15, 20, 0.78);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.lc-brand {
  font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em;
  background: linear-gradient(135deg, #7dd3fc, #34d399, #fbbf24);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lc-nav-links { display: flex; align-items: center; gap: 4px; }
.lc-nav-links a {
  color: var(--text-muted); font-weight: 500; font-size: 0.9rem;
  padding: 8px 12px; border-radius: 8px;
}
.lc-nav-links a:hover, .lc-nav-links a.active { color: var(--text); background: rgba(255,255,255,0.05); }
.lc-nav-cta {
  margin-left: 8px;
  background: var(--primary-soft); color: var(--primary);
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 0.85rem;
}
.lc-nav-cta:hover { background: var(--primary); color: #fff; }
.lc-menu-btn {
  display: none; background: none; border: none; color: var(--text);
  font-size: 1.35rem; padding: 8px; cursor: pointer;
}
@media (max-width: 768px) {
  .lc-menu-btn { display: block; }
  .lc-nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(11,15,20,0.96); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 12px; display: none;
  }
  .lc-nav-links.open { display: flex; }
  .lc-nav-links a { padding: 14px 16px; }
}

/* ---------- Mobile bottom nav ---------- */
.lc-bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; align-items: stretch; justify-content: space-around;
  background: rgba(12, 16, 22, 0.92);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
}
.lc-bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-dim); font-size: 0.68rem; font-weight: 600;
  min-height: 48px; transition: color 0.2s;
}
.lc-bottom-nav a i { font-size: 1.15rem; }
.lc-bottom-nav a.active, .lc-bottom-nav a:hover { color: var(--primary); }
@media (min-width: 900px) {
  .lc-bottom-nav { display: none; }
}

/* ---------- Cards ---------- */
.lc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.lc-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

/* ---------- Progress ---------- */
.bar-track {
  height: 8px; background: var(--bg-soft); border-radius: 99px; overflow: hidden;
}
.bar-fill {
  height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.6s var(--ease);
}

/* ---------- Toast ---------- */
#lc-toast-root {
  position: fixed; top: calc(var(--nav-h) + 12px); right: 16px; z-index: 10050;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.lc-toast {
  pointer-events: auto;
  min-width: 220px; max-width: min(340px, 90vw);
  background: var(--bg-elevated); color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem; font-weight: 500;
  animation: lcToastIn 0.35s var(--ease);
  display: flex; align-items: center; gap: 10px;
}
.lc-toast.success { border-color: rgba(52,211,153,0.4); }
.lc-toast.success::before { content: '✓'; color: var(--success); font-weight: 700; }
@keyframes lcToastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* ---------- Breadcrumb ---------- */
.lc-breadcrumb {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 0.82rem; color: var(--text-dim); margin-bottom: 16px;
}
.lc-breadcrumb a { color: var(--text-muted); }
.lc-breadcrumb a:hover { color: var(--primary); }
.lc-breadcrumb span.sep { opacity: 0.4; }

/* ---------- Hero cinematic ---------- */
.lc-hero {
  position: relative; overflow: hidden;
  padding: clamp(48px, 10vw, 100px) 0 clamp(40px, 6vw, 72px);
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(59,158,255,0.22), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 50%, rgba(0,212,170,0.08), transparent 50%),
    var(--bg);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.lc-hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.15;
  color: #fff; margin-bottom: 14px;
}
.lc-hero p {
  color: var(--text-muted); font-size: clamp(1rem, 2vw, 1.15rem);
  max-width: 540px; margin: 0 auto 28px; line-height: 1.65;
}
.lc-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- Section ---------- */
.lc-section { padding: clamp(40px, 6vw, 72px) 0; }
.lc-section-title {
  font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 700;
  color: #fff; margin-bottom: 8px; letter-spacing: -0.02em;
}
.lc-section-sub { color: var(--text-muted); margin-bottom: 28px; max-width: 520px; }

/* ---------- Course grid ---------- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.course-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; position: relative; overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.course-card:hover {
  transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow);
}
.course-card .tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.course-card.html .tag { background: var(--html-soft); color: #ff8a65; }
.course-card.js .tag { background: var(--js-soft); color: #f7df1e; }
.course-card h3 { font-size: 1.2rem; color: #fff; margin-bottom: 8px; }
.course-card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 16px; min-height: 44px; }
.course-card .prog { margin-top: auto; }
.course-card .prog-row {
  display: flex; justify-content: space-between; font-size: 0.8rem;
  color: var(--text-muted); margin-bottom: 6px;
}

/* ---------- Footer ---------- */
.lc-footer {
  border-top: 1px solid var(--border);
  padding: 28px clamp(16px, 4vw, 28px) 36px;
  text-align: center; color: var(--text-dim); font-size: 0.85rem;
}
.lc-footer a { color: var(--text-muted); }
.lc-footer a:hover { color: var(--primary); }

/* ---------- Animations ---------- */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }

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