/* ================================================
   NEME5WEB — Animations & Landing-specific styles
   ================================================ */

/* ── Hero title stagger ── */
.hero-line {
    display: block;
    opacity: 0;
    transform: translateY(40px);
    animation: heroLineIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-line:nth-child(1) { animation-delay: 0.1s; }
.hero-line:nth-child(2) { animation-delay: 0.25s; }
.hero-line:nth-child(3) { animation-delay: 0.4s; }

@keyframes heroLineIn {
    to { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
    opacity: 0;
    animation: fadeUp 0.6s ease 0s forwards;
}
.hero-desc {
    opacity: 0;
    animation: fadeUp 0.6s ease 0.55s forwards;
}
.hero-actions {
    opacity: 0;
    animation: fadeUp 0.6s ease 0.7s forwards;
}
.hero-stats {
    opacity: 0;
    animation: fadeUp 0.6s ease 0.85s forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Glowing button ── */
.btn--glow {
    position: relative;
    overflow: hidden;
}
.btn--glow::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--accent) 60deg,
        transparent 120deg
    );
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
    animation: rotateBorder 2s linear infinite paused;
}
.btn--glow:hover::after {
    opacity: 1;
    animation-play-state: running;
}
@keyframes rotateBorder {
    to { transform: rotate(360deg); }
}

/* ── Phone mockup ── */
.hero-phone-mockup {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    animation: floatPhone 4s ease-in-out infinite;
}

@keyframes floatPhone {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-16px); }
}

.phone-frame {
    width: 220px;
    height: 420px;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: 32px;
    padding: 12px;
    box-shadow:
        0 40px 80px rgba(0,0,0,0.6),
        0 0 0 1px rgba(255,255,255,0.05),
        inset 0 1px 0 rgba(255,255,255,0.08);
    position: relative;
}

.phone-screen {
    background: var(--bg-3);
    border-radius: 22px;
    height: 100%;
    overflow: hidden;
    padding: 16px 12px;
}

.screen-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.screen-dot {
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.3; }
}
.screen-bar {
    flex: 1; height: 6px;
    background: var(--border);
    border-radius: 3px;
}

.screen-hero-block { margin-bottom: 16px; }
.sh-tag {
    width: 60px; height: 10px;
    background: rgba(230,57,70,0.3);
    border-radius: 100px;
    margin-bottom: 10px;
    animation: shimmer 2s ease-in-out infinite;
}
.sh-title {
    width: 90%; height: 14px;
    background: var(--border-light);
    border-radius: 4px;
    margin-bottom: 8px;
    animation: shimmer 2s ease-in-out infinite 0.2s;
}
.sh-title--short { width: 65%; }
.sh-btn {
    width: 80px; height: 28px;
    background: var(--accent);
    border-radius: 6px;
    margin-top: 12px;
    animation: shimmer 2s ease-in-out infinite 0.4s;
}

@keyframes shimmer {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.6; }
}

.screen-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sc-card {
    height: 48px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}
.sc-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
}
.sc-card--1::before { background: var(--accent); }
.sc-card--2::before { background: var(--gold); }
.sc-card--3::before { background: var(--success-light); }

/* ── Float badges ── */
.float-badge {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    white-space: nowrap;
}
.float-badge--1 {
    top: 15%; left: -20px;
    animation: floatBadge1 3s ease-in-out infinite;
}
.float-badge--2 {
    top: 45%; right: -20px;
    animation: floatBadge2 3.5s ease-in-out infinite 0.5s;
}
.float-badge--3 {
    bottom: 15%; left: -10px;
    animation: floatBadge1 4s ease-in-out infinite 1s;
}

@keyframes floatBadge1 {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-8px); }
}
@keyframes floatBadge2 {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(8px); }
}

.fb-icon { font-size: 20px; }
.fb-val  { font-family: var(--font-display); font-size: 18px; color: var(--accent); line-height: 1; }
.fb-sub  { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ── Why grid ── */
.why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.why-item {
    padding: 32px 28px;
    background: var(--bg-card);
    position: relative;
    transition: background var(--transition);
    opacity: 0;
    transform: translateY(24px);
}
.why-item.fade-up { opacity: 1; transform: none; transition: opacity 0.5s ease, transform 0.5s ease; }
.why-item:hover { background: var(--bg-3); }

.why-num {
    font-family: var(--font-display);
    font-size: 48px;
    color: var(--bg-3);
    line-height: 1;
    position: absolute;
    top: 16px; right: 20px;
    transition: color var(--transition);
}
.why-item:hover .why-num { color: var(--border); }

.why-icon { font-size: 28px; margin-bottom: 16px; }
.why-title { font-family: var(--font-display); font-size: 20px; letter-spacing: 1px; margin-bottom: 10px; }
.why-desc  { font-size: 14px; color: var(--text-muted); line-height: 1.65; }

/* ── Landing types ── */
.ltype-list { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }

.ltype-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 24px;
    align-items: center;
    padding: 28px 32px;
    background: var(--bg-card);
    transition: background var(--transition), transform var(--transition);
    opacity: 0;
    transform: translateX(-20px);
}
.ltype-item.fade-up { opacity: 1; transform: none; transition: opacity 0.5s ease, transform 0.5s ease, background 0.25s; }
.ltype-item:hover { background: var(--bg-3); }

