/* Site header — airy, floating chrome. No bar, no strip: just the logo
   and hamburger sitting on top of the scene. */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  height: calc(var(--header-height) + var(--safe-top));
  display: flex;
  align-items: center;
  padding: var(--safe-top) max(var(--section-padding), var(--safe-right)) 0 max(var(--section-padding), var(--safe-left));
  background: transparent;
  pointer-events: none;
  transition: height .3s ease;
}

/* -16px is the original fixed 88px -> 72px scrolled delta, kept relative
   to --header-height (which itself scales per range) so the scrolled
   state shrinks proportionally instead of occasionally growing past the
   resting state on narrower ranges where --header-height is smaller. */
.site-header.is-scrolled {
  height: calc(var(--header-height) - 16px + var(--safe-top));
}

.site-header__inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.site-header__inner > * {
  pointer-events: auto;
}

/* Brand */
.hero__brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.hero__brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--color-accent-on-accent);
  flex-shrink: 0;
}

.hero__brand-name {
  position: relative;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: top;
  max-width: 210px;
  transition: max-width .4s var(--ease-rise);
}

.site-header.is-scrolled .hero__brand-name {
  max-width: 46px;
}

.hero__brand-name-full,
.hero__brand-name-short {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .01em;
  color: var(--color-text-primary);
  transition: opacity .3s ease, transform .3s ease;
}

.hero__brand-name-full span {
  color: var(--color-accent);
}

.hero__brand-name-short {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  transform: translateY(4px);
  color: var(--color-accent);
}

.site-header.is-scrolled .hero__brand-name-full {
  opacity: 0;
  transform: translateY(-4px);
}

.site-header.is-scrolled .hero__brand-name-short {
  opacity: 1;
  transform: translateY(0);
}

/* Hamburger */
.hamburger {
  z-index: var(--z-hamburger);
  width: 46px;
  height: 46px;
  border-radius: 9px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: border-color var(--motion-micro) ease;
}

.hamburger:hover {
  border-color: rgba(200, 255, 46, .6);
}

.hamburger:focus-visible {
  outline: 1.5px solid var(--color-accent);
  outline-offset: 2px;
}

.hamburger__line {
  width: 18px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: transform .3s var(--ease-rise), opacity .2s ease;
}

.hamburger.is-open .hamburger__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.is-open .hamburger__line:nth-child(2) {
  opacity: 0;
}
.hamburger.is-open .hamburger__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Fullscreen menu */
.menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  background: rgba(8, 8, 10, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 64px 56px;
}

.menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

.menu__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(80% 70% at 80% 10%, var(--glow-accent-soft), transparent 55%);
}

.menu__label {
  position: absolute;
  top: calc(var(--header-height) + 16px);
  left: var(--section-padding);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--color-text-dim);
}

.menu__links {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 560px;
}

.menu__link {
  display: flex;
  align-items: baseline;
  gap: 16px;
  color: var(--color-text-primary);
  padding: 9px 0;
  border-bottom: 1px solid var(--color-border-faint);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--motion-reveal) ease, transform var(--motion-reveal) var(--ease-rise), color .25s ease, padding-left .25s ease;
}

.menu__link:last-child {
  border-bottom: none;
}

.menu.is-open .menu__link {
  opacity: 1;
  transform: translateY(0);
}

.menu__link:nth-child(1) { transition-delay: .05s; }
.menu__link:nth-child(2) { transition-delay: .1s; }
.menu__link:nth-child(3) { transition-delay: .15s; }
.menu__link:nth-child(4) { transition-delay: .2s; }
.menu__link:nth-child(5) { transition-delay: .25s; }
.menu__link:nth-child(6) { transition-delay: .3s; }
.menu__link:nth-child(7) { transition-delay: .35s; }

.menu__link:hover {
  color: var(--color-accent);
  padding-left: 10px;
}

.menu__link:focus-visible,
.menu__phone:focus-visible {
  outline: 1.5px solid var(--color-accent);
  outline-offset: 3px;
}

.menu__link-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-accent);
  width: 28px;
}

.menu__link-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  letter-spacing: -.01em;
}

.menu__footer {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 44px;
  flex-wrap: wrap;
  gap: 24px;
}

.menu__phone {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--motion-reveal) ease .36s, transform var(--motion-reveal) var(--ease-rise) .36s;
}

.menu.is-open .menu__phone {
  opacity: 1;
  transform: translateY(0);
}

.menu__phone-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--color-text-dim);
  margin-bottom: 6px;
}

.menu__phone-number {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  color: var(--color-text-primary);
  transition: color .25s ease;
}

.menu__phone:hover .menu__phone-number {
  color: var(--color-accent);
}

