/* =========================
   ROOT: ВСЕ НАСТРОЙКИ СЦЕНЫ
   (ЗДЕСЬ ДВИГАЕШЬ И МАСШТАБИРУЕШЬ ЭЛЕМЕНТЫ)
========================= */

:root {
  /* Размер сцены под твой макет 1920x1080 */
  --scene-width: 1920px;
  --scene-height: 1080px;

  /* Фоны трёх экранов (подставь свои файлы) */
  --bg-main-image: url("bg_gigacats_main.png");
  --bg-about-image: url("bg_gigacats_about.png");
  --bg-chart-image: url("bg_gigacats_chart.png");

  /* ---------- SCREEN 1 ---------- */

  /* Верхнее меню */
  --top-nav-top: 20px;
  --top-nav-gap: 40px;
  --top-nav-font-size: 40px;

  /* Заголовок GIGACATS */
  --title-top: 300px;
  --title-font-size: 130px;

  /* Контракт CA */
  --ca-top: 470px;
  --ca-font-size: 28px;

  /* Стрелка на первом экране */
  --arrow-main-bottom: 80px;
  --arrow-main-size: 150px;

  /* ---------- SCREEN 2 (ABOUT) ---------- */

  --about-title-top: 40px;
  --about-title-font-size: 90px;

  --about-text-top: 200px;
  --about-text-width: 1200px;
  --about-text-font-size: 26px;
  --about-text-line-height: 1.5;

  --arrow-about-bottom: 80px;
  --arrow-about-size: 150px;

  /* ---------- SCREEN 3 (CHART) ---------- */

  --chart-title-top: 40px;
  --chart-title-font-size: 80px;

  --chart-window-top: 180px;
  --chart-window-width: 1100px;
  --chart-window-height: 520px;

  --chart-window-bg: rgba(0, 0, 0, 0.65);
  --chart-window-radius: 20px;

  /* Общие анимации */
  --fade-duration: 0.7s;
  --nav-hover-scale: 1.08;
  --arrow-bounce-distance: 12px;
}

/* =========================
   BASE
========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  background: #000;
  color: #fff;
}

body {
  display: flex;
  justify-content: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page-wrapper {
  width: var(--scene-width);
}

.screen {
  position: relative;
  width: var(--scene-width);
  height: var(--scene-height);
  overflow: hidden;
}

.screen-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 0;
}

.bg-main {
  background-image: var(--bg-main-image);
}

.bg-about {
  background-image: var(--bg-about-image);
}

.bg-chart {
  background-image: var(--bg-chart-image);
}

/* =========================
   TOP NAV (SCREEN 1)
========================= */

.top-nav {
  position: absolute;
  top: var(--top-nav-top);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--top-nav-gap);
  z-index: 2;
}

.top-nav-btn {
  background: transparent;
  border: none;
  padding: 4px 0;
  font-family: "Permanent Marker", cursive;
  font-size: var(--top-nav-font-size);
  color: #000;
  cursor: pointer;
  position: relative;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
  transition:
    transform 0.15s ease-out,
    text-shadow 0.15s ease-out,
    opacity 0.15s ease-out;
}

/* подчёркивание при ховере */
.top-nav-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: #000;
  transform: translateX(-50%);
  transition: width 0.15s ease-out;
}

.top-nav-btn:hover {
  transform: scale(var(--nav-hover-scale));
  text-shadow: 0 0 10px rgba(255, 255, 255, 1);
}

.top-nav-btn:hover::after {
  width: 110%;
}

.top-nav-btn:active {
  transform: scale(0.95);
  opacity: 0.8;
}

/* =========================
   TITLE + CA (SCREEN 1)
========================= */

.gigacats-title {
  position: absolute;
  top: var(--title-top);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-family: "Permanent Marker", cursive;
  font-size: var(--title-font-size);
  color: #000;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.9),
    0 0 18px rgba(0, 0, 0, 0.7);
  z-index: 2;
  animation: titleFloat 6s ease-in-out infinite;
}

/* лёгкий “плавающий” эффект */
@keyframes titleFloat {
  0%,
  100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, -10px);
  }
}

