/* Happ (happ.courses) — light editorial wiki design. */
:root {
  --bg: #f8fafc;
  --brand: #3356c8;
  --brand-2: #1371e8;
  --brand-strong: #172033;
  --brand-soft: #dbe7ff;
  --accent-green: #12a270;
  --text: #172033;
  --text-muted: #475569;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --surface-muted: #eef2ff;
  --border: #e2e8f0;
  --border-soft: #eef2ff;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 6px 20px rgba(15, 23, 42, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --container: 1120px;
  --sans: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { font-family: var(--sans); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(191, 219, 254, 0.7), transparent 32%),
    radial-gradient(circle at bottom right, rgba(224, 231, 255, 0.9), transparent 28%),
    linear-gradient(180deg, #f8fafc, #eef2ff);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 22px; }
.muted { color: var(--text-muted); }
h1, h2, h3, h4 { color: var(--brand-strong); letter-spacing: -0.4px; line-height: 1.2; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-weight: 700; font-size: 15px;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .08s ease, box-shadow .15s ease, background .15s ease; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 10px 24px rgba(51, 86, 200, .25); }
.btn--primary:hover { background: #253a8d; }
.btn--ghost { background: rgba(255,255,255,.7); color: var(--brand-strong); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn--sm { padding: 8px 15px; font-size: 14px; }
.btn--lg { padding: 14px 26px; font-size: 16px; }
.btn--block { width: 100%; }

.eyebrow { color: var(--brand); font-weight: 700; font-size: 13px; letter-spacing: .5px; text-transform: uppercase; margin-bottom: 8px; }
.grad { background: linear-gradient(90deg, #3356c8, #1371e8, #12a270); -webkit-background-clip: text; background-clip: text; color: transparent; }
.text-link { color: var(--brand); font-weight: 600; font-size: 14px; white-space: nowrap; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(248, 250, 252, 0.8); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand:hover { text-decoration: none; }
.brand__mark { display: block; border-radius: 8px; }
.brand__name { font-weight: 800; font-size: 19px; color: var(--brand-strong); letter-spacing: -0.5px; }
.brand__wiki { color: var(--brand); }
.site-nav { display: flex; gap: 22px; margin-left: 8px; margin-right: auto; }
.site-nav a { color: var(--text-muted); font-weight: 600; font-size: 15px; }
.site-nav a:hover, .site-nav a.active { color: var(--brand-strong); text-decoration: none; }

/* hero */
.hero { padding: 60px 0 30px; }
.hero-inner { max-width: 820px; }
.hero h1 { font-size: clamp(30px, 5vw, 50px); font-weight: 800; margin: 6px 0 16px; }
.hero-lead { font-size: 18px; color: var(--text-muted); max-width: 640px; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.category-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; font-weight: 600; color: var(--brand-strong); box-shadow: var(--shadow-sm);
}
.category-chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.category-chip span { color: var(--text-muted); font-weight: 600; font-size: 12px; }

/* sections */
.section { padding: 28px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading { font-size: 24px; font-weight: 800; margin: 0; }
.section-heading.center { text-align: center; margin: 0 auto 8px; }

/* card grid + article cards */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.article-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-soft); text-decoration: none; }
.article-card__meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); }
.article-card__title { font-size: 17px; font-weight: 700; margin: 0; color: var(--brand-strong); }
.article-card__excerpt { font-size: 14px; color: var(--text-muted); margin: 0; flex: 1; }
.article-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.article-card__footer .read { color: var(--brand); font-weight: 600; font-size: 13px; }
.pill { background: var(--surface-muted); color: var(--brand); font-weight: 700; font-size: 11px; padding: 3px 9px; border-radius: 999px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: #f1f5f9; color: var(--text-muted); font-size: 11px; padding: 3px 8px; border-radius: 6px; font-family: var(--mono); }

/* page head */
.page-head { padding: 44px 0 6px; }
.page-head h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; margin: 6px 0 10px; }
.crumbs { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--brand); }

/* article page */
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; align-items: start; padding-top: 34px; }
.article-main { min-width: 0; }
.article-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.article-main h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; margin: 4px 0 12px; }
.article-lead { font-size: 18px; color: var(--text-muted); margin: 0 0 22px; }
.article-body { font-size: 16px; color: #26324a; }
.article-body h2 { font-size: 21px; margin: 26px 0 10px; }
.article-body p { margin: 0 0 14px; }
.article-body ol, .article-body ul { margin: 0 0 16px; padding-left: 22px; }
.article-body li { margin: 6px 0; }
.article-tags { margin-top: 24px; }
.callout { background: var(--surface-muted); border: 1px solid var(--brand-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin: 18px 0; font-size: 15px; color: #2a3a5e; }
.callout.tip { background: rgba(18, 162, 112, 0.08); border-color: rgba(18, 162, 112, 0.28); }
.callout a { font-weight: 600; }
.article-aside { position: sticky; top: 84px; display: grid; gap: 16px; }
.aside-card { background: var(--surface-strong); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.aside-card h4 { margin: 0 0 12px; font-size: 15px; }
.aside-card p { font-size: 14px; color: var(--text-muted); margin: 0 0 14px; }
.aside-card .btn { margin-bottom: 8px; }
.aside-link { display: block; font-size: 14px; padding: 7px 0; border-bottom: 1px solid var(--border-soft); color: var(--brand-strong); font-weight: 600; }
.aside-link:last-child { border-bottom: none; }
.aside-link:hover { color: var(--brand); text-decoration: none; }

/* prose (legal) */
.prose { max-width: 780px; font-size: 16px; color: #26324a; }
.prose p { margin: 0 0 14px; }

/* faq */
.faq-wrap { max-width: 820px; margin: 0 auto; display: grid; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px 18px; box-shadow: var(--shadow-sm); }
.faq-item summary { cursor: pointer; padding: 15px 0; font-weight: 700; color: var(--brand-strong); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--brand); font-size: 20px; line-height: 1; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0 0 16px; color: var(--text-muted); font-size: 15px; }

/* cta */
.section--cta { padding: 34px 0 50px; }
.cta-card {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(120deg, #eef2ff, #dbe7ff); border: 1px solid var(--brand-soft);
  border-radius: 26px; padding: 32px; box-shadow: var(--shadow);
}
.cta-card h2 { font-size: 26px; font-weight: 800; margin: 4px 0 8px; }
.cta-card p { color: var(--text-muted); margin: 0; max-width: 520px; }

/* contacts */
.contacts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.link-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.link-card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-2px); }
.link-card h3 { margin: 0 0 8px; font-size: 17px; }
.link-card p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* pricing */
.plans-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.plan { position: relative; background: var(--surface-strong); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.plan--hot { border-color: var(--brand); box-shadow: 0 18px 40px rgba(51,86,200,.18); }
.plan__badge { position: absolute; top: -11px; left: 24px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.plan__name { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 8px; }
.plan__old { color: #94a3b8; text-decoration: line-through; font-size: 14px; }
.plan__price { font-size: 34px; font-weight: 800; color: var(--brand-strong); line-height: 1.1; }
.plan__price small { font-size: 14px; color: var(--text-muted); font-weight: 600; }
.plan__sub { color: var(--accent-green); font-weight: 700; font-size: 13px; margin-top: 4px; }
.plan ul { list-style: none; padding: 0; margin: 16px 0; flex: 1; }
.plan li { font-size: 14px; color: var(--text-muted); padding: 5px 0; padding-left: 22px; position: relative; }
.plan li::before { content: "✓"; color: var(--accent-green); position: absolute; left: 0; font-weight: 700; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { position: relative; width: 440px; max-width: 100%; background: #fff; border-radius: 22px; padding: 26px; box-shadow: var(--shadow); }
.modal__close { position: absolute; top: 14px; right: 16px; border: none; background: none; font-size: 26px; line-height: 1; color: #94a3b8; cursor: pointer; }
.modal h3 { font-size: 20px; margin: 0 0 6px; }
.modal__desc { color: var(--text-muted); font-size: 14px; margin: 0 0 18px; }
.modal__summary { display: flex; justify-content: space-between; align-items: center; background: var(--surface-muted); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; font-size: 15px; }
.modal__summary b { color: var(--brand); font-size: 18px; }
.modal label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.modal input { width: 100%; padding: 12px 14px; font-family: var(--sans); font-size: 15px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 16px; }
.modal input:focus { outline: none; border-color: var(--brand); }
.modal__methods { display: flex; gap: 8px; margin-bottom: 16px; }
.method-btn { flex: 1; padding: 10px; font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--text-muted); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.method-btn:hover { border-color: var(--brand); color: var(--brand); }
.method-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.modal__error { color: #dc2626; font-size: 13px; margin: 0 0 12px; min-height: 14px; }
.modal__note { color: var(--text-muted); font-size: 12px; text-align: center; margin-top: 12px; }

/* footer */
.site-footer { border-top: 1px solid var(--border-soft); background: rgba(255,255,255,.5); margin-top: 30px; padding: 40px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.footer-tag { color: var(--text-muted); font-size: 14px; max-width: 260px; margin-top: 10px; }
.footer-col h4 { font-size: 14px; margin: 0 0 12px; }
.footer-col a { display: block; color: var(--text-muted); font-size: 14px; padding: 4px 0; }
.footer-col a:hover { color: var(--brand); text-decoration: none; }
.footer-bottom { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border-soft); color: var(--text-muted); font-size: 13px; }

/* responsive */
@media (max-width: 900px) {
  .card-grid, .contacts-grid { grid-template-columns: repeat(2, 1fr); }
  .plans-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: 1fr; }
  .article-aside { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .site-nav { display: none; }
}
@media (max-width: 560px) {
  .card-grid, .contacts-grid, .plans-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
