/* ══════════════════════════════════════
   Visiology — 3 июня · Teaser Landing
   ══════════════════════════════════════ */

/* ── RESET ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── VARIABLES ── */
:root {
  --bg: #08080c;
  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.48);
  --text-dim: rgba(255, 255, 255, 0.28);
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.22);
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --accent: rgba(160, 160, 175, 0.15);

  --side-padding: 3.5rem;
  --top-padding: 2.5rem;
}

/* ── BASE ── */
html,
body {
  height: 100%;
  font-family: 'Onest', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* ══════════════════════════════════════
   VIDEO BACKGROUND
   ══════════════════════════════════════ */
.video-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.video-wrap video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

.video-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, transparent 0%, var(--bg) 100%),
    linear-gradient(to bottom, rgba(8, 8, 12, 0.35) 0%, rgba(8, 8, 12, 0.55) 50%, rgba(8, 8, 12, 0.8) 100%);
  z-index: 1;
}

/* ══════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════ */
.page {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(32px, var(--top-padding)) max(32px, var(--side-padding));
}

/* ══════════════════════════════════════
   HEADER
   ══════════════════════════════════════ */
header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  animation: fadeDown 0.8s ease forwards;
}

.logo {
  height: 20px;
  width: auto;
  display: block;
}

.date-badge {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: var(--surface);
}

.date-badge .dot {
  font-size: 18px;
  vertical-align: middle;
  line-height: 1;
}

/* ══════════════════════════════════════
   HERO SECTION
   ══════════════════════════════════════ */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* ── Swap container (steps 1 & 2 overlap) ── */
.swap-container {
  position: fixed;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 720px;
  perspective: 1200px;
  text-align: center;
  z-index: 2;
}

.swap-item {
  width: 100%;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.swap-item[data-step="2"] {
  position: absolute;
  top: 0;
  left: 0;
}

.swap-item[data-step="3"] {
  position: absolute;
  top: 0;
  left: 0;
}

/* Step 1: fade in */
.swap-item[data-step="1"].is-visible {
  animation: fadeIn 1.5s ease forwards;
}

/* Step 1: fade out */
.swap-item[data-step="1"].is-hidden {
  animation: fadeOut 0.8s ease forwards;
}

/* Step 2: fade out */
.swap-item[data-step="2"].is-hidden {
  animation: fadeOut 0.8s ease forwards;
}

/* Step 2: flip in */
.swap-item[data-step="2"].is-visible {
  animation: flipIn 0.8s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

/* Step 3: fade out */
.swap-item[data-step="3"].is-hidden {
  animation: fadeOut 0.8s ease forwards;
}

/* Step 3: flip in */
.swap-item[data-step="3"].is-visible {
  animation: flipIn 0.8s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes flipOut {
  0% {
    transform: rotateX(0deg);
    opacity: 1;
  }
  100% {
    transform: rotateX(-90deg);
    opacity: 0;
  }
}

@keyframes flipIn {
  0% {
    transform: rotateX(90deg);
    opacity: 0;
  }
  100% {
    transform: rotateX(0deg);
    opacity: 1;
  }
}

/* ── Reveal animation system ── */
.reveal-block {
  opacity: 0;
  transform: translateY(0);
}

.reveal-block.is-visible {
  opacity: 1;
}

.reveal-mask {
  overflow: hidden;
}

.swap-container .reveal-mask {
  overflow: visible;
}

.swap-container .reveal-mask > * {
  transform: none;
  transition: none;
}

.swap-container .reveal-block.is-visible .reveal-mask > * {
  transform: none;
}

.reveal-mask > * {
  transform: translateY(110%);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-block.is-visible .reveal-mask > * {
  transform: translateY(0);
}

/* Stagger lines within the same step */
.reveal-block.is-visible .reveal-mask:nth-child(2) > * {
  transition-delay: 0.15s;
}

.headline {
  font-size: 36px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  padding-bottom: 0.1em;
}

.headline-dim {
  font-size: 36px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-secondary);
  padding-bottom: 0.1em;
}

.headline-dim.last {
  margin-bottom: 2rem;
}

.headline-dim + .headline-dim {
  margin-top: 0.1rem;
}

.top-text {
  font-size: 36px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  margin-bottom: 1rem;
  padding-bottom: 0.1em;
}

.mid-text {
  font-size: 36px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
  margin-bottom: 2.2rem;
  padding-bottom: 0.1em;
  white-space: nowrap;
}

.highlight-date {
  display: inline-block;
  vertical-align: middle;
  color: #FEE121;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.2em 0.5em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: var(--surface);
  white-space: nowrap;
  line-height: 1.15;
}

/* Step 4: sub-text + form fade in */
.reveal-block[data-step="4"] {
  transition: opacity 0.8s ease;
}

.reveal-block[data-step="4"].is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Keep text in place while fading out — no slide-down shift */
.reveal-block[data-step="4"].is-hidden .reveal-mask > * {
  transform: translateY(0);
}

.reveal-block[data-step="5"] {
  opacity: 0;
}

.reveal-block[data-step="5"].is-visible {
  animation: fadeUp 0.8s ease forwards;
}

.sub-text {
  display: inline-block;
  font-size: 16px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  margin-bottom: 1.8rem;
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-hover);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.form-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.fields input {
  font-family: 'Onest', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.25s, background 0.25s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.fields input::placeholder {
  color: var(--text-dim);
  font-weight: 300;
}

.fields input:focus {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.07);
}

.f-name {
  width: 200px;
}

.f-email {
  width: 200px;
}

.f-company {
  width: 220px;
}

.cta {
  font-family: 'Onest', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  padding: 14px 40px;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.3s, border-color 0.3s, transform 0.2s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-top: 4px;
}

.cta:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
}

.cta:active {
  transform: translateY(0);
}

.assistance-text {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-dim);
  line-height: 1.6;
  margin-top: 1.5rem;
  text-align: center;
}

.assistance-link {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--text-dim);
  transition: opacity 0.3s ease;
}