.ltype-icon  { font-size: 32px; text-align: center; }
.ltype-title { font-family: var(--font-display); font-size: 22px; letter-spacing: 1px; margin-bottom: 8px; }
.ltype-desc  { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 12px; }
.ltype-tags  { display: flex; flex-wrap: wrap; gap: 6px; }
.ltype-tags span {
    padding: 3px 10px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 11px;
    color: var(--text-dim);
}
.ltype-price {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--gold);
    letter-spacing: 1px;
    white-space: nowrap;
}

/* ── CTA section ── */
.cta-section {
    position: relative;
    overflow: hidden;
}
.cta-bg-lines {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 80px,
            rgba(230,57,70,0.03) 80px,
            rgba(230,57,70,0.03) 81px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 80px,
            rgba(230,57,70,0.03) 80px,
            rgba(230,57,70,0.03) 81px
        );
    animation: bgShift 20s linear infinite;
}
@keyframes bgShift {
    from { background-position: 0 0; }
    to   { background-position: 80px 80px; }
}

/* ── Scroll reveal (override) ── */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.fade-up { opacity: 1; transform: none; }

/* ── Navbar animated underline ── */
.nav-link { position: relative; }
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 50%; right: 50%;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transition: left 0.25s ease, right 0.25s ease;
}
.nav-link:hover::after, .nav-link.active::after { left: 8px; right: 8px; }

/* ── Page-load body fade ── */
body { animation: bodyIn 0.4s ease; }
@keyframes bodyIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── PDF download page ── */
.pdf-page {
    min-height: calc(100vh - var(--nav-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
}
.pdf-card {
    max-width: 520px;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.pdf-card::before {
    content: '';
    position: absolute;
    top: -1px; left: 20%; right: 20%; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    border-radius: 0 0 3px 3px;
}
.pdf-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
    animation: iconPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes iconPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.pdf-title { font-family: var(--font-display); font-size: 32px; letter-spacing: 2px; margin-bottom: 12px; }
.pdf-meta  { color: var(--text-dim); font-size: 13px; margin-bottom: 8px; }
.pdf-info  { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 24px 0; text-align: left; }
.pdf-info-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.pdf-info-row:last-child { border-bottom: none; }
.pdf-info-label { color: var(--text-muted); }
.pdf-info-val   { font-weight: 600; }
.pdf-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

/* ── Report page ── */
.report-hero {
    padding: 60px 0 48px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}

/* ── Responsive additions ── */
@media (max-width: 1024px) {
    .why-grid   { grid-template-columns: repeat(2, 1fr); }
    .ltype-item { grid-template-columns: 48px 1fr; }
    .ltype-price { grid-column: 1 / -1; text-align: left; padding-top: 4px; }
}
/* На планшетах badge--2 не должен выходить вправо за экран */
@media (max-width: 1024px) {
    .float-badge--2 { right: 0; }
}

/* Телефон — прямое уменьшение phone-frame вместо scale().
   scale() создаёт stacking context и обрезает position:absolute бейджи. */
@media (max-width: 1024px) {
    .hero-phone-mockup {
        align-items: flex-start;
        animation-name: floatPhoneSm;
    }
    @keyframes floatPhoneSm {
        0%, 100% { transform: translateY(0); }
        50%       { transform: translateY(-10px); }
    }
    .phone-frame  { height: 344px; width: 180px; border-radius: 26px; }
    .phone-screen { border-radius: 18px; }
}

@media (max-width: 768px) {
    .why-grid   { grid-template-columns: 1fr; }
    .ltype-item { grid-template-columns: 40px 1fr; padding: 20px; }
    .ltype-icon { font-size: 24px; }
    .hero-phone-mockup {
        align-items: flex-start;
        animation-name: floatPhoneMd;
    }
    @keyframes floatPhoneMd {
        0%, 100% { transform: translateY(0); }
        50%       { transform: translateY(-8px); }
    }
    .phone-frame  { height: 300px; width: 156px; border-radius: 22px; }
    .phone-screen { border-radius: 15px; }
    /* бейджи: компактнее и прижаты к краям телефона */
    .float-badge    { padding: 7px 10px; gap: 6px; }
    .float-badge--1 { left: 0; }
    .float-badge--2 { right: 0; }
    .float-badge--3 { left: 0; }
    .fb-val         { font-size: 12px; }
    .fb-sub         { font-size: 10px; }
    .fb-icon        { font-size: 14px; }
}

@media (max-width: 480px) {
    .hero-phone-mockup {
        align-items: flex-start;
        animation-name: floatPhoneXs;
    }
    @keyframes floatPhoneXs {
        0%, 100% { transform: translateY(0); }
        50%       { transform: translateY(-6px); }
    }
    .phone-frame  { height: 240px; width: 125px; border-radius: 18px; }
    .phone-screen { border-radius: 12px; }
    .float-badge  { display: none; }
}

/* ── Custom cursor — отключён, используем системный курсор ── */
/* Кастомный курсор убран чтобы не скрывать системный на всех элементах */
a, button, [data-modal-open], .feature-item, .btn, label, select, input, textarea {
    cursor: pointer;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="number"], input[type="url"],
textarea { cursor: text; }

/* ── Particle canvas ──────────────────────────────────────── */
.hero-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.hero-content, .hero-visual { position: relative; z-index: 1; }

/* ── Page transition — убран ── */


/* ── Navbar hide on scroll down ───────────────────────────── */
.navbar {
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1),
                border-color 0.25s ease,
                background 0.25s ease;
}
.navbar--hidden { transform: translateY(-100%); }

/* ── Ripple ───────────────────────────────────────────────── */
.btn { position: relative; overflow: hidden; }
.ripple {
    position: absolute;
    width: 4px; height: 4px;
    background: rgba(255,255,255,0.35);
    border-radius: 50%;
    transform: translate(-50%,-50%) scale(0);
    animation: ripple-out 0.6s ease forwards;
    pointer-events: none;
}
@keyframes ripple-out {
    to { transform: translate(-50%,-50%) scale(80); opacity: 0; }
}

/* ── Glitch logo ──────────────────────────────────────────── */
.nav-logo { position: relative; }
.nav-logo.glitch::before,
.nav-logo.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    font-family: var(--font-display);
    font-size: inherit;
}
.nav-logo.glitch::before {
    color: #0ff;
    animation: glitch1 0.15s steps(2) 3;
    clip-path: polygon(0 30%,100% 30%,100% 50%,0 50%);
}
.nav-logo.glitch::after {
    color: var(--accent);
    animation: glitch2 0.15s steps(2) 3;
    clip-path: polygon(0 60%,100% 60%,100% 80%,0 80%);
}
@keyframes glitch1 {
    0%   { transform: translate(-2px,0); }
    50%  { transform: translate(2px,0); }
    100% { transform: translate(0,0); }
}
@keyframes glitch2 {
    0%   { transform: translate(2px,0); }
    50%  { transform: translate(-2px,0); }
    100% { transform: translate(0,0); }
}

/* ── Price pop animation ──────────────────────────────────── */
.price-pop {
    animation: pricePop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes pricePop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.12); color: var(--gold); }
    100% { transform: scale(1); }
}