.menu__socials {
  display: flex;
  gap: 9px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--motion-reveal) ease .42s, transform var(--motion-reveal) var(--ease-rise) .42s;
}

.menu.is-open .menu__socials {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Menu — portrait tablet / phone ----
   Desktop centers 7 links + footer vertically because they always fit
   the viewport. Below 1024px that stops being true (7 links at 34px
   each + footer can exceed a phone's height), so the menu switches to
   a top-anchored, internally-scrollable flow instead of clipping. */
@media (max-width: 1023px) {
  .menu {
    padding: calc(64px + var(--safe-top)) max(var(--section-padding), var(--safe-right)) calc(28px + var(--safe-bottom)) max(var(--section-padding), var(--safe-left));
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Was absolutely positioned against the header height; in the
     scrollable flow that would overlap whatever scrolls under it, so
     it becomes a normal in-flow element instead. */
  .menu__label {
    position: static;
    margin-bottom: 26px;
  }

  .menu__link-text {
    font-size: 26px;
  }

  .menu__footer {
    margin-top: 32px;
  }
}

@media (max-width: 599px) {
  .menu__link-text {
    font-size: 21px;
  }

  .menu__link {
    padding: 7px 0;
    gap: 12px;
  }

  .menu__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
}

/* Short landscape phones — compact the vertical rhythm so all 7 links
   plus footer stay reachable without feeling cramped mid-word. */
@media (max-height: 480px) and (orientation: landscape) {
  .menu {
    padding-top: calc(52px + var(--safe-top));
  }

  .menu__label {
    margin-bottom: 14px;
  }

  .menu__link {
    padding: 4px 0;
  }

  .menu__link-text {
    font-size: 19px;
  }

  .menu__footer {
    margin-top: 16px;
  }
}

/* Eyebrow badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: .16em;
  color: var(--color-accent);
  text-transform: uppercase;
  border: 1px solid var(--color-accent-border);
  border-radius: 3px;
  padding: 6px 12px;
}

.badge__dot {
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent);
}

/* Buttons */
.btn {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .02em;
  border-radius: var(--radius-sm);
  padding: 15px 26px;
  cursor: pointer;
  transition: transform .28s var(--ease-rise), box-shadow .18s ease, border-color .3s ease;
}

.btn--primary {
  font-weight: 700;
  color: var(--color-accent-on-accent);
  background: var(--color-accent);
  border: none;
  box-shadow: 5px 5px 0 rgba(200, 255, 46, .22);
}

.btn--primary:hover {
  box-shadow: 8px 8px 0 rgba(200, 255, 46, .32);
}

.btn--secondary {
  position: relative;
  overflow: hidden;
  font-weight: 600;
  padding: 15px 22px;
  background: transparent;
  border: 1px solid var(--color-accent-border-strong);
}

.btn--secondary:hover {
  border-color: var(--color-accent);
}

.btn__liquid {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  transition: height .55s cubic-bezier(.45, .05, .2, 1);
  pointer-events: none;
}

.btn--secondary:hover .btn__liquid {
  height: 160%;
}

.btn__liquid-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #d4ff5a, #9fe62a);
}

.btn__liquid-wave {
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 16px;
  background: radial-gradient(circle at 7px 16px, #d4ff5a 7px, transparent 8px);
  background-size: 14px 16px;
  background-repeat: repeat-x;
  animation: lutWaveX 1.1s linear infinite;
}

.btn__liquid-wave--soft {
  top: -6px;
  height: 14px;
  background: radial-gradient(circle at 7px 14px, rgba(212, 255, 90, .5) 6px, transparent 7px);
  background-size: 14px 14px;
  animation: lutWaveX 1.7s linear infinite reverse;
}

.btn__label {
  position: relative;
  z-index: 2;
  color: var(--color-text-primary);
  transition: color .35s ease;
}

.btn--secondary:hover .btn__label {
  color: var(--color-accent-on-accent);
}

/* Icon button (social links) */
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--color-surface-2);
  border: 1px solid rgba(200, 255, 46, .32);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  transition: background var(--motion-micro) ease, color var(--motion-micro) ease, transform var(--motion-micro) ease;
}

.icon-btn:hover {
  background: var(--color-accent);
  color: var(--color-accent-on-accent);
  transform: translateY(-3px);
}

.icon-btn:focus-visible {
  outline: 1.5px solid var(--color-accent);
  outline-offset: 2px;
}

/* Browser chrome bar (used by mockup, reusable for future previews) */
.browser-bar {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0 var(--space-md);
  border-bottom: 1px solid var(--color-border-faint);
}

.browser-bar__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.browser-bar__dot--red { background: #ff5f57; }
.browser-bar__dot--yellow { background: #febc2e; }
.browser-bar__dot--green { background: #28c840; }

.browser-bar__spacer {
  flex: 1;
}

.browser-bar__url {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-dim-2);
  background: rgba(255, 255, 255, .05);
  padding: 3px 12px;
  border-radius: 5px;
}

/* Decorative fake-content placeholders (used inside mockup/preview cards) */
.ui-bar {
  display: block;
  height: 7px;
  border-radius: 3px;
  background: rgba(160, 160, 152, .4);
}

.ui-bar--light { background: rgba(230, 230, 224, .55); }
.ui-bar--accent { background: var(--color-accent); }
.ui-bar--faint { background: rgba(160, 160, 152, .5); }

.ui-dot {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--color-accent);
}

.ui-dot--outline {
  background: transparent;
  border: 1.5px solid var(--color-accent);
}

/* Floating chip (small orbiting label, used around 2.5D scenes) */
.chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-chip);
  background: rgba(18, 19, 17, .82);
  border: 1px solid var(--color-border-soft);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .45);
  font-family: var(--font-mono);
  font-size: 10px;
  color: #c9c9c2;
  white-space: nowrap;
}

