/* MicroHelp — embedded systems learning platform */

:root {
  --bg: #000000;
  --bg-alt: #0a0e16;
  --surface: #10141f;
  --surface-hover: #161b29;
  --border: #202737;
  --text: #dce3f0;
  --text-dim: #8b96ab;
  --accent: #0d84ff;
  --accent-strong: #4fb2ff;
  --shadow-glow: 0 12px 32px -12px rgba(13, 132, 255, 0.35);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --radius: 10px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-strong); }

h1, h2, h3, h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
  margin: 0 0 .5em;
}

h1 { font-size: 2.4rem; letter-spacing: -0.01em; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; color: var(--text); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
}
.logo:hover { color: #fff; }
.logo-text em { color: var(--accent); font-style: normal; }
.logo-mark-img {
  height: 44px;
  width: auto;
  display: block;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  font-family: var(--font-mono);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.site-nav a:hover { color: #fff; border-color: var(--accent-strong); }
.site-nav a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  display: block;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 108px 0 84px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(circle, rgba(13, 132, 255, 0.09) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--bg);
  border-bottom: 1px solid var(--border);
}

.hero-glow {
  position: absolute;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  height: 480px;
  background: radial-gradient(ellipse at center, rgba(13, 132, 255, 0.28), transparent 70%);
  pointer-events: none;
  animation: glow-pulse 6s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.75; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-glow { animation: none; }
}

.hero .wrap { position: relative; }

.hero-mark {
  width: 260px;
  max-width: 70%;
  height: auto;
  margin: 0 auto 12px;
  display: block;
  filter: drop-shadow(0 0 30px rgba(13, 132, 255, 0.4));
}

.eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  margin-bottom: 14px;
}

.hero h1 {
  max-width: 780px;
  margin: 0 auto 20px;
  font-size: 2.6rem;
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-strong) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 620px;
  margin: 0 auto 32px;
  color: var(--text-dim);
  font-size: 1.05rem;
}

.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero-tags {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 40px 0 0;
  padding: 0;
}
.hero-tags li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
  background: rgba(13, 132, 255, 0.05);
}

.stats-strip {
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 36px 24px;
  text-align: center;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.page-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
}
.page-hero .hero-sub { margin: 0; max-width: 640px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  background: var(--accent-strong);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 14px 36px -10px rgba(79, 178, 255, 0.55);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.btn-block { display: block; width: 100%; text-align: center; margin-bottom: 10px; }

/* ---------- Sections ---------- */

.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 10px;
}
.section-head h2 {
  margin: 0;
  position: relative;
  padding-left: 16px;
}
.section-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.see-all { font-size: 0.9rem; font-weight: 600; }

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.08) 50%, transparent 60%);
  transform: translateX(-120%);
  pointer-events: none;
}
.card:hover::after {
  transform: translateX(120%);
  transition: transform 0.7s ease;
}

.card-thumb {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background:
    linear-gradient(135deg, rgba(13, 132, 255, 0.20), rgba(79, 178, 255, 0.06));
  border-bottom: 1px solid var(--border);
}
.course-card .card-thumb {
  height: 130px;
  color: #fff;
}
.course-card .thumb-icon { width: 40px; height: 40px; opacity: 0.9; }
.thumb-icon {
  width: 34px;
  height: 34px;
  transition: transform 0.2s ease;
}
.card:hover .thumb-icon { transform: scale(1.08); }

.card-body { padding: 20px; }
.card-body h3 { margin-bottom: 8px; }
.card-body p { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 0; }

.card-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.card-price {
  margin-top: 12px;
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Pill tags & ratings ---------- */

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  line-height: 1.6;
}
.pill-beginner { background: rgba(52, 199, 89, 0.15); color: #34c759; }
.pill-intermediate { background: rgba(13, 132, 255, 0.15); color: var(--accent-strong); }
.pill-advanced { background: rgba(255, 69, 58, 0.15); color: #ff453a; }
.pill-bestseller { background: rgba(255, 214, 10, 0.15); color: #ffd60a; }
.pill-free { background: rgba(255, 255, 255, 0.08); color: var(--text); border: 1px solid var(--border); }

.stars {
  color: #ffd60a;
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.stars .count { color: var(--text-dim); font-family: var(--font-mono); font-size: 0.78rem; margin-left: 4px; }

.feature-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.feature-list li {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 4px 0;
}
.feature-list li::before { content: "▸ "; color: var(--accent); }

.card-thumb-1 { background: linear-gradient(135deg, #ff6a3d, #ff9166); }
.card-thumb-2 { background: linear-gradient(135deg, #0d84ff, #4fb2ff); }
.card-thumb-3 { background: linear-gradient(135deg, #7c4dff, #b388ff); }
.card-thumb-4 { background: linear-gradient(135deg, #00c896, #4fe0bd); }
.card-thumb-5 { background: linear-gradient(135deg, #ff2d78, #ff7ab3); }
.card-thumb-6 { background: linear-gradient(135deg, #ffb300, #ffd166); }

/* ---------- Newsletter ---------- */

.newsletter { border-top: 1px solid var(--border); }
.newsletter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.newsletter-inner h2 { margin-bottom: 4px; }
.newsletter-inner p { color: var(--text-dim); margin: 0; }

.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter-form input {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  min-width: 240px;
  font-family: var(--font-body);
}
.newsletter-form input:focus { outline: none; border-color: var(--accent); }

/* ---------- Post / article ---------- */

.post-header { padding: 48px 0 32px; border-bottom: 1px solid var(--border); }
.post-header h1 { max-width: 760px; }

.tag-list { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
}

.post-content {
  max-width: 760px;
  padding: 40px 0;
}
.post-content h2, .post-content h3 { margin-top: 1.6em; }
.post-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  overflow-x: auto;
}
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
}
.post-content pre code { background: none; padding: 0; }
.post-content img { max-width: 100%; border-radius: var(--radius); }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5em 0;
  padding: 0.2em 1.2em;
  color: var(--text-dim);
}
.post-content ul, .post-content ol { padding-left: 1.4em; }

.embed-responsive {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.6em 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.embed-responsive.embed-ratio-4-3 { aspect-ratio: 4 / 3; }
.embed-responsive.embed-ratio-1-1 { aspect-ratio: 1 / 1; }
.embed-responsive iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.post-footer { padding-bottom: 60px; }

/* ---------- Course single ---------- */

.course-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}
.course-layout .post-content { padding-top: 40px; }

.course-sidebar {
  position: sticky;
  top: 88px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 40px;
}
.course-price {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
}
.syllabus {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.syllabus li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text-dim);
}
.syllabus li::before { content: "✓ "; color: var(--accent); }
.course-note { font-size: 0.8rem; color: var(--text-dim); text-align: center; margin: 0; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding-top: 56px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 40px;
}
.footer-logo { margin-bottom: 12px; }
.footer-logo-full { width: 220px; height: auto; margin-bottom: 16px; display: block; }
.footer-tagline { color: var(--text-dim); max-width: 320px; font-size: 0.92rem; }
.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--text-dim); font-size: 0.92rem; }
.footer-col a:hover { color: var(--accent); }

.social-links {
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 12px !important;
}
.social-links li { display: flex; }
.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.social-links a svg { width: 19px; height: 19px; }
.social-links a:hover {
  color: #fff;
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(13, 132, 255, 0.22), rgba(79, 178, 255, 0.08));
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -10px rgba(13, 132, 255, 0.6);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .course-layout { grid-template-columns: 1fr; }
  .course-sidebar { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 8px 24px 16px; }
  .site-nav li { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .card-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .newsletter-inner { flex-direction: column; align-items: flex-start; }
}
