/* Public SEO pages (/grammatika, /iboralar, /sozlar, /ielts; seo/layout.js). The landing's tokens
   and logo, dark and gold, readable at 360px, no layout shift. */
:root {
  --bg: #07070a;
  --bg-2: #0d0d12;
  --card: rgba(255, 255, 255, 0.028);
  --card-border: rgba(214, 178, 102, 0.12);
  --line: rgba(255, 255, 255, 0.07);
  --text: #ece8df;
  --muted: #a39f96;
  --gold: #d6b266;
  --gold-soft: rgba(214, 178, 102, 0.16);
  --gold-glow: rgba(214, 178, 102, 0.35);
  --ok: #8fcf9a;
  --bad: #e58f84;
  --radius: 16px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 120px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  font: 16px/1.7 var(--sans);
  background: radial-gradient(1100px 600px at 80% -10%, rgba(214, 178, 102, 0.07), transparent 60%), var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--gold); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: 0.005em; line-height: 1.15; margin: 0; }
p { margin: 0 0 14px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #1a1408; padding: 8px 14px; border-radius: 10px; z-index: 30; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 11.5px; color: var(--gold); margin: 0 0 12px; }

/* ---------- Logo and buttons (as on the landing) ---------- */
.logo { display: inline-flex; align-items: center; gap: 9px; font-family: var(--serif); font-size: 22px; font-weight: 500; white-space: nowrap; color: var(--text); text-decoration: none; padding-block: 5px; }
.logo-mark { width: 1.5em; height: 1.5em; flex: none; }
.logo-word em { font-style: normal; font-weight: 600; color: var(--gold); background: linear-gradient(180deg, #efd79e, #ad853f); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; text-decoration: none; cursor: pointer;
  font: 600 15px/1.2 var(--sans); letter-spacing: 0.01em; text-align: center;
  border: 1px solid transparent; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.btn.primary { background: linear-gradient(180deg, #e4c47e, var(--gold)); color: #1a1408; box-shadow: 0 8px 30px -10px var(--gold-glow); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost { border-color: rgba(214, 178, 102, 0.3); color: var(--text); background: rgba(255, 255, 255, 0.02); }
.btn.ghost:hover { border-color: var(--gold); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14px; }

/* ---------- Header: logo + account, then the sections (scroll sideways on a phone) ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(7, 7, 10, 0.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 58px; }
.top-acts { display: flex; align-items: center; gap: 6px; }
.top .login { color: var(--muted); font-size: 14.5px; font-weight: 500; padding: 12px 8px; text-decoration: none; }
.top .login:hover { color: var(--text); }
.sections { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.sections::-webkit-scrollbar { display: none; }
.sections a { flex: none; color: var(--muted); text-decoration: none; font-size: 14px; padding: 8px 12px; border-radius: 999px; border: 1px solid transparent; }
.sections a:hover { color: var(--text); }
.sections a[aria-current="page"] { color: var(--gold); border-color: var(--card-border); background: var(--gold-soft); }
.sections:empty { display: none; }
@media (max-width: 380px) {
  .top .logo { font-size: 20px; }
  .top .btn.small { padding: 0 12px; font-size: 13.5px; }
  .top .login { padding: 12px 4px; }
}

/* ---------- Page ---------- */
main { padding: 18px 16px 56px; }
.crumbs ol { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 13.5px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: rgba(214, 178, 102, 0.6); }
.crumbs a { color: var(--muted); text-decoration: none; padding-block: 8px; }
.crumbs a:hover { color: var(--text); }
.doc { max-width: 760px; }
.doc-head h1 { font-size: clamp(34px, 8.5vw, 52px); margin-bottom: 14px; }
.lead { font-size: 17.5px; color: #cfcac0; margin-bottom: 18px; }
.meta { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.badge { display: inline-grid; place-items: center; min-width: 36px; height: 24px; padding: 0 8px; border-radius: 999px; font: 600 12.5px/1 var(--sans); letter-spacing: 0.04em; color: #1a1408; background: linear-gradient(180deg, #e4c47e, var(--gold)); vertical-align: 0.2em; }
.block { padding: 30px 0 4px; border-top: 1px solid var(--line); margin-top: 26px; }
.block h2 { font-size: clamp(26px, 6.4vw, 34px); margin-bottom: 16px; }
.block h3 { font-size: 22px; margin: 18px 0 10px; }
.doc ul, .doc ol { padding-left: 20px; }

.formula { margin: 16px 0; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(214, 178, 102, 0.28); background: var(--gold-soft); }
.formula code { font: 500 15.5px/1.6 var(--sans); color: #f0dcae; white-space: normal; overflow-wrap: anywhere; }
.tip { padding: 12px 16px; border-left: 2px solid var(--gold); background: var(--card); border-radius: 0 12px 12px 0; color: #ddd6c6; }
.tip b { color: var(--gold); font-weight: 600; }

.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--gold); font-weight: 600; font-size: 13px; letter-spacing: 0.03em; background: rgba(255, 255, 255, 0.02); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td { min-width: 110px; }

.examples, .mistakes, .tasks { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 10px; }
.examples li { display: grid; gap: 2px; padding: 12px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.examples .en { color: var(--gold); font-weight: 500; }
.examples .uz { color: var(--muted); font-size: 14.5px; }
.mistakes li { padding: 14px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-border); }
.mistakes p { margin: 0 0 4px; }
.mistakes .wrong { color: var(--bad); }
.mistakes .wrong s { text-decoration-thickness: 1px; }
.mistakes .right { color: var(--ok); font-weight: 500; }
.mistakes .note { color: var(--muted); font-size: 14.5px; margin: 0; }
.tasks li { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); }
.tasks p { margin: 0 0 4px; }
.tasks .example { color: var(--muted); font-size: 14.5px; }
.tasks .example span { color: #e8dcc0; }
.tasks + .tip { margin-top: 14px; }
table.words td:first-child { white-space: nowrap; }

/* ---------- Video: a thumbnail until clicked (seo-practice.js loads the player) ---------- */
.video { margin: 14px 0 18px; }
.yt { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--card-border); }
.yt img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .82; transition: opacity .2s; }
.yt:hover img { opacity: 1; }
.yt .play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; border-radius: 14px; background: rgba(7, 7, 10, 0.78); border: 1px solid rgba(214, 178, 102, 0.6); }
.yt .play::after { content: ""; position: absolute; left: 28px; top: 14px; border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent var(--gold); }
.yt iframe, .video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; display: block; }
.video figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; overflow-wrap: anywhere; }

/* ---------- Practice ---------- */
.practice-list { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 12px; counter-reset: q; }
.practice-list > li { counter-increment: q; }
.practice { padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--card-border); }
.practice .q { font-size: 17px; font-weight: 500; margin-bottom: 10px; }
.practice .q::before { content: counter(q) ". "; color: var(--gold); font-family: var(--serif); font-weight: 600; }
.practice fieldset { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.practice fieldset label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; background: rgba(255, 255, 255, 0.02); }
.practice fieldset label:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.practice input[type="radio"] { accent-color: var(--gold); margin: 0; }
.practice .gap input { width: 100%; max-width: 280px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(214, 178, 102, 0.3); background: rgba(255, 255, 255, 0.03); color: var(--text); font: 16px var(--sans); margin-bottom: 10px; }
.practice .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.practice .feedback { margin: 0; font-size: 15px; }
.practice .feedback:empty { display: none; }
.practice.ok { border-color: rgba(143, 207, 154, 0.5); }
.practice.ok .feedback { color: var(--ok); }
.practice.bad .feedback { color: #f0c2bb; }
.practice .key { margin-top: 10px; font-size: 14.5px; color: var(--muted); }
.practice .key summary { cursor: pointer; color: var(--gold); min-height: 32px; display: inline-flex; align-items: center; }
.practice .key p { margin: 6px 0 0; }
.practice .key b { color: var(--text); }

/* ---------- Related, pager, lists ---------- */
.related ul { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 8px; }
.related a { display: flex; align-items: center; min-height: 48px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; color: var(--text); background: var(--card); }
.related a::after { content: "→"; margin-left: auto; padding-left: 12px; color: var(--gold); }
.related a:hover { border-color: var(--card-border); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.pager a { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: 14.5px; line-height: 1.35; }
.pager a span { color: var(--gold); font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.pager a[rel="next"] { text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.chips a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; border: 1px solid var(--card-border); text-decoration: none; color: var(--text); font-size: 14px; }
.chips a:hover { border-color: var(--gold); }
.topic-list, .section-cards { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 10px; }
.topic-list a, .section-cards a { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--text); transition: border-color .2s; }
.topic-list a:hover, .section-cards a:hover { border-color: var(--card-border); }
.topic-list b, .section-cards b { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.2; color: var(--text); }
.topic-list span { color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.level h2 .badge { font-size: 13px; height: 26px; }
.intro p { color: #d8d2c6; }

/* ---------- Call to action ---------- */
.cta-block { max-width: 760px; margin: 44px 0 0; padding: 28px 22px; border-radius: 22px; border: 1px solid rgba(214, 178, 102, 0.3); background: radial-gradient(500px 260px at 100% 0%, rgba(214, 178, 102, 0.13), transparent 70%), var(--card); }
.cta-block h2 { font-size: clamp(28px, 7vw, 38px); margin-bottom: 10px; }
.cta-block > p { color: var(--muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.cta-row .btn { flex: 1 1 220px; }
.cta-note { margin: 14px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 22px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 18px; }
.foot a { color: var(--muted); text-decoration: none; padding-block: 11px; }
.foot a:hover { color: var(--text); }
.foot .logo { color: var(--text); font-size: 20px; }
.foot p { margin: 0; }

@media (min-width: 760px) {
  .wrap { padding: 0 32px; }
  main { padding: 26px 32px 80px; }
  .top-row { height: 64px; }
  .topic-list { grid-template-columns: 1fr 1fr; }
  .related ul { grid-template-columns: 1fr 1fr; }
  .cta-block { padding: 36px 40px; }
  .cta-row .btn { flex: 0 0 auto; }
}
@media (min-width: 1000px) {
  .top .wrap.top-row { position: relative; }
  .sections { position: absolute; left: 50%; top: 0; height: 64px; transform: translateX(-50%); align-items: center; padding: 0; }
  .top { height: 65px; }
  .topic-list { grid-template-columns: 1fr 1fr 1fr; }
  .doc, .cta-block { max-width: 800px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
