:root {
    --bg: #fcfcfb;
    --bg-soft: #f5f2f4;
    --text: #1f1f1f;
    --muted: #5a5a5a;
    --rose: #d46c8a;
    --rose-deep: #b84f70;
    --green: #3b6b4c;
    --line: #e4e0e2;
    --shadow: 0 16px 44px rgba(31, 31, 31, 0.08);
}

html[data-theme="dark"] {
    --bg: #121315;
    --bg-soft: #1c1f22;
    --text: #f0f1f2;
    --muted: #b5b7ba;
    --rose: #eb8dad;
    --rose-deep: #f3a7c0;
    --green: #84c99f;
    --line: #2f3438;
    --shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Manrope", sans-serif;
    background: radial-gradient(circle at top, color-mix(in srgb, var(--rose) 10%, transparent), transparent 60%), var(--bg);
    color: var(--text);
    line-height: 1.6;
}

h1,
h2,
h3 {
    font-family: "Playfair Display", serif;
    margin: 0 0 0.75rem;
    line-height: 1.2;
}

p {
    margin: 0 0 1rem;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    left: 10px;
    top: 10px;
    z-index: 999;
    background: #fff;
    padding: 8px 12px;
}

#preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: rgba(252, 252, 251, 0.96);
    transition: opacity 0.4s ease, visibility 0.4s ease;
    animation: preloaderFailsafe 4s ease forwards;
}

html[data-theme="dark"] #preloader {
    background: rgba(18, 19, 21, 0.96);
}

#preloader.hide {
    opacity: 0;
    visibility: hidden;
    animation: none;
}

.preloader-inner {
    text-align: center;
    display: grid;
    gap: 12px;
    color: var(--rose-deep);
    font-weight: 700;
}

.preloader-inner img {
    animation: pulse 1s ease-in-out infinite;
    justify-self: center;
    object-fit: contain;
    width: 120px;
    height: 120px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes preloaderFailsafe {
    0%, 85% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; }
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 500;
    backdrop-filter: blur(10px);
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    border-bottom: 1px solid var(--line);
}

.header-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.85rem 1.1rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.brand img {
    object-fit: contain;
    width: 64px;
    height: 64px;
}

.site-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.site-nav a {
    font-size: 0.95rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
}

.site-nav a:hover {
    background: color-mix(in srgb, var(--rose) 16%, transparent);
}

.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.theme-toggle,
.lang-picker-btn,
.menu-toggle {
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    border-radius: 999px;
    cursor: pointer;
}

.theme-toggle {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
}

.theme-toggle .moon {
    display: none;
}

html[data-theme="dark"] .theme-toggle .sun {
    display: none;
}

html[data-theme="dark"] .theme-toggle .moon {
    display: inline;
}

.lang-picker {
    position: relative;
}

.lang-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    min-height: 44px;
}

.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    padding: 0.4rem;
    background: var(--bg);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 14px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: 0.24s ease;
}

.lang-picker.open .lang-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.lang-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    font-size: 0.92rem;
}

.lang-menu a.active,
.lang-menu a:hover {
    background: color-mix(in srgb, var(--rose) 18%, transparent);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 4px 0;
    background: currentColor;
}

.hero {
    min-height: calc(100svh - 74px);
    position: relative;
    overflow: clip;
    display: grid;
    isolation: isolate;
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    transform: scale(1.02);
    filter: saturate(1.05);
    z-index: 0;
}

.hero-video-shell {
    position: absolute;
    right: clamp(0.8rem, 3vw, 2.2rem);
    bottom: clamp(0.9rem, 3vw, 2.2rem);
    width: clamp(220px, 30vw, 420px);
    aspect-ratio: 1 / 1;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.35);
    background: rgba(8, 10, 12, 0.6);
    backdrop-filter: blur(2px);
    z-index: 2;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(12, 14, 16, 0.74) 0%, rgba(12, 14, 16, 0.25) 60%, rgba(12, 14, 16, 0.15) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    width: 100%;
    margin: auto;
    padding: 2rem 1.1rem 3rem;
    color: #fff;
    animation: riseIn 0.8s ease both;
}

.eyebrow {
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.82rem;
    color: #ffe8f0;
}

.hero-content h1 {
    max-width: 15ch;
    font-size: clamp(2rem, 6vw, 4.2rem);
    margin-bottom: 1rem;
}

.hero-content p {
    max-width: 52ch;
    color: #f4f1f3;
}

.hero-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.2rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 999px;
    font-weight: 700;
    padding: 0.7rem 1rem;
}

.btn-primary {
    background: var(--rose);
    color: #fff;
}

.btn-primary:hover {
    background: var(--rose-deep);
}

