/* Ranglar logotipdan olingan: to'q dengiz ko'ki va oq, urg'u uchun yashil */
:root {
  --ink: #112836;
  --bg: #f2f6f6;
  --surface: #ffffff;
  --tint: #e5eeee;
  --text: #112836;
  --muted: #4d6572;
  --line: #cbdadd;
  --accent: #0c7a54;
  --on-accent: #ffffff;
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --body: 'Manrope', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1b25; --surface: #112836; --tint: #0f222e; --text: #eef6f5; --muted: #9db4bd;
    --line: #254354; --accent: #5be0a8; --on-accent: #07241a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1b25; --surface: #112836; --tint: #0f222e; --text: #eef6f5; --muted: #9db4bd;
  --line: #254354; --accent: #5be0a8; --on-accent: #07241a; color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { background: var(--bg); color: var(--text); font: 500 1rem/1.65 var(--body); overflow-x: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
ul { list-style: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 14px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.2; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
h3 { font-size: 1.15rem; font-weight: 500; }

/* Navigatsiya */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: .9rem; }
.brand img { border-radius: 10px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; padding: 7px 14px; border-radius: 99px; color: var(--muted); font-size: .93rem; }
.nav a:hover { color: var(--text); }
.nav a.active { background: var(--text); color: var(--bg); }
.tools { display: flex; gap: 8px; }
.tool { min-width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; font-weight: 700; font-size: .85rem; }
.menu-btn { display: none; }

/* Bosh qism */
.hero { padding: clamp(40px, 8vw, 96px) 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.status { display: flex; align-items: center; gap: 10px; color: var(--muted); margin-bottom: 20px; }
.status i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
h1 { font-size: clamp(2.1rem, 6.4vw, 4.6rem); font-weight: 700; letter-spacing: -.02em; }
/* Shrift konturlari ustma-ust tushgani uchun ichi fon rangida to'ldiriladi */
h1 span { color: var(--bg); -webkit-text-stroke: 3px var(--text); paint-order: stroke fill; }
.lead { max-width: 52ch; color: var(--muted); font-size: 1.1rem; margin: 24px 0 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-block; text-decoration: none; padding: 12px 22px; border-radius: 12px; border: 1.5px solid var(--text); background: transparent; font-weight: 700; font-size: .93rem; transition: transform .15s; }
.btn:hover { transform: translateY(-2px); }
.btn.solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ghost { border-color: var(--line); color: var(--muted); }
.mark { justify-self: end; width: min(100%, 360px); padding: 14px; border: 2px solid var(--text); border-radius: 36px; transform: rotate(3deg); transition: transform .4s; }
.mark:hover { transform: rotate(0); }
.mark-frame { border-radius: 24px; overflow: hidden; aspect-ratio: 1; background: var(--ink); }
.mark-frame img { width: 100%; height: 100%; object-fit: cover; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 64px; border-block: 1px solid var(--line); }
.facts div { padding: 22px 20px; display: flex; flex-direction: column-reverse; }
.facts div + div { border-left: 1px solid var(--line); }
.facts dd { font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2.2rem); }
.facts dt { color: var(--muted); font-size: .85rem; }

/* Bo'limlar */
.block { padding: clamp(56px, 8vw, 96px) 0; }
.tint { background: var(--tint); }
.head { margin-bottom: 40px; max-width: 60ch; }
.head p { color: var(--muted); margin-top: 12px; }
.kicker { color: var(--accent); font-weight: 700; font-size: .85rem; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { border: 1px solid var(--line); border-radius: 99px; padding: 3px 12px; font-size: .8rem; }
.tags.big li { font-size: .93rem; padding: 7px 16px; background: var(--surface); }
.certs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; max-width: 900px; }
.cert { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 12px 12px 18px; }
.cert a { display: grid; place-items: center; height: 460px; background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.cert img { width: 100%; height: 100%; object-fit: contain; transition: transform .4s; }
.cert a:hover img { transform: scale(1.04); }
.cert h3 { margin: 16px 8px 4px; }
.cert p { margin: 0 8px; color: var(--muted); font-size: .9rem; }
.site .role { align-self: flex-start; margin: 10px 8px 0; padding: 3px 11px; border-radius: 99px; font-size: .75rem; font-weight: 700;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.site h4 { margin-top: 2px !important; }
@media (max-width: 700px) { .certs { grid-template-columns: minmax(0, 1fr); } .cert a { height: auto; } .cert img { height: auto; } }
@media print {
  .certs { display: block; } .cert { border: 0; padding: 0; } .cert a { display: none; }
  .cert h3 { margin: 0; } .cert p { margin: 0 0 4px; } #certs .head { margin-bottom: 2px; }
}
.print-projects { display: none; }

.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.timeline > div { position: relative; padding: 0 0 32px 30px; border-left: 2px solid var(--line); }
.timeline > div:last-child { padding-bottom: 0; }
.timeline > div::before { content: ""; position: absolute; left: -8px; top: 4px; width: 14px; height: 14px; border-radius: 4px; background: var(--tint); border: 3px solid var(--accent); }
.timeline p { color: var(--muted); margin-top: 6px; }
.score { background: var(--ink); color: #eef6f5; border-radius: 24px; padding: 32px; border: 1px solid var(--line); }
.score strong { display: block; font: 700 4rem/1.1 var(--display); margin-bottom: 20px; }
.bar-row { display: flex; justify-content: space-between; font-size: .9rem; margin-top: 14px; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: #ffffff24; border-radius: 9px; margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #5be0a8; }

.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 48px; }
.skills-grid h3 { margin-bottom: 16px; }
.langs li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.langs em { font-style: normal; color: var(--accent); font-weight: 700; }

/* Aloqa */
.contact { background: var(--ink); color: #eef6f5; padding-bottom: 96px; }
.contact .head p { color: #a9c0c9; }
.contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contacts li { display: flex; align-items: center; gap: 10px; border: 1px solid #ffffff2e; border-radius: 16px; padding: 6px 12px 6px 6px; min-width: 0; }
.contacts li:hover { border-color: #5be0a8; }
.contacts a { flex: 1; min-width: 0; text-decoration: none; padding: 12px 14px; }
.contacts small { display: block; color: #a9c0c9; }
.contacts span { font-weight: 700; overflow-wrap: anywhere; }
.copy { border: 0; border-radius: 10px; background: #ffffff1a; color: inherit; padding: 8px 12px; font-size: .8rem; }
footer { margin-top: 56px; color: #a9c0c9; font-size: .85rem; }

/* AI chat */
.chat-open { position: fixed; right: 18px; bottom: 18px; z-index: 40; border: 2px solid var(--on-accent); background: var(--accent); color: var(--on-accent); font-weight: 700; padding: 13px 20px; border-radius: 99px; box-shadow: 0 10px 30px #0005; }
.chat { position: fixed; right: 18px; bottom: 82px; z-index: 41; width: min(370px, 100% - 36px); height: min(520px, 100dvh - 110px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px #0006; }
.chat[hidden] { display: none; }
.chat header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--ink); color: #fff; }
.chat header button { background: none; border: 0; color: inherit; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { align-self: flex-start; max-width: 85%; background: var(--tint); padding: 9px 13px; border-radius: 14px; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--on-accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.chips button { border: 1px solid var(--line); background: none; border-radius: 99px; padding: 4px 11px; font-size: .78rem; }
.chat form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 16px; }
.chat form button { border: 0; border-radius: 10px; background: var(--accent); color: var(--on-accent); width: 44px; }

.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 20px; opacity: 0; pointer-events: none; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-size: .88rem; transition: .25s; z-index: 50; }
.toast.show { opacity: 1; translate: -50% 0; }

.js .reveal { opacity: 0; translate: 0 24px; transition: opacity .6s, translate .6s; }
.js .reveal.in { opacity: 1; translate: 0 0; }

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; padding: 12px 20px 18px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .hero-grid, .about-grid, .skills-grid, .contacts { grid-template-columns: minmax(0, 1fr); }
  .mark { justify-self: center; width: min(78%, 300px); order: -1; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(3) { border-left: 0; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

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

/* Chop etish: ixcham bir-ikki betlik CV */
@media print {
  :root, :root[data-theme] { --bg: #fff; --surface: #fff; --tint: #fff; --text: #000; --muted: #333; --line: #bbb; --accent: #000; }
  @page { margin: 14mm; }
  body { font-size: 10.5pt; line-height: 1.45; }
  .top, .actions, .mark, .status, .chat-open, .chat, .toast, .copy, .skip, .head p { display: none !important; }
  .reveal { opacity: 1 !important; translate: 0 0 !important; }
  .wrap { width: 100%; }
  .hero, .block { padding: 0 0 14px; }
  h1 { font-size: 24pt; }
  h1 br { display: none; }
  h1 span { color: #000; -webkit-text-stroke: 0; }
  h2 { font-size: 14pt; } h3 { font-size: 11pt; }
  .lead { margin: 6px 0; font-size: 10.5pt; }
  .facts { margin-top: 8px; grid-template-columns: repeat(4, 1fr); }
  .facts div { padding: 6px 10px; } .facts dd { font-size: 14pt; }
  .head { margin-bottom: 8px; }
  .print-projects { display: block; list-style: disc; padding-left: 18px; }
  .about-grid { grid-template-columns: 1fr; }
  .timeline > div { padding: 0 0 8px; border: 0; }
  .timeline > div::before { display: none; }
  .facts div:nth-child(n) { border-top: 0; }
  .facts div + div { border-left: 1px solid var(--line); }
  .score { display: none; }
  .skills-grid { gap: 10px 24px; } .skills-grid h3 { margin-bottom: 4px; }
  .tags.big li { padding: 1px 8px; font-size: 9.5pt; }
  .langs li { padding: 2px 0; }
  .contact { background: none; color: #000; }
  .contacts { grid-template-columns: 1fr 1fr; gap: 4px; }
  .contacts li { border: 0; padding: 0; } .contacts a { padding: 2px 0; }
  .contacts small, footer { color: #333; }
  footer { display: none; }
}

/* ---------- Ishlab turgan saytlar ---------- */
.sites-block h3 { margin-bottom: 20px; }
.sites { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.site { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 10px 10px 18px; }
.site > a:first-child { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); text-decoration: none; }
.chrome { display: flex; align-items: center; gap: 5px; padding: 7px 10px; background: var(--tint); }
.chrome i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .5; }
.chrome em { font-style: normal; font-size: .72rem; color: var(--muted); margin-left: 6px; }
.site img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .45s; }
.site > a:hover img { transform: scale(1.05); }
.site h4 { font: 500 1rem/1.3 var(--display); margin: 10px 8px 0; }
.site p { color: var(--muted); font-size: .9rem; margin: 0 8px; flex: 1; }
.site .more { margin: 4px 8px 0; color: var(--accent); font-weight: 700; font-size: .9rem; text-decoration: none; }

/* ---------- Muzey vitrinasi va 3D kitob ---------- */
.museum { --w: 250px; --h: 355px; --d: 16px; background: radial-gradient(ellipse at 70% 20%, #17222f, #05090e 70%); color: #f3efe6; padding: clamp(48px, 7vw, 88px) 0; overflow: hidden; }
.museum-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; }
.museum-text { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.museum .kicker { color: #d9ad4a; }
.museum-text p:not(.kicker) { color: #b6bec9; max-width: 44ch; }
.showcase { position: relative; height: 640px; cursor: grab; touch-action: pan-y; user-select: none; border-radius: 24px; }
.showcase:active { cursor: grabbing; }
.lamp { position: absolute; top: 0; left: 50%; translate: -50% 0; width: 110px; height: 34px; border-radius: 8px 8px 55px 55px / 8px 8px 22px 22px; background: linear-gradient(#3a3f47, #14171c); z-index: 2; }
.lamp::before { content: ""; position: absolute; left: 14px; right: 14px; bottom: -4px; height: 10px; border-radius: 50%; background: #fff6dc; box-shadow: 0 0 22px 8px #ffe3a199; }
.beam { position: absolute; top: 30px; left: 50%; translate: -50% 0; width: min(520px, 100%); height: 530px; pointer-events: none; background: linear-gradient(#ffeec044, #ffeec014 65%, #ffeec000); clip-path: polygon(42% 0, 58% 0, 94% 100%, 6% 100%); filter: blur(6px); }
.scene { position: absolute; left: 50%; top: 90px; width: var(--w); height: var(--h); translate: -50% 0; z-index: 2; perspective: 1100px; animation: float 5s ease-in-out infinite; }
.book { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(-6deg) rotateY(-28deg); }
.face { position: absolute; left: 50%; top: 50%; translate: -50% -50%; }
.face img { width: 100%; height: 100%; object-fit: cover; }
.front, .back { width: var(--w); height: var(--h); backface-visibility: hidden; background: #102a52; }
.front { transform: translateZ(calc(var(--d) / 2)); }
.back { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }
.front::after, .back::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, #ffffff2e, #ffffff00 42%, #00000038); }
.spine, .edge { width: var(--d); height: var(--h); }
.spine { transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); background: linear-gradient(90deg, #0b1d3a, #17335f 50%, #0b1d3a); }
/* Sahifalar qirrasi muqovadan biroz ichkarida turadi */
.edge { transform: rotateY(90deg) translateZ(calc(var(--w) / 2 - 2px)); background: repeating-linear-gradient(90deg, #f4f0e6 0 2px, #cfc8b8 2px 3px); }
.cap { width: var(--w); height: var(--d); background: repeating-linear-gradient(#f4f0e6 0 2px, #cfc8b8 2px 3px); }
.top-cap { transform: rotateX(90deg) translateZ(calc(var(--h) / 2 - 1px)); }
.bottom-cap { transform: rotateX(-90deg) translateZ(calc(var(--h) / 2 - 1px)); }
.shadow { position: absolute; left: 50%; top: 486px; translate: -50% 0; width: 260px; height: 36px; border-radius: 50%; background: radial-gradient(#000c, #0000 70%); z-index: 1; animation: shade 5s ease-in-out infinite; }
.pedestal { position: absolute; left: 50%; bottom: 0; translate: -50% 0; width: 340px; max-width: 94%; height: 138px; background: linear-gradient(90deg, #0c0f14, #2b313b 30%, #353c48 50%, #20252d 72%, #090b0f); border-radius: 0 0 50% 50% / 0 0 26px 26px; }
.pedestal::before { content: ""; position: absolute; left: 0; right: 0; top: -30px; height: 60px; border-radius: 50%; background: radial-gradient(ellipse, #b9a878, #5d574a 38%, #2c3038 72%); border: 1px solid #ffffff2b; }
.plate { position: absolute; left: 50%; top: 62px; translate: -50% 0; white-space: nowrap; padding: 6px 16px; border-radius: 3px; background: linear-gradient(135deg, #8a6a24, #e8c874 50%, #8a6a24); color: #231a06; font: 700 .65rem var(--display); letter-spacing: .1em; }
@keyframes float { 50% { transform: translateY(-14px); } }
@keyframes shade { 50% { scale: .86; opacity: .7; } }

@media (max-width: 980px) { .sites { grid-template-columns: minmax(0, 520px); justify-content: center; } }
@media (max-width: 860px) {
  .museum-grid { grid-template-columns: minmax(0, 1fr); }
  .museum { --w: 200px; --h: 284px; --d: 13px; }
  .showcase { height: 550px; }
  .beam { height: 440px; }
  .shadow { top: 400px; }
}
@media (max-width: 1080px) and (min-width: 861px) { .nav a { padding: 7px 8px; } }
@media (prefers-reduced-motion: reduce) { .scene, .shadow { animation: none; } }
@media print { .museum, .sites-block { display: none !important; } }
@media print { @page { margin: 11mm; } body { font-size: 9.5pt; line-height: 1.35; } .hero, .block { padding-bottom: 8px; } .timeline > div { padding-bottom: 4px; } .skills-grid { grid-template-columns: 1fr 1fr; } .contacts a { padding: 0; } }
