/* =========================================
   1. БАЗОВЫЕ СТИЛИ
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }

body {
    background-color: #f2f2f2; 
    color: #111;
    font-family: 'Geologica', sans-serif;
    overflow: hidden;
    width: 100vw; height: 100dvh;
    position: relative;
    touch-action: none;
}
@supports not (height: 100dvh) { body { height: 100vh; } }

body.shaking { animation: shake-anim 0.5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake-anim {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

#draw-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }
#blur-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(242, 242, 242, 0.8); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); z-index: 25; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; will-change: opacity; }
#blur-overlay.active { opacity: 1; pointer-events: auto; }

#custom-cursor { position: fixed; top: 0; left: 0; border: 1.5px solid #fff; border-radius: 50%; pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); display: none; mix-blend-mode: difference; background-color: transparent; transition: width 0.1s, height 0.1s; will-change: transform, width, height; }

/* =========================================
   2. МОБИЛЬНЫЙ КОНТЕНТ
   ========================================= */
#mobile-content-view { position: fixed; top: 0; left: 0; width: 100%; height: 100dvh; z-index: 30; display: none; flex-direction: column; overflow: hidden; pointer-events: none; transform: translateY(20px); opacity: 0; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
#mobile-content-view.active { display: flex; pointer-events: auto; transform: translateY(0); opacity: 1; }
.mobile-header { flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 20px; padding-top: max(20px, env(safe-area-inset-top)); background: rgba(255,255,255,0.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(0,0,0,0.05); min-height: 70px; position: relative; z-index: 10; }
.btn-close-menu { position: absolute; right: 20px; top: calc(50% + (env(safe-area-inset-top) / 2)); transform: translateY(-50%); width: 40px; height: 40px; background: #f4f4f5; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #111; transition: background 0.2s, transform 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
@supports not (padding-top: env(safe-area-inset-top)) { .btn-close-menu { top: 50%; } }
.btn-close-menu:active { background: #e4e4e7; transform: translateY(-50%) scale(0.95); }
.mobile-view-title { font-size: 1.1rem; font-weight: 800; text-transform: uppercase; text-align: center; }
.mobile-body-scroll { flex-grow: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 20px; padding-bottom: 40px; touch-action: pan-y; }
.static-card { background: #fff; border-radius: 20px; overflow: hidden; margin-bottom: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.05); cursor: pointer; }
.static-card img { width: 100%; height: auto; display: block; }
.static-card-content { padding: 20px; }
.static-card-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 6px; }
.static-card-desc { font-size: 0.95rem; color: #555; line-height: 1.4; margin-bottom: 12px; }
.static-service-row { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border-bottom: 1px solid #f0f0f0; background: #fff; border-radius: 16px; margin-bottom: 12px; }
.static-service-icon { width: 48px; height: 48px; min-width: 48px; min-height: 48px; background: #111; color: #fff; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.static-form-container { padding: 20px; background: #fff; border-radius: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.04); }

/* =========================================
   3. ПАНЕЛЬ ИНСТРУМЕНТОВ
   ========================================= */
.drawing-toolbar { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 12px; border-radius: 16px; border: 1px solid rgba(0,0,0,0.08); box-shadow: 0 10px 30px rgba(0,0,0,0.08); z-index: 2000; pointer-events: auto; transition: transform 0.3s ease; }
.tool-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #555; transition: all 0.2s; }
.tool-btn:hover { background: rgba(0,0,0,0.05); color: #000; }
.tool-btn.active { background: #111; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.tool-separator { height: 1px; width: 100%; background: rgba(0,0,0,0.08); margin: 2px 0; }
.color-picker { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.color-dot { width: 18px; height: 18px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform 0.2s; }
.color-dot:hover { transform: scale(1.2); }
.color-dot.active { border-color: #111; transform: scale(1.1); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.size-picker { display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 4px 0; }
.size-option { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.size-circle { background-color: #d1d5db; border-radius: 50%; transition: all 0.2s; }
.size-option:hover .size-circle { background-color: #9ca3af; }
.size-option.active .size-circle { background-color: #111; }
.icon-svg { width: 16px; height: 16px; stroke-width: 2; }

/* =========================================
   4. ФОН И КЛАВИАТУРА
   ========================================= */
.mobile-bg-layer { position: absolute; top: 25%; left: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; z-index: 0; pointer-events: none; text-align: center; transition: top 0.3s ease; }
.mb-studio-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; color: #9ca3af; margin-bottom: 8px; display: none; align-items: center; gap: 6px; }
.mb-title { font-size: 2.2rem; line-height: 1; font-weight: 800; letter-spacing: -0.04em; color: #000; margin-bottom: 16px; display: none; }
.mb-pill { background: #ffffff; color: #444; font-size: 0.9rem; font-weight: 600; padding: 10px 24px; border-radius: 100px; display: inline-flex; align-items: center; justify-content: center; letter-spacing: 0.01em; min-width: 280px; min-height: 40px; box-shadow: 0 4px 20px rgba(0,0,0,0.04); }
.cursor-blink { display: inline-block; width: 2px; height: 1.1em; background-color: #444; margin-left: 6px; animation: blink 1s step-end infinite; }
@keyframes blink { from, to { opacity: 1; } 50% { opacity: 0; } }

.keyboard-wrapper { display: flex; flex-direction: column; gap: 8px; background: rgba(220, 220, 223, 0.4); padding: 20px; border-radius: 24px; border: 1px solid rgba(255,255,255,0.5); backdrop-filter: blur(4px); transform: scale(0.9); margin-top: 40px; }
.kb-row { display: flex; gap: 6px; justify-content: center; }
.kb-key { width: 40px; height: 40px; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: #555; box-shadow: 0 2px 0 #d1d1d6; text-transform: uppercase; transition: transform 0.05s, box-shadow 0.05s, background-color 0.05s; }
.kb-key.kb-wide { width: 60px; font-size: 12px; }
.kb-key.kb-space { width: 200px; }
.kb-key.active { transform: translateY(2px); box-shadow: 0 0 0 #d1d1d6; background-color: #f0f0f0; color: #000; }

@media (max-width: 768px) {
    .mobile-bg-layer { top: 2%; } 
    .mb-studio-label { display: flex; } .mb-title { display: block; }
    .mb-pill { font-size: 0.75rem; padding: 8px 16px; min-width: 140px; margin-bottom: 0; }
    .keyboard-wrapper { display: none; } .drawing-toolbar { display: none; } 
    body { background-color: #f4f4f4; }
}

/* =========================================
   5. ИНФО ПАНЕЛЬ
   ========================================= */
.project-info-panel { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%) translateY(40px); width: 90%; max-width: 480px; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(0,0,0,0.06); border-radius: 24px; padding: 32px; box-shadow: 0 20px 40px rgba(0,0,0,0.08); z-index: 2000; opacity: 0; pointer-events: none; transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.project-info-panel.visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.info-header { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.info-title { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: #000; }
.info-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.info-tag { font-size: 0.75rem; background: #f4f4f5; padding: 6px 12px; border-radius: 100px; font-weight: 600; text-transform: uppercase; color: #666; letter-spacing: 0.02em; }
.info-desc { font-size: 1.05rem; color: #444; line-height: 1.6; margin-bottom: 24px; }
.info-btn { display: inline-flex; align-items: center; justify-content: center; background: #111; color: #fff; height: 48px; padding: 0 32px; border-radius: 100px; font-size: 1rem; font-weight: 600; text-decoration: none; transition: all 0.2s; cursor: pointer; }
.info-btn:hover { background: #000; transform: scale(1.02); }

/* =========================================
   6. ФИЗИЧЕСКИЕ КАРТОЧКИ
   ========================================= */
#scene-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; touch-action: none; cursor: grab; }
#scene-container:active { cursor: grabbing; }
.physics-card { position: absolute; display: flex; flex-direction: column; border-radius: 16px; background-color: #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.06); will-change: transform; pointer-events: none; transition: box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease; transform-origin: center center; border: 1px solid rgba(0,0,0,0.05); overflow: hidden; }
.card-scaler { width: 100%; height: 100%; transition: transform 0.2s; transform-origin: center center; display: flex; flex-direction: column; }
.physics-card.dragging { box-shadow: 0 25px 50px rgba(0,0,0,0.2); z-index: 1000 !important; cursor: grabbing; }
.physics-card.dragging .card-scaler { transform: scale(1.05); }
.physics-logo { background-color: #000; border-radius: 24px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); }
.mini-card-layout { width: 100%; height: 100%; position: relative; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; }
.mini-brand-title { font-size: 1.2rem; font-weight: 800; line-height: 0.95; letter-spacing: -0.03em; z-index: 2; pointer-events: none; }
.mini-card-img-container { position: absolute; bottom: 10px; left: 10px; right: 10px; top: 50%; border-radius: 8px; overflow: hidden; pointer-events: none; }
.mini-card-img { width: 100%; height: 100%; object-fit: cover; }
.style-polaroid { background-color: #a4c8d5; color: #1a3c4a; }
.style-patta { background-color: #6a4e38; color: #fff; }
.style-filling { background-color: #111; color: #fff; }
.style-fest { background-color: #e57373; color: #fff; }
.card-image { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.card-inner-text { padding: 24px; text-align: center; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.card-mini-title { font-weight: 800; font-size: 1.4rem; line-height: 1.1; margin-bottom: 4px; text-transform: uppercase; color: #111; }
.card-mini-sub { font-size: 0.9rem; color: #666; font-weight: 500; }
.card-dark { background-color: #111; color: #fff; border: 1px solid #222; }
.card-accent { background-color: #ff3b30; color: #fff; border: none; }
.card-outlined { background-color: #fff; border: 2px solid #111; color: #111; }
.card-service { background-color: #ffffff; color: #111; border: 2px solid #e4e4e7; align-items: flex-start; z-index: 20 !important; }
.service-inner { padding: 20px; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: flex-start; gap: 12px; pointer-events: none; }
.service-icon { width: 48px; height: 48px; min-width: 48px; min-height: 48px; background: #111; color: #fff; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 0; flex-shrink: 0; }
.service-title { font-size: 1.4rem; font-weight: 800; line-height: 1.1; margin-bottom: 8px; }
.service-desc { font-size: 0.85rem; color: #555; line-height: 1.4; }
.card-white-panel { background-color: #fff; color: #111; border: 1px solid rgba(0,0,0,0.1); justify-content: flex-start; box-shadow: 0 20px 60px rgba(0,0,0,0.1) !important; z-index: 20 !important; pointer-events: auto !important; }
.contact-form-inner { padding: 24px; width: 100%; height: 100%; display: flex; flex-direction: column; gap: 12px; pointer-events: auto !important; }
.panel-header-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.panel-header-sub { font-size: 0.9rem; color: #666; margin-bottom: 8px; }
.contact-input, .contact-textarea { width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid #e4e4e7; background: #f9f9fa; font-family: inherit; font-size: 0.95rem; outline: none; transition: border-color 0.2s, background 0.2s; }
.contact-input:focus, .contact-textarea:focus { border-color: #111; background: #fff; }
.contact-textarea { resize: none; height: 80px; }
.contact-submit-btn { margin-top: auto; background: #111; color: #fff; border: none; border-radius: 100px; height: 48px; flex-shrink: 0; font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.1s, background 0.2s; }
.contact-info-inner { padding: 32px; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; pointer-events: auto !important; }
.contact-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; color: #333; text-decoration: none; transition: opacity 0.2s; }
.contact-row:hover { opacity: 0.7; }
.socials-row { display: flex; gap: 12px; margin-top: 10px; }
.social-btn { width: 44px; height: 44px; border: 1px solid #e4e4e7; border-radius: 12px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; color: #111; }
.social-btn:hover { background: #111; color: #fff; border-color: #111; }
.social-btn img { transition: filter 0.2s; } .social-btn:hover img { filter: invert(1); }

/* =========================================
   7. МЕНЮ НАВИГАЦИИ
   ========================================= */
.nav-wrapper { position: fixed; top: 40px; left: 50%; transform: translateX(-50%); z-index: 1000; display: grid; grid-template-areas: "stack"; padding: 20px; pointer-events: none; width: max-content; }
.nav-layer { grid-area: stack; display: flex; align-items: center; gap: 6px; justify-content: center; }
.nav-bg-layer { z-index: 1; filter: url('#fluid-goo'); opacity: 1; mix-blend-mode: normal; position: relative; }
.nav-fg-layer { z-index: 2; mix-blend-mode: difference; color: #fff; }
.nav-bg-item { background-color: #000000; border-radius: 100px; height: 56px; display: flex; align-items: center; justify-content: center; will-change: transform; }
.nav-wrapper:not(:hover) .nav-bg-item { animation: nav-breathe 5s ease-in-out infinite; }
@keyframes nav-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
.nav-item-icon { width: 110px; } .nav-item-menu { width: 310px; padding: 0; justify-content: space-evenly; } .nav-item-cta { width: 160px; padding: 0; } 
.cursor-blob { position: absolute; width: 40px; height: 40px; background-color: #000; border-radius: 50%; opacity: 0; transition: opacity 0.3s; transform: translate(-50%, -50%); pointer-events: none; top: 0; left: 0; }
.nav-wrapper:hover .cursor-blob { opacity: 1; }
.nav-fg-item { height: 56px; display: flex; align-items: center; justify-content: center; color: #fff; text-decoration: none; pointer-events: auto; border-radius: 100px; transition: transform 0.1s ease; }
.nav-fg-item.nav-item-cta { font-weight: 600; font-size: 14px; }
.nav-logo-img { height: 24px; width: auto; display: block; pointer-events: none; filter: invert(1); }
.nav-link { position: relative; color: #fff; text-decoration: none; font-size: 14px; font-weight: 500; padding: 0 15px; line-height: 56px; display: inline-block; transition: opacity 0.2s, transform 0.2s; cursor: pointer; }
.nav-link:hover { transform: scale(1.05); }
.fluid-filter { position: absolute; visibility: hidden; width: 0; height: 0; }
@media (max-width: 768px) { .nav-wrapper { transform: translateX(-50%) scale(0.65); top: 10px; width: 100%; display: none; } }

/* =========================================
   8. ВЫБОР УСЛУГ (FORM)
   ========================================= */
.form-services-title { font-size: 0.9rem; font-weight: 600; color: #444; margin-bottom: 8px; margin-top: 4px; }
.form-services-group { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.service-pill-label { cursor: pointer; user-select: none; }
.service-pill-label input { display: none; }
.service-pill-span { display: inline-block; padding: 8px 14px; background: #f4f4f5; border-radius: 100px; color: #666; font-size: 0.8rem; font-weight: 600; transition: all 0.2s; border: 1px solid transparent; }
.service-pill-label input:checked + .service-pill-span { background: #111; color: #fff; border-color: #111; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.service-pill-label:hover .service-pill-span { background: #e4e4e7; }

/* =========================================
   9. CASE VIEWER
   ========================================= */
#case-viewer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #fff; z-index: 3000; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
#case-viewer.active { transform: translateY(0); }
.viewer-close { position: absolute; top: 20px; right: 20px; width: 48px; height: 48px; border-radius: 50%; border: none; background: #f4f4f5; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10; transition: 0.2s; }
.viewer-close:hover { background: #e4e4e7; transform: rotate(90deg); }
.viewer-scroll-area { flex-grow: 1; overflow-y: auto; padding: 0 0 80px 0; }
.case-hero { padding: 100px 20px 60px 20px; max-width: 800px; margin: 0 auto; text-align: center; }
.case-hero h1 { font-size: 3rem; font-weight: 800; line-height: 1.1; margin-bottom: 16px; }
.case-tags { color: #666; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; }
.viewer-content { max-width: 800px; margin: 0 auto; padding: 0 20px; }
.viewer-content h2 { font-size: 2rem; font-weight: 700; margin: 40px 0 20px 0; }
.viewer-content p { font-size: 1.15rem; line-height: 1.6; color: #333; margin-bottom: 24px; }
.case-block-img { margin: 32px 0; border-radius: 12px; overflow: hidden; }
.case-block-img img { width: 100%; height: auto; display: block; }
.case-block-video { width: 100%; height: auto; border-radius: 12px; margin: 32px 0; display: block; background: #000; }
.viewer-footer { max-width: 800px; margin: 60px auto 0 auto; padding: 40px 20px; border-top: 1px solid #eee; display: flex; flex-direction: column; align-items: center; }
.viewer-next-label { font-size: 0.9rem; color: #888; margin-bottom: 8px; }
.btn-next-case { font-size: 1.5rem; font-weight: 700; border: none; background: transparent; cursor: pointer; transition: 0.2s; }
.btn-next-case:hover { opacity: 0.6; }