:root {
  --bg: #f7f7fc;
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #ffffff;
  --text: #12122a;
  --muted: #5b5d78;
  --border: rgba(18, 18, 60, .10);
  --brand-1: #10b981;
  --brand-2: #3b82f6;
  --brand-3: #8b5cf6;
  --brand: #4f46e5;
  --grad: linear-gradient(120deg, var(--brand-1), var(--brand-2) 50%, var(--brand-3));
  --mark: rgba(16, 185, 129, .22);
  --mark-ink: #047857;
  --altgr: #7c3aed;
  --shadow: 0 1px 2px rgba(20, 20, 60, .05), 0 12px 32px -12px rgba(40, 40, 120, .18);
  --shadow-lg: 0 30px 80px -24px rgba(60, 50, 160, .35);
  --blob-a: 0.55;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b18;
    --surface: rgba(24, 24, 44, .72);
    --surface-solid: #16162a;
    --text: #ecebff;
    --muted: #a3a3c2;
    --border: rgba(255, 255, 255, .09);
    --brand: #818cf8;
    --mark: rgba(52, 211, 153, .22);
    --mark-ink: #6ee7b7;
    --altgr: #c4b5fd;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 80px -24px rgba(0, 0, 0, .7);
    --blob-a: 0.35;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b18; --surface: rgba(24, 24, 44, .72); --surface-solid: #16162a; --text: #ecebff; --muted: #a3a3c2;
  --border: rgba(255, 255, 255, .09); --brand: #818cf8; --mark: rgba(52, 211, 153, .22); --mark-ink: #6ee7b7;
  --altgr: #c4b5fd; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 30px 80px -24px rgba(0,0,0,.7); --blob-a: 0.35; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 Inter, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3 { font-family: Manrope, Inter, "Segoe UI", sans-serif; letter-spacing: -0.02em; margin: 0; }
a { color: var(--brand); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }
code { font: .9em ui-monospace, Consolas, monospace; background: var(--mark); color: var(--mark-ink); padding: 1px 6px; border-radius: 6px; }
kbd {
  font: 600 .85em Inter, sans-serif; padding: 1px 7px; border-radius: 6px;
  background: var(--surface-solid); border: 1px solid var(--border); box-shadow: 0 2px 0 var(--border);
}

/* Harakatlanuvchi gradient fon */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--blob-a); animation: drift 22s ease-in-out infinite alternate; }
.b1 { width: 560px; height: 560px; background: var(--brand-1); top: -180px; left: -120px; }
.b2 { width: 620px; height: 620px; background: var(--brand-2); top: -120px; right: -200px; animation-delay: -7s; }
.b3 { width: 520px; height: 520px; background: var(--brand-3); top: 380px; left: 30%; animation-delay: -14s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.08); }
  100% { transform: translate(-40px, 80px) scale(.95); }
}

/* Navigatsiya */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 18px Manrope, sans-serif; color: var(--text); text-decoration: none; }
.logo {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); color: #fff; font-weight: 800; box-shadow: 0 6px 16px -6px var(--brand-2);
}
.logo.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 14px; }
.links { display: flex; gap: 22px; margin-left: auto; }
.links a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; transition: color .2s; }
.links a:hover { color: var(--text); }

/* Tugmalar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 12px; border: 1px solid transparent; font: 600 15px Inter, sans-serif;
  text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px var(--brand-2); background-size: 150% 100%; }
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 14px 30px -10px var(--brand-3); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); backdrop-filter: blur(8px); }
.btn-white { background: #fff; color: #312e81; box-shadow: 0 12px 30px -10px rgba(0,0,0,.4); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-2) 60%, transparent); outline-offset: 3px; border-radius: 8px; }

/* Bosh ekran */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 56px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--border); font-size: 14px; color: var(--muted); backdrop-filter: blur(8px);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-1) 25%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand-1) 0%, transparent); } }
h1 { font-size: clamp(40px, 6.4vw, 72px); line-height: 1.02; font-weight: 800; margin: 22px 0 18px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 19px; color: var(--muted); max-width: 540px; margin: 0 0 30px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.chips { display: flex; gap: 18px; list-style: none; padding: 0; margin: 24px 0 0; color: var(--muted); font-size: 14px; }

.hero-demo { position: relative; }
.demo-card {
  position: relative; z-index: 1; border-radius: 20px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); backdrop-filter: blur(16px);
}
.demo-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.demo-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }
.demo-bar i:nth-child(1) { background: #ff5f57; } .demo-bar i:nth-child(2) { background: #febc2e; } .demo-bar i:nth-child(3) { background: #28c840; }
.demo-bar span { margin-left: 8px; }
.demo-body { min-height: 150px; padding: 26px 24px; font: 600 28px/1.45 Manrope, sans-serif; }
.demo-body mark { background: var(--mark); color: var(--mark-ink); border-radius: 6px; padding: 0 2px; }
.demo-body mark.pop { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(1.6); opacity: 0; } }
.caret { display: inline-block; width: 3px; height: 1.1em; background: var(--brand-2); vertical-align: -0.15em; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.demo-foot { padding: 12px 24px 18px; font-size: 14px; color: var(--muted); }
.kbd-mini { display: inline-block; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-solid); font-weight: 600; }
.kbd-mini.new { background: var(--grad); color: #fff; border: 0; }
.float {
  position: absolute; z-index: 2; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px;
  font: 800 30px Manrope, sans-serif; color: #fff; background: var(--grad); box-shadow: var(--shadow-lg);
  animation: bob 6s ease-in-out infinite;
}
.f1 { top: 34%; left: -34px; } .f2 { top: -40px; right: 30px; animation-delay: -1.5s; background: linear-gradient(135deg, var(--brand-2), var(--brand-3)); }
.f3 { bottom: -26px; right: -18px; animation-delay: -3s; } .f4 { bottom: -40px; right: 34%; animation-delay: -4.5s; background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); }
@keyframes bob { 50% { transform: translateY(-14px) rotate(-6deg); } }

