:root {
  --color-bg: #0a0a0f;
  --color-text: #f5f2ee;
  --color-gold: #d4af37;
  --color-gold-light: #f4e4c1;
  --font-sans: 'LXGW WenKai Mono TC', 'Montserrat', system-ui, -apple-system, sans-serif;

  --text-col-width: 33%;
  --text-col-max: 480px;
  --text-col-min: 340px;

  --gap-text-to-button: 6rem;

  --line-height-body: 1.5;
  --line-height-title: 1.2;

  --glass-bg: rgba(10, 10, 15, 0.18);
  --glass-blur: 6px;
  --glass-padding: 28px 26px;
  --glass-shadow: 0 6px 30px rgba(0, 0, 0, 0.22);
  --glass-radius: 0;
  --glass-border: transparent;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  hyphens: none;
  -webkit-hyphens: none;
  -ms-hyphens: none;
}

/* ---------- CANVAS ----------
   Размер задаётся JavaScript'ом один раз. CSS-высота не используется,
   чтобы исключить влияние vh-единиц. */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;

  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
}

/* ---------- ПРОГРЕСС-БАР ---------- */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light), var(--color-gold));
  background-size: 200% 100%;
  animation: shimmer 2.5s linear infinite;
  z-index: 1000;
  transition: width 0.08s linear;
}

@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ---------- ПРЕЛОАДЕР ---------- */
#loader {
  position: fixed;
  inset: 0;
  background-color: var(--color-bg);
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 22px;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.7s;
}

#loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-text {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.4em;
  color: var(--color-gold);
}

.loader-bar-container {
  width: 240px;
  height: 2px;
  background: rgba(245, 242, 238, 0.08);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.loader-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
  transition: width 0.15s ease-out;
}

/* ---------- MAIN / СЕКЦИИ ---------- */
.main-content {
  position: relative;
  z-index: 10;
  width: 100%;
}

.content-section {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 100px 6vw;
  position: relative;
}

.content-section.left {
  justify-content: flex-start;
}

.content-section.right {
  justify-content: flex-end;
}

/* ---------- ПОЧТИ НЕВИДИМЫЙ БЛОК ---------- */
.section-inner {
  width: var(--text-col-width);
  max-width: var(--text-col-max);
  min-width: var(--text-col-min);
  text-align: left;

  padding: var(--glass-padding);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);

  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));

  box-shadow: var(--glass-shadow);
}

/* ---------- ЗАГОЛОВОК / ТЕКСТ ---------- */
.section-title {
  font-family: var(--font-sans);
  font-size: clamp(1.4rem, 1.1rem + 0.8vw, 1.85rem);
  font-weight: 700;
  line-height: var(--line-height-title);
  letter-spacing: 0.005em;
  color: var(--color-gold-light);
  margin-bottom: 16px;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.75),
    0 2px 10px rgba(0, 0, 0, 0.55);

  hyphens: none;
  -webkit-hyphens: none;
  word-break: normal;
  overflow-wrap: break-word;
}

.section-body {
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, 0.95rem + 0.3vw, 1.18rem);
  font-weight: 400;
  line-height: var(--line-height-body);
  letter-spacing: 0.002em;
  color: rgba(245, 242, 238, 0.95);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.7),
    0 2px 10px rgba(0, 0, 0, 0.5);

  hyphens: none;
  -webkit-hyphens: none;
  word-break: normal;
  overflow-wrap: break-word;
}

/* ---------- КНОПКА ---------- */
.cta-button {
  display: inline-block;
  margin-top: var(--gap-text-to-button);
  font-family: var(--font-sans);
  font-size: clamp(0.85rem, 0.95vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-decoration: none;
  color: #0a0a0f;
  background: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold) 100%);
  padding: 18px 48px;
  border-radius: 60px;
  box-shadow:
    0 14px 44px rgba(212, 175, 55, 0.35),
    0 0 60px rgba(212, 175, 55, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  max-width: 100%;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow:
    0 22px 60px rgba(212, 175, 55, 0.55),
    0 0 90px rgba(212, 175, 55, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.cta-button:active {
  transform: translateY(-1px);
}

.cta-button:focus-visible {
  outline: 2px solid var(--color-gold-light);
  outline-offset: 4px;
}

/* ---------- ПОСЛЕДНЯЯ СЕКЦИЯ ---------- */
.content-section.last-section {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 8vh;
}

.content-section.last-section .section-inner {
  align-self: flex-end;
}

/* ---------- АДАПТИВ ---------- */
@media (max-width: 900px) {
  :root {
    --text-col-width: 46%;
    --text-col-max: 480px;
    --text-col-min: 300px;
    --gap-text-to-button: 4rem;
    --glass-padding: 22px 20px;
  }
  .content-section {
    padding: 80px 6vw;
  }
}

@media (max-width: 640px) {
  :root {
    --gap-text-to-button: 3rem;
    --glass-padding: 20px 16px;
    --line-height-body: 1.55;
    --glass-bg: rgba(10, 10, 15, 0.22);
  }

  .content-section {
    padding: 70px 20px;
  }

  .section-inner {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .content-section.left {
    padding-right: 20px;
  }

  .content-section.right {
    padding-left: 20px;
  }

  .content-section.last-section .section-inner {
    align-self: stretch;
  }

  .section-title {
    font-size: 1.35rem;
    margin-bottom: 14px;
  }

  .section-body {
    font-size: 1.02rem;
  }

  .cta-button {
    display: block;
    margin-left: auto;
    margin-right: auto;
    padding: 16px 32px;
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress-bar { animation: none; }
  .cta-button { transition: none; }
}