/* kdpify.com/learn — the course pages generated by scripts/website-learn.mjs. Uses site.css tokens. */
.learn-page .skip-link { position: absolute; top: -100px; inset-inline-start: 15px; background: var(--accent); color: #111; padding: 12px; z-index: 100; }
.learn-page .skip-link:focus { top: 10px; }
.learn-wrap { max-width: 1160px; padding-top: 32px; padding-bottom: 72px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Scripts the site fonts don't cover: Persian uses the Arabic face; Greek, Vietnamese and Japanese
   fall back to good system fonts after Inter. Tight letter-spacing is for Latin only. */
html[lang="fa"] { --font: "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif; }
html[lang="ja"] { --font: "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", "Noto Sans JP", system-ui, sans-serif; }
html[lang="el"], html[lang="vi"] { --font: "Inter", "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif; }
html:is([lang="ar"], [lang="fa"], [lang="ja"]) :is(h1, h2, .lesson-hero h1) { letter-spacing: 0; }
html[lang="ja"] .learn-body { line-height: 1.85; }

/* The header's language menu on pages that exist in many languages. */
.site-header .site-language-menu > summary { display: inline-flex; align-items: center; min-height: 36px; padding: 5px 12px; font-size: 12px;
  border: 1px solid var(--line); border-radius: 999px; }
.site-language-panel { width: 330px; display: grid; grid-template-columns: 1fr 1fr; max-height: min(70vh, 520px); overflow: auto; }
.site-language-panel a[aria-current="page"], .site-mobile-languages a[aria-current="page"] { color: var(--accent); }
@media (max-width: 600px) { .site-header .site-language-menu { display: none; } }

/* Reading progress (learn.js sets --read). */
.read-progress { position: fixed; inset-inline: 0; top: 0; height: 3px; z-index: 60; pointer-events: none;
  background: linear-gradient(90deg, var(--accent), #fbbf24); transform-origin: left; transform: scaleX(var(--read, 0)); }
[dir="rtl"] .read-progress { transform-origin: right; }

/* ---------- Course index ---------- */
.learn-hero, .learn-section, .learn-cta { max-width: 760px; margin-inline: auto; }
.learn-hero h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.15; margin: 14px 0 12px; letter-spacing: -0.01em; }
.learn-hero .lead { margin-bottom: 18px; }
.learn-hero { margin-bottom: 36px; }
.learn-section { margin-top: 30px; margin-bottom: 30px; }
.learn-section h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.learn-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.learn-list li + li { border-top: 1px solid var(--line); }
.learn-list a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--text); }
.learn-list a:hover { background: #1a1d24; text-decoration: none; }
.learn-list strong { display: block; font-weight: 600; }
.learn-list small { display: block; color: var(--muted); font-size: 14px; line-height: 1.45; margin-top: 2px; }
.learn-list em { margin-inline-start: auto; flex-shrink: 0; font-style: normal; font-size: 13px; color: var(--muted); }
.learn-num { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 14px; }

/* ---------- Lesson hero ---------- */
.learn-crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.learn-crumbs a { color: var(--soft); }
.lesson-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 24px; overflow: hidden;
  padding: 34px 36px 26px; margin-bottom: 36px; border: 1px solid var(--line); border-radius: 24px;
  background: radial-gradient(110% 140% at 100% 0%, rgba(245, 158, 11, .16), transparent 55%), linear-gradient(180deg, #15171d, #0f1115); }
[dir="rtl"] .lesson-hero { background: radial-gradient(110% 140% at 0% 0%, rgba(245, 158, 11, .16), transparent 55%), linear-gradient(180deg, #15171d, #0f1115); }
.lesson-hero h1 { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.1; letter-spacing: -0.02em; margin: 16px 0 12px; }
.lesson-hero .lead { margin: 0; max-width: 640px; color: var(--soft); }
.lesson-number { align-self: start; font-size: clamp(88px, 13vw, 168px); font-weight: 800; line-height: .78; letter-spacing: -0.06em;
  color: transparent; -webkit-text-stroke: 1.5px rgba(245, 158, 11, .5); user-select: none; font-variant-numeric: tabular-nums; }
.lesson-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 550;
  color: var(--soft); background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.chip-accent { color: var(--accent); background: var(--accent-soft); border-color: rgba(245, 158, 11, .3); }
.chip-app::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

.course-rail { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 26px; }
.rail-group { display: flex; gap: 4px; min-width: 0; }
.rail-seg { flex: 1; height: 6px; border-radius: 999px; background: #2a2e37; transition: background .2s, transform .2s; }
.rail-seg:hover { background: #4a505c; transform: scaleY(1.6); }
.rail-seg.done { background: rgba(245, 158, 11, .5); }
.rail-seg.current { background: var(--accent); box-shadow: 0 0 0 3px rgba(245, 158, 11, .18), 0 0 16px rgba(245, 158, 11, .55); }

/* ---------- Lesson body ---------- */
.lesson-layout.has-toc { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 44px; align-items: start; }
/* The pager and the call to action share the lesson column's edges with the section cards. */
.lesson-main { min-width: 0; }
.lesson-main .learn-pager { margin-top: 30px; }
.lesson-main .learn-cta { max-width: none; margin: 22px 0 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 28px; padding: 26px 30px; border-radius: 20px; }
.lesson-main .learn-cta p { margin: 0; grid-column: 1; }
.lesson-main .learn-cta .btn { grid-column: 2; grid-row: 1 / span 3; white-space: nowrap; }
.learn-cta p.cta-platforms { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px; color: #fff; font-size: 14px; font-weight: 600; }
.cta-platforms svg { width: 20px; height: 20px; flex-shrink: 0; }
.cta-platforms span + svg { margin-inline-start: 12px; }
.learn-body { font-size: 17px; line-height: 1.7; color: var(--soft); min-width: 0; }
.learn-body h2 { color: var(--text); font-size: 25px; line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 12px; scroll-margin-top: 96px; }
.learn-body h3 { color: var(--text); font-size: 19px; margin: 26px 0 8px; scroll-margin-top: 96px; }
.learn-body p { margin: 0 0 14px; }
.learn-body strong { color: var(--text); }
.learn-body ul { padding-inline-start: 1.3em; margin: 0 0 14px; }
.learn-body li { margin: 6px 0; }
.learn-body ul > li::marker { color: var(--accent); }
.learn-body code { background: #1b1e25; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .9em; }
.learn-body a { text-decoration: underline; text-decoration-color: rgba(245, 158, 11, .45); text-underline-offset: 3px; }
.learn-body a:hover { text-decoration-color: var(--accent); }

.lesson-intro { max-width: 720px; margin-bottom: 26px; font-size: 18px; }
.lesson-sec { margin: 0 0 22px; padding: 28px 30px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
.lesson-sec > :last-child, .sec-text > :last-child { margin-bottom: 0; }

/* A section with screenshots: text on one side, the phone on the other. */
.lesson-sec.has-shot { display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: 36px; align-items: start; position: relative;
  background: radial-gradient(60% 70% at 100% 50%, rgba(245, 158, 11, .09), transparent 70%), var(--panel); }
[dir="rtl"] .lesson-sec.has-shot { background: radial-gradient(60% 70% at 0% 50%, rgba(245, 158, 11, .09), transparent 70%), var(--panel); }
.sec-shots { position: sticky; top: 92px; display: grid; gap: 28px; }
.shot { margin: 0; perspective: 1100px; }
/* The phone frame. Screenshots have the Android status bar cropped off, so the frame draws its own
   top bezel with a speaker slot, and the screen's corners stay gentle enough to keep the app's
   header whole. The phone leans with its outer edge away (the original look the owner chose),
   scaled a touch so the lean stays inside its column, and straightens on hover. */
.lesson-phone { position: relative; padding: 22px 8px 12px; border-radius: 34px; cursor: zoom-in;
  background: linear-gradient(155deg, #30343e, #121419 60%);
  box-shadow: 0 0 0 1px #3a3f4b, inset 0 1px 0 rgba(255, 255, 255, .06), 0 28px 50px -22px rgba(0, 0, 0, .8), 0 0 70px -24px rgba(245, 158, 11, .45);
  transform: rotateY(-7deg) rotateX(2deg) scale(.95);
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s; }
[dir="rtl"] .lesson-phone { transform: rotateY(7deg) rotateX(2deg) scale(.95); }
.lesson-phone::before { content: ""; position: absolute; top: 9px; left: 50%; width: 46px; height: 5px; margin-left: -23px; border-radius: 99px;
  background: #0a0b0e; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .05); }
.lesson-phone:hover, .lesson-phone:focus-visible, [dir="rtl"] .lesson-phone:hover, [dir="rtl"] .lesson-phone:focus-visible { transform: translateY(-4px);
  box-shadow: 0 0 0 1px #4a505c, inset 0 1px 0 rgba(255, 255, 255, .06), 0 34px 60px -22px rgba(0, 0, 0, .85), 0 0 90px -20px rgba(245, 158, 11, .6); }
.lesson-phone img { display: block; width: 100%; height: auto; border-radius: 14px; }
.shot figcaption { display: flex; gap: 8px; margin-top: 14px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.shot figcaption::before { content: ""; flex-shrink: 0; width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: var(--accent); }

/* Numbered steps: a track of numbered dots joined by a line. */
.learn-body ol.lesson-steps { list-style: none; padding: 0; margin: 16px 0 18px; counter-reset: step; }
ol.lesson-steps > li { counter-increment: step; position: relative; margin: 0; padding-inline-start: 46px; padding-bottom: 14px; }
ol.lesson-steps > li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--accent); background: #1f1a10; border: 1px solid rgba(245, 158, 11, .4); }
ol.lesson-steps > li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 15px; top: 34px; bottom: 2px; width: 1px;
  background: linear-gradient(rgba(245, 158, 11, .4), var(--line)); }
ol.lesson-steps > li:last-child { padding-bottom: 0; }

/* A message you type to ChatGPT or Gemini, drawn as a sent chat bubble. */
.learn-body p.say { width: fit-content; max-width: min(88%, 560px); margin: 6px 0 16px auto; padding: 11px 16px; font-size: 16px; line-height: 1.5;
  color: var(--text); background: #2a2d35; border: 1px solid #353944; border-radius: 20px 20px 6px 20px; }
[dir="rtl"] .learn-body p.say { margin: 6px auto 16px 0; border-radius: 20px 20px 20px 6px; }

/* Callouts. */
.learn-body .callout { position: relative; margin: 20px 0; padding: 14px 18px 14px 50px; border-radius: 14px;
  background: var(--accent-soft); border: 1px solid rgba(245, 158, 11, .25); }
[dir="rtl"] .learn-body .callout { padding: 14px 50px 14px 18px; }
.learn-body .callout::before { content: ""; position: absolute; inset-inline-start: 16px; top: 17px; width: 20px; height: 20px; background: var(--accent);
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12.7c.6.5 1 1.3 1 2.3h6c0-1 .4-1.8 1-2.3A7 7 0 0 0 12 2z'/%3E%3C/svg%3E"); }
.learn-body .callout p { margin: 2px 0; font-size: 16px; }
.learn-body .callout-note { background: rgba(56, 189, 248, .08); border-color: rgba(56, 189, 248, .28); }
.learn-body .callout-note::before { background: #38bdf8;
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E"); }
.learn-body .callout-important { background: rgba(251, 113, 133, .08); border-color: rgba(251, 113, 133, .3); }
.learn-body .callout-important::before { background: #fb7185;
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0zM12 9v4M12 17h.01'/%3E%3C/svg%3E"); }

/* On this page. */
.lesson-toc { position: sticky; top: 92px; font-size: 14px; }
.lesson-toc p { margin: 0 0 10px; font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lesson-toc ol { list-style: none; margin: 0; padding: 0; border-inline-start: 1px solid var(--line); }
.lesson-toc a { display: block; padding: 6px 0 6px 14px; margin-inline-start: -1px; border-inline-start: 2px solid transparent; color: var(--muted); line-height: 1.4; }
[dir="rtl"] .lesson-toc a { padding: 6px 14px 6px 0; }
.lesson-toc a:hover { color: var(--text); text-decoration: none; }
.lesson-toc a.active { color: var(--accent); border-color: var(--accent); }

/* Pager and call to action. */
.learn-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 40px 0 0; }
.learn-pager a { position: relative; display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text);
  transition: border-color .2s, transform .2s; }
.learn-pager a:hover { border-color: rgba(245, 158, 11, .6); transform: translateY(-2px); text-decoration: none; }
.learn-pager small { display: block; color: var(--accent); font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.learn-pager strong { display: block; font-size: 18px; line-height: 1.3; }
.learn-pager .pager-sec { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; }
.learn-pager .next { text-align: end; grid-column: 2; }
.learn-pager .prev small::before { content: "← "; }
.learn-pager .next small::after { content: " →"; }
[dir="rtl"] .learn-pager .prev small::before { content: "→ "; }
[dir="rtl"] .learn-pager .next small::after { content: " ←"; }
.learn-cta { margin-top: 44px; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(135deg, rgba(245, 158, 11, .12), var(--panel) 60%); }
.learn-cta h2 { margin: 0 0 6px; font-size: 22px; }
.learn-cta p { margin: 0 0 16px; color: var(--soft); }

/* Zoomed screenshot (learn.js). */
.shot-zoom { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(5, 6, 8, .86); backdrop-filter: blur(6px); cursor: zoom-out; }
.shot-zoom img { max-height: calc(100vh - 48px); max-width: 100%; border-radius: 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }

@media (max-width: 1020px) {
  .lesson-layout.has-toc { grid-template-columns: minmax(0, 1fr); }
  .lesson-toc { display: none; }
}
@media (max-width: 760px) {
  .lesson-main .learn-cta { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; }
  .lesson-main .learn-cta .btn { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 16px; }
  .learn-wrap { padding-top: 20px; }
  .lesson-hero { padding: 24px 20px 20px; border-radius: 20px; }
  .lesson-number { position: absolute; top: 14px; inset-inline-end: 16px; font-size: 76px; opacity: .55; }
  .lesson-hero-text { grid-column: 1 / -1; }
  .lesson-sec { padding: 22px 18px; border-radius: 18px; }
  .lesson-sec.has-shot { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .sec-shots { position: static; justify-items: center; }
  .shot { max-width: 250px; }
  .learn-list a { padding: 12px 14px; }
  .learn-list em { display: none; }
  .learn-pager { grid-template-columns: 1fr; }
  .learn-pager .next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .lesson-phone, .rail-seg, .learn-pager a { transition: none; transform: none; }
}
