/* Davomla landing page (davomla.uz): a 3D scroll story, then questions and a last call.
   Layout after Yashil Vodiy; Davomla's tokens: indigo, the saffron tick, Onest and Manrope. */

:root {
  --ink: #17153B;
  --ink-2: #221F52;
  --ink-3: #2E2A66;
  --saffron: #F2B544;
  --saffron-hi: #F6C463;
  --paper: #FFFFFF;
  --on-ink: #F4F2FF;
  --on-ink-2: rgba(244, 242, 255, 0.74);
  --rule: rgba(244, 242, 255, 0.16);
  --text-2: #3A3670;
  --muted: #5E5A85;
  --line: #E4E2F0;
  --red: #E06A7E;
  --display: "Onest", system-ui, sans-serif;
  --text: "Manrope", system-ui, sans-serif;
  --hdr: 60px;
  --gutter: clamp(16px, 3.4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; accent-color: var(--saffron); }
body { margin: 0; background: var(--ink); color: var(--ink); font: 400 16px/1.55 var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
::selection { background: var(--saffron); color: var(--ink); }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--saffron); color: var(--ink); padding: 10px 16px; border-radius: 12px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 21px var(--display); letter-spacing: -0.01em; color: var(--on-ink); }
.brand img { width: 30px; height: 30px; flex: none; }
.wm { display: inline-flex; align-items: baseline; }
.wm svg { width: 0.66em; height: 0.66em; margin: 0 0.03em; overflow: visible; }
.wm path { fill: none; stroke: var(--saffron); stroke-width: 22; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 22px; border-radius: 999px; border: 2px solid transparent;
  font: 700 15px/1 var(--text); text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s, transform .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-cta { background: var(--saffron); color: var(--ink); }
.btn-cta:hover { background: var(--saffron-hi); }
.btn-light { background: transparent; color: var(--on-ink); border-color: rgba(244, 242, 255, 0.36); }
.btn-light:hover { border-color: var(--on-ink); background: rgba(244, 242, 255, 0.06); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- header ---------- */
.hdr { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--hdr); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 var(--gutter); background: linear-gradient(rgba(10, 9, 30, 0.72), rgba(10, 9, 30, 0)); color: var(--on-ink); transition: background-color .3s; }
.hdr.is-solid { background: var(--ink); }
.hdr-right { display: flex; align-items: center; gap: 12px; }
.langs { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(244, 242, 255, 0.1); }
.langs button { border: 0; background: transparent; min-width: 40px; min-height: 32px; padding: 0 10px; border-radius: 999px; font: 700 12px var(--text); color: var(--on-ink-2); }
.langs button[aria-pressed="true"] { background: var(--on-ink); color: var(--ink); }
.chbar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--saffron); transform-origin: 0 50%; transform: scaleX(0); }
.hdr.is-solid .chbar { opacity: 0; }

