*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f5f0e8; --bg2: #ede8df; --ink: #2a1f14; --ink2: #6a5a48;
  --terra: #9b4f2a; --terra2: #c4693d; --cream: #faf7f2; --line: #ddd8ce; --dark: #1a1209;
}
/* #4 убрали scroll-behavior с html — управляем скроллом только через JS */
body { background: var(--dark); color: var(--ink); font-family: 'Geologica', sans-serif; font-weight: 300; overflow-x: hidden; -webkit-overflow-scrolling: touch; /* #15 iOS smooth scroll */ }

/* пока активна заставка — страница не скроллится (нет бегунка, прогресс-бара и проступающего меню) */
html.intro-lock, html.intro-lock body { overflow: hidden !important; height: 100%; touch-action: none; }

/* ===== СТАТУС-БЕЙДЖ ===== */
.status-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(30,60,25,0.08); border: 1px solid rgba(60,140,50,0.2);
  border-radius: 20px; padding: 5px 12px 5px 8px;
  margin-bottom: 20px; width: fit-content;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4caf50;
  box-shadow: 0 0 0 0 rgba(76,175,80,0.4);
  animation: pulse-green 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76,175,80,0.4); }
  50% { box-shadow: 0 0 0 5px rgba(76,175,80,0); }
}
.status-text { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #3a8a32; }

/* ===== HERO АНИМАЦИЯ ===== */
.hero-left .hero-eyebrow,
.hero-left .status-badge,
.hero-left .hero-slogan,
.hero-left .hero-about,
.hero-left .hero-contacts,
.hero-left .hero-anchors {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
#main-content.revealed .hero-left .hero-eyebrow   { opacity: 1; transform: none; transition-delay: 0.1s; }
#main-content.revealed .hero-left .status-badge   { opacity: 1; transform: none; transition-delay: 0.22s; }
#main-content.revealed .hero-left .hero-slogan    { opacity: 1; transform: none; transition-delay: 0.36s; }
#main-content.revealed .hero-left .hero-about     { opacity: 1; transform: none; transition-delay: 0.52s; }
#main-content.revealed .hero-left .hero-contacts  { opacity: 1; transform: none; transition-delay: 0.66s; }
#main-content.revealed .hero-left .hero-anchors   { opacity: 1; transform: none; transition-delay: 0.78s; }

/* фото плавно появляется */
.hero-right { opacity: 0; transition: opacity 0.9s ease 0.5s; }
#main-content.revealed .hero-right { opacity: 1; }
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--terra); z-index: 2000; transition: width 0.1s linear;
  pointer-events: none;
}

/* ===== STICKY NAV #7 ===== */
#site-nav {
  position: fixed; top: 2px; left: 0; right: 0; z-index: 1500;
  display: flex; justify-content: center; padding: 10px 20px;
  opacity: 0; transform: translateY(-8px);
  transition: opacity 0.35s, transform 0.35s;
  pointer-events: none;
}
#site-nav.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.nav-inner {
  background: rgba(26,18,9,0.88); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(155,79,42,0.2);
  border-radius: 40px; padding: 8px 20px;
  display: flex; gap: 4px; align-items: center;
}
.nav-link {
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,210,160,0.45); text-decoration: none;
  padding: 6px 12px; border-radius: 20px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--terra2); background: rgba(155,79,42,0.12); }

/* ===== LAMP ===== */
#lamp-screen {
  position: fixed; inset: 0; z-index: 1000;
  background: radial-gradient(125% 95% at 50% 36%, #1b130b 0%, #110c07 46%, #0a0705 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden; transition: opacity 1.4s cubic-bezier(.4,0,.2,1);
}
#lamp-screen.fade-out { opacity: 0; pointer-events: none; }
/* звёздное небо + луна */
#lamp-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.star { position: absolute; border-radius: 50%; background: #ffeccf; }
.star.tw { animation: starTw 3.2s ease-in-out infinite; }
@keyframes starTw { 0%, 100% { opacity: var(--o, 0.7); } 50% { opacity: 0.12; } }
.moon-disc {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #fff4df 0%, #ffe3b8 55%, #f0c890 100%);
  box-shadow: 0 0 60px 18px rgba(255,220,160,0.18), 0 0 130px 50px rgba(255,200,130,0.10);
}
/* ночной город за лампой */
#lamp-city { position: absolute; left: 0; right: 0; bottom: 0; height: min(52vh, 420px); z-index: 1; pointer-events: none; }
#lamp-city svg { width: 100%; height: 100%; display: block; }
.city-far { filter: blur(1.4px); opacity: 0.75; }
.lamp-win.tw { animation: winTwinkle 3.6s ease-in-out infinite; }
@keyframes winTwinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { .lamp-win.tw { animation: none; } }
.lamp-skip {
  position: absolute; bottom: 26px; right: 26px; z-index: 6;
  background: transparent; border: 1px solid rgba(255,210,160,0.22); border-radius: 20px;
  color: rgba(255,220,180,0.45); font-family: 'Geologica', sans-serif; font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  padding: 9px 18px; cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity 0.7s, color 0.3s, border-color 0.3s;
}
.lamp-skip.visible { opacity: 1; pointer-events: auto; }
.lamp-skip:hover { color: rgba(196,105,61,0.95); border-color: rgba(196,105,61,0.55); }
/* мягкое тёплое сияние от лампы (НЕ выбеливание): лампа отдаёт тепло в ночь,
   но экран остаётся тёмным — логично перетекает в тёмный сайт */