.chip--accent {
  background: var(--color-accent);
  color: var(--color-accent-on-accent);
  font-weight: 700;
  border: none;
}

.chip__dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--color-accent);
  flex-shrink: 0;
}

/* Mini bar-chart (decorative data visual) */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
}

.bar-chart__bar {
  width: 8px;
  border-radius: 2px;
  background: rgba(200, 255, 46, .45);
}

/* Route block (page-structure preview) */
.route-block {
  border-radius: 4px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--color-border-faint);
}

.route-block--accent {
  background: rgba(200, 255, 46, .14);
  border-color: rgba(200, 255, 46, .3);
}

/* Toggle switch (decorative UI state) */
.toggle {
  width: 46px;
  height: 24px;
  border-radius: 12px;
  background: rgba(200, 255, 46, .18);
  border: 1px solid var(--color-accent-border);
  display: flex;
  align-items: center;
  padding: 0 3px;
  justify-content: flex-end;
}

.toggle__knob {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* Glass surface (frosted card background, reused by 2.5D scenes) */
.glass-card {
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, var(--color-surface-glass-start), var(--color-surface-glass-end));
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border: 1px solid var(--color-border-soft);
  box-shadow: var(--shadow-elevated), inset 0 1px 0 rgba(255, 255, 255, .06);
  overflow: hidden;
}

/* Status row (small labeled results, e.g. "Форма подключена") */
.status-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .03em;
  color: var(--color-text-muted);
}

.status-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent);
  flex-shrink: 0;
  animation: lutPulse 1.8s ease-in-out infinite;
}

/* Text link (small mono arrow-link, e.g. "Смотреть проект →") */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .03em;
  color: var(--color-accent);
  transition: gap var(--motion-micro) ease, color var(--motion-micro) ease;
}

.text-link:hover {
  gap: 10px;
  color: var(--color-text-primary-strong);
}

/* Check dot (done / confirmed indicator) */
.check-dot {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1.5px solid var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  font-size: 11px;
  flex-shrink: 0;
}

/* One-shot scan-line sweep — the static line itself (position, glow,
   idle state) is identical everywhere it's used; each section keeps
   only its own .is-scanning trigger + keyframe, since sweep duration
   is deliberately tuned per context. */
.scan-sweep {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  box-shadow: 0 0 16px 2px rgba(200, 255, 46, .55);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

/* Form field input (text/tel/textarea) — shared by the brief quiz's
   contact step and the project-signal popup. Each keeps only its own
   padding/border-radius/font-size as a modifier on top of this. */
.field-input {
  width: 100%;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--color-border-soft);
  font-family: var(--font-body);
  color: var(--color-text-primary);
  transition: border-color var(--motion-micro) ease, background var(--motion-micro) ease, box-shadow var(--motion-micro) ease;
}

.field-input::placeholder {
  color: var(--color-text-dim);
}

.field-input:focus {
  outline: none;
  border-color: var(--color-accent-border-strong);
  background: rgba(200, 255, 46, .03);
  box-shadow: 0 0 0 3px rgba(200, 255, 46, .08);
}

.field-input.is-invalid {
  border-color: rgba(255, 140, 90, .6);
  box-shadow: 0 0 0 3px rgba(255, 140, 90, .1);
}

/* Small error caption shown under an invalid field */
.field-error {
  display: none;
  font-family: var(--font-mono);
  letter-spacing: .02em;
  color: #ff9c73;
}

.field-error.is-visible {
  display: block;
}
