/* RED ATOM — enhanced motion + visual polish */

html, body { overflow-x: hidden; }
html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}
body {
    background: #fafafa;
    color: #0f172a;
}

/* ===== FONTS ===== */
@font-face { font-family: 'Find Sans Pro'; src: url('fonts/FindSansPro-Light.ttf') format('truetype'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Find Sans Pro'; src: url('fonts/FindSansPro-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Find Sans Pro'; src: url('fonts/FindSansPro-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Find Sans Pro'; src: url('fonts/FindSansPro-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

.brand-wordmark {
    font-family: 'Find Sans Pro', 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.font-mono-label {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    letter-spacing: 0.05em;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ===== SCROLL PROGRESS BAR ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #e11d48 0%, #f43f5e 50%, #fb7185 100%);
    z-index: 100;
    width: 0%;
    box-shadow: 0 0 12px rgba(225, 29, 72, 0.6);
    transition: width 0.1s linear;
}

/* ===== CURSOR GLOW ===== */
.cursor-glow {
    position: fixed;
    pointer-events: none;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(225,29,72,0.12) 0%, rgba(225,29,72,0) 60%);
    transform: translate(-50%, -50%);
    z-index: 1;
    transition: opacity 0.3s;
    mix-blend-mode: multiply;
    opacity: 0;
}
@media (hover: hover) {
    body:hover .cursor-glow { opacity: 1; }
}
@media (max-width: 768px) {
    .cursor-glow { display: none; }
}

/* ===== NOISE TEXTURE OVERLAY ===== */
.noise::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
    mix-blend-mode: multiply;
    opacity: 0.7;
    z-index: 1;
}

/* ===== SCROLL-REVEAL UTILITIES ===== */
[data-reveal] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
}
[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}
[data-reveal="left"] { transform: translateX(-60px); }
[data-reveal="left"].is-visible { transform: translateX(0); }
[data-reveal="right"] { transform: translateX(60px); }
[data-reveal="right"].is-visible { transform: translateX(0); }
[data-reveal="scale"] { transform: scale(0.9); }
[data-reveal="scale"].is-visible { transform: scale(1); }
[data-reveal="clip"] {
    opacity: 1;
    transform: none;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.1s cubic-bezier(0.77, 0, 0.175, 1);
}
[data-reveal="clip"].is-visible { clip-path: inset(0 0 0 0); }

[data-stagger] > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-stagger].is-visible > * { opacity: 1; transform: translateY(0); }
[data-stagger].is-visible > *:nth-child(1) { transition-delay: 0.05s; }
[data-stagger].is-visible > *:nth-child(2) { transition-delay: 0.15s; }
[data-stagger].is-visible > *:nth-child(3) { transition-delay: 0.25s; }
[data-stagger].is-visible > *:nth-child(4) { transition-delay: 0.35s; }
[data-stagger].is-visible > *:nth-child(5) { transition-delay: 0.45s; }
[data-stagger].is-visible > *:nth-child(6) { transition-delay: 0.55s; }

/* Split-word reveal */
.split-line {
    display: block;
    overflow: hidden;
    line-height: 1.1;
    padding-bottom: 0.08em;
}
.split-word {
    display: inline-block;
    transform: translateY(110%);
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}
.split-line.is-visible .split-word { transform: translateY(0); }
.split-line .split-word:nth-child(1) { transition-delay: 0.05s; }
.split-line .split-word:nth-child(2) { transition-delay: 0.12s; }
.split-line .split-word:nth-child(3) { transition-delay: 0.19s; }
.split-line .split-word:nth-child(4) { transition-delay: 0.26s; }
.split-line .split-word:nth-child(5) { transition-delay: 0.33s; }
.split-line .split-word:nth-child(6) { transition-delay: 0.40s; }
.split-line .split-word:nth-child(7) { transition-delay: 0.47s; }
.split-line .split-word:nth-child(8) { transition-delay: 0.54s; }

/* ===== HERO ===== */
.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(225, 29, 72, 0.25);
    border-radius: 999px;
    background: rgba(225, 29, 72, 0.04);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #e11d48;
    font-weight: 600;
}
.hero-kicker .dot {
    width: 6px; height: 6px;
    background: #e11d48;
    border-radius: 50%;
    animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(225,29,72,0.6); }
    50% { transform: scale(1.3); opacity: 0.7; box-shadow: 0 0 0 8px rgba(225,29,72,0); }
}

