/*
 * Panarina Marketing: site updates 2026-10-01
 * Loaded AFTER each page's own <style> block, so equal-specificity rules here win.
 *   1. Homepage hero with rotating service phrase
 *   2. Service cards: real service details on the back + keyboard flip
 *   3. S.A.M. one-time entrance pulse
 *   4. Lead form: optional message, analysis hint, "change answers" button
 *   5. Success popup: hidden popup no longer holds a keyboard stop
 *   6. Website Design page: "What would you like to improve?" task cards
 */

/* ------------------------------------------------------------------ 1. Hero */
.hero-title.hero-title--rotating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.18em;
    margin-bottom: 26px;
    font-size: inherit;
    line-height: 1.15;
}

.hero-lead,
.hero-tail {
    display: block;
    font-size: clamp(1.15rem, 2.4vw, 1.85rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.01em;
}

/* All phrases share one grid cell: the box is always as large as the longest phrase,
   so nothing around it moves when the phrase changes. */
.hero-rotator {
    display: grid;
    justify-items: center;
    font-size: clamp(2rem, 8vw, 4.6rem);
    font-weight: 900;
    line-height: 1.12;
    color: var(--neon-green, #CCFF00);
    text-shadow: 0 0 24px rgba(204, 255, 0, 0.45);
    max-width: 100%;
}

.hero-rotator__item {
    grid-area: 1 / 1;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.9s ease;
}

.hero-rotator__item.is-active {
    opacity: 1;
}

.hero-title--rotating + .hero-subtitle {
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    color: var(--text-gray, #a0a0a0);
    margin-bottom: 36px;
}

/* reduced motion: the same four phrases shown together as one static line (no rotation, no duplicate text) */
@media (prefers-reduced-motion: reduce) {
    .hero-rotator {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        font-size: clamp(1.35rem, 4.6vw, 2.5rem);
        line-height: 1.3;
    }
    .hero-rotator__item {
        grid-area: auto;
        opacity: 1;
        transition: none;
    }
    .hero-rotator__item + .hero-rotator__item::before {
        content: "·" / "";
        margin: 0 0.35em;
    }
}

/* ------------------------------------------------------------------ 2. Service cards */
/* the back side now lists what the service includes and offers a direct request link */
.flip-card-back .svc-back {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 30px 30px 26px;
    text-align: left;
}

.svc-back__note {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--neon-cyan, #00e5ff);
    margin-bottom: 12px;
}

.svc-back__list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
}

.svc-back__list li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 7px;
    color: #e6e6e6;
    font-size: 0.9rem;
    line-height: 1.45;
}

.svc-back__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--neon-green, #CCFF00);
    box-shadow: 0 0 8px rgba(204, 255, 0, 0.7);
}

.svc-back__cta {
    margin-top: auto;
    align-self: flex-start;
    color: var(--neon-green, #CCFF00);
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    padding: 4px 0;
    border-radius: 4px;
}

.svc-back__cta:hover { text-decoration: underline; text-underline-offset: 4px; }

.svc-back__cta:focus-visible {
    outline: 2px solid var(--neon-green, #CCFF00);
    outline-offset: 4px;
}

/* keyboard users: focusing the request link turns the card so the link is visible */
.flip-card-container:focus-within .flip-card {
    transform: rotateY(180deg);
}

/* the new card texts are slightly longer than the old ones: a little more height so nothing is cut */
.flip-card-container { height: 310px; }

/* small phones: the old fixed 320px column was wider than a 320px screen; long RU/UA words in the heading too */
@media (max-width: 480px) {
    .services-section { padding-left: 16px; padding-right: 16px; }
    .flip-cards-grid { grid-template-columns: minmax(0, 1fr); }
    .flip-card-container { height: 340px; }
    /* the free-analysis strip button did not fit a 320px screen (pre-existing, UA text) */
    .free-analysis-strip { padding: 20px 16px; }
    .free-analysis-strip a { white-space: normal; text-align: center; }
    .services-headline {
        font-size: clamp(1.5rem, 7.2vw, 2.5rem);
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

/* ------------------------------------------------------------------ 3. S.A.M. entrance pulse */
/* the old 9 s repeating glow is removed from the pages; this plays once per visit */
@media (prefers-reduced-motion: no-preference) {
    .sam-letter.sam-pulse::after {
        animation: samPulse 0.8s ease-out both;
        animation-delay: var(--sam-delay, 0s);
    }
}

@keyframes samPulse {
    0%   { opacity: 0; }
    22%  { opacity: 1; }    /* ~0.18 s quick rise */
    100% { opacity: 0; }    /* ~0.62 s smooth fade */
}

/* ------------------------------------------------------------------ 4. Lead form additions */
.form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.form-hint {
    margin: -4px 0 12px;
    padding: 10px 14px;
    border-left: 3px solid var(--neon-green, #CCFF00);
    background: rgba(204, 255, 0, 0.06);
    color: #e6e6e6;
    font-size: 0.9rem;
    line-height: 1.5;
    border-radius: 0 8px 8px 0;
}

.form-hint[hidden] { display: none; }

.form-optional {
    color: var(--text-dim, #8a9aa3);
    font-weight: 400;
    font-size: 0.85em;
}

.form-back {
    display: inline-block;
    margin: 0 0 18px;
    padding: 6px 0;
    background: none;
    border: none;
    color: var(--text-gray, #a0a0a0);
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    cursor: pointer;
}

.form-back:hover { color: var(--neon-green, #CCFF00); }

.form-back:focus-visible {
    outline: 2px solid var(--neon-green, #CCFF00);
    outline-offset: 4px;
    border-radius: 4px;
}

/* ------------------------------------------------------------------ 5. Success popup */
/* It used to be hidden with opacity only, so its Close button stayed in the Tab order
   while invisible. visibility removes it from the Tab order until the popup is shown. */
.success-popup {
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.4s;
}

.success-popup.show {
    visibility: visible;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

/* ------------------------------------------------------------------ 6. Website Design: task cards */
.task-section {
    max-width: none;
    margin: 0;
    padding: 100px 40px;
}

.task-section .section-title { margin-bottom: 16px; }

.task-intro {
    text-align: center;
    color: var(--text-gray, #a0a0a0);
    max-width: 640px;
    margin: 0 auto 44px;
    line-height: 1.7;
}

.task-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.task-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 32px 28px 28px;
    background: rgba(10, 16, 26, 0.6);
    border: 1px solid rgba(204, 255, 0, 0.18);
    border-radius: 20px;
    scroll-margin-top: 110px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.task-card:hover,
.task-card:focus-within {
    border-color: rgba(204, 255, 0, 0.55);
    box-shadow: 0 0 26px rgba(204, 255, 0, 0.14);
}

.task-card__num {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--neon-green, #CCFF00);
    opacity: 0.8;
    margin-bottom: 12px;
}

.task-card__title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 14px;
}

.task-card__text {
    color: var(--text-gray, #a0a0a0);
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.task-card__list {
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
}

.task-card__list li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 6px;
    color: #e6e6e6;
    font-size: 0.88rem;
    line-height: 1.5;
}

.task-card__list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--neon-green, #CCFF00);
}

.task-card .pricing-button {
    margin-top: auto;
    text-align: center;
}

@media (max-width: 1023px) {
    .task-section { padding: 70px 24px; }
    .task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* third card spans the full row on tablet so nothing is squeezed */
    .task-grid .task-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
    .task-section { padding: 56px 16px; }
    .task-grid { grid-template-columns: 1fr; gap: 16px; }
    .task-grid .task-card:last-child { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .task-card { transition: none; }
}
