/* ==========================================================================
   SUN Energy v2 — header and hero.
   The same world as the benefits block (css/benefits.css owns the tokens):
   near-black page, Geist, one warm accent, light drawn as dots. The hero's
   one authored moment is sunlight: a field of dots lit in slow rays that fall
   onto the product photo (js/hero.js).
   ========================================================================== */

:root {
  --fs-h1: 64px;                 /* Heading/H1: 64 / 48 / 30, 100 %, -4 % */
  --lh-h1: 1;
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scrollbar-color: rgba(255, 255, 255, 0.18) var(--bg-page);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

/* ---------- Buttons: one pill shape, two weights ----------
   Hover is the v1 Origin Button (Follow Cursor ON): a white circle grows
   from the pointer, follows it while inside and shrinks toward the exit
   point; the label turns dark over it (js/hero.js). No glass. */
.btn {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  font: 700 18px/22px var(--font);     /* Label/Button */
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    border-color 0.3s var(--ease-expo),
    transform 0.25s var(--ease-expo);
}

.btn:active {
  transform: scale(0.97);
}

.btn--sm {
  height: 48px;
  padding: 0 20px;
  font-size: 18px;
}

/* dark label on orange: 7:1 */
.btn--primary {
  background: var(--bg-accent);
  color: var(--text-inverse);
}

.btn--ghost {
  background: var(--bg-subtle);
  border-color: var(--border-control);
  color: var(--text-primary);
}

.btn--ghost.is-hover {
  border-color: var(--border-default);
}

/* placed on the pointer by js/hero.js; the circle itself is the ::before */
.btn__fill {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  will-change: transform;
}

.btn__fill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--bg-inverse);
  transform: scale(0);
  transition: transform 0.6s var(--ease-expo);
}

.btn.is-hover .btn__fill::before {
  transform: scale(1);
}

.btn__label {
  position: relative;
  z-index: 1;
  transition: color 0.3s var(--ease-expo);
}

.btn.is-hover .btn__label {
  color: var(--text-inverse);
}

/* ---------- Header ---------- */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: 1920px;
  margin: 0 auto;
  padding: 24px var(--page-x);
}

.brand {
  display: inline-flex;
  justify-self: start;
  border-radius: 8px;
}

.brand img {
  display: block;
  width: auto;
  height: 40px;
}

/* a solid pill, no glass; hover is the v1 Liquid Gooey Nav: one white pill
   melting from link to link under a goo filter (js/hero.js) */
.site-nav {
  position: relative;
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-surface);
}

.site-nav a,
.site-menu__links a {
  position: relative;
  z-index: 1;
  padding: 10px 16px;
  border-radius: 999px;
  font: 500 16px/20px var(--font);     /* Label/Nav */
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s var(--ease-expo);
}

.site-nav a:hover,
.site-menu__links a:hover {
  color: var(--text-primary);
}

.site-nav a.is-active,
.site-menu__links a.is-active {
  color: var(--text-inverse);
}

