:root {
  --green: #00e676;
  --green-dim: rgba(0, 230, 118, 0.55);
  --green-glow: rgba(0, 255, 120, 0.35);
  --text: #f5f5f5;
  --text-muted: rgba(245, 245, 245, 0.65);
  --bg: #050805;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  min-height: 100%;
  min-height: 100dvh;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Terminal-inspired animated background */
.code-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#codeCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.code-bg__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, transparent 0%, var(--bg) 72%),
    linear-gradient(180deg, rgba(5, 8, 5, 0.4) 0%, rgba(5, 8, 5, 0.92) 100%);
}

/* Page layout — Orange Dog style */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding:
    max(1.5rem, env(safe-area-inset-top))
    max(1.25rem, env(safe-area-inset-right))
    max(5rem, calc(4rem + env(safe-area-inset-bottom)))
    max(1.25rem, env(safe-area-inset-left));
}

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3rem 4rem;
  max-width: 960px;
  width: 100%;
}

.hero__logo {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__logo::before {
  content: "";
  position: absolute;
  width: 110%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 255, 80, 0.24) 0%,
    rgba(0, 255, 70, 0.08) 50%,
    transparent 72%
  );
  pointer-events: none;
}

.logo-infinity {
  position: relative;
  z-index: 1;
  display: block;
  width: clamp(170px, 28vw, 280px);
  height: auto;
  overflow: visible;
  transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
}

.logo-infinity__halo,
.logo-infinity__stroke {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  shape-rendering: auto;
}

.logo-infinity__halo {
  stroke: rgba(0, 255, 70, 0.32);
  stroke-width: 11;
  filter: blur(3px);
  opacity: 0.85;
}

.logo-infinity__stroke {
  stroke: url(#infinityGrad);
  stroke-width: 5.5;
  paint-order: stroke fill;
}

.hero__content {
  text-align: left;
  min-width: min(260px, 100%);
  flex: 1 1 280px;
  max-width: 100%;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero__subtitle {
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Store icon buttons */
.store-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.store-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid var(--green);
  color: var(--green);
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.store-link:hover {
  background: rgba(0, 230, 118, 0.12);
  box-shadow: 0 0 20px var(--green-glow);
  transform: translateY(-2px);
}

.store-link__icon {
  width: 26px;
  height: 26px;
}

/* Support pill button */
.btn-support {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  border: 1.5px solid var(--green);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.btn-support:hover {
  background: rgba(0, 230, 118, 0.1);
  box-shadow: 0 0 24px var(--green-glow);
}

.btn-support__icon {
  width: 22px;
  height: 22px;
  color: var(--green);
}

/* Footer */
.footer {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer__company {
  margin-bottom: 0.5rem;
}

.footer__links {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
}

.footer__links a,
.footer__link-btn {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.footer__links a:hover,
.footer__link-btn:hover {
  color: var(--green);
}

/* Contact modal */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.contact-modal[hidden] {
  display: none;
}

.contact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 5, 0.75);
  backdrop-filter: blur(4px);
}

.contact-modal__panel {
  position: relative;
  width: min(100%, 22rem);
  padding: 1.5rem 1.35rem 1.35rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 230, 118, 0.35);
  background: rgba(8, 14, 10, 0.96);
  box-shadow: 0 0 40px rgba(0, 255, 120, 0.12);
}

.contact-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}

.contact-modal__close:hover {
  color: var(--text);
}

.contact-modal__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.contact-form {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.contact-form__input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 230, 118, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form__input::placeholder {
  color: rgba(245, 245, 245, 0.4);
}

.contact-form__input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(0, 230, 118, 0.15);
}

.contact-form__textarea {
  resize: vertical;
  min-height: 5.5rem;
}

.contact-modal__divider {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0.65rem;
}

.contact-modal__email-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.contact-modal__email-link {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--green);
  text-decoration: none;
  word-break: break-all;
}

.contact-modal__email-link:hover {
  text-decoration: underline;
}

.contact-modal__icon-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 230, 118, 0.35);
  background: transparent;
  color: var(--green);
  cursor: pointer;
  transition: background 0.2s;
}

.contact-modal__icon-btn:hover {
  background: rgba(0, 230, 118, 0.1);
}

.contact-modal__btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 230, 118, 0.45);
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.contact-modal__btn:hover {
  background: rgba(0, 230, 118, 0.1);
  box-shadow: 0 0 16px var(--green-glow);
}

.contact-modal__btn--primary {
  border-color: var(--green);
  font-weight: 600;
}

.contact-modal__hint {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--green);
  text-align: center;
}

/* Планшет */
@media (max-width: 900px) {
  .hero {
    gap: 2.5rem 2rem;
    padding: 0 0.5rem;
  }
}

/* Телефон */
@media (max-width: 640px) {
  .page {
    padding-bottom: max(7rem, calc(5.5rem + env(safe-area-inset-bottom)));
  }

  .hero {
    flex-direction: column;
    text-align: center;
    gap: 1.75rem;
  }

  .hero__content {
    text-align: center;
    min-width: 0;
    flex: none;
    width: 100%;
  }

  .hero__logo::before {
    width: 100%;
    height: 110%;
  }

  .logo-infinity {
    width: min(200px, 58vw);
  }

  .hero__subtitle {
    margin-bottom: 1.5rem;
  }

  .store-links {
    justify-content: center;
  }

  .store-link {
    width: 48px;
    height: 48px;
  }

  .btn-support {
    min-height: 44px;
    padding: 0.75rem 1.35rem;
  }

  .footer {
    width: calc(100% - 2rem);
    padding: 0 0.5rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* Узкие экраны */
@media (max-width: 380px) {
  .hero__title {
    font-size: 1.75rem;
  }

  .hero__subtitle {
    font-size: 0.95rem;
  }

  .store-links {
    gap: 0.75rem;
  }
}

/* Ландшафт на телефоне */
@media (max-height: 520px) and (orientation: landscape) {
  .page {
    padding-top: 1rem;
    padding-bottom: 4.5rem;
  }

  .hero {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1.5rem 2rem;
    max-width: 100%;
  }

  .hero__content {
    text-align: left;
  }

  .hero__subtitle {
    margin-bottom: 1rem;
  }

  .logo-infinity {
    width: min(160px, 28vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  .store-link:hover,
  .btn-support:hover {
    transform: none;
  }
}