/* Animated gradient blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: 0.55;
    animation: blob-float 18s ease-in-out infinite;
}
.blob-1 { background: #e11d48; width: 480px; height: 480px; top: -10%; right: -10%; opacity: 0.28; display: none; }
.blob-2 { background: #f43f5e; width: 380px; height: 380px; bottom: -20%; left: -10%; animation-delay: -6s; opacity: 0.18; display: none; }
.blob-3 { background: #fb7185; width: 300px; height: 300px; top: 40%; left: 40%; animation-delay: -12s; opacity: 0.12; display: none; }
@media (max-width: 768px) {
    .blob-1, .blob-2, .blob-3 { display: none !important; }
    .bg-grid { display: none; }
}
@keyframes blob-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.08); }
    66% { transform: translate(-30px, 40px) scale(0.94); }
}

/* Grid overlay */
.bg-grid {
    background-image:
        linear-gradient(to right, rgba(15,23,42,0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15,23,42,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
}
.bg-grid-mask {
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

/* ===== BUTTON MAGNETIC / HOVER ===== */
.btn-primary {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s;
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, #be123c 0%, #e11d48 50%, #f43f5e 100%);
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: -1;
}
.btn-primary:hover::before { transform: translateX(0); }
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -10px rgba(225, 29, 72, 0.5);
}
.btn-primary .arrow {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn-primary:hover .arrow { transform: translateX(6px); }

/* White variant — used on dark backgrounds. No gradient wash on hover. */
.btn-white {
    position: relative;
    isolation: isolate;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s, background-color 0.3s;
}
.btn-white:hover {
    transform: translateY(-2px);
    background-color: #fef2f4;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35);
}
.btn-white .arrow {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn-white:hover .arrow { transform: translateX(6px); }

.btn-ghost {
    transition: transform 0.3s, background-color 0.3s, color 0.3s;
}
.btn-ghost:hover {
    transform: translateY(-2px);
}

/* ===== MARQUEE ===== */
.marquee {
    display: flex;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}
.marquee-track {
    display: flex;
    gap: 3rem;
    flex-shrink: 0;
    animation: marquee 40s linear infinite;
    padding-right: 3rem;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}
.marquee-item {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}
.marquee-item .sep {
    width: 6px; height: 6px;
    background: #e11d48;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== SERVICE CARD ===== */
.service-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s, box-shadow 0.4s;
}
.service-card::before {
    content: '';
    position: absolute;
    top: var(--mx, 50%);
    left: var(--my, 50%);
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(225,29,72,0.12) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    z-index: 0;
}
.service-card:hover::before { opacity: 1; }
.service-card:hover {
    transform: translateY(-6px);
    border-color: rgba(225, 29, 72, 0.3);
    box-shadow: 0 30px 60px -20px rgba(225, 29, 72, 0.15), 0 0 0 1px rgba(225, 29, 72, 0.05);
}
.service-card > * { position: relative; z-index: 1; }
.service-card .icon-wrap {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s, color 0.3s;
}
.service-card:hover .icon-wrap {
    transform: rotate(-8deg) scale(1.08);
    background: #e11d48;
    color: white;
}
.service-card .card-number {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    color: #cbd5e1;
    font-weight: 600;
    letter-spacing: 0.1em;
}

/* ===== CTA SECTION ===== */
.cta-section {
    position: relative;
    overflow: hidden;
    background: #0f172a;
}
.cta-section .cta-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(225,29,72,0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(225,29,72,0.08) 1px, transparent 1px);
    background-size: 80px 80px;
}
.cta-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(225,29,72,0.3) 0%, transparent 60%);
    animation: cta-pulse 6s ease-in-out infinite;
}
@keyframes cta-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.1); }
}
.cta-section-inner { position: relative; z-index: 2; }

/* Scrolling CTA big text */
.cta-bg-text {
    position: absolute;
    bottom: -1.5rem;
    left: 0;
    right: 0;
    font-size: clamp(80px, 16vw, 220px);
    font-weight: 900;
    color: rgba(255,255,255,0.04);
    white-space: nowrap;
    letter-spacing: -0.04em;
    line-height: 1;
    z-index: 1;
    pointer-events: none;
    font-family: 'Find Sans Pro', sans-serif;
}

/* ===== PORTFOLIO ===== */
.portfolio-card {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s;
}
.portfolio-card:hover {
    transform: translateY(-6px);
}
.portfolio-main { position: relative; }
.portfolio-main .shimmer {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(225,29,72,0.08) 50%, transparent 70%);
    animation: shimmer-move 8s linear infinite;
    pointer-events: none;
}
@keyframes shimmer-move {
    0% { transform: translate(-30%, -30%) rotate(0deg); }
    100% { transform: translate(-30%, -30%) rotate(360deg); }
}

