/* ==========================================================================
   СНЕЖНЫЙ ПАРК «БЕРЛОГА» — MOBILE SNOWBOARDING STYLESHEET (STYLE-M.CSS)
   Transparent Header + Inline Video + Slopestyle Progression
   ========================================================================== */

:root {
  --bg-studio: #F3EFEA;
  --bg-dark: #111111;
  --bg-dark-card: #1F1F1F;
  --bg-card: #FFFFFF;

  --ink: #111111;
  --ink-muted: #524E48;
  --ink-light: #7D7870;

  --accent: #FF5500;
  --accent-hover: #E04B00;
  --accent-glow: rgba(255, 85, 0, 0.30);

  --border: rgba(17, 17, 17, 0.14);
  --border-strong: rgba(17, 17, 17, 0.26);
  --border-dark: rgba(255, 255, 255, 0.12);

  --font-head: 'Unbounded', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --chamfer-sm: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  --chamfer-md: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));

  --header-height: 64px;
  --container-pad: 18px;
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-size: 16px;
  background-color: var(--bg-studio);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

main { transition: opacity 0.16s ease, transform 0.16s ease; }
main.page-fade-out { opacity: 0; transform: translateY(6px); }
main.page-fade-in { opacity: 0; transform: translateY(-6px); }
body.m-menu-open { overflow: hidden; touch-action: none; }

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 800; color: var(--ink); line-height: 1.15; }
p { color: var(--ink-muted); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  clip-path: var(--chamfer-sm);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
  text-align: center;
}

