@property --logo-y {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 52%;
}

@property --logo-scale {
  syntax: "<number>";
  inherits: false;
  initial-value: 0.35;
}

@property --logo-opacity {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

:root {
  --navy: #062a6e;
  --navy-deep: #031636;
  --lime: #c8d400;
  --lime-soft: color-mix(in srgb, var(--lime) 72%, white);
  --ink: #f4f7fb;
  --muted: color-mix(in srgb, var(--ink) 68%, transparent);
  --glass: color-mix(in srgb, #031636 48%, transparent);
  --stroke: color-mix(in srgb, white 18%, transparent);
  --shadow: 0 24px 60px color-mix(in srgb, black 45%, transparent);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --font-display: "Unbounded", "Rubik", "Vazirmatn", sans-serif;
  --font-body: "Rubik", "Vazirmatn", sans-serif;
  --font-fa: "Vazirmatn", "Rubik", sans-serif;
  --logo-size: clamp(7.5rem, 22vw, 13.5rem);
  --content-pad: clamp(1.25rem, 4vw, 3rem);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--navy-deep);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-lang="fa"] {
  font-family: var(--font-fa);
}

body[data-lang="fa"] .headline,
body[data-lang="fa"] .brand-word,
body[data-lang="fa"] .support {
  font-family: var(--font-fa);
}

.stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.bg__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
}

.bg__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, transparent 0%, color-mix(in srgb, var(--navy-deep) 35%, transparent) 55%, color-mix(in srgb, var(--navy-deep) 78%, transparent) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--navy-deep) 55%, transparent) 0%, transparent 28%, transparent 58%, color-mix(in srgb, var(--navy-deep) 82%, transparent) 100%);
  pointer-events: none;
}

.bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  mix-blend-mode: soft-light;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.lang-switch {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  inset-inline-end: max(1rem, env(safe-area-inset-right));
  z-index: 5;
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: color-mix(in srgb, var(--navy-deep) 55%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.lang-switch.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.lang-switch__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 0.78rem/1 var(--font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.65rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.lang-switch__btn:hover,
.lang-switch__btn:focus-visible {
  color: var(--ink);
  outline: none;
}

.lang-switch__btn:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--lime) 70%, white);
}

.lang-switch__btn[aria-pressed="true"] {
  background: color-mix(in srgb, var(--lime) 88%, white);
  color: var(--navy-deep);
}

.brand {
  position: absolute;
  left: 50%;
  top: var(--logo-y);
  z-index: 3;
  width: var(--logo-size);
  translate: -50% -50%;
  scale: var(--logo-scale);
  opacity: var(--logo-opacity);
  filter: drop-shadow(0 18px 40px color-mix(in srgb, black 40%, transparent));
  will-change: top, scale, opacity, filter;
  transition:
    top 1.35s var(--ease-out),
    scale 1.35s var(--ease-out),
    opacity 0.45s ease;
  pointer-events: none;
}

.brand.is-rising {
  --logo-y: 22%;
  --logo-scale: 1;
  --logo-opacity: 1;
}

.brand.is-settled {
  --logo-y: 18%;
  --logo-scale: 1;
  --logo-opacity: 1;
}

.brand__mark {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18%;
  user-select: none;
  -webkit-user-drag: none;
}

.ripple {
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 2;
  width: min(42vw, 18rem);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, white 55%, transparent);
  opacity: 0;
  pointer-events: none;
  scale: 0.2;
}

.ripple.is-active {
  animation: ripple-out 1.1s var(--ease-soft) forwards;
}

.ripple--delayed.is-active {
  animation-delay: 0.14s;
}

@keyframes ripple-out {
  0% {
    opacity: 0.55;
    scale: 0.2;
  }
  100% {
    opacity: 0;
    scale: 1.65;
  }
}

