* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --font-primary: 'Inter', sans-serif;
    --font-secondary: 'Playfair Display', serif;
    --cursor-size: 20px;
    --cursor-hover-size: 80px;
    --color-bg: #ffffff;
    --color-text: #000000;
    --color-inverse: #ffffff;
    --hero-stroke: #000000;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--color-bg);
    color: var(--color-text);
    overflow-x: hidden;
    cursor: none;
    -webkit-font-smoothing: antialiased;
}

/* Dark Theme */
.dark-theme {
    --color-bg: #0d0d0f;
    --color-text: #f3f4f6;
    --color-inverse: #111111;
    --hero-stroke: #f3f4f6;
}

.dark-theme body {
    background: var(--color-bg);
    color: var(--color-text);
}

.dark-theme .bg-white,
.dark-theme .bg-neutral-50 {
    background-color: #17171a !important;
}

.dark-theme .text-black {
    color: #f3f4f6 !important;
}

.dark-theme .text-gray-700,
.dark-theme .opacity-60,
.dark-theme .opacity-40 {
    color: rgba(243, 244, 246, 0.78) !important;
}

.dark-theme .border-black,
.dark-theme .border-black\/10,
.dark-theme .border-black\/20 {
    border-color: rgba(255, 255, 255, 0.28) !important;
}

.dark-theme .btn-outline {
    background: transparent;
    color: #f3f4f6;
    border-color: rgba(255, 255, 255, 0.6);
}

.dark-theme .btn-outline:hover {
    background: #f3f4f6;
    color: #101013;
    border-color: #f3f4f6;
}

.dark-theme .btn-primary,
.dark-theme .pricing-btn {
    background: #f3f4f6;
    color: #101013;
    border-color: #f3f4f6;
}

.dark-theme .btn-primary::before,
.dark-theme .pricing-btn::before {
    background: #101013;
}

.dark-theme .btn-primary:hover span,
.dark-theme .pricing-btn:hover span {
    color: #f3f4f6;
}

.dark-theme .btn-primary:hover,
.dark-theme .pricing-btn:hover {
    color: #f3f4f6;
}

.dark-theme input,
.dark-theme textarea {
    background: #101013;
    color: #f3f4f6;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.dark-theme input::placeholder,
.dark-theme textarea::placeholder {
    color: rgba(243, 244, 246, 0.58);
}

/* Dark mode: hero flip-card colors */
.dark-theme .hero-cards .invite-card .invite-front {
    background: #17171a;
    color: #f3f4f6;
}

.dark-theme .hero-cards .invite-card .invite-back {
    background: #0f0f12;
    color: #f3f4f6;
}

.dark-theme .hero-cards .invite-card .invite-front .border-black {
    border-color: rgba(255, 255, 255, 0.45) !important;
}

.dark-theme .hero-cards .invite-card .invite-front .opacity-60 {
    color: rgba(243, 244, 246, 0.75) !important;
}

.dark-theme .hero-cards .invite-card .invite-front .qr-scan {
    background: #1f1f23 !important;
}

.dark-theme .hero-cards .invite-card .invite-front .qr-scan .border-dashed {
    border-color: rgba(255, 255, 255, 0.55) !important;
}

.font-serif {
    font-family: var(--font-secondary);
}

/* Custom Cursor */
.cursor-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    transition: width 0.3s, height 0.3s;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid #fff;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    transition: width 0.3s, height 0.3s, border-width 0.3s;
}

.cursor-outline.hover {
    width: var(--cursor-hover-size);
    height: var(--cursor-hover-size);
    border-width: 2px;
    background: rgba(255,255,255,0.1);
}

.cursor-dot.hover {
    width: 12px;
    height: 12px;
}

/* Grain Texture */
.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9990;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Navigation - Absolute positioning */
.nav-absolute {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    padding: 1.5rem;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
}

