/* =========================================================
   Krasny Kon — Shared Design System & Common Components
   Used by both the homepage (with css/home.css) and /neurovideo/ (with css/neurovideo.css).
   ========================================================= */

@font-face { font-family: "Monoid"; src: url("../assets/fonts/Monoid-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Golos UI"; src: url("../assets/fonts/Golos-UI_Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Golos UI"; src: url("../assets/fonts/Golos-UI_Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Golos UI"; src: url("../assets/fonts/Golos-UI_Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Brand palette from Figma UI-kit */
  --red: #DE1620;
  --red-hover: #BF111A;
  --black: #131313;
  --green: #96A576;
  --green-hover: #717D5A;
  --light-green: #C4D0A8;
  --beige: #FFFCEB;
  --burgundy: #230002;
  --grey: #878787;
  --text-grey: #5C5C5C;
  --panel: #F7F3DD;
  --ink: #1D1F1B;

  --header-h: 13.1rem;
  --gentle: cubic-bezier(.32, .72, .18, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 10px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--beige);
  color: var(--black);
  font-family: "Golos UI", "Golos Text", Arial, sans-serif;
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.45;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: .2rem solid var(--red); outline-offset: .3rem; }

.nowrap { white-space: nowrap; }

.h2 { font-family: "Monoid", monospace; font-weight: 700; font-size: 3.5rem; line-height: 1.15; text-transform: uppercase; }
.section-title { font-family: "Monoid", monospace; font-weight: 700; font-size: 10rem; line-height: 1.05; text-transform: uppercase; color: var(--green); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 1.2rem;
  padding: 2.2rem 5.4rem;
  background: var(--green); color: #fff;
  font-family: "Monoid", monospace; font-weight: 700; font-size: 1.8rem; line-height: 1.2;
  text-transform: uppercase; white-space: nowrap;
  transition: background-color .2s ease-out, color .2s ease-out, border-color .2s ease-out;
}
.btn:hover { background: var(--green-hover); }
.btn img { width: 1.1rem; height: 2rem; flex: none; }
.btn--red { background: var(--red); }
.btn--red:hover { background: var(--red-hover); }
.btn--big { font-size: 2.2rem; padding: 2.4rem 6rem; }
.btn--outline {
  background: transparent;
  color: var(--black);
  border: .2rem solid var(--black);
}
.btn--outline:hover {
  background: var(--black);
  color: var(--beige);
}
.btn--outline-light {
  background: transparent;
  color: var(--beige);
  border: .2rem solid rgba(255, 252, 235, .45);
}
.btn--outline-light:hover {
  background: var(--beige);
  color: var(--burgundy);
  border-color: var(--beige);
}

.link-green {
  font-family: "Monoid", monospace; font-weight: 700; text-transform: uppercase;
  color: var(--green); white-space: nowrap; transition: color .2s ease-out;
}
.link-green:hover { color: var(--green-hover); }

/* ---------- Noise overlay (static subtle Figma grain texture) ---------- */
.noise {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 300;
  background-repeat: repeat;
}

/* =========================================================
   HEADER (shared base — /neurovideo/ uses this directly; / extends via .home-header)
   ========================================================= */
.header, .menu__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4rem;
}
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--beige);
  transition: transform .45s var(--gentle);
}
.header.is-hidden { transform: translateY(-100%); }

.logo { display: flex; align-items: flex-start; flex: none; }
.logo__horse { width: 5.1754rem; height: 5.0969rem; }
.logo__word { width: 22.3rem; height: 4.1rem; margin: .5rem 0 0 1.3526rem; }

.header__nav {
  flex: 1 0 0; display: flex; align-items: center; justify-content: flex-end; gap: 4.4rem;
  padding-right: 4rem;
  font-family: "Monoid", monospace; font-weight: 700; font-size: 2rem; text-transform: uppercase; white-space: nowrap;
}
.header__phone { color: var(--black); }
.header__phone--white { color: #fff; }
.header__cta { font-size: 2rem; }

.burger { display: flex; flex-direction: column; gap: .7rem; width: 4.0047rem; padding: .2rem 0; }
.burger span { display: block; height: .4rem; background: var(--red); transition: transform .3s; }
.burger:hover span:nth-child(2) { transform: translateX(-.6rem); }

main { padding-top: 13rem; }

/* ---------- Big links & socials (shared by menu & legacy footer) ---------- */
.socials { display: flex; align-items: center; gap: 4rem; }
.socials img:first-child { width: 6.1114rem; height: 5.2383rem; }
.socials a:last-child img { width: 7.3725rem; height: 4.2683rem; }
.socials a { transition: opacity .2s; }
.socials a:hover { opacity: .75; }

.big-links { display: flex; flex-direction: column; gap: 2.4rem; font-size: 8.432rem; }
.big-link { position: relative; display: block; height: 1.1385em; overflow: hidden; }
.big-link__inner {
  position: relative; display: flex; align-items: flex-start;
  margin-left: -.7946em;
  font-family: "Monoid", monospace; font-weight: 700; line-height: normal;
  text-transform: uppercase; color: var(--green); white-space: nowrap;
  transition: transform .4s var(--gentle);
}
.big-link__arrow { flex: none; width: .5337em; height: .4625em; margin: .3349em .166em 0 0; transform: rotate(90deg); }
.big-link:hover .big-link__inner { transform: translateX(.759em); }

/* =========================================================
   MENU OVERLAY
   ========================================================= */
.menu {
  position: fixed; inset: 0; z-index: 100; overflow: hidden;
  background: var(--burgundy);
  opacity: 0; visibility: hidden;
  transition: opacity .4s ease-out, visibility 0s linear .4s;
}
.menu.is-open { opacity: 1; visibility: visible; transition: opacity .4s ease-out; }
.menu__header { position: relative; z-index: 2; }
.menu__close { width: 4.4rem; height: 4.4rem; flex: none; }
.menu__close img { width: 100%; height: 100%; }
.menu__flower { position: absolute; left: calc(50% + .8rem); top: -8.6rem; width: 70.1925rem; height: 70.2rem; max-width: none; transition: transform 1.2s var(--gentle); transform: rotate(-30deg) scale(.9); pointer-events: none; }
.menu.is-open .menu__flower { transform: none; }
.big-links--menu { position: absolute; left: 4rem; top: calc(50% + 2rem); transform: translateY(-50%); width: auto; font-size: 9.861rem; gap: 2.6588rem; z-index: 1; }
.big-link.is-current .big-link__inner { color: var(--beige); }
.menu .big-link__inner { transform: translateY(110%); transition: transform .7s var(--gentle); }
.menu.is-open .big-link__inner { transform: none; }
.menu.is-open .big-link:nth-child(2) .big-link__inner { transition-delay: .05s; }
.menu.is-open .big-link:nth-child(3) .big-link__inner { transition-delay: .10s; }
.menu.is-open .big-link:nth-child(4) .big-link__inner { transition-delay: .15s; }
.menu.is-open .big-link:nth-child(5) .big-link__inner { transition-delay: .20s; }
.menu.is-open .big-link:hover .big-link__inner { transform: translateX(.759em); transition-delay: 0s; transition-duration: .4s; }
.menu__socials { position: absolute; left: 4rem; bottom: 4rem; z-index: 1; }
.menu__copy { position: absolute; left: calc(66.667% + 2.467rem); bottom: 4rem; z-index: 1; font-size: 2rem; color: #fff; white-space: pre; }

/* =========================================================
   POPUP
   ========================================================= */
.popup {
  position: fixed; inset: 0; z-index: 110;
  display: grid; place-items: center;
  padding: 1.6rem;
  opacity: 0; visibility: hidden;
  transition: opacity .35s ease-out, visibility 0s linear .35s;
}
.popup.is-open { opacity: 1; visibility: visible; transition: opacity .35s ease-out; }
.popup__overlay { position: absolute; inset: 0; background: rgba(19, 19, 19, .45); }
.popup__card {
  position: relative; width: min(101.3rem, calc(100vw - 3.2rem)); height: 65.8rem;
  background: var(--beige);
  filter: drop-shadow(0 1.6rem 1.04rem rgba(0, 0, 0, .14));
  transform: translateY(3rem) scale(.97);
  transition: transform .5s var(--gentle);
}
.popup.is-open .popup__card { transform: none; }
.popup__head { position: absolute; left: 4rem; top: 4rem; right: 9rem; display: flex; align-items: flex-start; gap: 2.3rem; }
.popup__title { font-family: "Monoid", monospace; font-weight: 700; font-size: 3.5rem; line-height: 1.15; text-transform: uppercase; color: var(--green); white-space: nowrap; }
.popup__sub { max-width: 46.5rem; font-weight: 500; font-size: 2rem; line-height: 1.3; text-transform: uppercase; color: var(--black); }
.popup__sub span { color: var(--red); }
.popup__close { position: absolute; right: 3rem; top: 3rem; width: 3.2rem; height: 3.2rem; transition: transform .3s var(--gentle); }
.popup__close img { width: 100%; height: 100%; }
.popup__close:hover { transform: rotate(90deg); }
.popup__view--form { position: absolute; inset: 0; }
.popup__form { position: absolute; inset: 0; pointer-events: none; }
.popup__fields { position: absolute; left: 4rem; top: 20rem; width: min(59.4rem, calc(100% - 26rem)); display: flex; flex-direction: column; gap: 3.2rem; pointer-events: auto; }
.field { display: block; }
.field input {
  display: block; width: 100%; padding: 1rem;
  border: 0; border-bottom: 1px solid var(--black); border-radius: 0; background: transparent;
  font: inherit; font-size: 2rem; color: var(--black); outline: none;
  transition: border-color .2s;
}
.field input::placeholder { color: var(--green-hover); text-transform: uppercase; opacity: 1; }
.field input:focus { border-bottom-color: var(--red); }
.field input.is-invalid, .field input[aria-invalid="true"] { border-bottom-color: var(--red); }
.field__error {
  display: block; margin: .45rem .5rem 0; color: var(--red);
  font-size: 1.05rem; line-height: 1.3; text-transform: none;
}
.field__error[hidden] { display: none; }
.popup__notice {
  position: absolute; left: 4rem; bottom: 13.5rem; max-width: 58rem;
  font-size: 1.4rem; line-height: 1.4; color: var(--text-grey);
  pointer-events: auto;
}
.popup__consent { display: flex; align-items: flex-start; gap: .8rem; cursor: pointer; }
.popup__consent input { flex: none; width: 1.5rem; height: 1.5rem; margin: .1em 0 0; accent-color: var(--green); }
.popup__consent a { text-decoration: underline; text-underline-offset: .15em; }
.popup__consent.is-invalid { color: var(--red); }
.popup__error {
  position: absolute; left: 4rem; bottom: 10rem; max-width: 58rem;
  font-size: 1.3rem; line-height: 1.35; color: var(--red);
  pointer-events: auto;
}
.popup__error[hidden] { display: none; }
.lead-honeypot {
  position: absolute !important; left: -10000px !important; top: auto !important;
  width: 1px !important; height: 1px !important; overflow: hidden !important;
}
.popup__submit { position: absolute; left: 4rem; bottom: 4rem; pointer-events: auto; }
.popup__submit:disabled { cursor: default; background: var(--green-hover); }

.stamp { position: absolute; right: 3rem; bottom: 3rem; width: 15.8rem; height: 20rem; }
.popup.is-open .stamp { animation: stamp .6s var(--gentle) .15s both; }
@keyframes stamp { from { transform: scale(1.35) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.stamp img, .stamp span { position: absolute; max-width: none; }
.stamp__border { inset: 0; width: 100%; height: 100%; }
.stamp__bg { left: calc(50% + .3%); top: 50%; width: 76.58%; height: 80%; transform: translate(-50%, -50%); background: var(--green); }
.stamp__clouds { left: 50%; top: 50.2%; width: 73.41%; height: 67.41%; transform: translate(-50%, -50%); }
.stamp__horse { left: 20.25%; top: 22%; width: 59.11%; height: 45.98%; }
.stamp__word { left: 15.82%; top: 71.5%; width: 68.99%; height: 9.5%; }

.popup__view--done {
  position: absolute; inset: 0; display: none;
  flex-direction: column; align-items: center; gap: 2.8rem;
  background: #FCFAE8;
}
.popup.is-done .popup__view--form { visibility: hidden; }
.popup.is-done .popup__view--done { display: flex; animation: fadeUp .5s var(--gentle) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(1.5rem); } to { opacity: 1; transform: none; } }
.popup__flap { flex: none; width: 100%; height: 38rem; max-width: none; }
.popup__thanks { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; padding: 1rem 3rem; color: var(--green-hover); max-width: 72rem; text-align: center; }
.popup__thanks-title { font-family: "Monoid", monospace; font-weight: 700; font-size: 3rem; line-height: 1.2; text-transform: uppercase; color: var(--black); }
.popup__thanks-text { font-size: 1.8rem; line-height: 1.45; color: var(--text-grey); }

body.is-locked { overflow: hidden; }

/* =========================================================
   TABLET (600–1023px)
   ========================================================= */
@media (max-width: 1023px) {
  :root { --header-h: 11.55rem; }
  main { padding-top: 11.5rem; }

  .header, .menu__header { padding: 4rem 3rem; }
  .header__nav { display: none; }
  .logo__horse { width: 3.6085rem; height: 3.5537rem; }
  .logo__word { width: 15.5484rem; height: 2.8587rem; margin: .349rem 0 0 .9435rem; }

  .menu__flower { left: auto; right: -10.695rem; top: -10.6rem; width: 61.795rem; height: 61.8016rem; }
  .big-links--menu { top: auto; bottom: 12.78rem; left: 3rem; width: auto; transform: none; gap: 2.059rem; font-size: 7.4rem; }
  .menu__socials { left: 3rem; bottom: 4rem; gap: 4.012rem; }
  .menu__socials a:first-child img { width: 5.4645rem; height: 4.6839rem; }
  .menu__socials a:last-child img { width: 6.6236rem; height: 3.8347rem; }
  .menu__copy { left: auto; right: 3rem; bottom: 4rem; font-size: 1.6rem; }

  .popup__card { width: min(70.8rem, calc(100vw - 3.2rem)); height: 58rem; }
  .popup__head { left: 3rem; top: 3rem; right: 6.5rem; gap: 2rem; }
  .popup__title { font-size: 2.7rem; }
  .popup__sub { flex: 1 1 0; width: auto; font-size: 1.6rem; }
  .popup__close { left: auto; right: 3rem; top: 3rem; }
  .popup__fields { left: 3rem; top: 15rem; width: min(44rem, calc(100% - 20rem)); gap: 2.6rem; }
  .popup__notice { left: 3rem; bottom: 11rem; max-width: 44rem; font-size: 1.3rem; }
  .popup__error { left: 3rem; bottom: 10rem; max-width: 44rem; font-size: 1.2rem; }
  .popup__submit { top: auto; left: 3rem; bottom: 3rem; padding: 1.6rem 5rem; }
  .stamp { right: 3rem; bottom: 3rem; width: 12.3rem; height: 15.5696rem; }
  .popup__view--done { gap: 2.4rem; }
  .popup__flap { height: 29rem; }
  .popup__thanks-title { font-size: 2.4rem; }
  .popup__thanks-text { font-size: 1.6rem; }
}

/* =========================================================
   MOBILE (<= 599px)
   ========================================================= */
@media (max-width: 599px) {
  .header, .menu__header { padding: 2.4rem 2rem; }

  .menu__close { width: 3rem; height: 3rem; }
  .menu__flower { right: auto; left: calc(75% - 1.9rem); top: -5.1rem; width: 46rem; height: 46rem; transform: translateX(-50%); }
  .menu.is-open .menu__flower { transform: translateX(-50%); }
  .big-links--menu { left: 2rem; bottom: 14rem; font-size: 3.6rem; gap: 1.4rem; }
  .menu__socials { left: 2rem; bottom: 8.4rem; gap: 3.012rem; }
  .menu__copy { left: 2rem; right: auto; bottom: 2rem; font-size: 1.3rem; white-space: normal; }

  .popup__card { width: calc(100vw - 3.2rem); max-width: 39rem; height: auto; max-height: calc(100dvh - 3.2rem); overflow-y: auto; }
  .popup__view--form { position: relative; inset: auto; display: flex; flex-direction: column; align-items: stretch; gap: 2.4rem; padding: 2.4rem 2rem; }
  .popup__head { position: static; flex-direction: column; gap: 1.2rem; padding-right: 4rem; }
  .popup__title { font-size: 2.2rem; white-space: normal; }
  .popup__sub { width: auto; flex: none; font-weight: 400; font-size: 1.4rem; }
  .popup__close { top: 2rem; right: 2rem; width: 2.6rem; height: 2.6rem; }
  .popup__form { position: static; display: flex; flex-direction: column; gap: 2rem; pointer-events: auto; }
  .popup__fields { position: static; width: 100%; gap: 2rem; }
  .field input { font-size: 1.5rem; }
  .popup__notice { position: static; max-width: none; font-size: 1.2rem; }
  .popup__error { position: static; max-width: none; margin: 0; font-size: 1.2rem; }
  .field__error { margin: .4rem .5rem 0; font-size: 1.1rem; }
  .popup__consent input { width: 1.6rem; height: 1.6rem; }
  .popup__submit { position: static; width: 100%; padding: 1.5rem 2.4rem; font-size: 1.5rem; }
  .stamp { display: none; }
  .popup.is-done .popup__view--form { display: none; }
  .popup__view--done { position: relative; inset: auto; min-height: 29rem; padding-bottom: 2.4rem; gap: 2rem; }
  .popup__flap { height: 15rem; }
  .popup__thanks-title { font-size: 2rem; }
  .popup__thanks-text { font-size: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
