:root {
  --bg: #08081f;
  --bg-2: #110f37;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-2: rgba(255, 255, 255, 0.09);
  --surface-3: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.11);
  --border-2: rgba(255, 255, 255, 0.22);
  --text: #f3f3ff;
  --muted: #a7a6d4;
  --faint: #6f6ea3;
  --brand: #4a42ff;
  --brand-hi: #7b74ff;
  --purple: #9a4dff;
  --teal: #35d0c6;
  --good: #3ee0a8;
  --warn: #ffb547;
  --grad: linear-gradient(120deg, #4a42ff 0%, #9a4dff 50%, #35d0c6 100%);
  --grad-soft: linear-gradient(120deg, rgba(74, 66, 255, 0.35), rgba(154, 77, 255, 0.3), rgba(53, 208, 198, 0.3));
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --font: "Plus Jakarta Sans", "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-he: "Rubik", "Plus Jakarta Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-he);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.num, .latin { font-family: var(--font); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- animated background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background:
  radial-gradient(1200px 700px at 85% -10%, #1a1660 0%, transparent 60%),
  radial-gradient(900px 600px at -10% 110%, #0f2a4a 0%, transparent 60%),
  linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); }
.bg::after { content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 75%); }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.45; animation: drift 22s ease-in-out infinite alternate; }
.b1 { width: 420px; height: 420px; background: #4a42ff; top: -120px; right: -80px; }
.b2 { width: 360px; height: 360px; background: #9a4dff; bottom: -140px; left: -100px; animation-delay: -7s; opacity: 0.32; }
.b3 { width: 260px; height: 260px; background: #35d0c6; top: 45%; left: 55%; animation-delay: -12s; opacity: 0.18; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(-60px, 40px) scale(1.15); } }

/* ---------- layout ---------- */
.top { position: relative; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; max-width: 1100px; margin: 0 auto; }
.top .logo img { height: 30px; width: auto; }
.top-link { font-size: 14px; color: var(--muted); text-decoration: none; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.top-link:hover { color: var(--text); border-color: var(--border-2); }
main { max-width: 760px; margin: 0 auto; padding: 8px 16px 64px; }
.screen { display: none; }
.screen.active { display: block; animation: screenIn 0.5s cubic-bezier(.2,.7,.2,1); }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- home ---------- */
.home { text-align: center; padding-top: 4vh; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: #d9d8ff; padding: 6px 14px 6px 12px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 12px var(--teal); }
.home h1 { font-size: clamp(40px, 8vw, 72px); line-height: 1.05; margin: 22px 0 14px; font-weight: 800; letter-spacing: -0.5px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home .lead { font-size: clamp(17px, 2.4vw, 20px); color: var(--muted); max-width: 560px; margin: 0 auto 26px; }
.facts { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.fact { display: flex; align-items: center; gap: 8px; font-size: 14.5px; padding: 9px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.fact b { font-family: var(--font); font-weight: 700; }
.fact svg { width: 18px; height: 18px; color: var(--brand-hi); flex: none; }
.dims-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; max-width: 640px; margin: 0 auto 34px; }
.dim-chip { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); line-height: 1.25; }
.dim-chip .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); }
.dim-chip .ico svg { width: 22px; height: 22px; }
.start-label { font-size: 15px; color: var(--muted); margin-bottom: 12px; }
.start-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 14px; padding: 15px 26px;
  font-weight: 700; font-size: 17px; text-decoration: none; transition: transform .15s ease, box-shadow .2s ease, background .2s; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--grad); background-size: 140% 100%; color: #fff; box-shadow: 0 12px 34px -10px rgba(98, 76, 255, 0.8); }
.btn-primary:hover { box-shadow: 0 16px 40px -8px rgba(98, 76, 255, 0.95); transform: translateY(-1px); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-li { background: #0a66c2; color: #fff; }
.btn-li:hover { background: #0b74dc; }
.btn svg { width: 20px; height: 20px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.start-row .btn { min-width: 210px; }
.fine { font-size: 13px; color: var(--faint); margin-top: 26px; }
.fine a { color: var(--muted); }

/* ---------- quiz ---------- */
.qtop { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 12px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding: 7px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.back:hover:not([disabled]) { color: var(--text); }
.back[disabled] { opacity: .35; cursor: default; }
.back svg { width: 16px; height: 16px; }
.counter { font-size: 14px; color: var(--muted); }
.counter b { color: var(--text); font-family: var(--font); }
.progress { display: grid; gap: 5px; margin-bottom: 22px; }
.seg { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; position: relative; }
.seg i { position: absolute; inset: 0 0 0 auto; width: 0; background: var(--grad); border-radius: 99px; transition: width .45s cubic-bezier(.2,.7,.2,1); }
.seg.done i { width: 100%; }
.dimtag { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: #dcdbff; padding: 6px 12px 6px 10px; border-radius: 10px; background: var(--grad-soft); border: 1px solid var(--border); }
.dimtag svg { width: 17px; height: 17px; }
.qcard { margin-top: 14px; }
.qtype { font-size: 12.5px; letter-spacing: .3px; color: var(--teal); font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.qtype.challenge { color: #ffb547; }
.qtext { font-size: clamp(21px, 3.4vw, 27px); font-weight: 700; line-height: 1.35; margin: 0 0 8px; }
.qhint { color: var(--muted); font-size: 15px; margin: 0 0 18px; }
.scenario { font-size: clamp(18px, 2.6vw, 21px); font-weight: 500; line-height: 1.5; margin: 0 0 10px; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); border-inline-start: 3px solid var(--brand-hi); }
.scenario.challenge { border-inline-start-color: var(--warn); }
.qask { font-weight: 700; font-size: 18px; margin: 18px 0 12px; }
.prompt-box { font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.opts { display: grid; gap: 10px; }
.opt { width: 100%; display: flex; align-items: center; gap: 14px; text-align: start; padding: 15px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  font-size: 17px; line-height: 1.45; transition: background .15s, border-color .15s, transform .12s; }
@media (hover: hover) { .opt:hover { background: var(--surface-2); border-color: var(--border-2); } }
.opt:active { transform: scale(0.995); }
.opt .key { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-family: var(--font); }
.opt.sel { background: linear-gradient(120deg, rgba(74,66,255,.35), rgba(154,77,255,.28)); border-color: rgba(160,150,255,.75); box-shadow: 0 0 0 3px rgba(123,116,255,.18); }
.opt.sel .key { background: var(--brand); color: #fff; border-color: transparent; }
.opt.long { font-size: 16px; align-items: flex-start; }
.opt .msg { font-family: var(--font-he); color: #e9e8ff; }
.opt .msg::before { content: "\0022"; color: var(--brand-hi); font-weight: 800; margin-inline-end: 2px; }
.opt .msg::after { content: "\0022"; color: var(--brand-hi); font-weight: 800; margin-inline-start: 2px; }
.opt.long .key { margin-top: 1px; }
.scale .opt { padding: 14px 18px; }
.scale .opt .bar { flex: none; display: flex; gap: 3px; }
.scale .opt .bar i { width: 6px; height: 16px; border-radius: 3px; background: var(--surface-3); }
.scale .opt .bar i.on { background: var(--brand-hi); }
.kbd-hint { margin-top: 14px; font-size: 12.5px; color: var(--faint); text-align: center; }
@media (hover: none) { .kbd-hint { display: none; } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 30px); opacity: 0; z-index: 30; padding: 10px 16px; border-radius: 12px;
  background: rgba(20, 18, 60, .92); border: 1px solid var(--border-2); font-size: 14.5px; display: flex; gap: 8px; align-items: center; transition: all .35s cubic-bezier(.2,.7,.2,1); backdrop-filter: blur(8px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 18px; height: 18px; color: var(--good); }
.fade-swap { animation: swap .35s cubic-bezier(.2,.7,.2,1); }
@keyframes swap { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.fade-swap.back-anim { animation-name: swapBack; }
@keyframes swapBack { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* ---------- analyzing ---------- */
.analyzing { text-align: center; padding-top: 12vh; }
.orb { width: 120px; height: 120px; margin: 0 auto 30px; border-radius: 50%; background: conic-gradient(from 0deg, #4a42ff, #9a4dff, #35d0c6, #4a42ff); animation: spin 1.6s linear infinite; position: relative; filter: drop-shadow(0 0 30px rgba(123,116,255,.6)); }
.orb::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--bg); }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { list-style: none; padding: 0; margin: 0 auto; max-width: 320px; text-align: start; display: grid; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--faint); transition: color .3s; }
.steps li .ck { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--faint); display: grid; place-items: center; flex: none; }
.steps li.on { color: var(--text); }
.steps li.on .ck { border-color: var(--good); background: var(--good); }
.steps li.on .ck::after { content: ""; width: 8px; height: 4px; border: 2px solid #08081f; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

/* ---------- result ---------- */
.result-hero { text-align: center; padding-top: 2vh; }
.r-kicker { font-size: 14px; color: var(--muted); letter-spacing: .3px; }
.dial { position: relative; width: 240px; height: 240px; margin: 18px auto 6px; }
.dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial .center { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; }
.dial .big { font-family: var(--font); font-size: 92px; font-weight: 800; line-height: 1; letter-spacing: -2px; }
.dial .of { font-family: var(--font); color: var(--muted); font-size: 16px; margin-top: 2px; }
.level-name { font-size: clamp(28px, 5vw, 38px); font-weight: 800; margin: 10px 0 2px; }
.level-en { font-family: var(--font); font-size: 15px; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; }
.level-desc { max-width: 560px; margin: 14px auto 0; color: #d6d5f5; font-size: 17.5px; }
.scale9 { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; max-width: 520px; margin: 26px auto 6px; direction: ltr; }
.scale9 span { height: 10px; border-radius: 3px; background: var(--surface-2); position: relative; }
.scale9 span.on { background: var(--grad); background-size: 900% 100%; }
.scale9 span.me { outline: 2px solid #fff; outline-offset: 2px; }
.scale9-labels { display: flex; justify-content: space-between; max-width: 520px; margin: 0 auto; font-size: 12.5px; color: var(--faint); direction: ltr; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-top: 18px; }
.card h2 { font-size: 21px; margin: 0 0 4px; }
.card .sub { color: var(--muted); font-size: 15px; margin: 0 0 16px; }
.profile { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; }
.radar svg { width: 100%; height: auto; overflow: visible; }
.radar text { font-family: var(--font-he); font-size: 11.5px; fill: var(--muted); }
.bars { display: grid; gap: 13px; }
.bar-row .lbl { display: flex; justify-content: space-between; font-size: 14.5px; margin-bottom: 5px; }
.bar-row .lbl b { font-family: var(--font); font-weight: 700; }
.bar-row .track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-row .fill { height: 100%; width: 0; border-radius: 99px; background: var(--grad); transition: width 1s cubic-bezier(.2,.7,.2,1); }
.insights { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ins { padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.ins h3 { margin: 0 0 6px; font-size: 16.5px; display: flex; gap: 8px; align-items: center; }
.ins h3 svg { width: 18px; height: 18px; }
.ins.strong h3 { color: var(--good); }
.ins.grow h3 { color: var(--warn); }
.ins p { margin: 0; font-size: 15px; color: #d4d3f2; }
.ins p + p { margin-top: 8px; }
.ins .tip { color: var(--muted); }

/* certificate */
.cert-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 5px; }
.field input { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--border-2); background: rgba(0,0,0,.25); font-size: 16px; outline: none; }
.field input:focus { border-color: var(--brand-hi); box-shadow: 0 0 0 3px rgba(123,116,255,.25); }
.seg-toggle { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.seg-toggle button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.seg-toggle button.on { background: #fff; color: #14123f; font-weight: 700; }
.cert-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cert-preview { border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.cert-preview canvas { width: 100%; height: auto; display: block; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.actions .btn { font-size: 15.5px; padding: 12px 18px; }
.verify-line { margin-top: 12px; font-size: 14px; color: var(--muted); word-break: break-all; }
.verify-line a { color: #cfccff; }
.post-box { margin-top: 14px; padding: 14px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px dashed var(--border-2); font-size: 15px; white-space: pre-wrap; color: #dcdbf7; }
.cta { text-align: center; background: linear-gradient(135deg, rgba(74,66,255,.25), rgba(154,77,255,.18) 50%, rgba(53,208,198,.16)); border-color: rgba(160,150,255,.35); }
.cta h2 { font-size: 23px; }
.cta p { color: #d6d5f5; max-width: 520px; margin: 6px auto 16px; }
.again { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.note { font-size: 13px; color: var(--faint); margin-top: 10px; }

/* ---------- about page ---------- */
.prose { max-width: 720px; margin: 0 auto; }
.prose h1 { font-size: clamp(30px, 5vw, 42px); margin: 20px 0 8px; }
.prose h2 { font-size: 22px; margin: 34px 0 8px; }
.prose p, .prose li { color: #d6d5f5; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 10px 0; }
.prose th, .prose td { text-align: start; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--muted); font-weight: 500; }

/* ---------- responsive ---------- */
@media (max-width: 680px) {
  body { font-size: 16px; }
  .top { padding: 12px 16px; }
  .top .logo img { height: 25px; }
  .dims-row { grid-template-columns: repeat(4, 1fr); row-gap: 14px; }
  .start-row .btn { width: 100%; min-width: 0; }
  .profile, .insights, .cert-form { grid-template-columns: 1fr; }
  .dial { width: 200px; height: 200px; }
  .dial .big { font-size: 78px; }
  .card { padding: 18px 16px; }
  .opt { padding: 14px 14px; font-size: 16.5px; }
  .actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