/* Fluid navbar typography only between 1090px and 1024px */
@media (max-width: 1090px) and (min-width: 1024px) {
    .nav-container .text-xl,
    .nav-container .lg\:text-2xl {
        font-size: clamp(1.32rem, 1.15rem + 0.22vw, 1.4rem) !important;
    }

    .nav-container .text-sm {
        font-size: clamp(0.8rem, 0.72rem + 0.12vw, 0.85rem) !important;
    }

    .nav-actions .btn-primary {
        font-size: clamp(0.78rem, 0.72rem + 0.1vw, 0.82rem);
        padding: clamp(0.78rem, 0.7rem + 0.1vw, 0.84rem) clamp(1.25rem, 1.1rem + 0.2vw, 1.35rem);
    }

    .lang-switcher__item,
    .lang-switcher-select {
        font-size: clamp(0.76rem, 0.7rem + 0.1vw, 0.8rem);
    }
}

.theme-toggle {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.25s ease;
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.lang-switcher__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1;
    transition: all 0.25s ease;
}

.lang-switcher__item:hover {
    background: rgba(255, 255, 255, 0.18);
}

.lang-switcher__item--active {
    background: #fff;
    color: #000;
}

.lang-switcher-select {
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 0.5rem 2.1rem 0.5rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='white' d='M1.1 0.6 5 4.5 8.9 0.6 10 1.7 5 6 0 1.7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 0.62rem 0.38rem;
}

.lang-switcher-select option {
    color: #000;
}