/* Phone mockup float */
.phone-mockup {
    animation: float-phone 6s ease-in-out infinite;
    transform-style: preserve-3d;
    perspective: 1000px;
}
@keyframes float-phone {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
}

/* ===== STATS COUNTER ===== */
.stat-counter {
    font-variant-numeric: tabular-nums;
    font-family: 'Find Sans Pro', sans-serif;
}

/* ===== BURNOUT MOCK ===== */
.burnout-calendar-bg { background-color: #dbc9a9; }
.burnout-day { background-color: #fef8ed; }

/* ===== SERVICES EXTRA TOGGLE ===== */
.services-extra.open {
    max-height: 2000px;
    opacity: 1;
    margin-top: 2rem;
}
#toggle-services[aria-expanded="true"] [data-chevron] {
    transform: rotate(180deg);
}

/* ===== SECTION LABEL ===== */
.section-counter {
    display: inline-flex;
    align-items: baseline;
    gap: 0.75rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #e11d48;
    font-weight: 600;
}
.section-counter .num {
    color: #94a3b8;
    font-size: 10px;
}
.section-counter .line {
    display: inline-block;
    width: 32px;
    height: 1px;
    background: #e11d48;
    margin: 0 0.25rem;
    transform: scaleX(0);
    transform-origin: left;
    animation: line-draw 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-play-state: paused;
}
.is-visible .section-counter .line { animation-play-state: running; }
@keyframes line-draw { to { transform: scaleX(1); } }

/* ===== SECTION COUNTER MODIFIERS ===== */
.section-counter--rose { color: #fb7185; }
.section-counter--rose .num { color: #64748b; }
.section-counter--rose .line { background: #fb7185; }

/* ===== HERO TEAM PHOTO (object-fit fine-tune) ===== */
.hero-team-photo { object-position: 45% center; }

/* ===== HEADER ===== */
.header-scrolled {
    box-shadow: 0 4px 24px -8px rgba(15, 23, 42, 0.08);
}

/* ===== FOOTER ===== */
.footer-brand-xl {
    font-family: 'Find Sans Pro', sans-serif;
    font-size: clamp(80px, 14vw, 200px);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 0.9;
    background: linear-gradient(180deg, rgba(225,29,72,0.25) 0%, rgba(225,29,72,0.02) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    pointer-events: none;
    user-select: none;
}

/* ===== PARALLAX ===== */
.parallax-y {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* ===== RESPECT REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    [data-reveal], [data-stagger] > *, .split-word {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ===== MOBILE MENU ANIMATION ===== */
#mobile-menu:not(.hidden) {
    animation: menu-slide 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes menu-slide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.mobile-link {
    animation: link-fade 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
#mobile-menu:not(.hidden) .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu:not(.hidden) .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu:not(.hidden) .mobile-link:nth-child(3) { animation-delay: 0.15s; }
@keyframes link-fade {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== CONTACT CARD ===== */
.contact-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.4s, border-color 0.3s, box-shadow 0.4s;
}
.contact-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e11d48, transparent);
    transform: translateX(-100%);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.contact-card:hover::before { transform: translateX(100%); }
.contact-card:hover {
    transform: translateY(-4px);
    border-color: rgba(225, 29, 72, 0.4);
    box-shadow: 0 20px 40px -20px rgba(225, 29, 72, 0.3);
}

/* ===== ABOUT TILE ===== */
.about-tile {
    position: relative;
    overflow: hidden;
    padding: 18px;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s;
}
.about-tile .tile-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    margin-bottom: 7px;
}
.about-tile .tile-text {
    font-size: 13px;
    line-height: 1.55;
}

/* ===== HERO ACHIEVEMENT BADGE (на фото команды) ===== */
.achievement-badge .material-symbols-outlined { font-size: 9px; }
.achievement-badge .achievement-text { font-size: 8px; }
.about-tile:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(225, 29, 72, 0.3);
}
.about-tile::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    height: 3px;
    background: #e11d48;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.about-tile:hover::after { transform: scaleX(1); }

/* Resident badge logo — responsive size */
.resident-badge { width: auto !important; max-width: max-content; align-self: center; }
@media (min-width: 768px) { .resident-badge { align-self: flex-start; } }
.resident-badge img.resident-logo-img { height: 81px; width: auto !important; max-width: none; display: block; }
@media (min-width: 640px) { .resident-badge img.resident-logo-img { height: 95px; } }
@media (min-width: 768px) { .resident-badge img.resident-logo-img { height: 108px; } }