#light-burst {
  position: absolute; top: 38%; left: 50%;
  width: 150vmax; height: 150vmax; border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.1);
  background: radial-gradient(circle, rgba(255,210,150,0.42) 0%, rgba(224,140,80,0.24) 28%, rgba(140,60,25,0.1) 48%, rgba(13,10,6,0) 68%);
  opacity: 0; pointer-events: none;
  transition: transform 1.3s cubic-bezier(.16,1,.3,1), opacity 0.8s ease;
}
#light-burst.expand { opacity: 1; transform: translate(-50%, -50%) scale(1); }
/* звёзды мягко разлетаются «варпом» при выходе */
#lamp-sky { transition: transform 1.1s cubic-bezier(.16,1,.3,1), opacity 0.85s ease; }
#lamp-screen.lit #lamp-sky { transform: scale(1.4); opacity: 0; }
/* окна города на миг отзываются тёплым светом и уходят */
#lamp-city { transition: filter 0.7s ease, opacity 0.85s ease, transform 1.1s cubic-bezier(.16,1,.3,1); }
#lamp-screen.lit #lamp-city { filter: brightness(1.35) saturate(1.15); transform: scale(1.05); opacity: 0.7; }

/* искры-идеи, вырывающиеся из лампы при рывке шнурка */
.spark {
  position: fixed; border-radius: 50%; pointer-events: none; z-index: 8;
  background: radial-gradient(circle, #fff6e0 0%, #ffd183 50%, rgba(255,168,80,0) 72%);
  box-shadow: 0 0 10px 3px rgba(255,196,110,0.7);
}
/* #3 лампа-hint — крупнее и видимее на мобилке */
.lamp-hint {
  position: relative; z-index: 2;
  font-size: clamp(11px, 3vw, 13px); letter-spacing: 4px; text-transform: uppercase;
  color: rgba(255,220,180,0.55); margin-bottom: 40px;
  transition: opacity 0.4s; user-select: none; pointer-events: none;
  text-align: center; padding: 0 20px;
}
.lamp-hint.hide { opacity: 0; }
.lamp-scene { position: relative; z-index: 5; display: flex; flex-direction: column; align-items: center; }
.lamp-svg { pointer-events: none; filter: drop-shadow(0 0 0px #9b4f2a); transition: filter 0.9s; }
#lamp-screen.lit .lamp-svg { filter: drop-shadow(0 0 32px rgba(155,79,42,0.95)); }
.bulb-glow { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); width: 30px; height: 30px; border-radius: 50%; pointer-events: none; transition: background 0.6s, box-shadow 0.6s; }
#lamp-screen.lit .bulb-glow { background: #fff8e0; box-shadow: 0 0 60px 30px rgba(196,105,61,0.75), 0 0 140px 80px rgba(155,79,42,0.25); }
.cord-outer { position: relative; z-index: 10; display: flex; flex-direction: column; align-items: center; cursor: grab; padding: 0 32px; user-select: none; touch-action: none; transform-origin: top center; }
.cord-outer:active { cursor: grabbing; }
/* лёгкое покачивание шнурка до первого взаимодействия — подсказывает, что за него можно потянуть */
@keyframes cordSway { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(3deg); } }
.cord-outer.idle-sway { animation: cordSway 2.8s ease-in-out infinite; }
/* мягкое свечение шарика, усиливается через несколько секунд бездействия, чтобы привлечь взгляд */
@keyframes cordAttract { 0%, 100% { filter: drop-shadow(0 0 0px rgba(196,105,61,0)); } 50% { filter: drop-shadow(0 0 11px rgba(196,105,61,0.6)); } }
.cord-outer.attract #cord-ball { animation: cordAttract 1.7s ease-in-out infinite; fill: rgba(255,210,160,0.55); stroke: rgba(255,210,160,0.6); }
.cord-outer.attract #cord-path { stroke: rgba(196,105,61,0.4); }
#cord-svg { overflow: visible; }
/* шнурок и шарик всегда контрастные: тёмная тень + тёплое свечение — видны и на небе, и на домах */
#cord-path { stroke: #ffd9a0; stroke-width: 2.6; fill: none; stroke-linecap: round; transition: stroke 0.3s; filter: drop-shadow(0 0 2px rgba(0,0,0,0.85)) drop-shadow(0 0 6px rgba(255,170,90,0.5)); }
.cord-outer:hover #cord-path { stroke: #ffe3b8; }
#cord-ball { fill: #ffca7a; stroke: #fff; stroke-width: 2; transition: fill 0.3s, stroke 0.3s, filter 0.3s; filter: drop-shadow(0 0 3px rgba(0,0,0,0.9)) drop-shadow(0 0 9px rgba(255,170,90,0.75)); }
.cord-outer:hover #cord-ball { fill: var(--terra2); stroke: #fff; filter: drop-shadow(0 0 11px rgba(255,180,100,0.95)); }
/* подпись на тёмной размытой «таблетке» — читается чётко даже поверх ночного города */
.lamp-name { margin-top: 30px; position: relative; z-index: 6; font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: clamp(16px,4.4vw,22px); font-weight: 600; color: rgba(255,236,208,0.95); letter-spacing: 1.5px; transition: color 1s; pointer-events: none; user-select: none; text-align: center;
  padding: 9px 26px; border-radius: 40px;
  background: rgba(12,8,5,0.5); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255,210,160,0.14);
  box-shadow: 0 6px 26px rgba(0,0,0,0.5);
  text-shadow: 0 1px 10px rgba(0,0,0,0.8); }