@media (max-width: 1220px) {
    .lang-switcher {
        padding: 0;
        border: 0;
        background: transparent;
    }

    .lang-switcher__item {
        display: none;
    }

    .lang-switcher-select {
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 415px) {
    .lang-switcher-select {
        font-size: 0.68rem;
        padding: 0.42rem 1.75rem 0.42rem 0.68rem;
        background-position: right 0.65rem center;
        background-size: 0.52rem 0.32rem;
    }

    .theme-toggle {
        height: 2rem;
        width: 2rem;
    }

    .theme-toggle i {
        font-size: 0.75rem;
    }
}

@media (max-width: 355px) {
    .brand-title {
        display: none;
    }
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: #fff;
}

.theme-toggle i {
    position: absolute;
    font-size: 1.15rem;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-toggle .theme-icon-moon {
    opacity: 0;
    transform: scale(0.6);
}

.dark-theme .theme-toggle .theme-icon-sun {
    opacity: 0;
    transform: scale(0.6);
}

.dark-theme .theme-toggle .theme-icon-moon {
    opacity: 1;
    transform: scale(1);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #000;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu a {
    color: #fff;
    font-size: 2rem;
    font-family: var(--font-secondary);
    font-style: italic;
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.mobile-menu.active a {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu.active a:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active a:nth-child(2) { transition-delay: 0.2s; }
.mobile-menu.active a:nth-child(3) { transition-delay: 0.3s; }
.mobile-menu.active a:nth-child(4) { transition-delay: 0.4s; }

.menu-toggle {
    width: 30px;
    height: 20px;
    position: relative;
    cursor: pointer;
    z-index: 101;
}

.menu-toggle span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: #fff;
    transition: all 0.3s ease;
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.menu-toggle span:nth-child(3) { bottom: 0; }

.menu-toggle.active span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* Hero Typography */
.hero-grid .hero-content {
    min-width: 0;
}

.hero-title {
    font-size: clamp(2.3rem, 7vw, 8rem);
    line-height: 0.9;
    letter-spacing: -0.03em;
    width: 100%;
}

.hero-title__line {
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.hero-title__line--stroke-wrap {
    -webkit-text-stroke: 1.5px var(--hero-stroke);
    font-size: clamp(2rem, 8vw, 6rem);
}

.hero-title__line--stroke {
    padding-bottom: 15px;
}

/* Uzbek hero lines are longer — slightly smaller than RU/EN, but still large */
html[lang="uz"] .hero-title {
    font-size: clamp(2rem, 6.5vw, 7rem);
    letter-spacing: -0.035em;
    line-height: 0.9;
}

html[lang="uz"] .hero-title .hero-title__line--stroke-wrap {
    font-size: clamp(1.85rem, 7.5vw, 5.5rem);
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 2rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* Hero Section Mobile */
@media (max-width: 768px) {
    .hero-section {
        min-height: auto;
        padding-top: 100px;
        padding-bottom: 60px;
    }

    .hero-grid {
        display: flex;
        flex-direction: column;
        gap: 3rem;
    }

    .hero-cards {
        position: relative;
        height: 360px !important;
        width: 100%;
        order: -1;
    }

    .hero-cards .invite-card {
        position: absolute !important;
        width: 180px !important;
        height: 240px !important;
    }

    /* Верхние две карточки сгруппированы по центру — без разъезда к краям */
    .hero-cards .invite-card:nth-child(1) {
        left: 50% !important;
        top: 8px !important;
        transform: translateX(calc(-100% - 10px)) rotate(-8deg) !important;
    }

    .hero-cards .invite-card:nth-child(2) {
        left: 50% !important;
        right: auto !important;
        top: 8px !important;
        transform: translateX(10px) rotate(6deg) !important;
    }

    .hero-cards .invite-card.hero-card-photo {
        left: 50% !important;
        bottom: auto !important;
        top: 152px !important;
        transform: translateX(-50%) rotate(-3deg) !important;
        width: 160px !important;
        height: 200px !important;
    }

    .hero-content {
        text-align: center;
        padding: 0 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0 2rem;
    }

    .hero-buttons button {
        width: 100%;
    }
}

/* Hero Section Tablet (between md and lg) */
@media (min-width: 769px) and (max-width: 1023px) {
    .hero-section {
        padding-top: 110px;
        padding-bottom: 70px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3.5rem;
    }

    .hero-content {
        text-align: center;
        max-width: 760px;
        margin: 0 auto;
    }

    .hero-content p {
        max-width: 620px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        justify-content: center !important;
        padding: 0;
    }

    .hero-cards {
        height: 440px !important;
        max-width: 760px;
        margin: 0 auto;
    }

    .hero-cards .invite-card:nth-child(1) {
        left: 50% !important;
        top: 28px !important;
        transform: translateX(calc(-100% - 14px)) rotate(-6deg) !important;
    }

    .hero-cards .invite-card:nth-child(2) {
        left: 50% !important;
        right: auto !important;
        top: 28px !important;
        transform: translateX(14px) rotate(6deg) !important;
    }

    .hero-cards .invite-card.hero-card-photo {
        left: 50% !important;
        bottom: 16px !important;
        top: auto !important;
        transform: translateX(-50%) rotate(-3deg) !important;
    }
}

/* Hero Section Small Phones */
@media (max-width: 640px) {
    .hero-section {
        padding-top: 86px !important;
        padding-bottom: 44px !important;
    }

    .hero-content {
        padding: 0 0.5rem;
    }

    .hero-title {
        font-size: clamp(1.9rem, 9vw, 3rem);
        line-height: 0.95;
        letter-spacing: -0.02em;
    }

    html[lang="uz"] .hero-title {
        font-size: clamp(1.8rem, 8.8vw, 3rem);
    }

    html[lang="uz"] .hero-title .hero-title__line--stroke-wrap {
        font-size: clamp(1.7rem, 8.2vw, 2.85rem);
    }

    .hero-subtitle {
        font-size: 0.75rem;
        letter-spacing: 0.14em;
    }

    .hero-content p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .hero-cards {
        height: 360px !important;
    }

    .hero-cards .invite-card {
        width: 150px !important;
        height: 205px !important;
    }

    .hero-cards .invite-card:nth-child(1) {
        left: 50% !important;
        top: 4px !important;
        transform: translateX(calc(-100% - 8px)) rotate(-8deg) !important;
    }

    .hero-cards .invite-card:nth-child(2) {
        left: 50% !important;
        right: auto !important;
        top: 4px !important;
        transform: translateX(8px) rotate(6deg) !important;
    }

    .hero-cards .invite-card.hero-card-photo {
        width: 136px !important;
        height: 176px !important;
        top: 176px !important;
        bottom: auto !important;
    }

    .hero-buttons {
        padding: 0;
        gap: 0.75rem;
    }

    .hero-buttons .btn-primary,
    .hero-buttons .btn-outline {
        min-height: 44px;
        font-size: 0.8rem;
        padding: 0.85rem 1rem;
    }
}

@media (max-width: 420px) {
    .hero-cards {
        height: 360px !important;
    }

    .hero-cards .invite-card {
        width: 136px !important;
        height: 190px !important;
    }

    .hero-cards .invite-card:nth-child(1) {
        transform: translateX(calc(-100% - 6px)) rotate(-8deg) !important;
    }

    .hero-cards .invite-card:nth-child(2) {
        transform: translateX(6px) rotate(6deg) !important;
    }

    .hero-cards .invite-card.hero-card-photo {
        width: 124px !important;
        height: 162px !important;
        top: 190px !important;
    }
}

/* Floating Animation */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

@keyframes float-reverse {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(15px) rotate(-2deg); }
}

.float-card {
    animation: float 6s ease-in-out infinite;
}

.float-card-reverse {
    animation: float-reverse 7s ease-in-out infinite;
}

/* Invitation Card */
.invite-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
    cursor: pointer;
}

.invite-card:hover:not(.hero-card-photo) {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: 0 40px 80px rgba(0,0,0,0.15);
}

.invite-card.hero-card-photo:hover {
    box-shadow: 0 40px 80px rgba(0,0,0,0.15);
}

@media (max-width: 768px) {
    .invite-card:hover:not(.hero-card-photo) {
        transform: scale(1.05);
    }

    .hero-cards .invite-card.hero-card-photo:hover {
        transform: translateX(-50%) rotate(-3deg) scale(1.03) !important;
    }
}

.invite-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.invite-card.flipped .invite-card-inner {
    transform: rotateY(180deg);
}

/* Hero wedding card: интерактив (3D flip + a11y) */
.hero-invite-card {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
}

.hero-invite-card:focus {
    outline: none;
}

.hero-invite-card:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

.hero-invite-card:active:not(.flipped) {
    filter: brightness(0.94);
}

/* Touch devices: keep wedding card stable on tap */
@media (hover: none) and (pointer: coarse) {
    .hero-invite-card.float-card {
        animation: none;
    }

    .hero-invite-card:hover:not(.hero-card-photo) {
        transform: none;
    }
}

.hero-invite-hint {
    animation: hero-invite-hint-pulse 2.4s ease-in-out infinite;
}

.invite-card.flipped .hero-invite-hint {
    animation: none;
}

@keyframes hero-invite-hint-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.hero-invite-card__icon {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-invite-card:hover .hero-invite-card__icon {
    transform: scale(1.08);
}

@media (max-width: 768px) {
    .hero-invite-card:hover .hero-invite-card__icon {
        transform: scale(1.06);
    }
}

.invite-front, .invite-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.invite-back {
    transform: rotateY(180deg);
    background: #000;
    color: #fff;
}

/* Marquee */
.marquee {
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    animation: marquee 25s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@media (max-width: 768px) {
    .marquee-content {
        font-size: 1.25rem !important;
    }
}

/* Phone Mockup */
.phone-mockup {
    border: 10px solid #000;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    background: #fff;
    box-shadow: 0 30px 60px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .phone-mockup {
        border-width: 8px;
        border-radius: 20px;
        transform: scale(0.9);
    }
}

.phone-screen {
    width: 280px;
    height: 560px;
    background: linear-gradient(135deg, #f5f5f5 0%, #fff 100%);
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .phone-screen {
        width: 260px;
        height: 520px;
    }
}

.invite-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
}

.invite-slide.active {
    opacity: 1;
}

/* Typewriter */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #000;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #000 }
}

@keyframes scroll {
    0% {
        transform: translateY(0);
        opacity: 0.45;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(100%);
        opacity: 0.45;
    }
}

/* Buttons */
.magnetic-wrap {
    display: inline-block;
    position: relative;
}

.btn-primary, .pricing-btn {
    padding: 1rem 2rem;
    background: #000;
    color: #fff;
    font-weight: 500;
    letter-spacing: 0.05em;
    border: 2px solid #000;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 0.9rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .btn-primary {
        padding: 1rem 1.5rem;
        font-size: 0.85rem;
        width: 100%;
    }
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #fff;
    transition: left 0.3s ease;
    z-index: 0;
}

.btn-primary:hover::before {
    left: 0;
}

.btn-primary span {
    position: relative;
    z-index: 1;
    transition: color 0.3s;
}

.btn-primary:hover span {
    color: #000;
}

.btn-outline {
    padding: 1rem 2rem;
    background: transparent;
    color: #000;
    font-weight: 500;
    letter-spacing: 0.05em;
    border: 2px solid #000;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .btn-outline {
        padding: 1rem 1.5rem;
        font-size: 0.85rem;
        width: 100%;
    }
}

.btn-outline:hover {
    background: #000;
    color: #fff;
}

/* Templates Grid Mobile */
@media (max-width: 768px) {
    .templates-grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    /* Портрет (H > W), чуть ниже чем 9/16 */
    .template-card {
        aspect-ratio: 2 / 3 !important;
    }

    .template-card img {
        filter: grayscale(0%) !important;
    }

    .template-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .template-info-bar {
        background: #000;
        padding: 1rem 1.5rem;
    }

    .template-info {
        opacity: 1 !important;
        transform: translateY(0) !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* Process Steps Mobile */
@media (max-width: 768px) {
    .process-container {
        padding-left: 2rem;
    }

    .process-line {
        left: 0 !important;
    }

    .process-step {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    .process-step > div:first-child {
        text-align: left !important;
        padding-right: 0 !important;
        width: 100%;
    }

    .process-dot {
        position: absolute;
        left: -1.5rem;
        top: 0;
    }

    .process-step h3 {
        font-size: 1.75rem !important;
    }
}

/* Features Grid Mobile */
@media (max-width: 768px) {
    .features-grid {
        display: flex;
        flex-direction: column;
        gap: 1px;
    }

    .feature-card {
        padding: 2rem !important;
    }
}

/* Stats Mobile */
@media (max-width: 768px) {
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem 1rem;
    }

    .stat-number {
        font-size: 2.5rem !important;
    }
}

/* Template Card */
.template-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.template-card img {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    filter: grayscale(100%);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-card:hover img {
    transform: scale(1.1);
    filter: grayscale(0%);
}

.template-info-bar {
    width: 100%;
    background: rgba(0,0,0,0.3);
    padding: 1.25rem 1.5rem;
}

.template-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background 0.3s;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.template-card:hover .template-overlay {
    background: rgba(0,0,0,0.3);
}

.template-info {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    color: #fff;
}

.template-card:hover .template-info {
    opacity: 1;
    transform: translateY(0);
}

/* Process Steps */
.process-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #fff, transparent);
    transform: translateX(-50%);
}

.process-dot {
    width: 16px;
    height: 16px;
    background: #000;
    border: 2px solid #fff;
    border-radius: 50%;
    position: relative;
    z-index: 10;
    transition: all 0.3s;
    flex-shrink: 0;
}

.process-step:hover .process-dot {
    background: #fff;
    transform: scale(1.3);
}

/* Home Steps Timeline */
.home-steps-container {
    position: relative;
}

.home-steps-line {
    position: absolute;
    left: 2rem;
    top: 13rem;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.3);
}

@media (min-width: 768px) {
    .home-steps-line {
        left: 50%;
        top: 11.5rem;
        transform: translateX(-50%);
    }
}

.home-step-item {
    position: relative;
    margin-bottom: 4rem;
}

@media (min-width: 768px) {
    .home-step-item {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
        align-items: center;
        margin-bottom: 5rem;
    }

    .home-step-item:nth-child(even) .home-step-content {
        order: 2;
        text-align: left;
    }

    .home-step-item:nth-child(even) .home-step-visual {
        order: 1;
    }

    .home-step-item:nth-child(odd) .home-step-content {
        text-align: right;
    }
}

.home-step-dot {
    position: absolute;
    left: 2rem;
    top: 0.2rem;
    width: 16px;
    height: 16px;
    background: #fff;
    border: 2px solid #000;
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 10;
    transition: all 0.3s;
}

@media (min-width: 768px) {
    .home-step-dot {
        left: 50%;
    }
}

.home-step-item:hover .home-step-dot {
    transform: translateX(-50%) scale(1.25);
}

.home-step-content {
    padding-left: 4rem;
}

@media (min-width: 768px) {
    .home-step-content {
        padding-left: 0;
    }

    .home-step-item:nth-child(odd) .home-step-content {
        padding-right: 2rem;
    }

    .home-step-item:nth-child(even) .home-step-content {
        padding-left: 2rem;
    }
}

.home-step-number {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px #fff;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.home-step-item:hover .home-step-number {
    color: #fff;
}

.home-step-title {
    font-size: 1.75rem;
    font-family: var(--font-secondary);
    font-style: italic;
    margin-bottom: 1rem;
}

.home-step-desc {
    opacity: 0.75;
    line-height: 1.6;
}

.home-step-visual {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 1rem;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 170px;
}

@media (max-width: 767px) {
    .home-step-number {
        font-size: 3rem;
    }

    .home-step-title {
        font-size: 1.4rem;
    }

    .home-step-visual {
        margin-left: 4rem;
        margin-top: 1rem;
    }
}

/* FAQ */
.faq-item {
    border-bottom: 1px solid #e5e5e5;
}

.faq-question {
    padding: 1.5rem 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    transition: opacity 0.3s;
}

.faq-question:hover {
    opacity: 0.7;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-answer.active {
    max-height: 300px;
    padding-bottom: 1.5rem;
}

.faq-icon {
    transition: transform 0.3s;
    flex-shrink: 0;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

/* QR Scan */
.qr-scan {
    position: relative;
    overflow: hidden;
}

.qr-scan::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.2), transparent);
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% { top: -40%; }
    100% { top: 100%; }
}

/* Mobile Cursor Disable */
@media (pointer: coarse) {
    body { cursor: auto; }
    .cursor-dot, .cursor-outline { display: none; }
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Stats */
.stat-number {
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 700;
    line-height: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #fff;
}

::-webkit-scrollbar-thumb {
    background: #000;
}

/* Section Spacing Mobile */
@media (max-width: 768px) {
    section {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    .section-title {
        font-size: 2.5rem !important;
        margin-bottom: 2rem !important;
    }
}

/* CTA Section Tablet / Small Laptop */
@media (min-width: 769px) and (max-width: 1290px) {
    #order .max-w-7xl > div {
        gap: 2.25rem !important;
        align-items: stretch !important;
    }

    #order .max-w-7xl > div > div:first-child {
        flex: 1 1 0% !important;
        max-width: 430px !important;
    }

    #order .max-w-7xl > div > div:last-child {
        flex: 1.1 1 0% !important;
        min-width: 0;
    }

    #order .section-title {
        font-size: clamp(2.4rem, 5vw, 3.8rem) !important;
        line-height: 1.06;
    }

    #order .cta-buttons {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    #order .cta-buttons > * {
        width: 100%;
    }

    #order .cta-buttons button {
        width: 100%;
        justify-content: center;
    }

    #order form {
        max-width: 100%;
        padding: 1.25rem !important;
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    #order .max-w-7xl > div {
        flex-direction: column !important;
        align-items: center !important;
    }

    #order .max-w-7xl > div > div:first-child,
    #order .max-w-7xl > div > div:last-child {
        width: 100%;
        max-width: 760px !important;
    }

    #order .max-w-7xl > div > div:first-child {
        align-items: center !important;
    }

    #order .section-title,
    #order p {
        text-align: center !important;
    }
}