/* ── Enhanced card hover ──────────────────────────────────── */
.service-card,
.project-card,
.review-card,
.why-item {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.25s ease !important;
    will-change: transform;
}

/* ── Reveal enhanced ──────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1),
                transform 0.6s cubic-bezier(0.16,1,0.3,1);
    will-change: opacity, transform;
}
.reveal.fade-up { opacity: 1; transform: none; }

/* ── Shimmer on feature cards when selected ──────────────── */
.feature-item.selected {
    border-color: var(--accent);
    background: rgba(230,57,70,0.05);
    box-shadow: inset 0 0 0 1px var(--accent), 0 0 16px rgba(230,57,70,0.1);
}
.feature-item.selected::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,transparent 30%,rgba(255,255,255,0.04) 50%,transparent 70%);
    animation: shimmerSlide 1.5s ease infinite;
    pointer-events: none;
    border-radius: inherit;
}
.feature-item { position: relative; overflow: hidden; }
@keyframes shimmerSlide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ── Floating label on form inputs ───────────────────────── */
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 2px 12px rgba(230,57,70,0.1);
    transform: translateY(-1px);
    transition: all 0.25s ease;
}

/* ── Admin nav item slide ─────────────────────────────────── */
.admin-nav-item {
    transition: padding-left 0.25s cubic-bezier(0.34,1.56,0.64,1),
                color 0.2s ease,
                background 0.2s ease !important;
}

/* ── Stat card entrance ───────────────────────────────────── */
.stat-card {
    animation: statIn 0.5s cubic-bezier(0.34,1.56,0.64,1) backwards;
}
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }

@keyframes statIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: none; }
}

/* ── Order status pulse ───────────────────────────────────── */
.status-new .status-dot,
.status-in_progress .status-dot {
    animation: statusPulse 2s ease-in-out infinite;
}
@keyframes statusPulse {
    0%,100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
    50%      { box-shadow: 0 0 0 5px transparent; opacity: 0.7; }
}

/* ── Scroll progress bar ──────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: calc(var(--scroll-pct, 0) * 1%);
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    z-index: 10001;
    transition: width 0.1s linear;
}

/* ── Tooltip on badges ────────────────────────────────────── */
[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 100;
    color: var(--text);
}
.badge, .btn { position: relative; }