.ca-wrapper {
  position: absolute;
  top: var(--ca-top);
  left: 50%;
  transform: translateX(-50%);
  display: none; /* по умолчанию скрыто, если нет CA */
  align-items: center;
  gap: 8px;
  font-family: "Permanent Marker", cursive;
  font-size: var(--ca-font-size);
  color: #000;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
  z-index: 2;
}

.ca-label {
  opacity: 0.8;
}

.ca-value {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.5);
  padding: 4px 18px;
  font-family: "Permanent Marker", cursive;
  font-size: inherit;
  color: #000;
  cursor: pointer;
  white-space: nowrap;
  max-width: 700px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out,
    background 0.15s ease-out;
}

.ca-value:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.ca-value:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* =========================
   ARROWS
========================= */

.arrow-down {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: none;
  background: transparent;
  color: #000;
  cursor: pointer;
  font-size: var(--arrow-main-size);
  font-family: "Permanent Marker", cursive;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.9),
    0 0 14px rgba(0, 0, 0, 0.7);
  z-index: 2;
  animation: arrowBounce 1.3s ease-in-out infinite;
  transition: transform 0.12s ease-out;
}

.arrow-main {
  bottom: var(--arrow-main-bottom);
  font-size: var(--arrow-main-size);
}

.arrow-about {
  bottom: var(--arrow-about-bottom);
  font-size: var(--arrow-about-size);
}

.arrow-down:hover {
  transform: translateX(-50%) translateY(-4px);
}

.arrow-down:active {
  transform: translateX(-50%) translateY(1px) scale(0.95);
}

@keyframes arrowBounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(var(--arrow-bounce-distance));
  }
}

/* =========================
   ABOUT SCREEN
========================= */

.about-title {
  position: absolute;
  top: var(--about-title-top);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-family: "Permanent Marker", cursive;
  font-size: var(--about-title-font-size);
  color: #000;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.9),
    0 0 18px rgba(0, 0, 0, 0.7);
  z-index: 2;
}

.about-text {
  position: absolute;
  top: var(--about-text-top);
  left: 50%;
  transform: translateX(-50%);
  width: var(--about-text-width);
  max-width: 90%;
  text-align: center;
  font-family: "Permanent Marker", cursive;
  font-size: var(--about-text-font-size);
  line-height: var(--about-text-line-height);
  color: #000;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
  z-index: 2;
  opacity: 0;
  transform-origin: center;
  transition:
    opacity var(--fade-duration) ease-out,
    transform var(--fade-duration) ease-out;
}

.about-text.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.about-text p {
  margin: 0 0 14px;
}

/* лёгкий фильтр, чтобы текст был читаемее на фоне */
.screen-about::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.15) 40%,
    rgba(255, 255, 255, 0.05) 100%
  );
  mix-blend-mode: screen;
  z-index: 1;
}

/* =========================
   CHART SCREEN
========================= */

.chart-title {
  position: absolute;
  top: var(--chart-title-top);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-family: "Permanent Marker", cursive;
  font-size: var(--chart-title-font-size);
  color: #000;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.9),
    0 0 18px rgba(0, 0, 0, 0.7);
  z-index: 2;
}

.chart-window {
  position: absolute;
  top: var(--chart-window-top);
  left: 50%;
  transform: translateX(-50%);
  width: var(--chart-window-width);
  height: var(--chart-window-height);
  background: var(--chart-window-bg);
  border-radius: var(--chart-window-radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8);
  z-index: 2;
}

.chart-window iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* =========================
   TOAST "COPIED"
========================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 24px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  font-family: "Permanent Marker", cursive;
  font-size: 20px;
  letter-spacing: 1px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease-out,
    transform 0.2s ease-out;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================
   MOBILE ADAPTIVE
   Масштабирование макета под ширину экрана
========================= */

@media (max-width: 1024px) {
  body {
    display: block;
    overflow-x: hidden;
  }

  .page-wrapper {
    width: 1920px;
    transform: scale(calc(100vw / 1920));
    transform-origin: top left;
  }
}