/* CTA Section Mobile */
@media (max-width: 767px) {
    #order {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    #order .section-title {
        font-size: clamp(2rem, 9vw, 2.8rem) !important;
        line-height: 1.05;
        margin-bottom: 1rem !important;
    }

    #order .max-w-7xl > div {
        gap: 2rem !important;
    }

    #order p {
        font-size: 0.95rem;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0;
        gap: 0.75rem;
    }

    .cta-buttons > * {
        width: 100%;
    }

    #order .cta-buttons button {
        width: 100%;
        min-height: 48px;
        padding: 0.85rem 1rem !important;
        font-size: 0.85rem !important;
        white-space: normal;
    }

    #order .cta-buttons button span {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    #order form {
        padding: 1rem !important;
        border-radius: 0.85rem;
    }

    #order input,
    #order textarea {
        font-size: 16px;
    }
}

@media (max-width: 420px) {
    #order .section-title {
        font-size: 1.9rem !important;
    }

    #order .btn-primary,
    #order .btn-outline {
        letter-spacing: 0.02em;
    }
}

/* CTA at 768px should match mobile view */
@media (min-width: 768px) and (max-width: 768px) {
    #order {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    #order .max-w-7xl > div {
        flex-direction: column !important;
        align-items: center !important;
        gap: 2rem !important;
    }

    #order .max-w-7xl > div > div:first-child,
    #order .max-w-7xl > div > div:last-child {
        width: 100%;
        max-width: 100% !important;
    }

    #order .max-w-7xl > div > div:first-child {
        align-items: center !important;
    }

    #order .section-title,
    #order p {
        text-align: center !important;
    }

    #order .max-w-7xl > div > div:first-child .section-title,
    #order .max-w-7xl > div > div:first-child > p {
        width: 100%;
        text-align: center !important;
    }

    #order .cta-buttons {
        flex-direction: column !important;
        width: 100%;
        gap: 0.75rem;
    }

    #order .cta-buttons > * {
        width: 100% !important;
    }

    #order .cta-buttons button {
        width: 100%;
        justify-content: center;
    }

    #order form {
        padding: 1rem !important;
        border-radius: 0.85rem;
    }
}