.btn-outline {
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #fff;
}

.section,
.inner-hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3.4rem 1.1rem;
}

.inner-hero {
    padding-bottom: 1rem;
}

.section-head {
    max-width: 70ch;
    margin-bottom: 1.25rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.product-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--bg-soft);
    padding: 1rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.product-card img {
    border-radius: 12px;
    margin-bottom: 0.75rem;
}

.product-card h3,
.product-card h2 {
    font-size: 1.18rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.gallery-grid figure {
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-soft);
}

.gallery-grid figcaption {
    padding: 0.7rem;
    font-size: 0.9rem;
}

.section-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.text-link {
    color: var(--green);
    font-weight: 700;
}

.prose ul {
    margin: 0;
    padding-left: 1.1rem;
}

[dir="rtl"] .prose ul {
    padding-right: 1.1rem;
    padding-left: 0;
}

.contact-wrap {
    display: grid;
    grid-template-columns: minmax(230px, 1fr) 2fr;
    gap: 1rem;
}

.contact-wrap.single-column {
    grid-template-columns: 1fr;
    max-width: 760px;
}

.contact-card,
.contact-form {
    border: 1px solid var(--line);
    background: var(--bg-soft);
    border-radius: 16px;
    padding: 1rem;
}

.contact-form {
    display: grid;
    gap: 0.75rem;
}

.contact-form label {
    display: grid;
    gap: 0.34rem;
    font-size: 0.92rem;
}

.contact-form input,
.contact-form textarea {
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    border-radius: 10px;
    padding: 0.68rem;
}

.contact-card a {
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.form-status.success {
    color: #1e8f4e;
}

.form-status.error {
    color: #b2324b;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.blog-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--bg-soft);
    padding: 1rem;
}

.date {
    font-size: 0.83rem;
    color: var(--muted);
}

.blog-post {
    max-width: 800px;
}

.site-footer {
    border-top: 1px solid var(--line);
    margin-top: 2rem;
    padding: 2rem 1.1rem 1rem;
}

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

.footer-grid a {
    display: block;
    margin-bottom: 0.38rem;
    color: var(--muted);
}

.footer-credit {
    text-align: center;
    margin-top: 1.1rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.footer-developer {
    text-align: center;
    margin-top: 1.1rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.footer-developer p {
    margin: 0;
}

.developer-link {
    position: relative;
    display: inline-block;
    font-weight: 600;
    color: var(--primary-color, #FFD700);
    text-decoration: none;
    transition: all 0.3s ease;
}

.developer-link:hover {
    color: var(--accent-color, #FF6B00);
    transform: translateY(-2px);
}

@keyframes popupBurst {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(0.95) rotate(-2deg);
    }
    75% {
        transform: scale(1.1) rotate(2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes glowPulse {
    0%, 100% {
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.5),
                     0 0 10px rgba(255, 215, 0, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8),
                     0 0 30px rgba(255, 215, 0, 0.5),
                     0 0 40px rgba(255, 215, 0, 0.3);
    }
}

.developer-link.popup-animation {
    animation: popupBurst 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55),
               glowPulse 0.6s ease-in-out;
}

.developer-link.hover-pulse {
    animation: glowPulse 1s ease-in-out infinite;
}

.developer-link::before,
.developer-link::after {
    content: '✨';
    position: absolute;
    opacity: 0;
    font-size: 14px;
    transition: all 0.3s ease;
}

.developer-link::before {
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
}

.developer-link::after {
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
}

.developer-link.popup-animation::before,
.developer-link.popup-animation::after {
    animation: sparkle 0.6s ease-out;
}

@keyframes sparkle {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
}

.developer-link:hover::before,
.developer-link:hover::after {
    opacity: 1;
}

#scrollTop {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 999px;
    background: var(--green);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

#scrollTop.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

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

@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .menu-toggle {
        display: inline-block;
    }

    .site-nav {
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        padding: 0.85rem 1.1rem 1rem;
    }

    .site-nav.open {
        display: flex;
    }

    .header-wrap {
        grid-template-columns: auto auto auto;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-grid,
    .section-split,
    .contact-wrap,
    .blog-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero-video-shell {
        width: min(45vw, 250px);
        border-radius: 16px;
        right: 0.9rem;
        bottom: 0.9rem;
    }

    .hero-content {
        padding-bottom: 8rem;
    }
}

@media (max-width: 560px) {
    .brand img {
        width: 54px;
        height: 54px;
    }

    .preloader-inner img {
        width: 96px;
        height: 96px;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-content {
        padding-top: 1.25rem;
        padding-bottom: 6.2rem;
    }

    .hero-video-shell {
        width: min(42vw, 180px);
        border-radius: 14px;
    }
}