#lamp-screen.lit .lamp-name { color: rgba(255,210,160,0.9); }

/* ===== GRAIN ===== */
body::before { content: ''; position: fixed; inset: 0; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E"); pointer-events: none; z-index: 9999; opacity: 0.6; }
#main-content { opacity: 0; transition: opacity 1.4s ease 0.3s; }
#main-content.revealed { opacity: 1; }

/* ===== HERO ===== */
.hero { min-height: 100vh; background: var(--cream); display: grid; grid-template-columns: 1fr 1fr; position: relative; overflow: hidden; }
.hero-left { padding: 90px 64px; display: flex; flex-direction: column; justify-content: center; position: relative; z-index: 2; }
.hero-eyebrow { font-size: 10px; letter-spacing: 5px; text-transform: uppercase; color: var(--terra); margin-bottom: 24px; display: flex; align-items: center; gap: 10px; }
.hero-eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--terra); }
.hero-slogan { font-family: 'Cormorant Garamond', serif; font-size: clamp(52px, 7vw, 100px); font-weight: 700; line-height: 0.9; color: var(--ink); margin-bottom: 32px; letter-spacing: -2px; }
.hero-slogan em { color: var(--terra); font-style: normal; display: block; }
.hero-about { font-size: 14px; color: var(--ink2); line-height: 1.9; max-width: 400px; margin-bottom: 44px; border-left: 2px solid var(--terra); padding-left: 18px; }
.hero-contacts { display: flex; flex-direction: column; gap: 13px; margin-bottom: 32px; }
.hero-contacts a { color: var(--ink); text-decoration: none; font-size: 13px; display: flex; align-items: center; gap: 12px; transition: color 0.2s; }
.hero-contacts a:hover { color: var(--terra); }
.c-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--terra); flex-shrink: 0; }

/* #19 иконки мессенджеров — клик ведёт сразу в личный диалог */
.social-icons { display: flex; gap: 12px; margin-bottom: 32px; }
.social-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(155,79,42,0.18);
}
.social-icon svg { width: 38px; height: 38px; display: block; }
.social-icon:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(155,79,42,0.3); }
/* у Telegram/WhatsApp/VK белый круг внутри SVG, а MAX — PNG без подложки,
   поэтому даём ему такой же белый круг, иначе в тёмной теме значок теряется */
