/*
 * secret · web/styles.css
 *
 * Прелоудер: оверлей (.all), кольцо SVG, анимации текста.
 * Цвета: фон #050505, кольцо — #E3C192 (золото из TemplateThemePreset.passion).
 */

:root {
  --preloader-bg:   #050505;
  --preloader-fill: #9B1020;
  --preloader-text: #ffffff;
  --preloader-track: rgba(255, 255, 255, 0.12);
  --preloader-backdrop:
    radial-gradient(circle at 50% 38%, rgba(155, 16, 32, 0.10) 0%, rgba(155, 16, 32, 0) 50%),
    linear-gradient(180deg, #050505 0%, #0d0808 100%);
}

html, body {
  margin: 0; padding: 0;
  height: 100%; width: 100%;
  overflow: hidden;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--preloader-backdrop);
  background-color: var(--preloader-bg);
}

body.ready {
  background: var(--preloader-backdrop);
  background-color: var(--preloader-bg);
  transition: background 0.3s ease;
}

flt-glass-pane, flt-scene-host, flt-scene, canvas[id^="flutter-view"] {
  width: 100vw !important; height: 100vh !important;
  position: fixed !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  transform: translateZ(0);
}

/* ── Оверлей ────────────────────────────────────────────────────────────────── */

.all {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  background: var(--preloader-backdrop);
  background-color: var(--preloader-bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.4s ease;
  opacity: 1;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.all.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Кольцо + логотип ────────────────────────────────────────────────────────── */

.loading {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  scale: 0;
}

.logo {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(54vw, 188px);
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

#logoFallback {
  position: absolute;
  top: 50%; left: 50%;
  width: min(42vw, 148px);
  height: auto;
  display: block;
  object-fit: contain;
  transform: translate(-50%, -50%);
}

.percent svg {
  position: absolute;
  top: 50%; left: 50%;
  width: 200px; height: 200px;
  transform: translate(-100px, -100px);
}

.percent svg path {
  fill: none;
  stroke-width: 8.5;
  stroke-linecap: round;
}

.percent svg path#preloaderRemainder {
  stroke: var(--preloader-track);
}

.percent svg path#preloaderProgress {
  stroke: var(--preloader-fill);
}

/* ── Otree-лого внизу ────────────────────────────────────────────────────────── */

.logoOtree {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 0);
  padding: 20px;
  opacity: 0;
}

/* ── Текст загрузки ──────────────────────────────────────────────────────────── */

.loadingTextWrap {
  position: fixed;
  top: max(24px, env(safe-area-inset-top, 0px) + 10px);
  left: 50%;
  width: min(92vw, 560px);
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  opacity: 0;
}

#loadingText {
  position: static;
  width: 100%;
  color: var(--preloader-text);
  font-size: 14px;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  text-align: center;
  user-select: none;
  opacity: 0.82;
  letter-spacing: 0.2px;
}

/* ── Анимации ─────────────────────────────────────────────────────────────────── */

.fade-in      { opacity: 1; transition: opacity 0.5s ease-in; }
.fade-inScale {
  opacity: 1; scale: 1;
  transition:
    opacity 0.5s cubic-bezier(0.42, 0.0, 0.58, 1.0),
    scale   0.5s cubic-bezier(0.42, 0.0, 0.58, 1.0);
}

@keyframes slideOutLeft {
  from { transform: translateX(0);     opacity: 1; }
  to   { transform: translateX(-100%); opacity: 0; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.slide-out-left { animation: slideOutLeft 0.5s forwards; }
.slide-in-right { animation: slideInRight 0.5s forwards; }

/* ── SEO / bot-mode ──────────────────────────────────────────────────────────── */

.visually-hidden,
.seo-h1 {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.bot-content { display: none; }

.seo-home {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 96px;
  color: #f7f4ef;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.seo-home h1 {
  max-width: 820px;
  margin: 0 0 24px;
  font-size: 48px;
  line-height: 1.05;
}

.seo-home h2 { margin: 42px 0 14px; font-size: 28px; }
.seo-home p,
.seo-home li,
.seo-home address { color: rgba(247, 244, 239, 0.74); font-size: 17px; line-height: 1.65; }
.seo-home ul { padding-left: 22px; }
.seo-home a { color: #f7f4ef; }
.seo-home address { margin-top: 36px; font-style: normal; }

.seo-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 36px; }
.seo-actions .btn {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid rgba(155, 16, 32, 0.55);
  color: #f7f4ef;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  letter-spacing: 0.04em;
}
.seo-actions .btn.primary {
  background: #9B1020;
  border-color: #9B1020;
  color: #fff;
}

.ready .seo-home { display: none; }
.bot-mode .seo-home { display: block !important; }
.bot-mode body {
  position: static !important;
  overflow: auto !important;
  user-select: text !important;
  touch-action: auto !important;
}
.bot-mode flutter-view { display: none !important; }

.bot-mode .percent,
.bot-mode .logoOtree { display: none !important; }

.bot-mode .loading { opacity: 1 !important; scale: 1 !important; }

.bot-mode #logoFallback { display: block !important; }

.bot-mode #loadingText { color: #111111; }

seo-text, seo-image, seo-widget, seo-widget-container {
  position: absolute !important;
  width: 0 !important; height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  z-index: -9999 !important;
}

video {
  pointer-events: none !important;
}

video::-webkit-media-controls,
video::-webkit-media-controls-panel,
video::-webkit-media-controls-overlay-play-button,
video::-webkit-media-controls-enclosure,
video::-webkit-media-controls-start-playback-button,
video::-webkit-media-controls-picture-in-picture-button {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── Мобильная адаптация ─────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .seo-home { width: min(100% - 28px, 960px); padding-top: 40px; }
  .seo-home h1 { font-size: 36px; }

  .logo { width: min(58vw, 156px); height: 42px; }

  #logoFallback { width: min(46vw, 132px); height: auto; }

  .percent svg {
    width: 176px; height: 176px;
    transform: translate(-88px, -88px);
  }

  .logoOtree {
    bottom: max(16px, env(safe-area-inset-bottom, 0px) + 8px);
  }

  #loadingText { font-size: 13px; }
}