.assistance-link:hover {
  opacity: 0.8;
}

.consent-text {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.22);
  line-height: 1.5;
  margin-top: 1.25rem;
  text-align: center;
}

.consent-link {
  color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.consent-link:hover {
  color: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ══════════════════════════════════════
   CODE PAGE (Персональный код)
   ══════════════════════════════════════ */
.code-page {
  background: #000;
}

.code-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 max(16px, var(--side-padding));
}

.code-form {
  width: 100%;
  max-width: 360px;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.2s forwards;
}

.code-field {
  position: relative;
  width: 100%;
}

.code-input {
  font-family: 'Onest', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 48px 12px 16px;
  width: 100%;
  outline: none;
  transition: border-color 0.25s, background 0.25s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.code-input::placeholder {
  color: var(--text-dim);
  font-weight: 300;
}

.code-input:focus {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.07);
}

.code-submit {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.2s;
}

.code-submit:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.code-submit:active {
  transform: translateY(-50%) scale(0.95);
}

.code-submit.is-sent {
  color: #FEE121;
  pointer-events: none;
}

.code-error {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: #E5341E;
  text-align: center;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  min-height: 1em;
}

.code-error.is-visible {
  opacity: 0.5;
  transform: translateY(0);
}

/* ══════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ══════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════ */

/* ── max 1920px: large desktops ── */
@media (max-width: 1920px) {
  :root {
    --side-padding: 3rem;
    --top-padding: 2.5rem;
  }

  .hero {
    max-width: 700px;
  }
}

/* ── max 1600px: mid-size desktops ── */
@media (max-width: 1600px) {
  :root {
    --side-padding: 2.75rem;
    --top-padding: 2.25rem;
  }

  .headline,
  .headline-dim {
    font-size: 30px;
  }

  .mid-text {
    font-size: 18px;
  }

  .hero {
    max-width: 680px;
  }
}

/* ── max 1200px: small desktops / large laptops ── */
@media (max-width: 1200px) {
  :root {
    --side-padding: 2.5rem;
    --top-padding: 2rem;
  }

  .headline,
  .headline-dim {
    font-size: 28px;
  }

  .mid-text {
    font-size: 17px;
  }

  .hero {
    max-width: 640px;
  }
}

/* ── max 1024px: tablets landscape ── */
@media (max-width: 1024px) {
  :root {
    --side-padding: 2rem;
    --top-padding: 1.8rem;
  }

  .headline,
  .headline-dim {
    font-size: 26px;
  }

  .mid-text {
    font-size: 16px;
  }

  .hero {
    max-width: 580px;
  }
}

/* ── max 992px ── */
@media (max-width: 992px) {
  :root {
    --side-padding: 1.5rem;
    --top-padding: 1.5rem;
  }

  .headline,
  .headline-dim {
    font-size: 24px;
  }

  .mid-text {
    font-size: 16px;
    margin-bottom: 1.8rem;
  }

  .sub-text {
    margin-bottom: 1.5rem;
  }

  .f-name {
    width: 150px;
  }

  .f-email {
    width: 185px;
  }

  .f-company {
    width: 150px;
  }
}

/* ── max 768px: tablets portrait ── */
@media (max-width: 768px) {
  :root {
    --side-padding: 1.25rem;
    --top-padding: 1.25rem;
  }

  header {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .headline,
  .headline-dim {
    font-size: 22px;
  }

  .headline br {
    display: none;
  }

  .mid-text {
    font-size: 15px;
    margin-bottom: 1.6rem;
    white-space: normal;
  }

  .sub-text {
    font-size: 12px;
    margin-bottom: 1.4rem;
  }

  .fields {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .fields input,
  .f-name,
  .f-email,
  .f-company {
    width: min(320px, 100%);
  }

  .cta {
    width: min(320px, 100%);
    padding: 14px 20px;
  }

  .headline-dim.last {
    margin-bottom: 1.5rem;
  }
}

/* ── max 480px: large phones ── */
@media (max-width: 480px) {
  :root {
    --side-padding: 15px;
    --top-padding: 1rem;
  }

  .logo {
    font-size: 13px;
  }

  .date-badge {
    font-size: 11px;
    padding: 5px 12px;
  }

  .headline,
  .headline-dim {
    font-size: 20px;
  }

  .mid-text {
    font-size: 14px;
    margin-bottom: 1.4rem;
  }

  .sub-text {
    font-size: 12px;
    margin-bottom: 1.2rem;
  }

  .sub-text br {
    display: none;
  }

  .fields input {
    font-size: 13px;
    padding: 11px 14px;
  }

  .cta {
    font-size: 14px;
    padding: 13px 16px;
  }
}

/* ── max 320px: small phones ── */
@media (max-width: 320px) {
  :root {
    --side-padding: 15px;
    --top-padding: 0.8rem;
  }

  .logo {
    font-size: 12px;
    letter-spacing: 0.08em;
  }

  .date-badge {
    font-size: 10px;
    padding: 4px 10px;
  }

  .headline,
  .headline-dim {
    font-size: 18px;
    line-height: 1.4;
  }

  .headline-dim.last {
    margin-bottom: 1.2rem;
  }

  .mid-text {
    font-size: 13px;
    margin-bottom: 1.2rem;
  }

  .sub-text {
    font-size: 11px;
    margin-bottom: 1rem;
  }

  .fields input,
  .f-name,
  .f-email,
  .f-company {
    width: 100%;
  }

  .cta {
    width: 100%;
    font-size: 13px;
    padding: 12px 12px;
  }

  .form-group {
    width: 100%;
  }

  .fields {
    width: 100%;
  }
}
