/* ==============================
   КНОПКИ
   ============================== */
.btn-primary,
.btn-outline,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--radius-btn);
}

.btn-primary {
    background: linear-gradient(135deg, #b0785c 0%, #9e6247 100%);
    color: var(--emerald-deep);
    box-shadow: 0 12px 28px rgba(158, 98, 71, 0.28);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #a86e51 0%, #8f573e 100%);
    box-shadow: 0 18px 40px rgba(158, 98, 71, 0.38);
}

.btn-outline {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
}

.btn-outline:hover {
    background: var(--gold);
    color: var(--emerald-deep);
}

.btn-ghost {
    background: transparent;
    color: var(--text-soft);
    padding: 14px 0;
    font-weight: 400;
}

.btn-ghost:hover {
    color: var(--blue);
}

.btn-block {
    width: 100%;
}

/* SVG-стрелка в ссылках-кнопках: при hover сдвигается вправо */
.btn-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.btn-ghost:hover .btn-arrow {
    transform: translateX(5px);
}

/* Свои фокус-состояния для клавиатуры (не браузерный outline) */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ==============================
   ФОРМЫ (контактная форма)
   ============================== */
.contact-form {
    text-align: left;
    margin-bottom: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    color: var(--gold);
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 252, 242, 0.7);
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    transition: all 0.3s ease;
    resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: rgba(60, 46, 32, 0.4);
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255, 252, 242, 0.95);
}

/* ==============================
   КАСТОМНЫЙ КУРСОР (desktop; включается скриптом классом has-cursor)
   ============================== */
body.has-cursor { cursor: none; }

/* над кликабельным — настоящий системный курсор-рука */
body.has-cursor a,
body.has-cursor button,
body.has-cursor .mascot,
body.has-cursor .case-media-frame,
body.has-cursor .contact-method,
body.has-cursor .contact-copy,
body.has-cursor .approach-card {
    cursor: pointer;
}

body.has-cursor input,
body.has-cursor textarea {
    cursor: text;
}

.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 24px;
    margin: -2px 0 0 -2px; /* остриё стрелки — на указателе */
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
    transition: opacity 0.16s ease;
}

.cursor-dot svg {
    display: block;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 1px 1.5px rgba(60, 40, 25, 0.3));
}

/* над кликабельным стрелка прячется — показывается системная рука */
.cursor-dot.is-hover { opacity: 0; }
.cursor-dot.is-hidden { opacity: 0; }

/* Наклон медиа-рамки кейса под курсором (3D-parallax) */
.case-media-frame.tilting {
    transition: transform 0.12s ease-out;
}

/* ==============================
   МАСКОТ-ШЕСТЕРЁНКА
   ============================== */
.mascot {
    position: fixed;
    right: 26px;
    bottom: 22px;
    width: 78px;
    height: 78px;
    z-index: 190;
    cursor: pointer;
    animation: mascot-bob 4.5s ease-in-out infinite;
}

/* Лёгкая статичная тень-подложка вместо drop-shadow по вращающейся форме
   (drop-shadow пересчитывался каждый кадр из-за вращения шестерёнки — дорого на слабом CPU) */
.mascot::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 56px;
    height: 12px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(60, 46, 32, 0.26) 0%, rgba(60, 46, 32, 0) 72%);
    z-index: -1;
    pointer-events: none;
}

body.has-cursor .mascot { cursor: pointer; }

.mascot-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.mascot-gear {
    transform-origin: 50px 45px;
    animation: mascot-spin 16s linear infinite;
}

.mascot-tooth,
.mascot-body { fill: var(--gold); }

