/* ==========================================================================
   Layout: header, hero, tree zone, split panels, footer.
   ========================================================================== */

/* ---------- header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-500) 18%, var(--gold-300) 50%, var(--gold-500) 82%, transparent);
  opacity: 0;
  transition: opacity 0.35s;
}
.site-header.is-solid {
  background: rgba(8, 6, 5, 0.88);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  backdrop-filter: blur(12px) saturate(1.15);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}
.site-header.is-solid::after { opacity: 1; }

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand img {
  width: 46px; height: 46px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.7));
}
.brand__text { display: grid; line-height: 1; }
.brand__text b {
  font: 800 1.15rem/1 var(--f-display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-100);
}
.brand__text small {
  margin-top: 7px;
  font: 600 0.6rem/1 var(--f-display);
  letter-spacing: 0.52em;
  text-transform: uppercase;
  color: var(--ember-300);
}

.nav {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: rgba(14, 11, 9, 0.72);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 0 0 1px #000;
}
.nav a {
  position: relative;
  padding: 0.85em 1.05em;
  font: 700 0.68rem/1 var(--f-display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ash-300);
  transition: color 0.2s;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 1em; right: 1em; bottom: 0.4em;
  height: 1px;
  background: var(--ember-300);
  box-shadow: 0 0 8px var(--ember-400);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease);
}
.nav a:hover,
.nav a[aria-current="true"] { color: var(--gold-100); }
.nav a:hover::after,
.nav a[aria-current="true"]::after { transform: scaleX(1); }

.site-header__actions { display: flex; align-items: center; gap: 12px; }

/* RU / EN / 中 switch */
.lang-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: rgba(14, 11, 9, 0.72);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 0 0 1px #000;
}
.lang-switch button {
  min-width: 38px;
  height: 34px;
  padding: 0 8px;
  background: none;
  border: 0;
  font: 700 0.68rem/1 var(--f-display);
  letter-spacing: 0.12em;
  color: var(--ash-300);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.lang-switch button:hover { color: var(--gold-100); }
.lang-switch button[aria-pressed="true"] {
  color: var(--gold-100);
  background: linear-gradient(180deg, rgba(196, 80, 15, 0.55), rgba(108, 36, 6, 0.55));
  box-shadow: inset 0 0 0 1px rgba(232, 164, 88, 0.5);
}
.lang-switch--menu { display: none; }

.burger {
  display: none;
  width: 44px; height: 44px;
  padding: 0;
  place-items: center;
  background: rgba(14, 11, 9, 0.8);
  border: 1px solid var(--line-2);
  cursor: pointer;
}
.burger span,
.burger span::before,
.burger span::after {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--gold-200);
  transition: transform 0.3s var(--ease), background 0.3s;
}
.burger span { position: relative; }
.burger span::before,
.burger span::after { content: ""; position: absolute; left: 0; }
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }
.menu-open .burger span { background: transparent; }
.menu-open .burger span::before { transform: translateY(6px) rotate(45deg); }
.menu-open .burger span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1080px) {
  .burger { display: inline-grid; }
  .nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 22px;
    background: rgba(8, 6, 5, 0.97);
    border: 0;
    border-bottom: 1px solid var(--gold-500);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s var(--ease), visibility 0.3s;
  }
  .menu-open .nav { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 1.2em 0.2em; font-size: 0.78rem; border-bottom: 1px solid var(--line); }
  .nav a::after { left: 0.2em; right: auto; width: 36px; bottom: 0.6em; }
}
@media (max-width: 720px) {
  .site-header__actions .btn { display: none; }
}
@media (max-width: 560px) {
  /* phones: the switch moves from the header into the menu drawer */
  .site-header__actions .lang-switch { display: none; }
  .nav .lang-switch--menu { display: inline-flex; align-self: flex-start; margin-top: 20px; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: max(100svh, 720px);
  display: grid;
  align-items: center;
  padding-top: var(--header-h);
  overflow: hidden;
  isolation: isolate;
}

.hero__art {
  position: absolute;
  top: 0; bottom: 0;
  right: -9%;
  width: min(88vw, 1560px);
  z-index: -3;
  will-change: transform;
}
.hero__img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 14%;
  filter: brightness(0.8) contrast(1.08) saturate(1.04);
}
/* fade the art in once decoded instead of popping (only when JS can mark it ready) */
.js .hero__img { opacity: 0; transition: opacity 1.4s var(--ease); }
.js .hero__img.is-ready { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .js .hero__img { transition: none; }
}

/* blends the art into the page: dark on the left (copy), fading at every edge */
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, var(--bg-0) 0%, rgba(8, 6, 5, 0.94) 20%, rgba(8, 6, 5, 0.58) 40%, rgba(8, 6, 5, 0) 62%),
    linear-gradient(0deg, var(--bg-0) 0%, rgba(8, 6, 5, 0) 24%),
    linear-gradient(180deg, rgba(8, 6, 5, 0.9) 0%, rgba(8, 6, 5, 0) 20%),
    radial-gradient(110% 90% at 68% 42%, transparent 52%, rgba(5, 4, 3, 0.8) 100%);
}

.hero__embers {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%; height: 100%;
  pointer-events: none;
}

