/* ============================================================
   VAIMAN EMBER LIGHT — Design System
   Version: 1.0.0
   Palette: ivory + espresso + ember
   Fonts: Outfit (headings) + Manrope (body)
   ============================================================ */

/* ── Custom Properties ─────────────────────────────────────── */

:root {
  /* Primary palette */
  --bg-primary: #F5F0E6;
  --bg-secondary: #FAF6EB;
  --bg-tertiary: #FFFDF7;

  /* Text */
  --text-primary: #2A1810;
  --text-secondary: #5C4634;
  --text-muted: #8B7866;

  /* Accent */
  --accent-ember: #C76619;
  --accent-ember-light: #E89765;
  --accent-ember-dark: #A85410;

  /* Complementary */
  --teal: #3F666B;
  --success: #2A8868;
  --warning: #C76619;
  --danger: #C85A5A;

  /* Borders & shadows */
  --border-light: rgba(199, 102, 25, 0.14);
  --border-strong: rgba(199, 102, 25, 0.35);
  --shadow-1: 0 2px 8px rgba(42, 24, 16, 0.06);
  --shadow-2: 0 4px 16px rgba(42, 24, 16, 0.10);
  --shadow-3: 0 12px 40px rgba(42, 24, 16, 0.18);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transition */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --duration: .22s;

  /* Z-index scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;

  --bg-inset: #EDE4D6;

  /* Layout shell (header + collapsible sidebar like KIE) */
  --header-h: 60px;
  --sidebar-w: 236px;            /* развёрнутый сайдбар */
  --sidebar-w-rail: 72px;        /* свёрнутый «рельс» (только иконки) */
  --sidebar-w-drawer: min(290px, 86vw); /* выезжающая панель на телефоне */

  /* Page & sidebar gradients */
  --bg-page-grad:
    radial-gradient(120% 70% at 100% -8%, rgba(199, 102, 25, 0.07), transparent 55%),
    radial-gradient(110% 70% at -10% 108%, rgba(63, 102, 107, 0.07), transparent 60%),
    linear-gradient(160deg, #FBF2E3 0%, #F7EBD6 45%, #F3E4CB 100%);
  --bg-sidebar-grad: linear-gradient(180deg, #F8F0E4 0%, #F4E8D8 100%);
  --sidebar-border: rgba(199, 102, 25, 0.12);
  --header-bg: rgba(255, 253, 247, 0.86);

  color-scheme: light;
}


/* ── EMBER DARK — тёмная тема (палитра EMBER мини-аппов, УТВ. 2026-05-09) ── */

[data-theme="dark"] {
  /* Primary palette — фирменный тёмный EMBER */
  --bg-primary: #142233;
  --bg-secondary: #19313B;
  --bg-tertiary: #1E3A46;

  /* Text — ivory на тёмном */
  --text-primary: #F5F0E6;
  --text-secondary: #CDC3B0;
  --text-muted: #93A1A8;

  /* Accent — ember светлее для контраста на тёмном */
  --accent-ember: #E8965A;
  --accent-ember-light: #F2B488;
  --accent-ember-dark: #C76619;

  /* Complementary */
  --teal: #6FA3AB;
  --success: #3FAE8C;
  --warning: #E8965A;
  --danger: #E07B7B;

  /* Borders & shadows — тёплые светлые бордеры, глубокие тени */
  --border-light: rgba(232, 151, 101, 0.16);
  --border-strong: rgba(232, 151, 101, 0.42);
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.36);
  --shadow-3: 0 12px 40px rgba(0, 0, 0, 0.5);

  --bg-inset: #112030;

  /* Фон страницы = ember-визуал мини-аппов TG: тёплое ember-свечение сверху-справа,
     холодный navy снизу-слева, плавное затемнение книзу (как body::before в photo_menu). */
  --bg-page-grad:
    radial-gradient(125% 65% at 82% -10%, rgba(199, 102, 25, 0.20), transparent 55%),
    radial-gradient(130% 75% at -12% 112%, rgba(40, 72, 108, 0.34), transparent 60%),
    linear-gradient(180deg, #17293B 0%, #122031 42%, #0E1926 100%);
  --bg-sidebar-grad: linear-gradient(180deg, rgba(24, 42, 58, 0.94) 0%, rgba(16, 28, 42, 0.94) 100%);
  --sidebar-border: rgba(232, 151, 101, 0.16);
  --header-bg: rgba(19, 32, 49, 0.82);

  color-scheme: dark;
}


/* ── Font Faces ────────────────────────────────────────────── */

/* Outfit — Headings */
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* Manrope — Body */
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* ── Reset + Base ──────────────────────────────────────────── */

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

html {
  /* Адаптив: корневой rem плавно растёт на больших экранах (ноут/монитор/34") — весь rem-контент
     масштабируется пропорционально, без zoom. До ~1167px = 16px (телефон/планшет не трогаем). */
  font-size: clamp(16px, 0.6vw + 9px, 19px);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  background-image: var(--bg-page-grad);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-ember);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

a:hover {
  color: var(--accent-ember-dark);
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  line-height: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul,
ol {
  list-style: none;
}

::selection {
  background: rgba(199, 102, 25, 0.18);
  color: var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--accent-ember);
  outline-offset: 2px;
}


/* ── Typography ────────────────────────────────────────────── */

.h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.h2 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--text-primary);
}

.h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.h5 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--text-primary);
}

.h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.45;
}

.text-xs {
  font-size: 0.75rem;
  line-height: 1.5;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.45;
}

.font-display {
  font-family: 'Outfit', sans-serif;
}

.text-muted {
  color: var(--text-muted);
}

.text-ember {
  color: var(--accent-ember);
}

.text-teal {
  color: var(--teal);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

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

.text-right {
  text-align: right;
}

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fw-900 { font-weight: 900; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ── Spacing Utilities ─────────────────────────────────────── */

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 24px; }
.mt-6 { margin-top: 32px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 24px; }
.mb-6 { margin-bottom: 32px; }

.mx-auto { margin-left: auto; margin-right: auto; }

.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 24px; }
.p-6 { padding: 32px; }

.px-1 { padding-left: 4px; padding-right: 4px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-5 { padding-left: 24px; padding-right: 24px; }
.px-6 { padding-left: 32px; padding-right: 32px; }

.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-5 { padding-top: 24px; padding-bottom: 24px; }
.py-6 { padding-top: 32px; padding-bottom: 32px; }

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }


/* ── Display Utilities ─────────────────────────────────────── */

.flex {
  display: flex;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

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

.flex-1 {
  flex: 1;
}

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

.grid {
  display: grid;
}

.hidden {
  display: none;
}

.block {
  display: block;
}

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

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}


/* ── Width Utilities ───────────────────────────────────────── */

.w-full {
  width: 100%;
}

.max-w-sm {
  max-width: 480px;
}

.max-w-md {
  max-width: 720px;
}

.max-w-lg {
  max-width: 960px;
}

.max-w-xl {
  max-width: 1200px;
}

.max-w-2xl {
  max-width: 1400px;
}


/* ── Reduced Motion ────────────────────────────────────────── */

/* Глобальная заморозка анимаций под reduced-motion СНЯТА по решению владельца:
   у многих телефон в режиме энергосбережения (=reduced-motion), а бренд-анимации
   (intro, движущиеся ленты, ambient) должны играть везде. Оставляем только плавный скролл. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* плавная смена темы */
body, .site-header, .site-sidebar, .mobile-tabs {
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
