/*
  Asia Star — tanishtiruv sayti
  Maket: chapga tekislangan matn, o'ngda "hakam varaqasi" (namuna natija);
  keyingi bo'limlar tinch, keng bo'shliqli, ustun-ustun. Faqat varaqaning o'zi
  chegara, soya va burchak radiusi oladi. Yagona bezak: gimnastika lentasi.
*/

:root {
  /* Rang: logodagi uchta rang + ularga moslab tanlangan neytrallar */
  --bg: #F2F1F1;          /* logo foni */
  --surface: #FFFFFF;
  --ink: #0E2A63;         /* logo to'q ko'ki */
  --ink-2: #475676;       /* ko'k tusli kulrang matn */
  --line: #D8DAE2;
  --red: #D40F14;         /* logo qizili */
  --red-deep: #B30C10;
  --on-red: #FFFFFF;
  --hit: #0E2A63;         /* "bajarildi" belgisi */
  --tint: #E7EAF3;
  --logo-bg: transparent;
  --seg-1: #C8D0E6;
  --seg-2: #0E2A63;
  --seg-3: #F0B4B6;
  --seg-4: #D40F14;
  --shadow: 0 1px 0 rgba(14, 42, 99, .04), 0 28px 56px -28px rgba(14, 42, 99, .32);

  /* Shrift */
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1630;
    --surface: #10214A;
    --ink: #EDEFF6;
    --ink-2: #A7B2CE;
    --line: #25376A;
    --red: #FF4D52;
    --red-deep: #FF6A6E;
    --on-red: #0A1630;
    --hit: #9DB8FF;
    --tint: #14275A;
    --logo-bg: #F2F1F1;
    --seg-1: #2B407A;
    --seg-2: #9DB8FF;
    --seg-3: #7C2F46;
    --seg-4: #FF4D52;
    --shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 28px 56px -28px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0A1630;
  --surface: #10214A;
  --ink: #EDEFF6;
  --ink-2: #A7B2CE;
  --line: #25376A;
  --red: #FF4D52;
  --red-deep: #FF6A6E;
  --on-red: #0A1630;
  --hit: #9DB8FF;
  --tint: #14275A;
  --logo-bg: #F2F1F1;
  --seg-1: #2B407A;
  --seg-2: #9DB8FF;
  --seg-3: #7C2F46;
  --seg-4: #FF4D52;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 28px 56px -28px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Asos ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Telefon tizim paneli ostidagi yo'lak sticky sarlavha bilan bir xil rangda */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--bg);
}

img, svg { max-width: 100%; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(2.7rem, 1.2rem + 6vw, 5.1rem); line-height: .98; letter-spacing: -.012em; }
h2 { font-size: clamp(2.1rem, 1.2rem + 3.2vw, 3.3rem); line-height: 1.04; letter-spacing: -.008em; }
h3 { font-size: 1.6rem; line-height: 1.15; }

p { margin: 0; text-wrap: pretty; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.band { padding-block: clamp(56px, 9vw, 120px); }
.band + .band { border-top: 1px solid var(--line); }

.lead { font-size: 1.1875rem; color: var(--ink-2); max-width: 56ch; }

/* ---------- Tugmalar ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px;
  border-radius: 999px; border: 1.5px solid transparent;
  font: 600 1rem/1 var(--sans); text-decoration: none; text-align: center;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn-red { background: var(--red); color: var(--on-red); }
.btn-red:hover { background: var(--red-deep); }
.btn-line { border-color: var(--ink); color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--bg); }
.btn[aria-disabled="true"] { background: var(--tint); color: var(--ink-2); cursor: default; }

/* ---------- Sarlavha ---------- */

.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-logo {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 12px; background: var(--logo-bg);
}
.brand-logo img { display: block; height: 36px; width: auto; }
.brand-name { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 1.7rem; line-height: 1; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); }
.nav a:not(.btn) { text-decoration: none; font-size: .9375rem; font-weight: 500; color: var(--ink-2); padding: 8px 0; }
.nav a:not(.btn):hover { color: var(--ink); }
.nav .btn { min-height: 44px; padding: 0 22px; font-size: .9375rem; }

/* ---------- Bosh qism ---------- */

.hero { position: relative; overflow: hidden; padding-block: clamp(40px, 7vw, 96px) clamp(128px, 17vw, 230px); }

