:root {
  --bg: #070b1d;
  --lens-bg: #0d1638;
  --text: #ffffff;
  --text-70: rgba(255, 255, 255, 0.7);
  --text-60: rgba(255, 255, 255, 0.6);
  --text-50: rgba(255, 255, 255, 0.5);
  --text-40: rgba(255, 255, 255, 0.4);
  --accent-soft: #8fb4ff;
  --ink: #0a1024;
  --field-fill: rgba(255, 255, 255, 0.08);
  --field-stroke: rgba(255, 255, 255, 0.25);
  --error: #ff8a8a;

  /* Scene placement: the design frame (1440×900, 834×1112 or 390×844) scaled by --k and shifted by --sx/--sy; set in app.js */
  --k: 1;
  --sx: 0px;
  --sy: 0px;
  --scene-h: 900px;
  /* Lens: centre in scene coordinates and diameter */
  --cx: 1030px;
  --cy: 390px;
  --lens: 300px;
  --lens-zoom: 1.18;
  /* Where the text starts on tablet and phone (below the phones), in CSS pixels */
  --hero-top: 0px;

  /* Desktop frame values; tablet and phone override them below */
  --gutter: 96px;
  --head-top: 48px;
  --mark: 40px;
  --glow-x: 1090px;
  --glow-y: 510px;
  --glow-s: 900px;
  --blur: 13px;
  --field-h: 72px;
  --field-pl: 27px;
  --field-fs: 20px;
  --btn-h: 60px;
  --note-left: 28px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  position: relative;
  min-height: 100svh;
}