.mascot-face { fill: #fff7ee; }

.mascot-eyes {
    transform-origin: 50px 43px;
    transition: transform 0.1s ease;
}

.mascot-eyes.blinking { transform: scaleY(0.12); }

.mascot-pupils { transition: transform 0.18s ease; }

.mascot-eye { fill: #3a2a1e; }

.mascot-smile {
    fill: none;
    stroke: #4a3626;
    stroke-width: 2.4;
    stroke-linecap: round;
}

/* Ручки и ножки — тёмный «металл», перчатки и ботинки */
.m-limb {
    fill: none;
    stroke: #5a4433;
    stroke-width: 5;
    stroke-linecap: round;
}

.m-hand {
    fill: #fff7ee;
    stroke: #5a4433;
    stroke-width: 1.4;
}

.m-shoe {
    fill: var(--gold-light);
    stroke: #5a4433;
    stroke-width: 1.2;
}

.m-bolt { fill: #7a4a35; }
.m-cheek { fill: rgba(192, 138, 107, 0.5); }
.m-eye-white { fill: #ffffff; }
.m-eye-shine { fill: #ffffff; }
.m-nose { fill: var(--gold); }

.m-arm,
.m-leg { transform-box: fill-box; }

.m-leg { transform-origin: center top; }
.m-arm-l { transform-origin: right top; }
.m-arm-r { transform-origin: left top; }

/* Походка — ножки шагают, ручки машут (класс walking) */
.mascot.walking .m-leg-l { animation: m-step 0.5s ease-in-out infinite; }
.mascot.walking .m-leg-r { animation: m-step 0.5s ease-in-out infinite; animation-delay: -0.25s; }
.mascot.walking:not(.carrying) .m-arm-l { animation: m-swing-a 0.5s ease-in-out infinite; animation-delay: -0.25s; }
.mascot.walking:not(.carrying) .m-arm-r { animation: m-swing-b 0.5s ease-in-out infinite; }

@keyframes m-step {
    0%, 100% { transform: rotate(16deg); }
    50% { transform: rotate(-16deg); }
}
@keyframes m-swing-a {
    0%, 100% { transform: rotate(18deg); }
    50% { transform: rotate(-4deg); }
}
@keyframes m-swing-b {
    0%, 100% { transform: rotate(-18deg); }
    50% { transform: rotate(4deg); }
}

/* Направление движения */
.mascot.facing-left .mascot-svg { transform: scaleX(-1); }

/* Позы «держит» — ручки вперёд (чтение / несёт бумаги) */
.m-arm { transition: transform 0.35s ease; }
.mascot.reading .m-arm-l,
.mascot.carrying .m-arm-l { transform: rotate(46deg); }
.mascot.reading .m-arm-r,
.mascot.carrying .m-arm-r { transform: rotate(-46deg); }

/* Действие «машет рукой» */
.mascot.waving .m-arm-r {
    transform-origin: left top;
    animation: m-wave 0.7s ease-in-out infinite;
}

@keyframes m-wave {
    0%, 100% { transform: rotate(-45deg); }
    50% { transform: rotate(-80deg); }
}

/* Потягушки — ручки вверх, корпус проворачивается */
.mascot.stretching .m-arm-l { transform: rotate(155deg); }
.mascot.stretching .m-arm-r { transform: rotate(-155deg); }
.mascot.stretching .mascot-gear { animation: m-twist 1.3s ease-in-out; }

@keyframes m-twist {
    0%, 100% { transform: rotate(0); }
    35% { transform: rotate(-13deg); }
    70% { transform: rotate(11deg); }
}

/* Смущение от клика — ручки к лицу, глазки жмурятся, щёчки краснеют */
.mascot.shy .m-arm-l { transform: rotate(120deg); }
.mascot.shy .m-arm-r { transform: rotate(-120deg); }
.mascot.shy .mascot-eyes { transform: scaleY(0.18); }
.mascot.shy .m-cheek { fill: rgba(205, 120, 90, 0.8); }

/* Ура, кликнули — подпрыгивает и делает сальто */
.mascot.cheer { animation: m-flip 0.75s ease; }

@keyframes m-flip {
    0% { transform: translateY(0) rotate(0); }
    40% { transform: translateY(-30px) rotate(160deg); }
    60% { transform: translateY(-30px) rotate(250deg); }
    100% { transform: translateY(0) rotate(360deg); }
}

/* Тихий час — спит, глазки закрыты, z-z-z */
.mascot.sleeping { animation: none; }
.mascot.sleeping .mascot-gear { animation: none; }
.mascot.sleeping .mascot-svg { transform: rotate(-10deg); }
.mascot.sleeping .mascot-eyes { transform: scaleY(0.1); }

.mascot-zzz {
    position: absolute;
    top: -4px;
    right: 6px;
    font-family: var(--serif);
    font-weight: 600;
    font-size: 15px;
    color: var(--gold);
    opacity: 0;
    pointer-events: none;
}

.mascot-zzz span { font-size: 0.8em; }

.mascot.sleeping .mascot-zzz { animation: zzz 2.6s ease-in-out infinite; }

@keyframes zzz {
    0% { opacity: 0; transform: translateY(6px) scale(0.7); }
    40% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-16px) scale(1.1); }
}

/* --- Партия 2 --- */
.mascot-cup,
.mascot-oil {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    filter: drop-shadow(0 3px 6px rgba(60, 46, 32, 0.18));
}

/* Чаепитие */
.mascot-cup {
    width: 22px;
    height: 22px;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
}
.mascot.tea .mascot-cup { opacity: 1; }
.mascot.tea .m-arm-r { transform: rotate(-92deg); }
.mascot.tea .m-cheek { fill: rgba(205, 120, 90, 0.7); }
.mascot.tea .mascot-eyes { transform: scaleY(0.5); }
.cup-body { fill: #fff7ee; stroke: var(--gold); stroke-width: 1.5; stroke-linejoin: round; }
.cup-handle { fill: none; stroke: var(--gold); stroke-width: 1.5; }
.cup-steam { fill: none; stroke: var(--gold-light); stroke-width: 1.2; stroke-linecap: round; opacity: 0.7; }

/* Смазка шестерёнки */
.mascot-oil {
    width: 30px;
    height: 24px;
    left: 6px;
    top: -12px;
}
.mascot.oiling .mascot-oil { opacity: 1; }
.mascot.oiling .mascot-gear { animation: m-spin-fast 0.5s linear infinite; }
@keyframes m-spin-fast { to { transform: rotate(360deg); } }
.oil-body { fill: var(--gold-light); stroke: #5a4433; stroke-width: 1.3; stroke-linejoin: round; }
.oil-spout { fill: none; stroke: #5a4433; stroke-width: 2; stroke-linecap: round; }
.oil-drop { fill: var(--gold); }

/* Головокружение (быстрый курсор) */
.mascot.dizzy { animation: m-wobble 0.5s ease-in-out infinite; }
@keyframes m-wobble {
    0%, 100% { transform: rotate(-4deg); }
    50% { transform: rotate(4deg); }
}
.mascot.dizzy .mascot-pupils { animation: m-dizzy 0.6s linear infinite; }
@keyframes m-dizzy {
    0% { transform: translate(2px, -1px); }
    25% { transform: translate(1px, 1.5px); }
    50% { transform: translate(-2px, 1px); }
    75% { transform: translate(-1px, -1.5px); }
    100% { transform: translate(2px, -1px); }
}

/* Помощь при скролле — быстро перебирает ножками */
.mascot.running .m-leg-l { animation: m-step 0.26s ease-in-out infinite; }
.mascot.running .m-leg-r { animation: m-step 0.26s ease-in-out infinite; animation-delay: -0.13s; }

/* Прятки за нижней границей */
.mascot.peeking { animation: m-peek 3s ease-in-out; }
@keyframes m-peek {
    0% { transform: translateY(0); }
    18% { transform: translateY(64px); }
    72% { transform: translateY(64px); }
    88% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

/* --- Партия 3 --- */
.mascot-key,
.mascot-dust {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Заводной ключ → быстрое вращение */
.mascot-key {
    width: 20px;
    height: 20px;
    right: -7px;
    top: 32px;
    filter: drop-shadow(0 2px 4px rgba(60, 46, 32, 0.2));
}
.mascot.winding .mascot-key { opacity: 1; }
.mascot.winding .mascot-gear { animation: m-spin-fast 0.4s linear infinite; }
.key-ring { fill: none; stroke: #5a4433; stroke-width: 2.4; }
.key-hole { fill: #5a4433; }
.key-stem { fill: none; stroke: #5a4433; stroke-width: 2.4; stroke-linecap: round; }

/* Сдувание пыли */
.mascot-dust {
    width: 30px;
    height: 20px;
    left: -18px;
    bottom: 18px;
}
.mascot.blowing .mascot-dust { opacity: 1; }
.mascot.blowing .m-cheek { fill: rgba(205, 120, 90, 0.6); }
.mascot.blowing .mascot-eyes { transform: scaleY(0.4); }
.dust { fill: rgba(120, 90, 60, 0.4); }
.mascot.blowing .dust { animation: dust-fly 0.9s ease-out infinite; }
@keyframes dust-fly {
    0% { transform: translate(0, 0) scale(0.6); opacity: 0.7; }
    100% { transform: translate(-16px, -5px) scale(1.2); opacity: 0; }
}

/* Полировка — блеск */
.mascot-sparkle {
    position: absolute;
    right: 4px;
    top: 2px;
    font-size: 16px;
    opacity: 0;
    pointer-events: none;
}
.mascot.polishing .mascot-sparkle { animation: sparkle 1.1s ease-in-out infinite; }
.mascot.polishing .mascot-gear { animation: m-spin-fast 3s linear infinite; }
@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0.5) rotate(0); }
    50% { opacity: 1; transform: scale(1.1) rotate(20deg); }
}

/* Ловля курсора — тянет ручки к курсору */
.mascot.reaching .m-arm-l { transform: rotate(78deg); }
.mascot.reaching .m-arm-r { transform: rotate(-78deg); }

/* --- Партия 4 --- */
.mascot-juggle,
.mascot-level,
.mascot-driver,
.mascot-heart {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Жонглирование */
.mascot-juggle {
    left: 50%;
    top: -2px;
    width: 40px;
    height: 34px;
    transform: translateX(-50%);
}
.mascot.juggling .mascot-juggle { opacity: 1; }
.mascot.juggling .m-arm-l { transform: rotate(96deg); }
.mascot.juggling .m-arm-r { transform: rotate(-96deg); }
.jball { fill: var(--gold); }
.mascot.juggling .jball-1 { animation: juggle 0.9s linear infinite; }
.mascot.juggling .jball-2 { animation: juggle 0.9s linear infinite; animation-delay: -0.3s; }
.mascot.juggling .jball-3 { animation: juggle 0.9s linear infinite; animation-delay: -0.6s; }
@keyframes juggle {
    0% { transform: translate(-11px, 8px); }
    42% { transform: translate(0, -13px); }
    50% { transform: translate(11px, 8px); }
    92% { transform: translate(-11px, 9px); }
    100% { transform: translate(-11px, 8px); }
}

/* Качели на паутине */
.mascot-web {
    position: absolute;
    left: 50%;
    top: -32px;
    width: 2px;
    height: 32px;
    margin-left: -1px;
    background: linear-gradient(rgba(120, 90, 60, 0.55), rgba(120, 90, 60, 0.15));
    opacity: 0;
    pointer-events: none;
}
.mascot.swinging .mascot-web { opacity: 1; }
.mascot.swinging {
    animation: m-swing 2.4s ease-in-out infinite;
    transform-origin: 50% -30px;
}
@keyframes m-swing {
    0%, 100% { transform: rotate(-11deg); }
    50% { transform: rotate(11deg); }
}

/* Проверка уровня */
.mascot-level {
    left: 50%;
    bottom: -6px;
    width: 40px;
    height: 13px;
    transform: translateX(-50%);
}
.mascot.leveling .mascot-level { opacity: 1; }
.mascot.leveling .mascot-svg { animation: m-nod 1.7s ease-in-out; }
@keyframes m-nod {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-5deg); }
    55% { transform: rotate(4deg); }
    80% { transform: rotate(-2deg); }
}
.lvl-body { fill: var(--gold-light); stroke: #5a4433; stroke-width: 1.2; }
.lvl-vial { fill: #fff7ee; stroke: #5a4433; stroke-width: 0.8; }
.lvl-bubble { fill: #7fae86; }

/* Подкрутка винтика */
.mascot-driver {
    right: -10px;
    top: 38px;
    width: 20px;
    height: 20px;
}
.mascot.screwing .mascot-driver {
    opacity: 1;
    animation: drv-turn 0.3s ease-in-out infinite;
    transform-origin: 30% 50%;
}
@keyframes drv-turn {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
}
.drv-handle { fill: var(--gold); }
.drv-shaft { fill: #8a8078; }

/* Застревание */
.mascot.stuck { animation: m-stuck 2s ease-in-out; }
@keyframes m-stuck {
    0%, 100% { transform: translate(0, 0); }
    12% { transform: translate(-3px, 0); }
    24% { transform: translate(3px, 0); }
    36% { transform: translate(-3px, 0); }
    48% { transform: translate(3px, 0); }
    60% { transform: translate(-2px, 0); }
    84% { transform: translate(0, -16px); }
}
.mascot.stuck .m-arm-l { animation: flail 0.18s linear infinite alternate; }
.mascot.stuck .m-arm-r { animation: flail 0.18s linear infinite alternate; animation-delay: -0.09s; }
@keyframes flail {
    from { transform: rotate(25deg); }
    to { transform: rotate(-30deg); }
}

/* Рисование сердечка */
.mascot-heart {
    left: -26px;
    top: 16px;
    width: 22px;
    height: 22px;
}
.mascot.drawing .mascot-heart { animation: heart-draw 2.3s ease; }
.mascot.drawing .m-arm-l { transform: rotate(58deg); }
@keyframes heart-draw {
    0% { opacity: 0; transform: scale(0.2); }
    55% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.05); }
}
.heart-shape { fill: rgba(190, 90, 80, 0.6); }

/* Стопка бумаг в руках */
.mascot-papers {
    position: absolute;
    left: 50%;
    bottom: 18px;
    width: 38px;
    height: 28px;
    transform: translateX(-50%) translateY(6px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    filter: drop-shadow(0 4px 8px rgba(60, 46, 32, 0.18));
}

.mascot.carrying .mascot-papers {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.paper {
    fill: #fff7ee;
    stroke: var(--gold);
    stroke-width: 1.2;
}

.paper-line {
    stroke: var(--gold);
    stroke-width: 1;
    opacity: 0.5;
    stroke-linecap: round;
}

/* Сценка «читает книгу» */
.mascot-book {
    position: absolute;
    left: 50%;
    bottom: 16px;
    width: 42px;
    height: 32px;
    transform: translateX(-50%) translateY(6px);
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
    filter: drop-shadow(0 4px 8px rgba(60, 46, 32, 0.2));
}

.mascot.reading .mascot-book {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mascot.reading .mascot-gear { animation-play-state: paused; }

.book-page-left,
.book-page-right {
    fill: #fff7ee;
    stroke: var(--gold);
    stroke-width: 1.4;
    stroke-linejoin: round;
}

.book-flip {
    fill: #fdf3e6;
    stroke: var(--gold);
    stroke-width: 1.2;
    transform-origin: 20px 16px;
}

.mascot.reading .book-flip {
    animation: book-flip 2.4s ease-in-out infinite;
}

@keyframes book-flip {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(-1); }
}

@keyframes mascot-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes mascot-spin {
    to { transform: rotate(360deg); }
}

/* Пузырь-подсказка маскота */
.mascot-bubble {
    position: absolute;
    right: 78px;
    bottom: 12px;
    width: max-content;
    max-width: 220px;
    padding: 11px 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(60, 46, 32, 0.18);
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.45;
    transform-origin: right bottom;
    animation: bubble-in 0.35s ease both;
}

.mascot-bubble[hidden] { display: none; }

.mascot-bubble::after {
    content: '';
    position: absolute;
    right: -7px;
    bottom: 15px;
    width: 12px;
    height: 12px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: rotate(-45deg);
}

/* когда маскот у левого края — пузырь открывается вправо */
.mascot-bubble.flip {
    right: auto;
    left: 78px;
}

.mascot-bubble.flip::after {
    right: auto;
    left: -7px;
    border-right: none;
    border-bottom: none;
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
}

@keyframes bubble-in {
    from { opacity: 0; transform: scale(0.85) translateY(6px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .mascot { animation: none; }
    .mascot-gear { animation: none; }
}

@media (max-width: 500px) {
    .mascot { right: 16px; bottom: 16px; width: 54px; height: 54px; }
    .mascot-bubble { display: none; }
}
