/* ============================================================
   NiYien.com v2 — global stylesheet
   Palette: brand blue #165DFF + neutral gray scale only.
   No external fonts, no CDN. See spec §4.
   ============================================================ */
:root {
  --brand: #165DFF;
  --brand-deep: #0E3FBF;
  --brand-ghost: #EEF4FF;
  --ink: #111827;
  --body: #374151;
  --muted: #6B7280;
  --line: #E8EAEF;
  --bg: #FFFFFF;
  --bg-alt: #F7F9FC;
  --wip: #D97706;
  --wip-bg: #FFFBEB;
  --radius-btn: 10px;
  --radius-card: 14px;
  --radius-img: 16px;
  --shadow-card: 0 1px 2px rgba(17,24,39,.04), 0 8px 24px rgba(17,24,39,.06);
  --shadow-card-hover: 0 2px 4px rgba(17,24,39,.05), 0 16px 40px rgba(22,93,255,.12);
  --font: -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- layout ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ---------- typography ---------- */
h1, h2, h3 { color: var(--ink); font-weight: 700; }
.h1 { font-size: 56px; font-weight: 800; letter-spacing: -1.5px; line-height: 1.12; }
.h2 { font-size: 34px; letter-spacing: -0.5px; line-height: 1.3; }
.h3 { font-size: 20px; font-weight: 600; }
.lead { font-size: 17.5px; color: var(--muted); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--brand); font-size: 14px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
}
.eyebrow::before, .eyebrow::after {
  content: ''; width: 22px; height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--brand));
}
.eyebrow::after { background: linear-gradient(90deg, var(--brand), transparent); }
.small { font-size: 15px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn, .btn-outline, .btn-accent {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 600; padding: 12px 28px;
  border-radius: var(--radius-btn); cursor: pointer; border: 1px solid transparent;
  transition: opacity .15s ease, border-color .15s ease, transform .15s ease;
}
.btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: 0 8px 20px rgba(22,93,255,.28), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(22,93,255,.36), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-outline { background: #fff; color: var(--ink); border-color: #D1D5DB; font-weight: 500; }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-accent {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: 0 4px 12px rgba(22,93,255,.25);
}
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(22,93,255,.32); }
.link { color: var(--brand); font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ---------- download confirmation ---------- */
.download-modal[hidden] { display: none; }
.download-modal {
  position: fixed; inset: 0; z-index: 220;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(17,24,39,.62);
}
.download-modal-content {
  width: min(420px, 100%); padding: 28px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: 0 24px 64px rgba(17,24,39,.24);
}
.download-modal-title { margin: 0; color: var(--ink); font-size: 21px; font-weight: 700; }
.download-modal-copy { margin-top: 10px; color: var(--body); font-size: 16px; line-height: 1.7; }
.download-modal-buttons {
  display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px;
}
.download-modal-buttons .btn,
.download-modal-buttons .btn-outline { min-width: 92px; padding: 10px 20px; }

/* ---------- cards ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.card:hover {
  border-color: rgba(22,93,255,.35); transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}
.card-icon {
  width: 58px; height: 58px; border-radius: 14px;
  background: linear-gradient(145deg, var(--brand-ghost), #fff);
  border: 1px solid rgba(22,93,255,.18);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.card-icon svg { width: 30px; height: 30px; stroke: var(--brand); }
.badge-wip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--wip-bg); color: var(--wip);
  font-size: 13.5px; font-weight: 600; padding: 5px 14px; border-radius: 99px;
}
.badge-wip::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--wip); }

/* ---------- page head (inner pages) ---------- */
.page-head {
  padding: 78px 0 20px;
  background: radial-gradient(680px 280px at 24% -70px, rgba(22,93,255,.08), transparent 70%);
}
.page-head .eyebrow { margin-bottom: 16px; }
.page-head .h2 { font-size: 42px; letter-spacing: -1px; }
.page-head .lead { margin-top: 12px; }

/* ---------- nav (injected by site.js) ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-nav .nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 21px; }
.nav-logo img, .nav-logo svg { width: 30px; height: 30px; object-fit: contain; }
.nav-links { display: flex; gap: 28px; font-size: 18px; color: var(--body); }
.nav-links a {
  position: relative; padding-bottom: 4px;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--brand); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.active { color: var(--ink); font-weight: 600; }
.nav-links a.active::after { transform: scaleX(1); }
.nav-side { display: flex; align-items: center; gap: 14px; }
.lang-switch {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 15px; color: var(--muted); border: 1px solid #E5E7EB;
  padding: 4px 11px; border-radius: 6px;
}
.lang-switch svg { width: 14px; height: 14px; }
.lang-switch:hover { color: var(--ink); border-color: var(--muted); }
.nav-burger { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-burger svg { width: 22px; height: 22px; }

/* ---------- hero ambience (homepage) ---------- */
.hero-ambient {
  position: relative;
  background:
    radial-gradient(900px 420px at 50% -80px, rgba(22,93,255,.10), transparent 70%),
    linear-gradient(180deg, #fff 0%, #FDFEFF 100%);
}
.hero-ambient::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(17,24,39,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,24,39,.028) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(720px 380px at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(720px 380px at 50% 0%, #000 30%, transparent 75%);
}
.hero-ambient > * { position: relative; }
.steady-curve { display: block; width: 100%; max-width: 880px; margin: 34px auto -6px; }

/* ---------- footer (injected by site.js) ---------- */
.site-footer {
  background: var(--ink); color: #D1D5DB; margin-top: 88px;
  border-top: 3px solid transparent;
  background-clip: padding-box; position: relative;
}
.site-footer::before {
  content: ''; position: absolute; top: -3px; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent 8%, var(--brand) 50%, transparent 92%);
  opacity: .65;
}
.site-footer .footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 56px 24px 40px;
  display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap;
}
.footer-brand .nav-logo { color: #fff; }
.footer-brand .small { color: #6B7280; margin-top: 12px; }
.footer-cols { display: flex; gap: 64px; }
.footer-col h4 { color: #9CA3AF; font-size: 13.5px; font-weight: 700; letter-spacing: 1px; margin-bottom: 12px; }
.footer-col a { display: block; font-size: 15.5px; line-height: 2.2; }
.footer-col a:hover { color: #fff; }

/* ---------- lightbox (tutorials) ---------- */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(17,24,39,.8); align-items: center; justify-content: center; padding: 24px;
}
.lightbox.lightbox-open { display: flex; }
.lightbox-frame {
  width: min(960px, 100%); aspect-ratio: 16/9; background: #000;
  border-radius: var(--radius-card); overflow: hidden;
}
.lightbox-frame iframe { width: 100%; height: 100%; border: 0; }
.lightbox-close {
  position: absolute; top: 20px; right: 24px; background: none; border: none;
  color: #fff; font-size: 32px; line-height: 1; cursor: pointer;
}

/* ---------- responsive ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media (max-width: 768px) {
  .h1 { font-size: 36px; }
  .h2 { font-size: 26px; }
  .section { padding: 56px 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-links.nav-links-open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 8px 24px 16px;
  }
  .nav-links.nav-links-open a { padding: 12px 0; border-bottom: none; font-size: 15px; }
  .nav-burger { display: block; }
  .footer-cols { gap: 36px; flex-wrap: wrap; }
}