/* ---------- Scene: glow, blurred phones, lens ---------- */

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.scene > * {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

.scene__glow {
  width: 1380px;
  height: 1380px;
  /* The SVG is a 900px disc with 240px of blur bleed on each side */
  transform:
    translate(var(--sx), var(--sy)) scale(var(--k))
    translate(calc(var(--glow-x) - var(--glow-s) * 0.7667), calc(var(--glow-y) - var(--glow-s) * 0.7667))
    scale(calc(var(--glow-s) / 900px));
}

.scene__phones {
  width: 1440px;
  height: 900px;
}

.scene__phones--blurred {
  transform: translate(var(--sx), var(--sy)) scale(var(--k));
  filter: blur(var(--blur));
  opacity: 0.9;
}

.phone {
  position: absolute;
  display: block;
  height: auto;
}

.phone--f6 { left: 650px; top: 250px; width: 290px; }
.phone--z5 { left: 1130px; top: 250px; width: 290px; }
.phone--g02 { left: 830px; top: 110px; width: 400px; }

.scene__shade {
  width: 760px;
  height: 900px;
  transform: translate(var(--sx), var(--sy)) scale(var(--k));
  background: linear-gradient(90deg, #070b1d 0%, rgba(7, 11, 29, 0.9) 72%, rgba(7, 11, 29, 0) 100%);
}

.lens {
  width: var(--lens);
  height: var(--lens);
  transform:
    translate(var(--sx), var(--sy))
    scale(var(--k))
    translate(calc(var(--cx) - var(--lens) / 2), calc(var(--cy) - var(--lens) / 2));
  will-change: transform;
}

.lens__sharp {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--lens-bg);
}

.lens__sharp .scene__phones {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  transform:
    translate(
      calc(var(--lens) / 2 - var(--cx) * var(--lens-zoom)),
      calc(var(--lens) / 2 - var(--cy) * var(--lens-zoom))
    )
    scale(var(--lens-zoom));
}

.lens__rim {
  position: absolute;
  /* The rim SVG is 400px for a 300px lens: the extra third is the drop shadow */
  left: calc(var(--lens) / -6);
  top: calc(var(--lens) / -6);
  width: calc(var(--lens) * 4 / 3);
  height: calc(var(--lens) * 4 / 3);
}

/* ---------- Page content ---------- */

.page {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 0 var(--gutter) 36px;
}

.top {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: var(--head-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.touchpad {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: calc(var(--mark) * 0.22);
  color: inherit;
  text-decoration: none;
}

.brand__mark {
  width: var(--mark);
  height: var(--mark);
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(180deg, #3f7bff 0%, #2450d6 100%);
  flex: none;
}

.brand__mark img {
  display: block;
  width: calc(var(--mark) * 1.18);
  height: calc(var(--mark) * 1.18);
  margin: calc(var(--mark) * -0.02) 0 0 calc(var(--mark) * -0.09);
  max-width: none;
}

.brand__name {
  font-size: calc(var(--mark) * 0.78);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.04em;
}

.lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-60);
}

.lang__item {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px 2px;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  cursor: pointer;
  transition: color 0.2s;
}

.lang__item:hover,
.lang__item[aria-pressed="true"] {
  color: var(--text);
}

.lang__item:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
  border-radius: 4px;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 160px 0 56px;
  max-width: 640px;
}

.hero__label {
  margin: 0 0 17px 4px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.4em;
  color: var(--accent-soft);
}

.hero__title {
  margin: 0 0 30px -2px;
  font-size: clamp(44px, 5.84vw, 84px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero__lead {
  margin: 0 0 52px 4px;
  max-width: 440px;
  font-size: 20px;
  line-height: 1.3;
  color: var(--text-70);
}

/* ---------- Form ---------- */

.lead-form {
  width: min(520px, 100%);
}

.lead-form__field {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--field-h);
  padding: 5px 6px 5px var(--field-pl);
  border-radius: calc(var(--field-h) / 2);
  background: var(--field-fill);
  border: 1px solid var(--field-stroke);
  transition: border-color 0.2s, background-color 0.2s;
}

.lead-form__field:focus-within {
  border-color: rgba(255, 255, 255, 0.5);
}

.lead-form.is-invalid .lead-form__field {
  border-color: var(--error);
}

.lead-form__prefix {
  font-size: var(--field-fs);
  font-weight: 500;
  line-height: 1.3;
  flex: none;
}

.lead-form__input {
  flex: 1;
  min-width: 0;
  margin-left: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: var(--field-fs);
  line-height: 1.3;
  letter-spacing: 0.02em;
  outline: none;
}

.lead-form__input::placeholder {
  color: var(--text-40);
}

.lead-form__submit {
  appearance: none;
  flex: none;
  height: var(--btn-h);
  padding: 0 20px;
  border: 0;
  border-radius: calc(var(--btn-h) / 2);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s, background-color 0.2s, opacity 0.2s;
}

.lead-form__submit-short { display: none; }

.lead-form__submit:hover { background: #eef2ff; }
.lead-form__submit:active { transform: scale(0.98); }
.lead-form__submit:disabled { cursor: default; opacity: 0.7; }

.lead-form__submit:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

.lead-form__note {
  margin: 14px 0 0 var(--note-left);
  font-size: 14px;
  line-height: 1.3;
  color: var(--text-50);
  transition: color 0.2s;
}

.lead-form.is-invalid .lead-form__note,
.lead-form.is-error .lead-form__note {
  color: var(--error);
}

.lead-form.is-done .lead-form__note {
  color: var(--accent-soft);
}

.lead-form.is-done .lead-form__field {
  border-color: rgba(143, 180, 255, 0.5);
}

/* ---------- Footer ---------- */

.bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.social {
  display: flex;
  gap: 26px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.social a,
.social span {
  color: var(--text-70);
  text-decoration: none;
  transition: color 0.2s;
}

.social a:hover { color: var(--text); }

.copyright {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-40);
}

/* ---------- Tablet (834 frame) and phone (390 frame): phones on top, text below ---------- */

[data-layout="tablet"],
[data-layout="phone"] {
  --sx: 0px;
  --sy: 0px;
}

[data-layout="tablet"] .scene,
[data-layout="phone"] .scene {
  position: absolute;
  inset: auto 0 auto 0;
  top: 0;
  height: calc(var(--scene-h) * var(--k));
}

[data-layout="tablet"] .scene__shade,
[data-layout="phone"] .scene__shade {
  background: linear-gradient(180deg, rgba(7, 11, 29, 0) 0%, rgba(7, 11, 29, 0.92) 22%, #070b1d 100%);
}

[data-layout="tablet"] .touchpad,
[data-layout="phone"] .touchpad {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--hero-top);
  touch-action: none;
}

[data-layout="tablet"] .hero,
[data-layout="phone"] .hero {
  justify-content: flex-start;
  padding-top: var(--hero-top);
  max-width: none;
}

[data-layout="tablet"] .bottom,
[data-layout="phone"] .bottom {
  margin-top: auto;
}

[data-layout="tablet"] .copyright,
[data-layout="phone"] .copyright {
  display: none;
}

[data-layout="tablet"] .social,
[data-layout="phone"] .social {
  gap: 6px;
}

[data-layout="tablet"] .social > * + *::before,
[data-layout="phone"] .social > * + *::before {
  content: "·";
  margin-right: 6px;
  color: var(--text-70);
}

/* Tablet frame: 834 wide */
[data-layout="tablet"] {
  --gutter: 64px;
  --head-top: 44px;
  --glow-x: 417px;
  --glow-y: 485px;
  --glow-s: 917px;
  --blur: 24px;
  --note-left: 28px;
}

[data-layout="tablet"] .phone--f6 { left: 59.6px; top: 240px; width: 270px; }
[data-layout="tablet"] .phone--z5 { left: 504.4px; top: 240px; width: 270px; }
[data-layout="tablet"] .phone--g02 { left: 227px; top: 110px; width: 380px; }

[data-layout="tablet"] .scene__shade {
  width: 834px;
  height: 642px;
  transform: translate(var(--sx), var(--sy)) scale(var(--k)) translate(0, 470px);
}

[data-layout="tablet"] .hero__title {
  font-size: clamp(44px, 8.15vw, 68px);
  margin-bottom: 22px;
}

[data-layout="tablet"] .hero__lead {
  margin-bottom: 32px;
}

[data-layout="tablet"] .lead-form {
  width: min(560px, 100%);
}

[data-layout="tablet"] .page {
  padding-bottom: 34px;
}

/* Phone frame: 390 wide */
[data-layout="phone"] {
  --gutter: 20px;
  --head-top: 54px;
  --mark: 30px;
  --glow-x: 195px;
  --glow-y: 280px;
  --glow-s: 429px;
  --blur: 16px;
  --field-h: 60px;
  --field-pl: 20px;
  --field-fs: 17px;
  --btn-h: 48px;
  --note-left: 20px;
}

[data-layout="phone"] .phone--f6 { left: -19.2px; top: 180px; width: 160px; }
[data-layout="phone"] .phone--z5 { left: 249.2px; top: 180px; width: 160px; }
[data-layout="phone"] .phone--g02 { left: 80px; top: 104px; width: 230px; }

[data-layout="phone"] .scene__shade {
  width: 390px;
  height: 514px;
  transform: translate(var(--sx), var(--sy)) scale(var(--k)) translate(0, 330px);
}

[data-layout="phone"] .lang {
  font-size: 12px;
}

[data-layout="phone"] .hero__label {
  font-size: 13px;
  margin-bottom: 9px;
}

[data-layout="phone"] .hero__title {
  font-size: clamp(30px, 9.75vw, 38px);
  line-height: 1.3;
  margin: 0 0 14px;
}

[data-layout="phone"] .hero__lead {
  font-size: 15px;
  margin-bottom: 22px;
}

[data-layout="phone"] .lead-form {
  width: 100%;
}

[data-layout="phone"] .lead-form__field {
  padding-right: 6px;
}

[data-layout="phone"] .lead-form__submit {
  padding: 0 18px;
}

[data-layout="phone"] .lead-form__submit-long { display: none; }
[data-layout="phone"] .lead-form__submit-short { display: inline; }

[data-layout="phone"] .lead-form__note {
  margin-top: 12px;
  font-size: 12px;
}

[data-layout="phone"] .social {
  font-size: 13px;
}

[data-layout="phone"] .page {
  padding-bottom: 23px;
}

@media (prefers-reduced-motion: reduce) {
  .lens { transition: none; }
}
