@charset "UTF-8";
:root { color-scheme: light; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body { margin: 0; background: #f4f7f5; color: #10231a; font-family: Inter, system-ui, sans-serif; }
a { color: #14532d; text-decoration: none; }
a:focus-visible, .search:focus-visible { outline: 3px solid #14532d; outline-offset: 2px; }
.wrap { padding-left: max(16px, 6%, env(safe-area-inset-left, 0px)); padding-right: max(16px, 6%, env(safe-area-inset-right, 0px)); }
.header { background: #fff; border-bottom: 1px solid #d3ded7; padding-block: 12px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.logo, .hero-title, .card-title { font-family: 'Space Grotesk', system-ui, sans-serif; }
.logo { font-size: 22px; }
.menu-link { padding: 12px 0; font-size: 14px; font-weight: 600; }
.hero { padding-block: 72px 48px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px; }
.hero-title { margin: 0; max-width: 18ch; font-size: clamp(36px, 6.4vw, 76px); line-height: 1.08; letter-spacing: -.02em; text-wrap: balance; }
.hero-lead { margin: 0; color: #3f5249; font-size: 18px; }
.search { width: 100%; max-width: 560px; height: 54px; padding: 0 20px; border: 1px solid #8aa595; border-radius: 12px; background: #fff; color: #10231a; font: 400 16px Inter, system-ui, sans-serif; }
.grid { list-style: none; max-width: 1240px; margin: 0 auto; padding: 0 16px 64px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 1050px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .card-title { font-size: 15px; padding: 12px; } }
@media (max-width: 460px) { .grid { grid-template-columns: minmax(0, 1fr); } .card-title { font-size: 18px; padding: 16px 18px 18px; } }
.card { min-width: 0; }
.card a { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid #d3ded7; border-radius: 18px; overflow: hidden; }
.card a:hover, .card a:target { box-shadow: 0 12px 28px rgba(16,35,26,.14); }
.card a:target { border-color: #14532d; }
.art { display: block; width: 100%; height: auto; }
.card-title { display: flex; gap: 7px; margin: 0; padding: 16px 18px 18px; font-size: 18px; line-height: 1.3; }
.num { flex: none; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: #3f5249; margin: 0 16px 48px; }
.footer { border-top: 1px solid #d3ded7; padding-block: 24px; font-size: 13px; color: #3f5249; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
[hidden] { display: none !important; }

a.logo { color: #10231a; font-weight: 700; }
.btn { display: inline-block; padding: 13px 28px; border: 2px solid #14532d; border-radius: 10px; background: #14532d; color: #fff; font: 600 15px Inter, system-ui, sans-serif; cursor: pointer; }
.btn:hover { background: #0f3f22; color: #fff; }
.progress { margin: -8px 0 0; font-size: 14px; color: #3f5249; min-height: 1.4em; }
.card a.is-done .card-title::after { content: "\2713"; margin-left: auto; color: #15803d; }
button:focus-visible, summary:focus-visible, .btn:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.layout { max-width: 1160px; margin: 0 auto; padding: 24px 16px 56px; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 32px; align-items: start; }
.side { background: #fff; border: 1px solid #d3ded7; border-radius: 14px; padding: 6px 10px; }
.side summary { padding: 12px; font-weight: 600; cursor: pointer; }
.side ol { list-style: none; margin: 0; padding: 0 0 8px; }
.side a { display: flex; gap: 8px; padding: 9px 8px; border-radius: 8px; font-size: 14px; }
.side a:hover { background: #eef5f0; }
.side a[aria-current] { background: #dcefe2; font-weight: 600; }
.side a.is-done::after { content: "\2713"; margin-left: auto; color: #15803d; }
.lesson { min-width: 0; background: #fff; border: 1px solid #d3ded7; border-radius: 18px; padding: clamp(18px, 4vw, 44px); line-height: 1.7; overflow-wrap: break-word; }
.lesson h1 { margin: 0 0 16px; font-family: 'Space Grotesk', system-ui, sans-serif; font-size: clamp(28px, 4vw, 40px); line-height: 1.2; }
.lesson h2 { margin: 32px 0 8px; font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 22px; }
.intro { font-size: 18px; }
.lesson li { margin-bottom: 6px; }
.lesson p code, .lesson li code { background: #e9f0ec; padding: 1px 6px; border-radius: 5px; font-size: .92em; }
.block { margin: 14px 0; border-radius: 12px; overflow: hidden; background: #0f1f2e; color: #e8eef5; }
.block-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 16px; min-height: 42px; border-bottom: 1px solid #2b3d50; font-size: 13px; color: #b7c7d6; }
.block pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 14px/1.6 ui-monospace, Consolas, monospace; tab-size: 4; }
.block.result, .block.input { background: #eef5f0; color: #10231a; border: 1px solid #c5d8cc; }
.result .block-head, .input .block-head { border-color: #c5d8cc; color: #3f5249; }
.copy { flex: none; padding: 6px 12px; border: 1px solid #4b6278; border-radius: 7px; background: transparent; color: #e8eef5; font-size: 13px; cursor: pointer; }
.warn { background: #fdeecb; color: #4a2a0a; padding: 14px 18px; border-radius: 12px; }
.warn code { background: #fff8e6 !important; }
.solution { margin: 12px 0 28px; }
.solution summary { cursor: pointer; font-weight: 600; color: #14532d; padding: 10px 0; }
.done[aria-pressed="true"] { background: #fff; color: #14532d; }
.pager { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px; }
.pager-link { flex: 1 1 220px; display: flex; flex-direction: column; padding: 12px 18px; border: 1px solid #d3ded7; border-radius: 12px; font-weight: 600; }
.pager-link small { font-weight: 400; color: #3f5249; }
.pager-link.next { text-align: right; }
@media (max-width: 860px) { .layout { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

/* 3 holat: o'qilgan, o'qishi kerak bo'lgan (navbatdagi), yangi dars */
.card a.is-done { background: #eaf7ee; border-color: #16a34a; }
.card a.is-next { background: #fffbeb; border-color: #d97706; box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.25); }
.card a.is-next .card-title::after { content: "Navbat"; margin-left: auto; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #fef3c7; color: #92400e; }
.card a.is-new { background: #f8fafc; border-color: #cbd5e1; }
.card a.is-new .card-title::after { content: "Yangi"; margin-left: auto; font-size: 12px; font-weight: 500; padding: 2px 7px; border-radius: 999px; background: #f1f5f9; color: #64748b; }
.card a.is-done.is-next .card-title::after { content: "\2713  Navbat"; }