/* input с ошибкой */
input.border-red-400,
textarea.border-red-400 {
    border-color: #f87171 !important;
}

input.ring-red-400:focus,
textarea.ring-red-400:focus {
    --tw-ring-color: #f87171 !important;
}

/* Входит анимировано */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    60% {
        opacity: 1;
        transform: scale(1.05);
    }

    80% {
        transform: scale(0.98);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-bounce-in {
    animation: bounceIn 0.7s cubic-bezier(.45, 1.33, .64, 1) both;
}

/* Убираем выделение обводки на всплывашке при клике */
#success-modal:focus {
    outline: none;
}

#pricing .btn-primary {
    background: #000;
    color: #fff;
    border-color: #000;
}

#pricing .btn-primary::before {
    background: #fff;
}

#pricing .btn-primary:hover span {
    color: #000;
}

#pricing .btn-outline {
    background: #fff;
    color: #000;
    border-color: #000;
}

#pricing .btn-outline:hover {
    background: #000;
    color: #fff;
}

/* Pricing CTA button animation */
#pricing .pricing-cta {
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
    will-change: transform, box-shadow;
}

#pricing .pricing-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.28);
    background-color: rgba(255, 255, 255, 0.85);
    color: rgba(0, 0, 0, 0.95);
}

#pricing .pricing-cta:active {
    transform: translateY(0) scale(0.985);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