/* ---------- story ---------- */
.story { position: relative; height: 1000vh; height: 1000svh; background: var(--ink); }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--ink); color: var(--on-ink); }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .9s ease-out; }
.poster { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 80% at 70% 100%, #3a2a3e 0, var(--ink) 60%); transition: opacity 1s ease-out; }
.stage.is-ready #gl { opacity: 1; }
.stage.is-ready .poster { opacity: 0; }
.loader { position: absolute; left: 50%; bottom: 32px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-radius: 999px;
  background: var(--ink-2); font-size: 13px; pointer-events: none; transition: opacity .4s; }
.loader i { width: 72px; height: 3px; border-radius: 3px; background: var(--ink-3); position: relative; overflow: hidden; }
.loader i::after { content: ''; position: absolute; inset: 0; width: 35%; background: var(--saffron); animation: load 1.3s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.stage.is-ready .loader { opacity: 0; }

.cards { position: absolute; inset: 0; pointer-events: none; }
.card { position: absolute; left: var(--gutter); top: calc(50% + var(--hdr) / 2); width: min(440px, 36vw); padding: 28px 28px 26px; border-radius: 24px;
  background: rgba(23, 21, 59, 0.86); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(244, 242, 255, 0.1); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  opacity: 0; visibility: hidden; transform: translateY(calc(-50% + 14px));
  transition: opacity .45s cubic-bezier(.16, 1, .3, 1), transform .45s cubic-bezier(.16, 1, .3, 1), visibility 0s linear .45s; }
.card.is-active { opacity: 1; visibility: visible; transform: translateY(-50%); pointer-events: auto;
  transition: opacity .45s cubic-bezier(.16, 1, .3, 1), transform .45s cubic-bezier(.16, 1, .3, 1), visibility 0s; }
.eyebrow { font: 700 12px var(--text); letter-spacing: .1em; text-transform: uppercase; color: var(--saffron); margin-bottom: 14px; }
.num { font: 700 13px var(--display); letter-spacing: .1em; color: var(--saffron); margin-bottom: 12px; }
.card h1 { font: 700 clamp(30px, 3.4vw, 50px)/1.06 var(--display); letter-spacing: -0.015em; text-wrap: balance; }
.card h2 { font: 700 clamp(24px, 2.4vw, 36px)/1.1 var(--display); letter-spacing: -0.01em; text-wrap: balance; }
.lede { margin-top: 14px; color: var(--on-ink-2); font-size: 16px; max-width: 40ch; }
.card .actions { margin-top: 22px; }
.meta { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 13px; font-weight: 600; color: var(--on-ink-2); }
.note { margin-top: 14px; font-size: 13px; color: var(--on-ink-2); }
.ex { margin-top: 16px; padding: 10px 14px; border-radius: 14px; background: rgba(244, 242, 255, 0.06); font-size: 14px; color: var(--on-ink-2); }
.ex s { color: var(--red); text-decoration-thickness: 1.5px; }

.goal { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.goal-ab { font: 800 32px var(--display); letter-spacing: -0.01em; }
.goal-ab span { color: var(--saffron); margin: 0 6px; }
.facts { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.facts div { padding: 10px 12px; border-radius: 14px; background: rgba(242, 181, 68, 0.12); }
.facts dt { font-size: 12px; font-weight: 700; color: var(--on-ink-2); }
.facts dd { font: 700 18px var(--display); margin-top: 2px; }

.week { margin-top: 16px; display: grid; gap: 8px; font: 700 14px var(--display); }
.week i { height: 6px; border-radius: 6px; background: rgba(244, 242, 255, 0.14); overflow: hidden; }
.week b { display: block; height: 100%; background: var(--saffron); transform-origin: 0 50%; transform: scaleX(0); }
.tg { margin-top: 14px; padding: 12px; border-radius: 18px; background: rgba(244, 242, 255, 0.07); }
.tg-head { display: flex; align-items: center; gap: 10px; }
.tg-head span { display: grid; line-height: 1.2; font-size: 14px; }
.tg-head small { color: var(--on-ink-2); font-size: 12px; }
.tg-msg { margin-top: 10px; background: #fff; color: var(--ink); border-radius: 14px 14px 14px 4px; padding: 10px 12px; font-size: 14px; }
.tg-btns { margin-top: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tg-btns span { background: rgba(244, 242, 255, 0.12); border-radius: 10px; padding: 9px 10px; text-align: center; font-size: 13px; font-weight: 700; }

.rail { position: absolute; right: clamp(14px, 2.2vw, 32px); top: 50%; transform: translateY(-50%); list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rail button { display: flex; align-items: center; justify-content: flex-end; gap: 10px; border: 0; background: transparent; padding: 7px 0; width: 100%; color: var(--on-ink); }
.rail em { font: 600 12px/1 var(--display); font-style: normal; white-space: nowrap; padding: 9px 12px; border-radius: 999px; background: var(--ink); opacity: 0; transform: translateX(6px); transition: opacity .25s, transform .25s; }
.rail button::after { content: ''; width: 16px; height: 3px; border-radius: 3px; background: var(--on-ink); opacity: .5; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); transition: width .25s, background-color .25s, opacity .25s; }
.rail button:hover em, .rail button.is-active em { opacity: 1; transform: none; }
.rail button.is-active::after { width: 36px; background: var(--saffron); opacity: 1; }

.hint { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px;
  font: 600 12px/1 var(--display); letter-spacing: .02em; color: var(--on-ink); text-shadow: 0 1px 8px rgba(0, 0, 0, .6); transition: opacity .4s; pointer-events: none; }
.hint i { width: 2px; height: 34px; border-radius: 2px; background: var(--saffron); animation: drip 1.8s cubic-bezier(.16, 1, .3, 1) infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.hint.gone, .stage:not(.is-ready) .hint { opacity: 0; }
.steps { display: none; }

/* labels pinned to the scene */
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; visibility: hidden; opacity: 0; will-change: transform, opacity; translate: -50% -100%; }
.lbl span { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 9px 13px; border-radius: 999px; font: 700 13px/1.2 var(--text);
  background: rgba(23, 21, 59, 0.9); color: var(--on-ink); border: 1px solid rgba(244, 242, 255, 0.16); box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .6); }
.lbl-you span { background: var(--saffron); color: var(--ink); border-color: var(--saffron); }
.lbl-you::after, .lbl-goal::after { content: ''; display: block; width: 2px; height: 18px; margin: 0 auto; background: var(--saffron); }
.lbl-past .tk { width: 10px; height: 6px; border: solid var(--saffron); border-width: 0 0 2.5px 2.5px; transform: translateY(-2px) rotate(-45deg); }
.lbl-skill span { flex-direction: column; gap: 0; padding: 8px 13px; border-radius: 14px; }
.lbl-skill small { font: 600 11px var(--text); color: var(--on-ink-2); }
.lbl-skill b { font: 800 16px var(--display); color: var(--saffron); }
.lbl-gap span { max-width: 240px; white-space: normal; border-radius: 14px; }
.lbl-gap i { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--saffron); color: var(--ink); font: 700 12px var(--display); font-style: normal; }
.lbl-week span { padding: 8px 12px; font-size: 12px; }
.lbl-goal span { background: var(--saffron); color: var(--ink); border-color: var(--saffron); font: 700 15px var(--display); padding: 8px 14px 8px 8px; }
.lbl-goal b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--saffron); font: 800 14px var(--display); }

.fallback-note { position: relative; max-width: 720px; margin: 0 auto 24px; padding: 0 16px; text-align: center; display: grid; gap: 14px; justify-items: center; color: var(--on-ink-2); }

.story.is-static { height: auto; }
.story.is-static .stage { position: relative; height: auto; overflow: visible; padding: calc(var(--hdr) + 40px) 0 64px; }
.story.is-static #gl, .story.is-static .poster, .story.is-static .labels, .story.is-static .loader,
.story.is-static .rail, .story.is-static .hint, .story.is-static .steps, .story.is-static .week { display: none; }
.story.is-static .cards { position: static; display: grid; gap: 16px; padding: 0 16px; pointer-events: auto; }
.story.is-static .card { position: static; opacity: 1; visibility: visible; transform: none; width: 100%; max-width: 720px; margin: 0 auto; }

/* ---------- after the story ---------- */
.faq { background: var(--paper); padding: 96px max(var(--gutter), calc((100vw - 820px) / 2)) 72px; }
.faq h2 { font: 700 clamp(28px, 4vw, 44px) var(--display); letter-spacing: -0.01em; margin-bottom: 24px; }
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; font: 700 18px var(--text); }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 600 24px var(--display); color: var(--muted); transition: transform .2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 0 22px; color: var(--text-2); max-width: 40em; }
details a { color: var(--ink); }

