/* =========================================================
   متن باز — design system
   مفهوم: «ادیتور کد» + نئوبروتالیسم پاستلی روشن
   ========================================================= */

:root {
  --bg: #FBF9F4;
  --surface: #FFFFFF;
  --ink: #1F1D2B;
  --ink-2: #4A4760;
  --muted: #8A879C;
  --line: #E9E4D9;

  --violet: #6C5CE7;  --violet-soft: #EEEBFF;
  --mint:   #12B886;  --mint-soft:   #E1F7EE;
  --coral:  #FF7A59;  --coral-soft:  #FFEDE6;
  --sun:    #FFC53D;  --sun-soft:    #FFF5D6;
  --sky:    #3D8BFD;  --sky-soft:    #E5EFFF;

  --radius: 14px;
  --radius-sm: 9px;
  --border: 1.5px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);

  --font: "Vazirmatn", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(#E4DED1 1px, transparent 1px);
  background-size: 22px 22px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
code, pre, .mono { font-family: var(--mono); }
::selection { background: var(--sun); color: var(--ink); }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- syntax colors ---------- */
.tok-kw  { color: var(--violet); font-weight: 600; }
.tok-str { color: var(--mint); }
.tok-num { color: var(--sky); }
.tok-fn  { color: var(--coral); }
.tok-com { color: var(--muted); font-style: italic; }
.tok-tag { color: var(--sky); }

/* ---------- buttons ---------- */
.btn {
  --b-bg: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .7em 1.3em;
  font: 600 .95rem/1.2 var(--font);
  color: var(--ink);
  background: var(--b-bg);
  border: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .2s;
  white-space: nowrap;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { --b-bg: var(--violet); color: #fff; }
.btn-mint { --b-bg: var(--mint); color: #fff; }
.btn-sun { --b-bg: var(--sun); }
.btn-ghost { box-shadow: none; border-color: var(--line); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-sm { padding: .45em .95em; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-done { --b-bg: var(--mint-soft); color: var(--mint); border-color: var(--mint); box-shadow: none; transform: none; cursor: default; }
.btn .mono { font-size: .85em; opacity: .8; }

.chip {
  display: inline-flex; align-items: center; gap: .35em;
  font: 500 .78rem/1 var(--mono);
  padding: .45em .75em;
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  direction: ltr;
}

/* ---------- navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgb(251 249 244 / .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 70px; }
.logo { display: flex; align-items: center; font-weight: 800; font-size: 1.25rem; gap: 2px; direction: ltr; }
.logo .brk { font-family: var(--mono); color: var(--violet); font-weight: 600; }
.logo .name { direction: rtl; padding-inline: 3px; }
.cursor { display: inline-block; width: 9px; height: 1.1em; margin-inline-start: 3px; background: var(--coral); border-radius: 2px; animation: blink 1s steps(1) infinite; vertical-align: middle; }
@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; gap: 6px; margin-inline-start: 12px; }
.nav-links a { padding: .4em .9em; border-radius: 999px; font-weight: 500; color: var(--ink-2); transition: background .2s, color .2s; }
.nav-links a:hover, .nav-links a.active { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.nav-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.cart-btn { position: relative; font-family: var(--mono); direction: ltr; }
.cart-count { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .3em; border-radius: 999px; background: var(--coral); color: #fff; font-size: .75rem; }
.cart-count.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.45); } }
.nav-toggle { display: none; margin-inline-start: auto; background: none; border: var(--border); border-radius: 10px; padding: 6px 10px; font: 600 1rem var(--mono); cursor: pointer; }
.inline-form { display: inline; margin: 0; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 100; display: grid; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 12px 16px; font-size: .92rem; max-width: 380px;
  animation: toast-in .35s cubic-bezier(.2, 1.4, .4, 1);
}
.toast::before { content: "✓"; display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 6px; background: var(--mint-soft); color: var(--mint); font-family: var(--mono); font-weight: 700; }
.toast.info::before { content: "i"; background: var(--sky-soft); color: var(--sky); }
.toast.error::before { content: "!"; background: var(--coral-soft); color: var(--coral); }
.toast.hide { opacity: 0; transform: translateY(10px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px) scale(.95); } }

/* ---------- section heads ---------- */
.section { padding: 80px 0; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 34px; flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0; }
.comment { display: block; font: 500 .85rem var(--mono); color: var(--muted); margin-bottom: 6px; direction: ltr; text-align: right; }
.comment::before { content: "// "; color: var(--violet); }

/* ---------- hero ---------- */
.hero { padding: 70px 0 40px; position: relative; overflow-x: clip; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 900; letter-spacing: -.5px; margin-bottom: .4em; }
.hero h1 .hl { position: relative; white-space: nowrap; }
.hero h1 .hl::after { content: ""; position: absolute; inset-inline: -4px; bottom: .12em; height: .32em; background: var(--sun); z-index: -1; border-radius: 4px; transform: skewX(-8deg); }
.hero h1 .tag { font-family: var(--mono); color: var(--violet); font-weight: 600; font-size: .7em; }
.hero-lead { font-size: 1.12rem; color: var(--ink-2); max-width: 34em; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 30px; }

.prompt {
  display: flex; align-items: center; gap: 10px;
  max-width: 480px;
  background: var(--surface); border: var(--border); border-radius: 12px; box-shadow: var(--shadow-sm);
  padding: 6px 6px 6px 14px; direction: ltr;
}
.prompt .ps { font-family: var(--mono); color: var(--mint); font-weight: 600; white-space: nowrap; }
.prompt input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 500 .95rem var(--font); direction: rtl; text-align: right; color: var(--ink); }
.prompt button { flex: none; }

/* editor window */
.editor {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
  direction: ltr;
}
.editor-bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: var(--border); background: var(--bg); }
.dots { display: flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgb(0 0 0 / .15); }
.dots i:nth-child(1) { background: var(--coral); }
.dots i:nth-child(2) { background: var(--sun); }
.dots i:nth-child(3) { background: var(--mint); }
.tabs { display: flex; gap: 4px; font: 500 .78rem var(--mono); overflow: hidden; }
.tabs span { padding: 4px 10px; border-radius: 6px; color: var(--muted); white-space: nowrap; }
.tabs span.on { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.editor-body { display: grid; grid-template-columns: auto 1fr; font: 400 .92rem/1.85 var(--mono); padding: 18px 0; min-height: 300px; }
.gutter { padding: 0 14px 0 18px; text-align: right; color: #C9C4B8; user-select: none; white-space: pre; }
.code { padding-right: 18px; white-space: pre; overflow-x: auto; color: var(--ink); }
.code .caret { display: inline-block; width: 2px; height: 1.2em; background: var(--violet); vertical-align: -3px; animation: blink 1s steps(1) infinite; }
.term { border-top: var(--border); background: var(--violet-soft); padding: 12px 18px; font: 500 .85rem/1.9 var(--mono); min-height: 74px; }
.term .ps { color: var(--violet); }
.term .ok { color: var(--mint); font-weight: 600; }
.term-line { opacity: 0; transform: translateY(4px); transition: .35s; }
.term-line.show { opacity: 1; transform: none; }

.hero-art { position: relative; }
.float {
  position: absolute; z-index: 2;
  display: grid; place-items: center;
  width: 54px; height: 54px;
  font: 700 1.1rem var(--mono);
  border: var(--border); border-radius: 14px; box-shadow: var(--shadow-sm);
  animation: float 5s ease-in-out infinite;
}
.float.f1 { top: -24px; left: -22px; background: var(--sun); transform: rotate(-10deg); }
.float.f2 { bottom: 70px; right: -26px; background: var(--mint-soft); color: var(--mint); animation-delay: -1.5s; }
.float.f3 { top: 38%; left: -34px; background: var(--coral-soft); color: var(--coral); animation-delay: -3s; width: 46px; height: 46px; }
@keyframes float { 50% { translate: 0 -12px; } }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; margin-top: 30px; }
.stat { padding: 22px 24px; border-inline-start: 1px dashed var(--line); }
.stat:first-child { border: 0; }
.stat b { display: block; font: 800 1.9rem/1.2 var(--font); }
.stat span { color: var(--muted); font-size: .9rem; }
.stat .key { font: 500 .75rem var(--mono); color: var(--violet); direction: ltr; display: block; text-align: right; }

/* categories */
.cats { display: flex; flex-wrap: wrap; gap: 12px; }
.cat {
  --c: var(--violet);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px 10px 12px;
  background: var(--surface); border: var(--border); border-radius: 999px;
  font-weight: 600; transition: .2s;
}
.cat .ext { font: 600 .75rem var(--mono); background: color-mix(in srgb, var(--c) 15%, white); color: var(--c); padding: 4px 8px; border-radius: 999px; }
.cat small { color: var(--muted); font-weight: 400; }
.cat:hover, .cat.on { background: color-mix(in srgb, var(--c) 10%, white); box-shadow: var(--shadow-sm); transform: translate(-2px, -2px); }

/* ---------- course card ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.card {
  --c: var(--violet);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translate(-4px, -4px); box-shadow: 6px 6px 0 var(--c), 6px 6px 0 1.5px var(--ink); }
.card-tab { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: var(--border); background: color-mix(in srgb, var(--c) 9%, white); font: 500 .8rem var(--mono); direction: ltr; }
.card-tab .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.card-tab .off { margin-left: auto; background: var(--coral); color: #fff; border-radius: 6px; padding: 1px 7px; font-size: .72rem; }
.card-code { margin: 0; padding: 16px 18px; font: .8rem/1.75 var(--mono); background: color-mix(in srgb, var(--c) 4%, white); border-bottom: 1px dashed var(--line); white-space: pre; overflow: hidden; min-height: 108px; direction: ltr; text-align: left; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.card-body { padding: 18px 18px 16px; display: flex; flex-direction: column; flex: 1; }
.card-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.card h3 { font-size: 1.12rem; margin-bottom: .35em; }
.card h3 a:hover { color: var(--violet); }
.card p { color: var(--ink-2); font-size: .9rem; margin-bottom: 14px; }
.card-info { display: flex; gap: 14px; color: var(--muted); font-size: .82rem; margin-top: auto; padding-bottom: 14px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px dashed var(--line); padding-top: 14px; }

.lvl { font-size: .75rem; font-weight: 600; padding: .25em .7em; border-radius: 6px; }
.lvl-beginner { background: var(--mint-soft); color: var(--mint); }
.lvl-intermediate { background: var(--sun-soft); color: #B7791F; }
.lvl-advanced { background: var(--coral-soft); color: var(--coral); }

.price { display: flex; flex-direction: column; line-height: 1.3; }
.price b { font-size: 1.1rem; font-weight: 800; }
.price b small { font-size: .7rem; font-weight: 500; color: var(--muted); margin-inline-start: 3px; }
.price s { color: var(--muted); font-size: .8rem; }
.price .free { color: var(--mint); }

/* ---------- how it works (git log) ---------- */
.gitlog { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; }
.gitlog::before { content: ""; position: absolute; top: 27px; inset-inline: 30px; height: 2px; background: repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 14px); }
.commit { position: relative; padding: 0 18px 0 0; }
.commit .node { position: relative; width: 56px; height: 56px; display: grid; place-items: center; border: var(--border); border-radius: 50%; background: var(--surface); font: 700 1.2rem var(--mono); box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.commit:nth-child(1) .node { background: var(--violet-soft); color: var(--violet); }
.commit:nth-child(2) .node { background: var(--sun-soft); color: #B7791F; }
.commit:nth-child(3) .node { background: var(--mint-soft); color: var(--mint); }
.commit:nth-child(4) .node { background: var(--coral-soft); color: var(--coral); }
.commit .hash { font: 500 .78rem var(--mono); color: var(--muted); direction: ltr; display: inline-block; }
.commit .hash em { font-style: normal; color: var(--coral); border: 1px solid currentColor; border-radius: 5px; padding: 0 5px; margin-left: 6px; }
.commit h3 { font-size: 1.1rem; margin: 4px 0; }
.commit p { color: var(--ink-2); font-size: .9rem; }

/* ---------- CTA terminal ---------- */
.cta { border: var(--border); border-radius: 22px; box-shadow: 8px 8px 0 var(--ink); background: var(--violet-soft); overflow: hidden; display: grid; grid-template-columns: 1.2fr 1fr; }
.cta-text { padding: 46px; }
.cta-text h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.cta-code { background: var(--surface); border-inline-start: var(--border); padding: 34px 30px; font: .9rem/2 var(--mono); direction: ltr; display: flex; flex-direction: column; justify-content: center; }
.cta-code .ps { color: var(--mint); }

/* ---------- page header (path) ---------- */
.page-head { padding: 50px 0 20px; }
.path { display: inline-flex; flex-wrap: wrap; gap: 4px; font: 500 .85rem var(--mono); color: var(--muted); direction: ltr; background: var(--surface); border: 1px solid var(--line); padding: 4px 12px; border-radius: 8px; margin-bottom: 18px; }
.path a:hover { color: var(--violet); }
.path b { color: var(--ink); font-weight: 600; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 900; }

/* filters */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 24px 0 36px; }
.filters .prompt { flex: 1 1 320px; max-width: none; }
.select { appearance: none; font: 500 .9rem var(--font); padding: .7em 1em .7em 2.2em; border: var(--border); border-radius: 12px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231F1D2B' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat left 12px center; color: var(--ink); cursor: pointer; }
.cats-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 30px; }
.cats-row .cat { padding: 6px 14px 6px 8px; font-size: .9rem; }

.empty { text-align: center; padding: 70px 20px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.empty pre { font: 1rem var(--mono); color: var(--muted); margin: 0 0 20px; direction: ltr; }

/* ---------- course detail ---------- */
.detail { display: grid; grid-template-columns: 1fr 370px; gap: 46px; align-items: start; padding-bottom: 80px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; color: var(--ink-2); font-size: .92rem; margin: 18px 0 30px; }
.detail-meta .mi { display: inline-flex; align-items: center; gap: 6px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: var(--border); background: var(--sun); font-weight: 800; }
.prose { font-size: 1.02rem; color: var(--ink-2); white-space: pre-line; }
.block { background: var(--surface); border: var(--border); border-radius: var(--radius); padding: 26px; margin-bottom: 26px; }
.block > h2 { font-size: 1.25rem; display: flex; align-items: center; gap: 10px; }
.block > h2 .mono { font-size: .8rem; color: var(--muted); font-weight: 500; }
.learn-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.learn-list li { display: flex; gap: 10px; }
.learn-list li::before { content: "✓"; color: var(--mint); font-weight: 800; font-family: var(--mono); }

/* file tree curriculum */
.tree { font-size: .95rem; }
.tree details { border-bottom: 1px dashed var(--line); }
.tree details:last-child { border: 0; }
.tree summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 0; cursor: pointer; font-weight: 700; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary .folder { font-family: var(--mono); color: var(--sun); font-size: 1.1rem; transition: transform .2s; display: inline-block; }
.tree details[open] summary .folder { transform: rotate(90deg); }
.tree summary .count { margin-inline-start: auto; font: 500 .78rem var(--mono); color: var(--muted); }
.tree ul { list-style: none; margin: 0 0 14px; padding: 0 22px 0 0; border-inline-start: 1.5px solid var(--line); margin-inline-start: 8px; }
.tree li { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; }
.tree li::before { content: ""; position: absolute; inset-inline-start: -22px; top: 50%; width: 16px; border-top: 1.5px solid var(--line); }
.tree li:hover { background: var(--bg); }
.tree li .n { font: 500 .75rem var(--mono); color: var(--muted); }
.tree li .t { flex: 1; }
.tree li .d { font: .78rem var(--mono); color: var(--muted); direction: ltr; }
.tree li .ico { font-size: .85rem; }
.tag-free { font-size: .72rem; font-weight: 700; background: var(--mint-soft); color: var(--mint); padding: 2px 8px; border-radius: 6px; }
.tree li a.t:hover { color: var(--violet); }

/* buy card */
.buy { position: sticky; top: 94px; }
.buy .editor { box-shadow: 6px 6px 0 var(--ink); }
.buy-inner { padding: 22px; direction: rtl; }
.buy .price b { font-size: 1.8rem; }
.buy .price { margin-bottom: 18px; flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.buy .off-tag { background: var(--coral); color: #fff; font: 600 .75rem var(--mono); border-radius: 6px; padding: 2px 8px; }
.buy-actions { display: grid; gap: 10px; }
.feat { list-style: none; padding: 18px 0 0; margin: 18px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 8px; font-size: .9rem; color: var(--ink-2); }
.feat li { display: flex; gap: 10px; }
.feat li span { font-family: var(--mono); color: var(--violet); width: 2em; flex: none; white-space: nowrap; text-align: center; }

/* ---------- lesson player ---------- */
.player-layout { display: grid; grid-template-columns: 1fr 330px; gap: 30px; align-items: start; padding: 30px 0 80px; }
.player { border: var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--ink); aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.player-empty { height: 100%; display: grid; place-items: center; text-align: center; color: #fff; background: radial-gradient(circle at 30% 20%, #3A3555, var(--ink)); padding: 20px; }
.player-empty .play { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); color: var(--ink); border: 2px solid #fff; margin: 0 auto 14px; font-size: 1.6rem; }
.player-empty p { color: #B9B5CC; font: .85rem var(--mono); direction: ltr; margin: 0; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
.playlist { border: var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.playlist h3 { margin: 0; padding: 14px 18px; border-bottom: var(--border); font-size: 1rem; background: var(--bg); }
.playlist ol { list-style: none; margin: 0; padding: 8px; max-height: 520px; overflow: auto; }
.playlist li a, .playlist li span { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; font-size: .9rem; }
.playlist li a:hover { background: var(--bg); }
.playlist li.on a { background: var(--violet-soft); color: var(--violet); font-weight: 700; }
.playlist li span { color: var(--muted); }
.playlist .n { font: .75rem var(--mono); width: 2em; color: var(--muted); }

/* ---------- cart (diff view) ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 34px; align-items: start; padding-bottom: 80px; }
.diff .editor-body { display: block; padding: 0; min-height: 0; font-family: var(--font); }
.diff-row { display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 16px; padding: 16px 18px 16px 0; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent, transparent), var(--surface); direction: rtl; animation: row-in .4s backwards; }
.diff-row:last-child { border: 0; }
.diff-row .sign { align-self: stretch; display: grid; place-items: center; font: 700 1.1rem var(--mono); color: var(--mint); background: var(--mint-soft); margin: -16px 0; }
.diff-row h3 { font-size: 1rem; margin: 0; }
.diff-row .sub { font: .78rem var(--mono); color: var(--muted); direction: ltr; text-align: right; }
.diff-row .rm { background: none; border: 1px solid var(--line); width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font: 700 1rem var(--mono); color: var(--coral); transition: .2s; }
.diff-row .rm:hover { background: var(--coral-soft); border-color: var(--coral); }
@keyframes row-in { from { opacity: 0; transform: translateX(-12px); } }

.summary { border: var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 24px; position: sticky; top: 94px; }
.summary .calc { font: .9rem/2.2 var(--mono); direction: ltr; margin-bottom: 18px; }
.summary .calc div { display: flex; justify-content: space-between; }
.summary .calc .k { color: var(--violet); }
.summary .calc .neg { color: var(--coral); }
.summary .calc .total { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; font-weight: 700; font-size: 1.05rem; }
.secure { font-size: .8rem; color: var(--muted); text-align: center; margin: 12px 0 0; }

/* ---------- dashboard ---------- */
.my-card .progress { height: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.my-card .progress i { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: right; padding: 12px 10px; border-bottom: 1px dashed var(--line); }
.table th { font: 600 .78rem var(--mono); color: var(--muted); }
.paid { color: var(--mint); font-weight: 700; }

/* ---------- auth ---------- */
.auth { display: grid; place-items: center; padding: 60px 0 90px; }
.auth .editor { width: min(460px, 100%); }
.auth-inner { padding: 30px; direction: rtl; }
.auth h1 { font-size: 1.6rem; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.field label .mono { color: var(--violet); font-size: .8rem; margin-inline-start: 6px; }
.field input { width: 100%; padding: .8em 1em; font: 500 1rem var(--font); border: var(--border); border-radius: 10px; background: var(--bg); color: var(--ink); outline: none; transition: box-shadow .2s, background .2s; }
.field input:focus { background: var(--surface); box-shadow: 3px 3px 0 var(--violet); }
.field .help { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.field .help ul { margin: 0; padding-inline-start: 18px; }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0; color: var(--coral); font-size: .85rem; }
.form-error { background: var(--coral-soft); color: var(--coral); border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; font-size: .9rem; }
.auth-alt { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--muted); }
.auth-alt a { color: var(--violet); font-weight: 700; }

/* ---------- footer ---------- */
.footer { border-top: var(--border); background: var(--surface); margin-top: 40px; }
.footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 40px; padding: 50px 0 30px; }
.footer h4 { font-size: .95rem; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; color: var(--ink-2); font-size: .92rem; }
.footer ul a:hover { color: var(--violet); }
.trust a { display: inline-block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px; transition: border-color .2s, box-shadow .2s; }
.trust a:hover { border-color: var(--ink); box-shadow: var(--shadow-sm); }
.trust img { display: block; width: 110px; height: auto; }
.footer .eof { border-top: 1px dashed var(--line); padding: 16px 0 24px; font: .8rem var(--mono); color: var(--muted); display: flex; justify-content: space-between; direction: ltr; flex-wrap: wrap; gap: 10px; }

/* ---------- reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .6s; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
/* grid children default to min-width:auto; code blocks would otherwise stretch them past the viewport */
.hero .wrap > *, .detail > *, .player-layout > *, .cart-layout > *, .cta > * { min-width: 0; }

@media (max-width: 960px) {
  .hero .wrap, .detail, .player-layout, .cart-layout, .cta { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
  .hero-art { margin: 10px 14px 0; }
  .buy, .summary { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-inline-start: 0; }
  .stat:nth-child(n+3) { border-top: 1px dashed var(--line); }
  .gitlog { grid-template-columns: 1fr 1fr; gap: 34px 0; }
  .gitlog::before { display: none; }
  .cta-code { border-inline-start: 0; border-top: var(--border); }
  .footer .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav .wrap { gap: 12px; }
  .nav-toggle { display: block; }
  .nav-links, .nav-actions { display: none; }
  .nav.open .wrap { flex-wrap: wrap; height: auto; padding: 14px 0; }
  .nav.open .nav-links, .nav.open .nav-actions { display: flex; flex-direction: column; width: 100%; align-items: stretch; margin: 0; }
  .nav.open .nav-actions .btn { width: 100%; }
  .section { padding: 56px 0; }
  .gitlog { grid-template-columns: 1fr; }
  .learn-list { grid-template-columns: 1fr; }
  .cta-text { padding: 30px 24px; }
  .footer .wrap { grid-template-columns: 1fr; }
  .diff-row { grid-template-columns: 34px 1fr auto; }
  .diff-row .price { grid-column: 2; }
  .float { display: none; }
  .editor-body { font-size: .8rem; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