.btn-primary { background: var(--accent); color: #ffffff; box-shadow: 0 6px 18px var(--accent-glow); }
.btn-primary:active { transform: scale(0.98); background: var(--accent-hover); }
.btn-outline { background: rgba(255, 255, 255, 0.72); color: var(--ink); border: 1.5px solid var(--border-strong); clip-path: none; border-radius: 3px; }
.btn-outline-light { background: rgba(255, 255, 255, 0.06); color: #ffffff; border: 1.5px solid rgba(255, 255, 255, 0.28); clip-path: none; border-radius: 3px; }
.btn-block { width: 100%; }

/* ==========================================================================
   TRANSPARENT MOBILE HEADER (NO BACKGROUND BAR)
   ========================================================================== */
.m-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 2000;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: none !important;
  pointer-events: none;
}

.m-header-inner {
  position: relative;
  z-index: 2001;
  background: transparent !important;
  height: 100%;
  padding: 0 var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-brand-berloga,
.m-header-actions { pointer-events: auto; }

.m-brand-berloga {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: rgba(17, 17, 17, 0.9);
  clip-path: var(--chamfer-sm);
}

.m-brand-emblem { width: 30px; height: 30px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.m-brand-name { font-family: var(--font-head); font-size: 0.84rem; font-weight: 900; color: #ffffff; text-transform: uppercase; }
.m-brand-sub { font-family: var(--font-mono); font-size: 0.58rem; color: var(--accent); margin-left: 4px; }

.m-header-actions { display: flex; align-items: center; gap: 8px; }

.m-vk-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 12px;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  clip-path: var(--chamfer-sm);
}

.m-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 38px;
  background: var(--ink);
  clip-path: var(--chamfer-sm);
  padding: 8px;
}

.m-burger span { display: block; width: 18px; height: 2px; background: #ffffff; transition: all 0.25s ease; }
.m-burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.m-burger.active span:nth-child(2) { opacity: 0; }
.m-burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Slide-down Drawer */
.m-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100dvh;
  background: #141414;
  color: #ffffff;
  z-index: 1999;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-height) + 18px) var(--container-pad) 28px;
  overflow-y: auto;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.m-nav-drawer.open { transform: translateY(0); opacity: 1; visibility: visible; pointer-events: auto; }

.m-drawer-search {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  background: #202020;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0 12px;
  margin-bottom: 20px;
}

.m-drawer-search-icon { width: 16px; height: 16px; color: #999; margin-right: 8px; }
.m-drawer-search-input { width: 100%; height: 100%; background: transparent; border: none; outline: none; color: #ffffff; font-size: 0.9rem; }
.m-drawer-search-clear { color: #999; font-size: 14px; display: none; padding: 6px; }
.m-drawer-search.has-value .m-drawer-search-clear { display: block; }

.m-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: #1a1a1a;
  border: 1px solid rgba(255, 85, 0, 0.4);
  z-index: 1200;
  display: none;
  flex-direction: column;
}
.m-search-dropdown.is-open { display: flex; }
.m-search-dropdown .search-dropdown-header { padding: 10px 12px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); display: flex; justify-content: space-between; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.m-search-dropdown .search-results-list { list-style: none; padding: 6px; }
.m-search-dropdown .search-item { display: flex; flex-direction: column; gap: 3px; padding: 10px; }
.m-search-dropdown .search-item-category { font-family: var(--font-mono); font-size: 0.68rem; color: var(--accent); }
.m-search-dropdown .search-item-title { font-family: var(--font-head); font-size: 0.84rem; color: #fff; }
.m-search-dropdown .search-item-snippet { font-size: 0.74rem; color: #aaa; }
.m-search-dropdown .search-empty-state { padding: 16px; text-align: center; }
.m-search-dropdown .search-empty-desc { color: #999; font-size: 0.74rem; margin-bottom: 10px; }
.m-search-dropdown .search-suggestion-pills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.m-search-dropdown .search-pill-btn { padding: 5px 8px; background: #262626; border: 1px solid rgba(255, 255, 255, 0.16); color: #fff; font-family: var(--font-mono); font-size: 0.72rem; }
mark.search-match { background: rgba(255, 85, 0, 0.3); color: #ffb38a; }

.m-drawer-menu { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.m-drawer-link {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.m-drawer-link.active { color: var(--accent); }

.m-drawer-contacts { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.m-dc-meta { font-family: var(--font-mono); font-size: 0.72rem; color: #999; margin-bottom: 12px; }
.m-dc-socials { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.social-btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px; background: #222; border: 1px solid rgba(255, 255, 255, 0.14); font-family: var(--font-mono); font-size: 0.74rem; color: #fff; }
.social-btn-accent { background: var(--accent); border-color: var(--accent); font-weight: 700; }

/* ==========================================================================
   MOBILE HERO & INLINE VIDEO
   ========================================================================== */
.m-main { padding-top: var(--header-height); width: 100%; overflow-x: hidden; }
.m-hero { padding: 14px var(--container-pad) 32px; display: flex; flex-direction: column; }

.m-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--ink);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  transform: skewX(-8deg);
  align-self: flex-start;
  margin-bottom: 14px;
}
.m-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.m-hero-title { font-size: clamp(2rem, 8.5vw, 2.7rem); font-weight: 900; text-transform: uppercase; margin-bottom: 12px; }
.m-hero-title span { color: var(--accent); }
.m-hero-lead { font-size: 0.94rem; line-height: 1.55; color: var(--ink-muted); margin-bottom: 18px; }

.m-hero-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #141414;
  clip-path: var(--chamfer-md);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 14px 30px rgba(17, 17, 17, 0.16);
  margin-bottom: 18px;
}
.m-hero-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-video-tag {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 10px; background: rgba(17, 17, 17, 0.86); border-left: 3px solid var(--accent);
  font-family: var(--font-mono); font-size: 0.64rem; font-weight: 700; color: #ffffff;
}

.m-hero-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

/* Mobile Ticker */
.m-trail-ticker { background: var(--accent); color: #111111; padding: 11px 0; overflow: hidden; border-top: 2px solid #111; border-bottom: 2px solid #111; }
.m-marquee-track { display: flex; width: max-content; animation: mRoll 20s linear infinite; }
@keyframes mRoll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.m-marquee-item { font-family: var(--font-head); font-size: 0.92rem; font-weight: 900; padding: 0 14px; white-space: nowrap; color: #111111; }
.m-marquee-sep { color: #ffffff; font-size: 0.8rem; }

/* Mobile Interactive Slopestyle Progression */
.m-section { padding: 38px var(--container-pad); }
.m-section-header { margin-bottom: 20px; }
.m-section-title { font-size: 1.55rem; font-weight: 900; text-transform: uppercase; margin-top: 6px; }

.m-slope-board {
  background: var(--bg-dark);
  color: #ffffff;
  clip-path: var(--chamfer-md);
  padding: 20px 16px;
}

.m-slope-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.m-slope-node {
  background: var(--bg-dark-card);
  border-left: 3px solid var(--accent);
  padding: 14px;
  color: #ffffff;
}
.m-slope-node .node-step { font-family: var(--font-mono); font-size: 0.68rem; color: var(--accent); font-weight: 700; margin-bottom: 4px; display: flex; justify-content: space-between; }
.m-slope-node .node-title { font-family: var(--font-head); font-size: 0.95rem; color: #ffffff; margin-bottom: 4px; }
.m-slope-node .node-spec { font-size: 0.8rem; color: #b8b2a8; line-height: 1.45; }

/* Mobile Deck & Cards */
.m-artwork-card {
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.14);
  clip-path: var(--chamfer-md);
  overflow: hidden;
  margin-top: 20px;
}
.m-artwork-img { width: 100%; display: block; object-fit: cover; background: #ffffff; }
.m-artwork-caption { padding: 12px 16px; display: flex; justify-content: space-between; color: #fff; font-family: var(--font-mono); font-size: 0.72rem; }

.m-services-list { display: flex; flex-direction: column; gap: 14px; }
.m-service-card { background: #ffffff; border: 1px solid var(--border-strong); border-top: 3px solid var(--accent); padding: 20px; }
.m-card-title { font-size: 1.12rem; margin-bottom: 8px; }
.m-card-desc { font-size: 0.88rem; line-height: 1.55; margin-bottom: 14px; }
.m-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.m-cta-box {
  background: #141414;
  color: #ffffff;
  clip-path: var(--chamfer-md);
  padding: 28px 20px;
  margin: 12px var(--container-pad) 36px;
}
.m-cta-title { color: #ffffff; font-size: 1.35rem; margin-bottom: 10px; }
.m-cta-desc { font-size: 0.88rem; color: #cbc4ba; line-height: 1.55; margin-bottom: 18px; }

/* Mobile Subpage Styles */
.m-page-body { padding-top: 0; }
.m-breadcrumbs { padding: 12px var(--container-pad); font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-light); display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.m-breadcrumbs .cur { color: var(--ink); font-weight: 700; }
.m-page-hero { padding: 20px var(--container-pad) 28px; }
.m-page-hero-title { font-size: clamp(1.7rem, 7vw, 2.2rem); font-weight: 900; text-transform: uppercase; margin-bottom: 12px; }
.m-page-hero-lead { font-size: 0.92rem; line-height: 1.55; margin-bottom: 18px; }

.m-metrics-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.m-metric-tile { background: #141414; color: #fff; border-left: 3px solid var(--accent); padding: 12px; }
.m-mt-val { font-family: var(--font-head); font-size: 1.25rem; font-weight: 900; color: var(--accent); display: block; }
.m-mt-lbl { font-family: var(--font-mono); font-size: 0.66rem; color: #ccc5bb; text-transform: uppercase; }

.m-steps-list { display: flex; flex-direction: column; gap: 12px; }
.m-step-item { background: #ffffff; border: 1px solid var(--border-strong); border-left: 3px solid var(--accent); padding: 16px; }
.m-step-num { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.m-step-title { font-size: 1rem; margin-bottom: 6px; }
.m-step-desc { font-size: 0.86rem; line-height: 1.5; }

/* Mobile Footer & Map */
.m-footer { background: #0d0d0d; color: #ffffff; padding: 40px var(--container-pad) 28px; border-top: 4px solid var(--accent); }
.m-footer-top { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.m-brand { display: flex; align-items: center; gap: 10px; }
.m-footer-about { font-size: 0.86rem; color: #a39e97; line-height: 1.55; }
.m-footer-contacts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.m-fc-item span:first-child { font-family: var(--font-mono); font-size: 0.7rem; color: #7e7972; display: block; }
.m-fc-item a { font-size: 0.92rem; color: #ffffff; }
.m-footer-socials { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }

.m-footer-map-wrap { position: relative; isolation: isolate; z-index: 1; height: 270px; overflow: hidden; border: 1px solid var(--border-dark); background: #0c0c0c !important; margin: 16px 0 22px; }
.m-page-map-wrap { height: 300px; }
.m-footer-map-view { width: 100%; height: 100%; background: #0c0c0c !important; }
.leaflet-container { background: #0c0c0c !important; }
.leaflet-pane, .leaflet-layer, .leaflet-tile-container { background-color: transparent !important; }
.leaflet-tile-pane { filter: invert(95%) hue-rotate(180deg) contrast(110%) brightness(80%) saturate(40%); }
.leaflet-control-attribution { display: none !important; }

.m-map-floating-badge { position: absolute; bottom: 10px; left: 10px; right: 10px; z-index: 650; background: rgba(14, 14, 14, 0.92); border: 1px solid rgba(255, 85, 0, 0.35); padding: 10px 12px; }
.mfb-header { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.mfb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.mfb-title { font-family: var(--font-mono); font-size: 0.68rem; color: var(--accent); font-weight: 700; }
.mfb-address { font-size: 0.78rem; color: #fff; font-weight: 600; margin-bottom: 8px; }
.mfb-actions { display: flex; gap: 8px; }
.mfb-btn { flex: 1; text-align: center; padding: 6px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); color: #eee; font-family: var(--font-mono); font-size: 0.7rem; }

.climat-pin-wrapper { position: relative; width: 32px; height: 32px; }
.climat-pin-pulse { position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: rgba(255, 85, 0, 0.25); animation: pinPulse 2s infinite ease-out; }
@keyframes pinPulse { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.climat-pin-core { position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; background: var(--accent); border: 2px solid #fff; border-radius: 50%; }
.leaflet-popup-content-wrapper { background: #141414 !important; color: #eee !important; border: 1px solid rgba(255, 255, 255, 0.14); }
.leaflet-popup-tip { background: #141414 !important; }

.m-footer-section-title { display: block; font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.m-footer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.m-footer-links a { font-size: 0.88rem; color: #c7c2ba; }
.m-footer-meta { border-top: 1px solid var(--border-dark); padding-top: 16px; font-family: var(--font-mono); font-size: 0.7rem; color: #777; display: flex; flex-direction: column; gap: 6px; }

/* Mobile Modal & Lightbox */
.m-modal-overlay,
.lightbox-modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.82); backdrop-filter: blur(8px);
  z-index: 10000; display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none; transition: all 0.25s ease;
}
.lightbox-modal { align-items: center; padding: 20px; }
.m-modal-overlay.active, .lightbox-modal.active { opacity: 1; visibility: visible; pointer-events: auto; }
.m-modal-sheet-privacy { width: 100%; height: 100dvh; background: #161616; color: #fff; display: flex; flex-direction: column; padding: 20px var(--container-pad); }
.m-modal-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.m-modal-title { font-size: 1.1rem; color: #fff; }
.m-modal-close, .lightbox-close { font-size: 1.8rem; color: #aaa; }
.m-privacy-modal-scroll { flex: 1; overflow-y: auto; padding: 12px 0; font-size: 0.86rem; color: #ccc; line-height: 1.6; }
.m-privacy-modal-scroll h4 { color: #fff; margin: 14px 0 6px; }
.m-privacy-modal-scroll ul { margin: 6px 0 10px 18px; }
.m-privacy-req-box { background: #1f1f1f; border: 1px solid rgba(255, 255, 255, 0.1); padding: 12px; margin-top: 8px; }
.m-privacy-req-row { padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); font-size: 0.78rem; }
.m-privacy-req-label { color: #888; display: block; }
.m-privacy-req-val { color: #fff; font-weight: 600; }
.m-privacy-actions-bar { display: flex; flex-direction: column; gap: 8px; }
.m-privacy-pdf-btn { display: flex; justify-content: center; padding: 12px; border: 1px solid rgba(255, 255, 255, 0.25); color: #fff; font-family: var(--font-mono); font-size: 0.82rem; }
.lightbox-content { position: relative; max-width: 94vw; text-align: center; }
.lightbox-img { max-width: 100%; max-height: 76vh; object-fit: contain; }
.lightbox-caption { margin-top: 10px; font-family: var(--font-mono); font-size: 0.78rem; color: #fff; }
.m-toast { position: fixed; bottom: 16px; left: 16px; right: 16px; background: #111; color: #fff; border: 1px solid var(--accent); padding: 12px 16px; font-family: var(--font-mono); font-size: 0.78rem; z-index: 11000; transform: translateY(120%); opacity: 0; transition: all 0.25s ease; }
.m-toast.show { transform: translateY(0); opacity: 1; }
.font-mono { font-family: var(--font-mono); }
.m-breadcrumbs .sep { opacity: 0.45; }