.hero__inner { position: relative; z-index: 2; padding-block: clamp(40px, 8vh, 96px); }
.hero__copy { max-width: 640px; }

.hero__title {
  isolation: isolate;
  margin-top: 22px;
  text-transform: uppercase;
  line-height: 0.9;
}
/* max-content: the gradient clip must cover the whole word, not just the 640px copy column */
.hero__title span { display: block; width: max-content; }
.t-1 {
  font-size: clamp(2.9rem, 9.4vw, 8.4rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  background: linear-gradient(180deg, #fff3cf 0%, #e7c98a 36%, #b98a3c 64%, #7a5622 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.9)) drop-shadow(0 0 30px rgba(255, 106, 26, 0.28));
}
.t-2 {
  margin-top: 0.12em;
  font-size: clamp(2.1rem, 5.6vw, 5rem);
  font-weight: 800;
  letter-spacing: 0.42em;
  background: linear-gradient(180deg, #ffe2b0 0%, #ff9a3c 45%, #c8400d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: crown 3.6s ease-in-out infinite alternate;
}
@keyframes crown {
  from { filter: drop-shadow(0 0 10px rgba(255, 106, 26, 0.35)); }
  to   { filter: drop-shadow(0 0 26px rgba(255, 138, 42, 0.8)); }
}

.hero__lore {
  margin-top: 30px;
  padding-left: 18px;
  border-left: 2px solid var(--ember-400);
  font: 400 clamp(1.15rem, 1.9vw, 1.5rem)/1.4 var(--f-lore);
  color: var(--gold-200);
}
.hero__lead {
  margin-top: 18px;
  max-width: 52ch;
  font-size: 1.12rem;
  color: var(--ash-200);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 30px;
  font: 700 0.68rem/1 var(--f-display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ash-300);
}
.hero__facts li { display: inline-flex; align-items: center; gap: 0.8em; }
.hero__facts li::before {
  content: "";
  width: 5px; height: 5px;
  background: var(--gold-400);
  transform: rotate(45deg);
}

.hero__cue {
  position: absolute;
  left: 50%; bottom: 22px;
  z-index: 3;
  width: 26px; height: 44px;
  transform: translateX(-50%);
  border: 1px solid var(--gold-500);
  border-radius: 14px;
  background: rgba(8, 6, 5, 0.4);
}
.hero__cue::after {
  content: "";
  position: absolute;
  left: 50%; top: 8px;
  width: 4px; height: 4px;
  margin-left: -2px;
  background: var(--ember-300);
  transform: rotate(45deg);
  box-shadow: 0 0 8px var(--ember-400);
  animation: cue 2s var(--ease) infinite;
}
@keyframes cue {
  0%   { transform: translateY(0) rotate(45deg); opacity: 1; }
  80%  { transform: translateY(18px) rotate(45deg); opacity: 0; }
  100% { transform: translateY(0) rotate(45deg); opacity: 0; }
}

@media (max-width: 960px) {
  .hero { align-items: end; min-height: max(100svh, 780px); }
  .hero__art { left: 0; right: 0; width: 100%; bottom: auto; height: min(74vh, 760px); }
  .hero__img { object-position: 50% 6%; }
  .hero__shade {
    background:
      linear-gradient(0deg, var(--bg-0) 0%, rgba(8, 6, 5, 0.93) 36%, rgba(8, 6, 5, 0.25) 66%, rgba(8, 6, 5, 0.5) 100%),
      linear-gradient(180deg, rgba(8, 6, 5, 0.85) 0%, rgba(8, 6, 5, 0) 16%);
  }
  .hero__copy { padding-top: min(40vh, 380px); }
  .hero__cue { display: none; }
}
@media (max-width: 520px) {
  .t-2 { letter-spacing: 0.3em; }
  .hero__cta .btn { flex: 1 1 100%; }
}

/* ---------- passive-tree backdrop ---------- */
.tree-zone { position: relative; }
.tree-zone__canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}
.tree-zone > .section,
.tree-zone > .container { position: relative; z-index: 1; }

/* ---------- features + requirements ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding-bottom: clamp(72px, 10vw, 128px);
}
.split > section { scroll-margin-top: calc(var(--header-h) + 16px); }
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; }
}

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  padding-top: 64px;
  background: linear-gradient(180deg, #0a0706, #050403);
  border-top: 1px solid var(--line-2);
}
.site-footer::before {
  content: "";
  position: absolute;
  left: 50%; top: -1px;
  width: min(520px, 70%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--gold-300), transparent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: 40px 36px;
}
.footer-brand p { margin-top: 18px; max-width: 34ch; color: var(--ash-300); }
.footer-col h3 {
  margin-bottom: 16px;
  font: 700 0.7rem/1 var(--f-display);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ash-400);
}
.footer-col a {
  display: block;
  padding: 5px 0;
  color: var(--ash-300);
  text-decoration: none;
  transition: color 0.2s, transform 0.2s var(--ease);
}
.footer-col a:hover { color: var(--gold-200); transform: translateX(3px); }

.legal {
  margin-top: 56px;
  padding: 26px 0 40px;
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--ash-400);
}
.legal p { max-width: 96ch; }
.legal__title {
  font: 700 0.7rem/1 var(--f-display);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ash-300);
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