.nav__goo {
  position: absolute;
  inset: 0;
  filter: url(#goo);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

[data-gooey-nav].is-hover .nav__goo {
  opacity: 1;
}

.nav__pill {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: 999px;
  background: var(--bg-inverse);
  will-change: transform, width, height;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.site-contact {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 20px;
}

.site-phone {
  font: 700 16px/20px var(--font);     /* Label/Phone */
  letter-spacing: -0.04em;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.site-phone:hover {
  color: var(--text-accent);
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-self: end;
  gap: 8px;
  height: 44px;
  padding: 0 16px 0 14px;
  border: 1px solid var(--border-control);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-primary);
  font: 500 15px/20px var(--font);
  cursor: pointer;
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
}

.menu-toggle__close,
.menu-toggle[aria-expanded="true"] .menu-toggle__open {
  display: none;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__close {
  display: block;
}

.site-menu {
  position: absolute;
  top: 84px;
  right: var(--page-x);
  width: min(360px, calc(100vw - 2 * var(--page-x)));
  padding: 8px;
  border: 1px solid var(--border-raised);
  border-radius: 20px;
  background: var(--bg-raised);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.6);   /* effect Shadow/Menu */
}

.site-menu[hidden] {
  display: none;
}

.site-menu__links {
  position: relative;
  display: flex;
  flex-direction: column;
}

.site-menu__links a {
  border-radius: 12px;
  font-size: 16px;
  color: var(--text-primary);
}

.site-menu__contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  padding: 16px 16px 8px;
  border-top: 1px solid var(--border-raised);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(720px, 100svh, 960px);
}

.hero__rays {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(0, 1fr);
  align-items: center;
  max-width: 1920px;
  min-height: inherit;
  margin: 0 auto;
  padding: 136px var(--page-x) 120px;
}

.hero__title {
  margin: 0 0 24px;
  font-weight: 600;
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.hero__title-accent {
  display: block;
  color: var(--text-accent);
}

.hero__lead {
  max-width: 34rem;
  margin: 0 0 40px;
  font-size: var(--fs-body);           /* Body/L: 20/26, 18/24, 16/21 */
  line-height: var(--lh-body);
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.hero__lead-key {
  font-weight: 500;
  color: var(--text-primary);
}

/* "за один день", underlined by a line that draws itself once the copy is in */
.hero__underline {
  position: relative;
  white-space: nowrap;
}

.hero__underline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 2px;
  border-radius: 1px;
  background: var(--bg-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.9s var(--ease-expo) 0.55s;
}

.hero.is-in .hero__underline::after,
html:not(.js) .hero__underline::after {
  transform: none;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* The station on its plinth, its foot fading into the page */
.hero__product {
  position: absolute;
  right: 40px;
  bottom: 0;
  width: min(1100px, 58vw);
  pointer-events: none;
}

.hero__product img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-mask-image: linear-gradient(#000 58%, transparent 97%);
  mask-image: linear-gradient(#000 58%, transparent 97%);
}

/* Entrance: copy first, the product a beat later; both from already-close */
.js .hero__copy > *,
.js .hero__product {
  opacity: 0;
  transform: translateY(16px);
}

.js .hero.is-in .hero__copy > *,
.js .hero.is-in .hero__product {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.9s var(--ease-expo) calc(var(--d, 0) * 1ms),
    transform 1.1s var(--ease-expo) calc(var(--d, 0) * 1ms);
}

.hero__copy > :nth-child(1) { --d: 0; }
.hero__copy > :nth-child(2) { --d: 90; }
.hero__copy > :nth-child(3) { --d: 180; }
.hero__product { --d: 260; }

/* ==========================================================================
   Tablet: the header folds into one button; copy over product
   ========================================================================== */
@media (max-width: 1279px) {
  :root {
    --fs-h1: 48px;
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-nav,
  .site-contact {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .hero {
    min-height: 0;
  }

  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    min-height: 0;
    padding: 152px var(--page-x) 0;
  }

  .hero__copy {
    max-width: 640px;
  }

  .hero__product {
    position: relative;
    right: auto;
    bottom: auto;
    width: calc(100% + var(--page-x));
    max-width: 960px;
    margin: 56px 0 0 calc(var(--page-x) * -0.5);
    justify-self: center;
  }
}

/* ==========================================================================
   Phone
   ========================================================================== */
@media (max-width: 767px) {
  :root {
    --fs-h1: 30px;

  }

  .site-header {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .brand img {
    height: 32px;
  }

  .site-menu {
    top: 68px;
  }

  .hero__inner {
    padding-top: 112px;
  }

  .hero__title {
    margin-bottom: 16px;
  }

  .hero__lead {
    margin-bottom: 28px;
  }

  .hero__actions .btn {
    flex: 1 1 0;
    padding: 0 20px;
  }

  /* a little wider than the screen, so the station reads at phone size;
     only the panels' outer edges go past the sides */
  .hero__product {
    width: 118vw;
    max-width: none;
    margin: 36px 0 0 calc((100% - 118vw) / 2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .hero__copy > *,
  .js .hero__product {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__underline::after {
    transform: none;
    transition: none;
  }

  .btn,
  .btn__fill::before,
  .btn__label,
  .nav__goo,
  .site-nav a,
  .site-menu__links a {
    transition: none;
  }
}