.content {
  position: relative;
  z-index: 4;
  width: min(42rem, calc(100% - 2 * var(--content-pad)));
  margin-top: clamp(8.5rem, 28vh, 14rem);
  text-align: center;
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.9s var(--ease-out) 0.15s, transform 0.9s var(--ease-out) 0.15s;
}

.content.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
  color: var(--lime-soft);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: color-mix(in srgb, var(--lime) 70%, transparent);
}

.brand-word {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 4.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 0.85rem;
  text-wrap: balance;
  background: linear-gradient(180deg, #fff 20%, color-mix(in srgb, var(--lime) 55%, white) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.headline {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.4vw, 1.85rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-bottom: 0.9rem;
}

.support {
  max-width: 34rem;
  margin-inline: auto;
  color: var(--muted);
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  line-height: 1.7;
  text-wrap: pretty;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 1.6rem;
  padding: 0.95rem 1.45rem;
  border: 1px solid color-mix(in srgb, var(--lime) 55%, white);
  border-radius: 999px;
  background: color-mix(in srgb, var(--lime) 88%, white);
  color: var(--navy-deep);
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(0.92rem, 2vw, 1.05rem);
  line-height: 1.2;
  box-shadow: 0 12px 30px color-mix(in srgb, black 28%, transparent);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.cta:hover,
.cta:focus-visible {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--lime) 96%, white);
  box-shadow: 0 16px 36px color-mix(in srgb, black 34%, transparent);
  outline: none;
}

.cta:focus-visible {
  box-shadow:
    0 0 0 2px var(--navy-deep),
    0 0 0 4px color-mix(in srgb, var(--lime) 80%, white),
    0 16px 36px color-mix(in srgb, black 34%, transparent);
}

.cta__phone {
  display: inline-block;
  padding-inline-start: 0.85rem;
  border-inline-start: 1px solid color-mix(in srgb, var(--navy-deep) 28%, transparent);
  font-family: var(--font-body);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.footer-note {
  position: absolute;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 4;
  translate: -50% 0;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.8s ease 0.4s;
  white-space: nowrap;
}

.footer-note.is-visible {
  opacity: 1;
}

body[dir="rtl"] .brand-word,
body[dir="rtl"] .headline,
body[dir="rtl"] .support {
  letter-spacing: 0;
}

body[dir="rtl"] .eyebrow {
  letter-spacing: 0.08em;
}

@media (max-width: 720px) {
  :root {
    --logo-size: clamp(5.75rem, 34vw, 8.5rem);
  }

  .brand.is-rising,
  .brand.is-settled {
    --logo-y: 28%;
  }

  .content {
    margin-top: clamp(9.5rem, 34vh, 13rem);
  }

  .lang-switch {
    inset-inline: auto;
    left: 50%;
    translate: -50% 0;
    inset-inline-end: auto;
  }

  .lang-switch__btn {
    padding: 0.7rem 0.95rem;
    font-size: 0.8rem;
  }

  .cta {
    width: min(100%, 22rem);
    padding: 1rem 1.25rem;
  }

  .cta__phone {
    display: none;
  }
}

@media (max-height: 700px) and (min-width: 721px) {
  .brand.is-rising,
  .brand.is-settled {
    --logo-y: 14%;
  }

  .content {
    margin-top: clamp(5.5rem, 22vh, 9rem);
  }

  .support {
    display: none;
  }
}

@media (max-width: 720px) and (max-height: 700px) {
  .brand.is-rising,
  .brand.is-settled {
    --logo-y: 24%;
  }

  .content {
    margin-top: clamp(8rem, 30vh, 11rem);
  }

  .support {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand,
  .content,
  .lang-switch,
  .footer-note,
  .ripple {
    transition: none !important;
    animation: none !important;
  }

  .brand {
    --logo-y: 18%;
    --logo-scale: 1;
    --logo-opacity: 1;
  }

  .content,
  .lang-switch,
  .footer-note {
    opacity: 1;
    transform: none;
  }
}