#pricing .pricing-cta:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.35);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    #pricing .pricing-cta {
        transition: none;
    }

    #pricing .pricing-cta:hover,
    #pricing .pricing-cta:active {
        transform: none;
        box-shadow: none;
    }
}

/* Dark mode: pricing section */
.dark-theme #pricing {
    background: #111317 !important;
}

.dark-theme #pricing .bg-neutral-100\/80 {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.dark-theme #pricing .bg-white\/40 {
    background: transparent !important;
}

.dark-theme #pricing .text-black,
.dark-theme #pricing .text-black\/45,
.dark-theme #pricing .text-black\/50,
.dark-theme #pricing .text-black\/35 {
    color: #f3f4f6 !important;
}

.dark-theme #pricing .border-black\/10 {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.dark-theme #pricing .pricing-cta {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #f3f4f6 !important;
    border-color: rgba(255, 255, 255, 0.32) !important;
}

.dark-theme #pricing .pricing-cta:hover {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.38) !important;
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #f3f4f6 !important;
}

.dark-theme #pricing .pricing-cta:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.45);
}

.dark-theme #pricing .btn-primary {
    background: #f3f4f6;
    color: #101013;
    border-color: #f3f4f6;
}

.dark-theme #pricing .btn-primary::before {
    background: #101013;
}

.dark-theme #pricing .btn-primary:hover span {
    color: #f3f4f6;
}

.dark-theme #pricing .btn-outline {
    background: transparent;
    color: #f3f4f6;
    border-color: rgba(255, 255, 255, 0.6);
}

.dark-theme #pricing .btn-outline:hover {
    background: #f3f4f6;
    color: #101013;
    border-color: #f3f4f6;
}

/* Страница просмотра приглашения (templates/invite/invite.html) */
.invite-page-shell {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: clip;
}

html.dark-theme .invite-page-shell {
    background: var(--color-bg) !important;
}

html.dark-theme .invite-view-footer {
    background: var(--color-bg) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

html.dark-theme .invite-view-footer .text-xl,
html.dark-theme .invite-view-footer .font-bold {
    color: #f3f4f6 !important;
}

html.dark-theme .invite-view-footer .opacity-60 a,
html.dark-theme .invite-view-footer .opacity-40 {
    color: rgba(243, 244, 246, 0.55) !important;
}

