/* ==========================================================================
   Ваше Мурлычество — стили
   Все цвета берутся только из переменных :root, чтобы позже можно было
   подключить систему тем без переделки разметки и стилей.
   ========================================================================== */

/* ---------- Тема по умолчанию (dark) — визуально идентична текущему дизайну ---------- */
:root,
[data-theme="dark"] {
  --bg: #1F1220;
  --surface: #2A1B2E;
  --border: #4A3350;
  --text-primary: #F5EDE4;
  --text-secondary: #C9B8C7;
  --primary: #E8A94C;
  --primary-hover: #F2C173;
  --text-inverse: #241521;

  --bg-rgb: 31, 18, 32;
  --primary-rgb: 232, 169, 76;
  --shadow-rgb: 0, 0, 0;
}

/* ---------- Тема sunset (подготовлена, пока не подключена) ---------- */
[data-theme="sunset"] {
  --bg: #2B1420;
  --surface: #3B1D2C;
  --border: #5C2F3E;
  --text-primary: #FBEEE6;
  --text-secondary: #E3B7B0;
  --primary: #F0784B;
  --primary-hover: #F59470;
  --text-inverse: #2B1420;

  --bg-rgb: 43, 20, 32;
  --primary-rgb: 240, 120, 75;
  --shadow-rgb: 0, 0, 0;
}

/* ---------- Тема sunrise (подготовлена, пока не подключена) ---------- */
[data-theme="sunrise"] {
  --bg: #FFF6EC;
  --surface: #FFFFFF;
  --border: #F0DCC4;
  --text-primary: #3A2418;
  --text-secondary: #8A6A52;
  --primary: #E2793D;
  --primary-hover: #EF9760;
  --text-inverse: #FFF6EC;

  --bg-rgb: 255, 246, 236;
  --primary-rgb: 226, 121, 61;
  --shadow-rgb: 58, 36, 24;
}

/* ---------- Тема light (подготовлена, пока не подключена) ---------- */
[data-theme="light"] {
  --bg: #F7F7F8;
  --surface: #FFFFFF;
  --border: #E2E2E6;
  --text-primary: #201C22;
  --text-secondary: #6B6570;
  --primary: #C97C2E;
  --primary-hover: #DE9750;
  --text-inverse: #FFFFFF;

  --bg-rgb: 247, 247, 248;
  --primary-rgb: 201, 124, 46;
  --shadow-rgb: 30, 30, 35;
}

/* ---------- Общие токены, не зависящие от темы ---------- */
:root {
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 28px;
  --radius-full: 999px;

  --shadow-soft: 0 20px 60px -20px rgba(var(--shadow-rgb), 0.55);
  --shadow-hover: 0 24px 70px -18px rgba(var(--primary-rgb), 0.35);

  --header-h: 76px;
  --container-w: 1080px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.section-inner,
.header-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 100;
  background: rgba(var(--bg-rgb), 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}

.site-header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(var(--bg-rgb), 0.88);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.3s var(--ease);
}

.logo:hover {
  opacity: 0.85;
}

.logo-mark {
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.01em;
}

.main-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-list a {
  display: inline-block;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}

.nav-list a:hover {
  color: var(--text-primary);
  background: var(--surface);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + 40px) 24px 80px;
  position: relative;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(var(--primary-rgb), 0.10), transparent 70%),
    var(--bg);
}

.hero-inner {
  max-width: 720px;
  text-align: center;
}

.eyebrow {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(48px, 9vw, 92px);
  line-height: 1.03;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.hero-title span {
  font-style: italic;
  color: var(--primary);
}

.tail-flourish {
  margin: 22px auto 26px;
  display: block;
}

.hero-text {
  max-width: 480px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s var(--ease);
  will-change: transform;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-soft);
  position: relative;
  animation: btn-glow 2.6s ease-in-out infinite;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px) scale(1.03);
  box-shadow: var(--shadow-hover);
  animation-play-state: paused;
}

@keyframes btn-glow {
  0%, 100% {
    box-shadow: var(--shadow-soft), 0 0 0 0 rgba(var(--primary-rgb), 0.45);
  }
  50% {
    box-shadow: var(--shadow-soft), 0 0 18px 6px rgba(var(--primary-rgb), 0.38);
  }
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px) scale(1.02);
}

.btn-large {
  padding: 13px 28px;
  font-size: 14.5px;
  margin-top: 8px;
}

.btn[aria-disabled="true"] {
  cursor: default;
  opacity: 0.55;
}

.btn[aria-disabled="true"]:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
  color: var(--text-primary);
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding: 120px 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-inner {
  text-align: center;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(30px, 4vw, 42px);
  margin-bottom: 16px;
}

.section-lead {
  color: var(--text-secondary);
  font-size: 16.5px;
  max-width: 520px;
  margin: 0 auto;
}

/* ---------- Link cards ---------- */

.link-list {
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 300px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.link-row:hover {
  transform: translateX(4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.link-row-cta {
  border-color: var(--primary);
  position: relative;
}

.link-row-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.link-row-icon img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.link-row-icon img.icon-missing {
  display: none;
}

.link-row-icon.icon-placeholder::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.5;
}

.link-row-name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
}

.link-row-arrow {
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 15px;
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}

.link-row:hover .link-row-arrow {
  color: var(--primary);
  transform: translateX(3px);
}

.link-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--text-inverse);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  box-shadow: 0 6px 16px -4px rgba(var(--primary-rgb), 0.55);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding: 40px 24px 100px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13.5px;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   Scroll-to-top
   ========================================================================== */

.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s, background 0.3s var(--ease);
  z-index: 90;
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--primary-hover);
  transform: translateY(-3px) scale(1.05);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 760px) {
  .nav-toggle {
    display: flex;
  }

  .nav-list {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(var(--bg-rgb), 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 18px;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }

  .nav-list.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-list a {
    padding: 14px 4px;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
  }

  .section {
    padding: 88px 0;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
}