/* Lenta hero'ning pastki yo'lagida yuradi va matn bilan kesishmaydi */
.ribbon { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: clamp(96px, 14vw, 190px); pointer-events: none; }
.ribbon path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.ribbon .r1 { stroke: var(--red); stroke-width: 2; }
.ribbon .r2 { stroke: var(--ink); stroke-width: 1; opacity: .35; }

.hero .wrap {
  position: relative; z-index: 1;
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: clamp(36px, 6vw, 88px);
}

.hero-copy { display: grid; gap: 28px; justify-items: start; }
.hero-copy .lead { max-width: 46ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { font-size: .9375rem; color: var(--ink-2); max-width: 46ch; }

/* ---------- Hakam varaqasi ---------- */

.card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 34px);
  display: grid; gap: 22px;
  min-width: 0;
}

.card-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.card-top h2 { font-size: 1.9rem; line-height: 1.1; }
.card-top p { color: var(--ink-2); font-size: .9375rem; margin-top: 4px; }
.sample {
  flex: none; font-size: .8125rem; font-weight: 600; color: var(--ink-2);
  border: 1px dashed var(--ink-2); border-radius: 999px; padding: 5px 12px;
}

.score { display: flex; align-items: center; gap: 22px; }
.ring { position: relative; flex: none; width: 118px; height: 118px; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring circle { fill: none; stroke-width: 7; }
.ring-track { stroke: var(--line); }
.ring-fill {
  stroke: var(--hit); stroke-linecap: round; stroke-dasharray: 82 100;
  transform: rotate(-90deg); transform-origin: 60px 60px;
}
.ring-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.ring-num b { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 2.9rem; font-variant-numeric: tabular-nums; }
.ring-num span { font-size: .75rem; color: var(--ink-2); margin-top: 2px; }
.score p { font-size: .9688rem; color: var(--ink-2); min-width: 0; }

.card h3 { font-size: 1.35rem; }

.criteria { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.criteria li {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto;
  column-gap: 12px; row-gap: 7px; align-items: start; font-size: .9375rem; line-height: 1.4;
}
.mark { width: 20px; height: 20px; margin-top: 1px; color: var(--hit); }
.miss .mark { color: var(--red); }
.criteria b { font-weight: 600; font-variant-numeric: tabular-nums; }
.miss b { color: var(--red); }
.bar { grid-column: 2 / 4; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); background: var(--hit); border-radius: 2px; }
.miss .bar i { background: var(--red); }

.verdict { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .9375rem; }
.verdict p { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: 12px; }
.verdict strong { font-weight: 600; }
.verdict .conf { color: var(--ink-2); font-size: .8438rem; display: block; }

/* ---------- Qanday ishlaydi (haqiqiy ketma-ketlik) ---------- */

.band-head { display: grid; gap: 18px; max-width: 62ch; margin-bottom: clamp(36px, 5vw, 64px); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; counter-reset: step; }
.steps li { position: relative; display: grid; gap: 10px; align-content: start; padding-top: 34px; border-top: 1.5px solid var(--ink); }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -1px; left: 0; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--red); color: var(--on-red);
  font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 1.4rem; line-height: 1;
}
.steps p { color: var(--ink-2); font-size: 1rem; }

/* ---------- BMI ---------- */

.split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(36px, 6vw, 88px); align-items: center; }
.split-copy { display: grid; gap: 22px; justify-items: start; }

.formula {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  font-size: clamp(1.4rem, 1rem + 1.6vw, 1.9rem); line-height: 1.2;
  padding-left: 18px; border-left: 2px solid var(--red);
}

.scale { display: grid; gap: 14px; min-width: 0; }
.scale-track { position: relative; padding-top: 44px; }
.scale-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; gap: 2px; }
.scale-bar span { display: block; }
.scale-bar .s1 { flex: 3.5; background: var(--seg-1); }
.scale-bar .s2 { flex: 6.5; background: var(--seg-2); }
.scale-bar .s3 { flex: 5;   background: var(--seg-3); }
.scale-bar .s4 { flex: 10;  background: var(--seg-4); }

.pin { position: absolute; left: 25.2%; top: 0; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; }
.pin b {
  font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 1.5rem; line-height: 1;
  background: var(--ink); color: var(--bg); border-radius: 999px; padding: 5px 14px 7px; font-variant-numeric: tabular-nums;
}
.pin::after {
  content: ""; width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--ink);
}