/* Bo'limlar */
.section { padding-top: 96px; padding-bottom: 24px; }
.head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.eyebrow { display: inline-block; font: 700 13px Inter, sans-serif; text-transform: uppercase; letter-spacing: .12em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; font-weight: 800; margin: 10px 0 12px; }
.head p { color: var(--muted); font-size: 17px; margin: 0; }

/* Konvertor */
.conv {
  position: relative; display: grid; grid-template-columns: 1fr auto 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px); overflow: hidden;
}
.conv-pane { position: relative; display: flex; flex-direction: column; min-width: 0; }
.conv-pane.out { background: color-mix(in srgb, var(--surface-solid) 55%, transparent); }
.conv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.tag { font: 700 14px Inter, sans-serif; color: var(--muted); }
.tag-new { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tools { display: flex; gap: 6px; }
.icon-btn {
  font: 600 13px Inter, sans-serif; padding: 6px 12px; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--border); transition: all .15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-solid); }
.icon-btn.primary { background: var(--grad); color: #fff; border-color: transparent; }
.icon-btn.done { background: var(--brand-1); color: #fff; border-color: transparent; }
textarea, .output {
  flex: 1; min-height: 260px; padding: 18px 20px; margin: 0; border: 0; background: transparent; color: var(--text);
  font: 18px/1.65 Inter, sans-serif; resize: none; outline: none;
}
.output { white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; max-height: 520px; }
.output:empty::before { content: "Natija şu yerda çiqadi"; color: var(--muted); opacity: .7; }
.output mark { background: var(--mark); color: var(--mark-ink); border-radius: 4px; padding: 0 1px; font-weight: 600; }
textarea::placeholder { color: var(--muted); opacity: .7; }
.conv-foot { padding: 10px 20px 14px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); }
#count.has { color: var(--mark-ink); font-weight: 600; }
.conv-arrow {
  align-self: center; display: grid; place-items: center; width: 44px; height: 44px; margin: 0 -22px; z-index: 2;
  border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; box-shadow: var(--shadow);
}
.drop-hint {
  position: absolute; inset: 8px; display: none; place-items: center; border-radius: 16px;
  border: 2px dashed var(--brand-2); background: color-mix(in srgb, var(--brand-2) 10%, transparent);
  font-weight: 600; color: var(--brand-2);
}
.conv-pane.dragging .drop-hint { display: grid; }
.examples { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; color: var(--muted); font-size: 14px; }
.chip {
  font: 500 14px Inter, sans-serif; padding: 7px 14px; border-radius: 99px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); transition: all .15s;
}
.chip:hover { border-color: var(--brand-2); color: var(--brand-2); }

/* Qadamlar */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; list-style: none; padding: 0; margin: 0; counter-reset: s; position: relative; }
.step {
  position: relative; padding: 28px; border-radius: 20px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
.num {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; margin-bottom: 18px;
  background: var(--grad); color: #fff; font: 800 20px Manrope, sans-serif;
}
.step h3 { font-size: 20px; margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); }

/* Imkoniyatlar */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card {
  padding: 26px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow); backdrop-filter: blur(12px); transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card.big { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; }