.social-icon--max { background: #fff; }
.social-icon--max img { width: 24px; height: 24px; display: block; border-radius: 22%; }

/* #6 якорные кнопки в hero */
.hero-anchors { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-anchor-btn {
  font-size: 10px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--terra); text-decoration: none;
  border: 1px solid rgba(155,79,42,0.3); padding: 7px 16px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.hero-anchor-btn:hover { background: var(--terra); color: #fff; border-color: var(--terra); }

.hero-right { position: relative; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.photo-area { flex: 1; display: flex; align-items: flex-end; justify-content: center; position: relative; overflow: hidden; }
.hero-bg-text {
  position: absolute; right: -10px; top: 50%;
  transform: translateY(calc(-55% + var(--bgtext-shift, 0px)));
  font-family: 'Cormorant Garamond', serif; font-size: 220px; font-weight: 700; line-height: 1;
  color: rgba(155,79,42, var(--bgtext-glow, 0.05));
  user-select: none; pointer-events: none; writing-mode: vertical-rl; letter-spacing: -10px;
  transition: color 0.25s ease;
}
/* мягкий тёплый ореол за фото — вместо инициалов ЕФ, добавляет глубину */
.photo-halo {
  position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%);
  width: min(82%, 540px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(196,105,61,0.18) 0%, rgba(196,105,61,0.07) 45%, rgba(196,105,61,0) 70%);
  pointer-events: none; z-index: 1; filter: blur(6px);
}
body.dark-mode .photo-halo { background: radial-gradient(circle, rgba(196,105,61,0.28) 0%, rgba(196,105,61,0.1) 48%, rgba(196,105,61,0) 72%); }
.photo-wrap { width: 360px; height: 480px; perspective: 900px; position: relative; z-index: 2; }
/* #17 will-change убран из статики — добавляется JS-ом при hover */
.photo-inner { width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.12s ease-out; }

/* #20 переворот фото: реальное ↔ мультяшное — обе стороны в одной рамке одного размера */
.photo-flip { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.85s cubic-bezier(.4,0,.2,1); cursor: pointer; }
.photo-flip.flipped { transform: rotateY(180deg); }
.photo-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.photo-face img { width: 100%; height: 100%; object-fit: contain; object-position: bottom center; display: block; }
.photo-face-back { transform: rotateY(180deg); }

/* TICKER */
.ticker-wrap { border-top: 1px solid rgba(155,79,42,0.14); background: transparent; overflow: hidden; padding: 13px 0; white-space: nowrap; }
.ticker-track { display: inline-flex; animation: ticker 32s linear infinite; }
/* #11 тач-пауза через класс */
.ticker-track:hover, .ticker-track.paused { animation-play-state: paused; }
.ticker-item { font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--ink2); padding: 0 24px; display: inline-flex; align-items: center; gap: 24px; }
.ticker-item::after { content: '·'; color: var(--terra); font-size: 16px; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ===== SECTIONS ===== */
section { padding: 96px 0; background: var(--bg); position: relative; }

/* ===== РИСОВАННЫЕ ДУДЛЫ (само-дорисовываются при скролле) ===== */
.doodle {
  position: absolute; z-index: 3; height: auto; pointer-events: none;
  opacity: 0; transform-origin: center; transition: opacity 0.4s ease;
}
.doodle path {
  fill: none; stroke: var(--terra2); stroke-width: 2.3;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.doodle.drawn { opacity: 1; animation: doodleWiggle 4.6s ease-in-out 1.1s infinite; }
.doodle.drawn path { animation: doodleDraw 1s ease forwards; }
.doodle.drawn path:nth-child(2) { animation-delay: 0.35s; }
.doodle.drawn path:nth-child(3) { animation-delay: 0.6s; }
@keyframes doodleDraw { to { stroke-dashoffset: 0; } }
@keyframes doodleWiggle { 0%, 100% { transform: rotate(-3.5deg); } 50% { transform: rotate(3.5deg); } }
/* на тёмных секциях штрих светлее */
.cta-section .doodle path { stroke: #e8a06a; }
@media (max-width: 1024px) { .doodle { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .doodle { opacity: 1; }
  .doodle path { stroke-dashoffset: 0; }
  .doodle.drawn { animation: none; }
}
.container { max-width: 1160px; margin: 0 auto; padding: 0 60px; }
.section-header { margin-bottom: 56px; }
.section-eyebrow { font-size: 10px; letter-spacing: 5px; text-transform: uppercase; color: var(--terra); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.section-eyebrow::before { content: ''; width: 20px; height: 1px; background: var(--terra); }
.section-title { font-family: 'Cormorant Garamond', serif; font-size: clamp(28px, 4vw, 50px); font-weight: 700; color: var(--ink); line-height: 1.1; }

/* ===== STAT-ORB — кружок-бейдж, перетекающий между фактами ===== */
#section-exp .section-header { position: relative; }
.stat-orb {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%) scale(0.6);
  width: 116px; height: 116px; border-radius: 50%;
  background: var(--terra); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  opacity: 0; box-shadow: 0 14px 36px rgba(155,79,42,0.32);
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.34,1.56,.64,1);
}
.stat-orb.visible { opacity: 1; transform: translateY(-50%) scale(1); }
.stat-orb-num { font-family: 'Cormorant Garamond', serif; font-size: 30px; font-weight: 700; line-height: 1; transition: opacity 0.3s, transform 0.3s; }
.stat-orb-label { font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 5px; opacity: 0.85; transition: opacity 0.3s, transform 0.3s; }
.stat-orb.morph .stat-orb-num, .stat-orb.morph .stat-orb-label { opacity: 0; transform: translateY(7px); }
@media (max-width: 960px) { .stat-orb { display: none; } }
.section-divider { height: 1px; background: var(--line); }

/* ===== FLIP CARDS ===== */
/* блок следует теме как и остальные секции: светлый в светлой теме, тёмный в тёмной
   (раньше тут была var(--ink), которая в тёмной теме инвертируется в светлый — блок «выпадал») */
.offer-section { background: var(--bg) !important; }
.flip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.flip-card { height: 280px; perspective: 1000px; cursor: pointer; }
.flip-inner { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s cubic-bezier(.4,0,.2,1); }
/* #11 flip по hover и по классу .flipped (тач) */
.flip-card:hover .flip-inner, .flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
/* тёплая подложка-фолбэк: видна, пока внешнее фото грузится (медленный LTE) или если не загрузилось */
.flip-front { border-radius: 4px; background: linear-gradient(150deg, #3a2418 0%, #5c3420 55%, #7a4527 100%); }
.flip-front img { width: 100%; height: 100%; object-fit: cover; display: block; filter: brightness(0.38); transition: filter 0.4s, opacity 0.4s; background: transparent; }
.flip-card:hover .flip-front img, .flip-card.flipped .flip-front img { filter: brightness(0.28); }
.flip-front-content { position: absolute; inset: 0; padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; }
.flip-label { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--terra2); margin-bottom: 8px; }
.flip-title { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 700; color: #fff; line-height: 1.15; }
.flip-back { background: var(--terra); transform: rotateY(180deg); border-radius: 4px; padding: 28px; display: flex; flex-direction: column; justify-content: center; }
.flip-back-label { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 12px; }
.flip-back-text { font-size: 13px; color: rgba(255,255,255,0.92); line-height: 1.8; }

/* ===== NICHES ===== */
.niches-section { background: var(--bg2) !important; }
.niches-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.niche-card { padding: 20px 16px; background: var(--cream); border: 1px solid var(--line); border-bottom: 3px solid transparent; cursor: pointer; text-align: center; text-decoration: none; display: block; opacity: 0; transform: translateY(12px); transition: opacity 0.4s, transform 0.4s, border-color 0.25s, background 0.25s; }
.niche-card:hover { border-bottom-color: var(--terra); background: #fff; transform: translateY(-3px) !important; }
.niche-card.visible { opacity: 1; transform: translateY(0); }
.niche-num { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 700; color: rgba(155,79,42,0.15); line-height: 1; margin-bottom: 8px; }
.niche-name { font-size: 12px; color: var(--ink); line-height: 1.4; }

/* ===== ACCORDION ===== */
.acc-item { border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(16px); transition: opacity 0.5s, transform 0.5s; }
.acc-item.visible { opacity: 1; transform: none; }
/* #9 aria-friendly */
.acc-header { display: grid; grid-template-columns: 100px 1fr auto; gap: 24px; align-items: center; padding: 28px 0; cursor: pointer; user-select: none; }
.acc-header:hover .acc-company { color: var(--terra); }
.acc-duration { text-align: center; }
.acc-dur-num { font-family: 'Cormorant Garamond', serif; font-size: 34px; font-weight: 700; color: var(--terra); line-height: 1; }
.acc-dur-label { font-size: 10px; letter-spacing: 1px; color: var(--ink2); text-transform: uppercase; margin-top: 2px; }
.acc-dur-period { font-size: 10px; color: var(--line); margin-top: 2px; }
.acc-company { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 700; color: var(--ink); transition: color 0.2s; margin-bottom: 4px; }
.acc-position { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--terra); }
.acc-arrow { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.35s, border-color 0.2s, background 0.2s; color: var(--ink2); font-size: 12px; }
.acc-item.open .acc-arrow { transform: rotate(180deg); border-color: var(--terra); background: var(--terra); color: #fff; }
/* #6 max-height увеличен до 1200px — защита от обрезания длинных блоков */
.acc-body { max-height: 0; overflow: hidden; transition: max-height 0.5s cubic-bezier(.4,0,.2,1); padding: 0 0 0 124px; }
.acc-item.open .acc-body { padding-bottom: 32px; }
.acc-desc { font-size: 14px; line-height: 1.9; color: var(--ink2); margin-bottom: 20px; }
.acc-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-tag { font-size: 11px; padding: 5px 12px; background: rgba(155,79,42,0.07); color: var(--terra); border: 1px solid rgba(155,79,42,0.18); }

/* ===== TOOLS ===== */
.tools-section { background: var(--cream) !important; }
.tools-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 40px; }
.tool-group-title { font-size: 10px; letter-spacing: 4px; text-transform: uppercase; color: var(--terra); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.tool-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-tag { font-size: 12px; padding: 6px 14px; border: 1px solid var(--line); color: var(--ink2); background: var(--bg); transition: border-color 0.2s, color 0.2s; }
.tool-tag:hover { border-color: var(--terra); color: var(--terra); }

/* ===== QUALITIES ===== */
/* #10 убрали padding:0!important — заменили нормальным отступом */
.q-section { background: var(--bg) !important; padding: 96px 0 !important; }
.q-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 2px; background: var(--line); }
.q-card { background: var(--cream); padding: 40px 28px; opacity: 0; transform: translateY(16px); transition: opacity 0.5s, transform 0.5s; position: relative; overflow: hidden; }
.q-card.visible { opacity: 1; transform: none; }
.q-card:hover .q-num { color: rgba(155,79,42,0.25); }
.q-card:hover { background: #fff; }
.q-num { font-family: 'Cormorant Garamond', serif; font-size: 80px; font-weight: 700; color: rgba(155,79,42,0.1); line-height: 1; margin-bottom: 12px; transition: color 0.3s; }
.q-title { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.q-desc { font-size: 13px; color: var(--ink2); line-height: 1.65; }
.q-accent { position: absolute; bottom: 0; left: 0; width: 0; height: 3px; background: var(--terra); transition: width 0.4s ease; }
.q-card:hover .q-accent { width: 100%; }

/* ===== EDUCATION ===== */
.edu-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.edu-card { border: 1px solid var(--line); padding: 28px 28px 28px 36px; position: relative; background: var(--cream); opacity: 0; transform: translateY(16px); transition: opacity 0.5s, transform 0.5s, border-color 0.2s; }
.edu-card:hover { border-color: var(--terra); }
.edu-card.visible { opacity: 1; transform: none; }
.edu-card::before { content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: var(--terra); }
.edu-year { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--terra); margin-bottom: 8px; }
.edu-title { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 700; margin-bottom: 5px; line-height: 1.3; color: var(--ink); }
.edu-sub { font-size: 12px; color: var(--ink2); }

/* ===== CTA ===== */
.cta-section { background: var(--ink) !important; padding: 96px 0; text-align: center; position: relative; overflow: hidden; }
.cta-section::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--terra), transparent); }
/* маскот-лампочка */
#mascot { display: flex; justify-content: center; margin: 0 auto 26px; width: clamp(118px, 15vw, 188px); }
#mascot svg { width: 100%; height: auto; overflow: visible; transform-origin: center bottom; animation: mascotFloat 4.6s ease-in-out infinite; }
#mascot .bulb-body { animation: bulbPulse 3.6s ease-in-out infinite; }
#mascot #eyeL, #mascot #eyeR { transition: transform 0.12s ease-out; }
@keyframes mascotFloat { 0%, 100% { transform: translateY(0) rotate(-1.6deg); } 50% { transform: translateY(-12px) rotate(1.6deg); } }
@keyframes bulbPulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(255,200,110,0.45)); }
  50%      { filter: drop-shadow(0 0 26px rgba(255,212,130,0.8)); }
}
@media (prefers-reduced-motion: reduce) {
  #mascot svg, #mascot .bulb-body { animation: none; }
}

/* ===== СВЕТЛЯЧКИ-ИСКРЫ ИДЕЙ: свободно летают по сайту — только в тёмной теме ===== */
/* на светлом фоне свечение почти не видно, поэтому показываем их только в тёмной теме */
#fireflies { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; display: none; }
body.dark-mode #fireflies { display: block; }
.firefly {
  position: absolute; top: 0; left: 0; border-radius: 50%;
  will-change: transform, opacity; pointer-events: none;
  background: radial-gradient(circle, #fff6e0 0%, #ffd183 48%, rgba(255,168,80,0) 72%);
  box-shadow: 0 0 16px 5px rgba(255,196,110,0.5);
  animation: fireflyGlow 3s ease-in-out infinite;
}
@keyframes fireflyGlow {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.95; }
}
@media (prefers-reduced-motion: reduce) { #fireflies { display: none; } }

.cta-big { font-family: 'Cormorant Garamond', serif; font-size: clamp(36px, 5.5vw, 72px); font-weight: 700; color: #fff; margin-bottom: 12px; line-height: 1; }
.cta-big em { color: var(--terra2); font-style: normal; }
.cta-sub { font-size: 14px; color: rgba(255,255,255,0.35); margin-bottom: 44px; letter-spacing: 1px; }
.cta-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 34px; font-family: 'Geologica', sans-serif; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; text-decoration: none; cursor: pointer; border: none; transition: all 0.25s; }
.btn-fill { background: var(--terra); color: #fff; }
.btn-fill:hover { background: var(--terra2); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.15); }
.btn-ghost:hover { border-color: var(--terra); color: var(--terra); }
/* #12 кнопка печати */
.btn-print { background: transparent; color: rgba(255,255,255,0.4); border: 1px solid rgba(255,255,255,0.1); }
.btn-print:hover { border-color: rgba(155,79,42,0.5); color: rgba(196,105,61,0.8); }

footer { background: #0d0a06; color: rgba(255,200,150,0.2); padding: 28px 60px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; letter-spacing: 1px; }
footer span { color: var(--terra); }

/* ===== ТЁМНАЯ ТЕМА #12 ===== */
.theme-toggle {
  position: fixed; bottom: 28px; right: 28px; z-index: 1600;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); border: 1px solid rgba(155,79,42,0.3);
  color: rgba(255,210,160,0.6); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.25s; opacity: 0;
  pointer-events: none;
}
.theme-toggle.visible { opacity: 1; pointer-events: auto; }
.theme-toggle svg { width: 20px; height: 20px; display: block; }
.theme-toggle:hover { border-color: var(--terra); transform: scale(1.12) rotate(12deg); }

body.dark-mode {
  --bg: #1a1510; --bg2: #130f09; --ink: #e8ddd0; --ink2: #a89880;
  --cream: #201810; --line: #3a2e20; --dark: #0a0806;
}
body.dark-mode .hero { background: var(--cream); }
body.dark-mode .ticker-wrap { background: var(--cream); }
body.dark-mode section { background: var(--bg); }
body.dark-mode .tools-section { background: var(--bg2) !important; }
body.dark-mode .niches-section { background: var(--dark) !important; }
/* #18 .cta-section в тёмной теме брал var(--ink), которая в dark-mode становится светлой —
   из-за этого белый текст и цифры становились невидимыми. Держим секцию всегда тёмной. */
body.dark-mode .cta-section { background: var(--dark) !important; }
body.dark-mode footer { background: #060402; }

/* === тёмная тема: фиксы читаемости === */
body.dark-mode .hero-slogan { color: var(--ink); }
body.dark-mode .hero-about { color: var(--ink2); }
body.dark-mode .hero-contacts a { color: var(--ink); }
body.dark-mode .hero-contacts a:hover { color: var(--terra2); }
body.dark-mode .niche-card { background: #1e1810; border-color: var(--line); }
body.dark-mode .niche-card:hover { background: #261e14; }
body.dark-mode .niche-name { color: var(--ink); }
/* #21 декоративные номера на тёмном фоне были почти не видны — поднимаем контраст */
body.dark-mode .niche-num { color: rgba(196,105,61,0.35); }
body.dark-mode .acc-company { color: var(--ink); }
body.dark-mode .acc-desc { color: var(--ink2); }
body.dark-mode .acc-item { border-color: var(--line); }
body.dark-mode .tool-tag { background: #1e1810; color: var(--ink2); border-color: var(--line); }
body.dark-mode .tool-tag:hover { color: var(--terra2); border-color: var(--terra); }
body.dark-mode .tool-group-title { border-color: var(--line); }
body.dark-mode .q-card { background: #1e1810; }
body.dark-mode .q-card:hover { background: #261e14; }
/* #21 крупные декоративные номера качеств — ярче на тёмном фоне */
body.dark-mode .q-num { color: rgba(196,105,61,0.28); }
body.dark-mode .q-card:hover .q-num { color: rgba(196,105,61,0.5); }
body.dark-mode .q-title { color: var(--ink); }
body.dark-mode .q-desc { color: var(--ink2); }
body.dark-mode .q-grid { background: var(--line); }
body.dark-mode .edu-card { background: #1e1810; border-color: var(--line); }
body.dark-mode .edu-title { color: var(--ink); }
body.dark-mode .edu-sub { color: var(--ink2); }
body.dark-mode .section-title { color: var(--ink); }
body.dark-mode .hero-anchor-btn { color: var(--terra2); border-color: rgba(196,105,61,0.3); }
body.dark-mode .acc-dur-label { color: var(--ink2); }

/* ===== ЧИСТЫЙ ФОН HERO + КРУПНОЕ ФОТО + ЕДИНЫЙ HOVER ===== */
/* спокойный тёплый градиент вместо «графика»/частиц */
.hero { background: linear-gradient(135deg, #faf6ee 0%, #f4e8d7 52%, #ecd8c2 100%); }
.hero-right { position: relative; background: transparent; z-index: 2; }
body.dark-mode .hero { background: linear-gradient(135deg, #1d150d 0%, #241810 55%, #2b1c11 100%) !important; }

/* фото — крупное и адаптивное под любой экран (монитор / ноут / телефон) */
.photo-area { align-items: flex-end; }
.photo-wrap {
  width: clamp(280px, 38vw, 600px);
  height: clamp(400px, 78vh, 820px);
}
/* фото без подложки: светлый студийный фон растворяем смешиванием — остаётся только портрет */
.photo-face img { object-fit: contain; object-position: center bottom; mix-blend-mode: multiply; }
/* в тёмной теме multiply не нужен: фон вырезан прямо в PNG (с un-matting краёв),
   поэтому портрет «парит» без подложки — так же, как в светлой теме */
body.dark-mode .photo-face img { mix-blend-mode: normal; }

/* единый эффект наведения для всех кнопок-действий */
.btn, .hero-anchor-btn {
  transition: transform 0.28s cubic-bezier(.16,1,.3,1), box-shadow 0.28s ease, background 0.25s, color 0.25s, border-color 0.25s;
}
.btn:hover, .hero-anchor-btn:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 12px 26px rgba(155,79,42,0.28);
}

/* более выразительные «выезды» секций при скролле */
.acc-item, .q-card, .edu-card {
  transform: translateY(32px) scale(0.985);
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(.16,1,.3,1);
}
.niche-card {
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(.16,1,.3,1), border-color 0.25s, background 0.25s;
}
.acc-item.visible, .q-card.visible, .edu-card.visible, .niche-card.visible {
  opacity: 1; transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .acc-item, .q-card, .edu-card, .niche-card { transition: opacity 0.3s ease; transform: none; }
  .btn:hover, .hero-anchor-btn:hover { transform: none; box-shadow: none; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  /* #1 фото на мобилке — крупное и адаптивное */
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-left { padding: 60px 32px 40px; order: 1; }
  .hero-right { order: 2; min-height: auto; padding-bottom: 6px; }
  .photo-area { min-height: auto; padding: 6px 0 0; }
  .photo-wrap { width: min(78vw, 360px); height: min(104vw, 480px); }

  /* флип-карточки: на мобильных без 3D-переворота — вся инфа видна сразу */
  .flip-card { height: auto; perspective: none; }
  .flip-inner { transform: none !important; transform-style: flat; height: auto; }
  .flip-front, .flip-back {
    position: relative; inset: auto; transform: none !important;
    backface-visibility: visible; -webkit-backface-visibility: visible;
  }
  .flip-front { height: 168px; border-radius: 8px 8px 0 0; }
  .flip-card .flip-front img { filter: brightness(0.42) !important; }
  .flip-back { border-radius: 0 0 8px 8px; padding: 20px 22px; }

  .flip-grid { grid-template-columns: 1fr 1fr; }
  .niches-grid { grid-template-columns: repeat(2,1fr); }
  .tools-grid { grid-template-columns: 1fr; }
  .q-grid { grid-template-columns: 1fr 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  .acc-header { grid-template-columns: 72px 1fr auto; gap: 16px; }
  .acc-item.open .acc-body { padding: 0 0 24px 88px; }
  .container { padding: 0 28px; }
  footer { flex-direction: column; gap: 8px; text-align: center; padding: 28px 32px; }
  .nav-link { display: none; }
  .nav-link:nth-child(-n+4) { display: block; }
}
@media (max-width: 560px) {
  .flip-grid { grid-template-columns: 1fr; }
  .niches-grid { grid-template-columns: repeat(2,1fr); }
  .q-grid { grid-template-columns: 1fr 1fr; }
  .photo-wrap { width: min(84vw, 340px); height: min(116vw, 460px); }
  .hero-anchors { gap: 8px; }
}

/* ===== PRINT STYLES ===== */
.print-skills { display: none; }

@media print {
  /* скрыть всё интерактивное и лишнее */
  #lamp-screen, #site-nav, #scroll-progress, .theme-toggle,
  .ticker-wrap, .hero-bg-text, .offer-section, .niches-section,
  .cta-section, footer, .acc-arrow, .hero-anchors,
  .section-divider, body::before { display: none !important; }

  /* показать print-only блок навыков */
  .print-skills { display: block !important; }

  html, body { background: #fff !important; color: #1a1209 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #main-content { opacity: 1 !important; }

  /* hero — компактный, на одной странице */
  .hero { grid-template-columns: 1fr 1fr !important; min-height: auto !important; page-break-after: always; background: #faf7f2 !important; }
  .hero-left { padding: 32px 40px; }
  .hero-right { background: #f5f0e8 !important; }
  .photo-wrap { width: 240px; height: 310px; }
  .hero-slogan { font-size: 52px !important; }

  section { padding: 24px 0; background: #fff !important; }
  section + section { border-top: 1px solid #ddd8ce; }
  .container { padding: 0 40px; max-width: 100%; }
  .section-title { font-size: 26px !important; }
  .section-header { margin-bottom: 20px; }

  /* аккордеон — все раскрыты */
  .acc-item { opacity: 1 !important; transform: none !important; border-bottom: 1px solid #ddd8ce; }
  .acc-body { max-height: none !important; overflow: visible !important; padding: 0 0 16px 100px !important; display: block !important; }
  .acc-desc { font-size: 12px; line-height: 1.7; }
  .acc-company { font-size: 18px; }
  .acc-tags { gap: 5px; }
  .acc-tag { font-size: 10px; padding: 3px 8px; }
  /* не разрывать запись опыта посередине */
  .acc-item { page-break-inside: avoid; }

  /* образование */
  .edu-grid { grid-template-columns: repeat(2,1fr) !important; gap: 12px; }
  .edu-card { opacity: 1 !important; transform: none !important; padding: 16px 16px 16px 24px; }

  /* качества */
  .q-grid { grid-template-columns: repeat(4,1fr) !important; gap: 1px; }
  .q-card { opacity: 1 !important; transform: none !important; padding: 20px 16px; }
  .q-num { font-size: 48px; }
  .q-section { padding: 24px 0 !important; }

  /* инструменты — компактнее */
  .tools-grid { grid-template-columns: repeat(3,1fr) !important; gap: 20px; }
  .tools-section { background: #fff !important; }

  a { color: inherit !important; text-decoration: none !important; }
  * { box-shadow: none !important; text-shadow: none !important; transition: none !important; animation: none !important; }
}