.ticks { position: relative; height: 22px; margin-top: 8px; font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ticks span { position: absolute; top: 0; transform: translateX(-50%); }
.ticks span:first-child { transform: none; }
.ticks span:last-child { transform: translateX(-100%); }

.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; font-size: .9375rem; }
.legend li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; align-items: start; }
.legend i { width: 14px; height: 14px; border-radius: 50%; margin-top: 5px; }
.legend small { display: block; color: var(--ink-2); font-size: .8438rem; font-variant-numeric: tabular-nums; }
.legend .l1 i { background: var(--seg-1); }
.legend .l2 i { background: var(--seg-2); }
.legend .l3 i { background: var(--seg-3); }
.legend .l4 i { background: var(--seg-4); }

.example { padding-top: 18px; border-top: 1px solid var(--line); font-size: .9688rem; color: var(--ink-2); }
.example b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Baholash ---------- */

.parts { list-style: none; margin: 0; padding: 0; display: grid; }
.parts li {
  display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 8px 24px; align-items: baseline;
  padding-block: 18px; border-top: 1px solid var(--line);
}
.parts li:last-child { border-bottom: 1px solid var(--line); }
.parts h3 { font-size: 1.5rem; }
.parts p { color: var(--ink-2); font-size: 1rem; }

.caution {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2.15rem); line-height: 1.25; text-wrap: balance;
}
.caution-note { color: var(--ink-2); font-size: .9688rem; max-width: 46ch; }

/* ---------- Mashq ---------- */

.facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 16px 36px; margin: 0; }
.facts dt { font-size: .875rem; color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.45rem; line-height: 1.2; }
.facts .lvl { font-family: var(--serif); }

.exercise { display: grid; gap: 18px; min-width: 0; }
.exercise h3 { font-size: clamp(2rem, 1.4rem + 2vw, 2.6rem); }
.exercise p { color: var(--ink-2); }
.exercise h4 { margin: 10px 0 0; font: 600 1rem/1.3 var(--sans); }
.crit { list-style: none; margin: 0; padding: 0; display: grid; }
.crit li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 14px; align-items: start; padding-block: 14px; border-top: 1px solid var(--line); font-size: 1rem; line-height: 1.45; }
.crit li:last-child { border-bottom: 1px solid var(--line); }

.lvl { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.lvl span { display: inline-flex; gap: 3px; }
.lvl i { width: 5px; height: 14px; border-radius: 2px; background: var(--line); }
.lvl.l1 i:nth-child(-n+1), .lvl.l2 i:nth-child(-n+2), .lvl.l3 i:nth-child(-n+3) { background: var(--ink); }

/* ---------- Admin panel ---------- */

.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); }
.cols > div { display: grid; gap: 12px; align-content: start; }
.cols p { color: var(--ink-2); font-size: 1rem; }
.cols ul { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: .9688rem; }
.cols li { position: relative; padding-left: 20px; }
.cols li::before { content: ""; position: absolute; left: 0; top: .72em; width: 10px; height: 1.5px; background: var(--red); }

/* ---------- Yuklab olish va pastki qism ---------- */

.band.get { background: var(--ink); color: var(--bg); border-top: 0; }
.get h2, .get .lead { color: var(--bg); }
.get .lead { opacity: .82; }
.get .wrap { display: grid; gap: 28px; justify-items: start; }
.get .btn[aria-disabled="true"] { background: var(--bg); color: var(--ink); }

.foot { padding-block: 40px; border-top: 1px solid var(--line); }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.foot p { color: var(--ink-2); font-size: .9063rem; }

/* ---------- Harakat (faqat bir marta, sahifa ochilganda) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .ribbon .r1 { stroke-dasharray: 1; animation: draw 2.2s cubic-bezier(.3, .6, .2, 1) both; }
  .ribbon .r2 { stroke-dasharray: 1; animation: draw 2.6s .15s cubic-bezier(.3, .6, .2, 1) both; }
  .ring-fill { animation: fill 1.4s .35s cubic-bezier(.3, .6, .2, 1) both; }
  @keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes fill { from { stroke-dasharray: 0 100; } to { stroke-dasharray: 82 100; } }
}

/* ---------- Moslashuvchanlik ---------- */

@media (max-width: 980px) {
  .hero .wrap, .split { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 44px; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .nav a:not(.btn) { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .brand-name { font-size: 1.5rem; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .parts li { grid-template-columns: minmax(0, 1fr); }
  .legend { grid-template-columns: minmax(0, 1fr); }
  .score { flex-direction: column; align-items: flex-start; }
  .verdict p { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .actions .btn { flex: 1 1 100%; }
  .facts { grid-template-columns: minmax(0, 1fr); }
}