.card h3 { font-size: 19px; margin: 14px 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.ico {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; font-size: 22px;
  background: color-mix(in srgb, var(--brand-2) 14%, transparent); color: var(--brand-2);
}
.card.big .ico { background: var(--grad); color: #fff; }
.morph {
  margin-top: auto; padding-top: 28px; display: flex; align-items: center; gap: 16px;
  font: 800 clamp(26px, 3.4vw, 40px) Manrope, sans-serif;
}
.morph b { color: var(--muted); font-weight: 500; }
.morph span:first-child { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.morph .new { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Klaviatura */
.kb-wrap { padding: 28px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); backdrop-filter: blur(16px); }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: color-mix(in srgb, var(--text) 6%, transparent); gap: 4px; }
.seg button {
  font: 600 14px Inter, sans-serif; padding: 8px 16px; border-radius: 9px; border: 0; cursor: pointer;
  background: transparent; color: var(--muted);
}
.seg button[aria-selected="true"] { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow); }
.note { color: var(--muted); margin: 14px 0 20px; font-size: 15px; }
.keyboard { display: grid; gap: var(--g, 7px); padding: 4px 0 10px; overflow-x: auto; }
.row { display: flex; gap: var(--g, 7px); }
.key {
  --w: 1; position: relative; flex: 0 0 auto;
  width: calc(var(--w) * var(--u, 56px) + (var(--w) - 1) * var(--g, 7px)); height: var(--u, 56px);
  border-radius: 11px; background: var(--surface-solid); border: 1px solid var(--border);
  box-shadow: 0 3px 0 var(--border); transition: transform .08s, box-shadow .08s, background .15s;
  font: 500 15px Inter, sans-serif; color: var(--muted);
}
.key.label { display: grid; place-items: center; font-size: 12px; }
.key .base { position: absolute; left: 10px; bottom: 7px; color: var(--text); font-size: 17px; }
.key .ag { position: absolute; right: 8px; top: 5px; font-size: 13px; font-weight: 700; color: var(--altgr); }
.key.new { background: var(--grad); border-color: transparent; }
.key.new .base { color: #fff; font: 800 22px Manrope, sans-serif; }
.key.new .ag { color: rgba(255, 255, 255, .85); }
.key.pressed { transform: translateY(3px); box-shadow: 0 0 0 var(--border); background: color-mix(in srgb, var(--brand-2) 22%, var(--surface-solid)); }
.key.new.pressed { filter: brightness(1.15); }
.legend { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 18px; height: 18px; border-radius: 5px; }
.sw-new { background: var(--grad); }
.sw-ag { background: color-mix(in srgb, var(--altgr) 25%, transparent); border: 1px solid var(--altgr); }

/* Alifbo */
.alphabet { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; }
.letter {
  position: relative; height: 92px; border-radius: 16px; perspective: 600px; cursor: default;
}
.letter .face {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  font: 800 28px Manrope, sans-serif; backface-visibility: hidden; transition: transform .5s cubic-bezier(.3, 1.4, .5, 1);
}
.letter .back { transform: rotateY(180deg); font-size: 22px; color: var(--muted); }
.letter .back small { display: block; font: 600 11px Inter, sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.letter.new .front { background: var(--grad); color: #fff; border-color: transparent; }
.letter.new:hover .front { transform: rotateY(-180deg); }
.letter.new:hover .back { transform: rotateY(0); }
.letter .front small { position: absolute; bottom: 8px; font: 600 10px Inter, sans-serif; opacity: .85; letter-spacing: .06em; text-transform: uppercase; }

/* Savollar */
.faq { display: grid; gap: 12px; }
.faq details {
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  backdrop-filter: blur(12px); overflow: hidden;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 22px; font: 700 17px Manrope, sans-serif;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 500 24px Inter, sans-serif; color: var(--brand-2); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 22px 20px; color: var(--muted); }

/* Yakuniy chaqiriq */
.final {
  position: relative; overflow: hidden; text-align: center; padding: 64px 24px; border-radius: 28px;
  background: var(--grad); color: #fff; box-shadow: var(--shadow-lg);
}
.final::before {
  content: ""; position: absolute; inset: -40%; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.25), transparent 40%);
  animation: drift 16s ease-in-out infinite alternate;
}
.final > * { position: relative; }
.final h2 { color: #fff; }
.final p { margin: 0 0 28px; opacity: .9; }

.foot { margin-top: 96px; border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: 14px; }
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot .brand { font-size: 15px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 20px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600;
  box-shadow: var(--shadow-lg); transition: all .25s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Paydo bo'lish animatsiyasi */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; gap: 64px; }
  .hero-demo { max-width: 520px; margin: 0 auto; width: calc(100% - 40px); }
  .bento { grid-template-columns: 1fr 1fr; }
  .card.big { grid-column: span 2; grid-row: auto; }
  .links { display: none; }
  .nav-inner .btn { margin-left: auto; }
}

@media (max-width: 680px) {
  :root { --blob-a: 0.28; }
  .blob { filter: blur(70px); }
  .conv { grid-template-columns: 1fr; }
  .conv-arrow { margin: -22px auto; transform: rotate(90deg); }
  .conv-pane.out { border-top: 1px solid var(--border); }
  textarea, .output { min-height: 170px; font-size: 17px; }
  .steps { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .card.big { grid-column: auto; }
  .lead { font-size: 17px; }
  .demo-body { font-size: 22px; min-height: 120px; }
  .float { width: 50px; height: 50px; font-size: 24px; border-radius: 14px; }
  .kb-wrap { padding: 18px 12px; }
  .key { border-radius: 6px; }
  .key .base { left: 5px; bottom: 3px; font-size: 13px; }
  .key .ag { right: 4px; top: 2px; font-size: 10px; }
  .key.new .base { font-size: 16px; }
  .key.label { font-size: 9px; }
  .section { padding-top: 72px; }
  .chips { gap: 12px; flex-wrap: wrap; }
}