.final { background: var(--paper); padding: 0 var(--gutter) 48px; }
.final-in { border-radius: 32px; background: var(--ink); color: var(--on-ink); padding: clamp(40px, 7vw, 80px) 24px;
  display: grid; justify-items: center; text-align: center; gap: 16px; }
.final-in img { width: 72px; height: 72px; }
.final-wm { font: 800 clamp(40px, 8vw, 84px)/1 var(--display); letter-spacing: -0.01em; }
.final-line { font-size: clamp(17px, 2vw, 21px); color: var(--on-ink-2); }
.final .actions { justify-content: center; margin-top: 10px; }

.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; padding: 8px var(--gutter) 40px; background: var(--paper); font-size: 14px; color: var(--muted); }
.foot a { color: var(--muted); }

/* ---------- phones ---------- */
@media (max-width: 759px) {
  :root { --hdr: 56px; }
  .hdr-cta { display: none; }
  .brand { font-size: 18px; }
  .card { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 56svh; overflow-y: auto; padding: 20px 18px 18px; border-radius: 22px; transform: translateY(12px); }
  .card.is-active { transform: none; }
  .card h1 { font-size: 28px; }
  .card h2 { font-size: 23px; }
  .lede { font-size: 15px; margin-top: 10px; }
  .card .actions { margin-top: 16px; }
  .card[data-ch="5"] .lede, .card[data-ch="5"] .note, .card[data-ch="4"] .note { display: none; }
  .goal { margin-top: 12px; padding-top: 12px; }
  .goal-ab { font-size: 26px; }
  .rail { display: none; }
  .steps { position: absolute; left: 8px; right: 8px; top: calc(var(--hdr) + 2px); display: flex; gap: 3px; z-index: 2; }
  .steps button { flex: 1; height: 30px; border: 0; background: transparent; padding: 0; display: flex; align-items: center; }
  .steps i { display: block; width: 100%; height: 3px; border-radius: 3px; background: var(--on-ink); opacity: .5; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
  .steps .is-done i { background: var(--saffron); opacity: .6; }
  .steps .is-active i { background: var(--saffron); opacity: 1; height: 5px; }
  .chbar { display: none; }
  .hint { top: calc(var(--hdr) + 40px); bottom: auto; flex-direction: row; white-space: nowrap; }
  .hint i { display: none; }
  .lbl span { font-size: 12px; padding: 8px 11px; }
  .lbl-gap span { max-width: 170px; }
  .lbl-week { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .card { left: 8px; right: auto; top: calc(var(--hdr) + 6px); bottom: 8px; width: min(380px, 46vw); max-height: none; transform: none; padding: 16px 18px; overflow-y: auto; }
  .card.is-active { transform: none; }
  .card .lede { display: none; }
  .steps, .hint, .rail { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hint i, .loader i::after { animation: none; }
  .card { transition: opacity .2s linear, visibility 0s; }
  .btn { transition: none; }
}
