/* ========================================
   ArtWeb - Mobile First Stylesheet
   ======================================== */

/* CSS Custom Properties (Variables)
   ======================================== */
:root {
    /* Colors */
    --color-primary: #3d5a4c;
    --color-primary-dark: #2d4a3c;
    --color-secondary: #23332D;
    --color-primary-light: #F5F5F5;
    --color-white: #ffffff;
    --color-overlay: rgba(45, 74, 60, 0.85);
    
    /* Services Section Colors */
    --color-dark: #0a0a0a;
    --color-card-bg: #111111;
    --color-accent: #00d9a5;
    
    /* Typography */
    --font-family: 'Raleway', sans-serif;
    
    /* Spacing */
    --container-padding: 20px;
    --header-height: 66px; /* Mobile header height */
    
    /* Transitions */
    --transition-default: 0.3s ease;
}

/* Reset & Base Styles
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-family);
    font-weight: 400;
    color: var(--color-white);
    background-color: var(--color-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

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

address {
    font-style: normal;
}

/* Typography Styles
   ======================================== */

/* H1 Mobile - 40px, 900, 100% line-height, 3% letter-spacing */
.h1-mob,
.hero__logo {
    font-family: var(--font-family);
    font-weight: 900;
    font-size: 40px;
    line-height: 100%;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: uppercase;
}

/* H2 Mobile - 16px, 700, 16px line-height, 3% letter-spacing */
.h2-mob,
.hero__subtitle {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 16px;
    line-height: 16px;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: uppercase;
}

/* H3 Bold - 18px, 700, 27px line-height, 3% letter-spacing */
.h3-bold {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 18px;
    line-height: 27px;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: uppercase;
}

.hero__tagline {
    font-family: var(--font-family);
    font-weight: 900;
    font-size: 40px;
    line-height: 100%;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: uppercase;
}

/* Layout
   ======================================== */
.container {
    width: 100%;
    max-width: min(390px, 100%);
    min-width: 0; /* allow shrinking in narrow viewports */
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.tag--ecommerce {
    margin: 0 20px;
}

/* Logo
   ======================================== */
.logo {
    font-family: var(--font-family);
    font-weight: 900;
    font-size: 20px;
    letter-spacing: 0.03em;
    display: inline-block;
}

.logo-accent {
    display: inline-block;
    transform: rotate(180deg);
}

/* Header
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 15px 0;
    background-color: color-mix(in srgb, var(--color-white) 80%, transparent);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Desktop Navigation (hidden on mobile/tablet)
   ======================================== */
.desktop-nav,
.desktop-nav__social {
    display: none;
}

/* Burger Menu Button
   ======================================== */
.burger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 110;
}

.burger-line {
    display: block;
    width: 100%;
    height: 2px;
    min-height: 2px;
    flex-shrink: 0;
    background-color: var(--color-secondary);
    border-radius: 2px;
    transition: var(--transition-default);
    transform-origin: center;
}

/* Burger menu animation - active state */
.burger-menu.is-active .burger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.burger-menu.is-active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-menu.is-active .burger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Navigation
   ======================================== */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-primary);
    z-index: 90;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-default), visibility var(--transition-default);
    padding-top: var(--header-height);
    padding-bottom: 40px;
    box-sizing: border-box;
}

.mobile-nav.is-open {
    opacity: 1;
    visibility: visible;
    background-color: var(--color-secondary);
}

.mobile-nav__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 48px;
    padding: 0 var(--container-padding);
    width: 100%;
    max-width: min(390px, 100%);
    flex: 1;
}

.mobile-nav__list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(32px, 8vh, 64px);
    margin-bottom: 0;
}

.mobile-nav__link {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 18px;
    line-height: 27px;
    letter-spacing: 0.03em;
    transition: opacity var(--transition-default);
}

.mobile-nav__link:hover,
.mobile-nav__link:focus {
    opacity: 0.8;
}

.mobile-nav__contact {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mobile-nav__email {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    letter-spacing: 0.01em;
    transition: opacity var(--transition-default);
}

.mobile-nav__email:hover,
.mobile-nav__email:focus {
    opacity: 0.8;
}

.mobile-nav__icon {
    width: 24px;
}

.mobile-nav__btn {
    width: 100%;
    max-width: 326px;
    min-width: 326px;
    padding: 25px 40px;
}

/* Button Styles
   ======================================== */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 18px;
    line-height: 27px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 25px 40px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: var(--transition-default);
}

.btn--primary {
    background-color: var(--color-primary-light);
    color: var(--color-secondary);
    border-radius: 100px;
    max-width: 326px;
}

.btn--primary:hover,
.btn--primary:focus {
    background-color: rgba(255, 255, 255, 0.9);
}

/* Hero Section
   ======================================== */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero__background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
}

.hero__video {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: color-mix(in srgb, var(--color-overlay) 35%, transparent);
    animation: overlayFadeIn 1.2s ease-out forwards;
}

@keyframes overlayFadeIn {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 1;
    }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .hero__logo,
    .hero__subtitle,
    .hero__tagline,
    .hero__btn {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .hero__overlay {
        animation: none;
    }
}

.hero__container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: calc(var(--header-height) + 20px);
    padding-bottom: 40px;
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
}

/* Ensure content doesn't overlap header on very short viewports */
@media (max-height: 600px) {
    .hero__container {
        justify-content: flex-start;
        padding-top: calc(var(--header-height) + 30px);
    }
    
    .hero__content {
        gap: 16px;
    }
    
    .hero__tagline {
        margin-bottom: 0;
    }
    
    .hero__btn {
        margin-top: 16px;
    }
}

.hero__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
    perspective: 1000px;
}

/* Hero Blinds Animation
   ======================================== */
@keyframes blindsReveal {
    0% {
        opacity: 0;
        transform: translateY(30px) rotateX(-90deg);
        filter: blur(4px);
    }
    60% {
        opacity: 1;
        filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
        filter: blur(0px);
    }
}

@keyframes blindsRevealBtn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    70% {
        opacity: 1;
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hero__logo,
.hero__subtitle,
.hero__tagline,
.hero__btn {
    opacity: 0;
    transform-origin: top center;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.hero__logo {
    margin-bottom: 8px;
    animation: blindsReveal 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.hero__subtitle {
    margin-bottom: 16px;
    animation: blindsReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

.hero__tagline {
    max-width: 330px;
    margin-bottom: 10px;
    animation: blindsReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

.hero__btn {
    margin-top: 24px;
    width: 100%;
    max-width: 326px;
    min-width: 326px;
    border-radius: 100px;
    animation: blindsRevealBtn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 1.3s forwards;
}

/* Body scroll lock when menu is open
   ======================================== */
body.menu-open {
    overflow: hidden;
}

/* Focus styles for accessibility
   ======================================== */
.burger-menu:focus-visible,
.btn:focus-visible,
a:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
}

/* Screen reader only utility
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   Services Section
   ======================================== */
.services {
    background-color: var(--color-white);
    padding: 64px 0 80px;
}

.services__container {
    padding: 8px 0;
}

.services__title {
    font-family: var(--font-family);
    font-weight: 900;
    font-size: 40px;
    line-height: 100%;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: uppercase;
    color: var(--color-secondary);
    margin-bottom: 40px;
}

.services__grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    padding: 0 8px;
}

.service-card {
    position: relative;
    max-width: 374px;
    width: 100%;
    min-width: 0; /* allow card to shrink on narrow viewports */
    margin: 0 auto;
    height: 670px;
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.service-card:hover {
    transform: translateY(-6px);
}

.service-card:active {
    transform: translateY(-3px);
}

.service-card__image {
    position: absolute;
    inset: 0;
}

.service-card__image picture {
    display: block;
    width: 100%;
    height: 100%;
}

.service-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover .service-card__image img {
    transform: scale(1.05);
}

.service-card__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    text-align: center;
    padding: 40px 12px 48px;
    z-index: 1;
}

.service-card__title {
    font-family: var(--font-family);
    font-weight: 900;
    font-size: 40px;
    line-height: 100%;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--color-white);
    margin-bottom: 16px;
}

.service-card__description {
    font-family: var(--font-family);
    font-weight: 400;
    font-size: 18px;
    line-height: 27px;
    letter-spacing: 0.01em;
    color: var(--color-white);
    margin-bottom: 20px;
    max-width: 330px;
}

/* Tags
   ======================================== */
.service-card__tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    border: 1px solid var(--color-white);
    border-radius: 100px;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 18px;
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--color-white);
    background: transparent;
    transition: var(--transition-default);
}

.tag:hover {
    background-color: var(--color-white);
    color: var(--color-dark);
}

/* Projects Section
   ======================================== */
.projects {
    background: url(../img/projects-bg-mob.jpg) no-repeat center center;
    background-size: cover;
    padding: 64px 0 80px;
}

/* Projects background: desktop, 2K, 4K */
@media (min-width: 1280px) {
    .projects {
        background-image: url(../img/projects-bg.jpg);
    }
}

@media (min-width: 1920px) {
    .projects {
        background-image: url(../img/projects-bg2.jpg);
    }
}

@media (min-width: 3840px) {
    .projects {
        background-image: url(../img/projects-bg4.jpg);
    }
}

.projects__container {
    padding: 8px 0;
}

.projects__title {
    font-family: var(--font-family);
    font-weight: 900;
    font-size: 40px;
    line-height: 100%;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: uppercase;
    color: var(--color-white);
    margin-bottom: 60px;
}

/* Projects Gallery Grid
   ======================================== */
.projects__gallery {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: auto repeat(8, 1fr) auto;
    gap: 8px;
    max-width: 374px;
    margin: 0 auto;
}

.gallery__item {
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: var(--color-card-bg);
    border: 1px solid white;
}

.gallery__item::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-bottom: 22px solid white;
}

.gallery__item:hover::after,
.gallery__item:focus-within::after {
    opacity: 1;
}

.gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery__item:hover img,
.gallery__item:focus-within img {
    transform: scale(1.05);
}

/* Mobile Grid Layout (8-column grid) */
/* Item 1: Top full width */
.gallery__item:nth-child(1) {
    grid-column: 1 / -1;
    grid-row: 1;
    aspect-ratio: 374 / 180;
}

/* Item 2: Large left (rows 2-5) */
.gallery__item:nth-child(2) {
    grid-column: 1 / 6;
    grid-row: 2 / 6;
}

/* Item 3: Small right top (rows 2-4) */
.gallery__item:nth-child(3) {
    grid-column: 6 / 9;
    grid-row: 2 / 5;
}

/* Item 4: Large left (rows 6-9) */
.gallery__item:nth-child(4) {
    grid-column: 1 / 6;
    grid-row: 6 / 10;
}

/* Item 5: Tall right (rows 5-9) */
.gallery__item:nth-child(5) {
    grid-column: 6 / 9;
    grid-row: 5 / 10;
}

/* Item 6: Bottom full width */
.gallery__item:nth-child(6) {
    grid-column: 1 / -1;
    grid-row: 10;
    aspect-ratio: 374 / 180;
}

/* ========================================
   Lightbox / Modal
   ======================================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.is-active {
    opacity: 1;
    visibility: visible;
}

.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.lightbox__content {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
    z-index: 1;
    border-radius: 16px;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
}

.lightbox.is-active .lightbox__content {
    transform: scale(1) translateY(0);
}

.lightbox__image {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 32px;
}

/* Lightbox Close Button */
.lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--color-white);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox__close:hover,
.lightbox__close:focus {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Lightbox Navigation */
.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--color-white);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox__nav:hover,
.lightbox__nav:focus {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.lightbox__nav--prev {
    left: 20px;
}

.lightbox__nav--next {
    right: 20px;
}

.lightbox__nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox__nav:disabled:hover {
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
}

/* Lightbox Counter */
.lightbox__counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    color: var(--color-white);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.05em;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Lightbox body scroll lock */
body.lightbox-open {
    overflow: hidden;
}
/* ========================================
   Contact Section
   ======================================== */
.contact {
    background: linear-gradient(150deg, #F2E1C2 0%, #9BD5D8 33%, #A9CFC1 66%, #9EB6E3 100%);
    padding: 60px 0 64px;
}

.contact__container {
    padding:0 8px;
}

.contact__content {
    padding:0 8px;
    width: 100%;
    background-color: var(--color-white);
    border-radius: 40px;
    padding: 60px 16px;
    margin-bottom: 8px;
}

.contact__title {
    font-family: var(--font-family);
    font-weight: 900;
    font-size: 40px;
    line-height: 100%;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: uppercase;
    color: var(--color-secondary);
    margin-bottom: 54px;
}

/* Contact Form
   ======================================== */
.contact__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
}

.form-group {
    width: 100%;
}

.form-input {
    width: 100%;
    padding: 10px 30px;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-secondary);
    background-color: var(--color-white);
    border: 1px solid var(--color-secondary);
    border-radius: 100px;
    outline: none;
    transition: border-color var(--transition-default);
}

.form-input::placeholder {
    color: var(--color-secondary);
}

.form-input:focus {
    border-color: var(--color-secondary);
}

/* Form Validation States
   ======================================== */
.form-input.is-error {
    border-color: #d64545;
    color: #d64545;
}

.form-input.is-error::placeholder {
    color: #d64545;
}

/* Checkbox
   ======================================== */
.form-group--checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
}

.form-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 1px solid #666666;
    border-radius: 4px;
    background-color: var(--color-white);
    cursor: pointer;
    position: relative;
    margin-top: 2px;
    transition: var(--transition-default);
}

.form-checkbox:checked {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
}

.form-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 10px;
    border: solid var(--color-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-checkbox:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* Checkbox Error State */
.form-checkbox.is-error {
    border-color: #d64545;
    background-color: #d64545;
}

.form-checkbox.is-error + .form-checkbox-label {
    color: #d64545;
}

.form-checkbox-label {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 18px;
    line-height: 1.4;
    color: var(--color-secondary);
    cursor: pointer;
}

/* Submit Button
   ======================================== */
.btn--dark {
    background-color: var(--color-secondary);
    color: var(--color-white);
    border-radius: 100px;
}

.btn--dark:hover,
.btn--dark:focus {
    background-color: var(--color-primary-dark);
}

.contact__submit {
    width: 100%;
    margin-top: 8px;
    font-weight: 500;
    padding: 10px 0;
}

.contact__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Form Success State
   ======================================== */
.form-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.form-success__title {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 18px;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--color-secondary);
    margin-bottom: 40px;
}

.form-success__icon {
    margin-bottom: 40px;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
    opacity: 0;
    transform: scale(0.5);
}

.form-success__icon svg {
    width: 80px;
    height: 80px;
}

.form-success__icon circle {
    stroke: var(--color-secondary);
}

.form-success__icon path {
    stroke: var(--color-secondary);
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheck 0.5s ease-out 0.5s forwards;
}

.form-success__message {
    font-family: var(--font-family);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-secondary);
    opacity: 0.8;
}

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

@keyframes scaleIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Contact Image
   ======================================== */
.contact__image {
    border-radius: 40px;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
}

.contact__image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 40px;
}

/* Footer
   ======================================== */
.footer {
    padding: 0;
}

.footer__main {
    background-color: var(--color-white);
    padding: 64px 0;
}

.footer__container {
    padding: 8px 0;
}

.footer__content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer__brand {
    text-align: center;
}

.footer__title-text {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: uppercase;
    color: var(--color-secondary);
}

.footer__logo {
    display: block;
    margin: 0 auto;
}

.footer__nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    margin-top: 64px;
}

.footer__nav-title {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 18px;
    line-height: 100%;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: uppercase;
    color: var(--color-secondary);
}

.footer__list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.footer__item {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 18px;
    line-height: 100%;
    letter-spacing: 0.03em;
    text-align: center;
    color: var(--color-secondary);
    display: flex;
}

.footer__link {
    color: inherit;
    padding: 10px 20px;
    border-radius: 100px;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer__link:hover,
.footer__link:focus {
    border-color: var(--color-secondary);
}

.footer__contacts-block {
    margin-top: 64px;
}

.footer__contacts-block .footer__nav-title {
    margin-bottom: 0;
}

.footer__contacts {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    margin-top: 32px;
}

.footer__contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
}

.footer__contact-link:hover,
.footer__contact-link:focus {
    text-decoration: underline;
}

.footer__contact-icon {
    width: 24px;
}

.footer__copyright {
    margin-top: 0;
    text-align: center;
    height: 64px;
    background-color: var(--color-secondary);
}

.footer__copyright-link {
    display: flex;
    font-size: 20px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-white);
}

.footer__copyright-link:hover {
    text-decoration: underline;
}

.footer__copyright-link:focus {
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
}

.footer__copyright-link:active {
    text-decoration: none;
}

/* ========================================
   Scroll-triggered Animations
   ======================================== */

/* Initial hidden state for animated elements */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Visible state when element enters viewport */
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delays for cards */
.animate-on-scroll.delay-1 {
    transition-delay: 0.1s;
}

.animate-on-scroll.delay-2 {
    transition-delay: 0.2s;
}

.animate-on-scroll.delay-3 {
    transition-delay: 0.3s;
}

.animate-on-scroll.delay-4 {
    transition-delay: 0.4s;
}

.animate-on-scroll.delay-5 {
    transition-delay: 0.5s;
}

.animate-on-scroll.delay-6 {
    transition-delay: 0.6s;
}

/* Service cards - slide up with scale */
.service-card.animate-on-scroll {
    opacity: 0;
    transform: translateY(80px) scale(0.95);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
}

.service-card.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Hover state for visible service cards */
.service-card.animate-on-scroll.is-visible:hover {
    transform: translateY(-12px) scale(1);
}

.service-card.animate-on-scroll.is-visible:active {
    transform: translateY(-6px) scale(1);
}

/* Gallery items - fade in with scale and rotation */
.gallery__item.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px) scale(0.9);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery__item.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Contact section elements */
.contact__content.animate-on-scroll {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact__content.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.contact__image.animate-on-scroll {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact__image.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Section titles animation */
.section-title-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-title-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll,
    .service-card.animate-on-scroll,
    .gallery__item.animate-on-scroll,
    .contact__content.animate-on-scroll,
    .contact__image.animate-on-scroll,
    .section-title-animate {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Services: responsive for viewports < 390px
   ======================================== */
@media (max-width: 389px) {
    :root {
        --container-padding: 12px;
    }

    .service-card__content {
        padding: 32px 12px 40px;
    }

    .service-card__title {
        font-size: clamp(28px, 10vw, 40px);
    }

    .service-card__description {
        font-size: 16px;
        line-height: 24px;
        max-width: 100%;
    }

    .tag {
        padding: 12px 20px;
        font-size: 14px;
    }

    .contact__title {
        font-size: clamp(28px, 10vw, 40px);
    }

    .contact__form {
        max-width: 100%;
    }

    .contact__image {
        max-width: 100%;
    }
}

/* ========================================
   Tablet Styles (768px and up)
   ======================================== */
@media (min-width: 768px) {
    :root {
        --container-padding: 32px;
        --header-height: 76px;
    }

    /* Container - wider for tablets */
    .container {
        max-width: 768px;
    }

    .tag--ecommerce {
        margin: 0 40px;
    }

    /* Header */
    .header {
        padding: 20px 0;
    }

    .header .container {
        max-width: 768px;
    }

    /* Burger Menu - larger touch target and icon on tablets */
    .burger-menu {
        width: 36px;
        height: 26px;
        min-height: 26px;
        padding: 0;
    }

    .burger-line {
        height: 3px;
        min-height: 3px;
        flex-shrink: 0;
        border-radius: 3px;
    }

    .burger-menu.is-active .burger-line:nth-child(1) {
        transform: translateY(11.5px) rotate(45deg);
    }

    .burger-menu.is-active .burger-line:nth-child(3) {
        transform: translateY(-11.5px) rotate(-45deg);
    }

    /* Mobile nav overlay - updated for tablets */
    .mobile-nav__content {
        max-width: 768px;
        padding: 0 var(--container-padding);
        gap: 56px;
    }

    .mobile-nav__list {
        gap: clamp(32px, 6vh, 48px);
        margin-bottom: 0;
    }

    .mobile-nav__link {
        font-size: 22px;
        line-height: 1.3;
    }

    .mobile-nav__email {
        font-size: 18px;
        gap: 12px;
    }

    .mobile-nav__icon {
        width: 28px;
    }

    .mobile-nav__btn {
        max-width: 380px;
        min-width: 380px;
        padding: 28px 48px;
        font-size: 20px;
    }

    /* Hero Section */
    .hero__tagline {
        font-size: 56px;
        max-width: 600px;
    }

    .hero__subtitle {
        font-size: 20px;
        line-height: 24px;
    }

    .hero__btn {
        max-width: 380px;
        min-width: 380px;
        padding: 28px 48px;
        font-size: 20px;
    }

    /* Services Section */
    .services {
        padding: 80px 0 100px;
    }

    .services__title {
        font-size: 56px;
        margin-bottom: 56px;
    }

    .services__grid {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 24px;
        padding: 0;
    }

    .service-card {
        max-width: 340px;
        height: 600px;
    }

    .service-card__title {
        font-size: 36px;
    }

    .service-card__description {
        font-size: 16px;
        line-height: 24px;
        max-width: 300px;
    }

    .tag {
        padding: 12px 24px;
        font-size: 16px;
    }

    /* Projects Section */
    .projects {
        padding: 80px 0 100px;
    }

    .projects__title {
        font-size: 56px;
    }

    /* Tablet gallery: scale up mobile layout */
    .projects__gallery {
        max-width: 560px;
        gap: 12px;
    }

    /* Contact Section */
    .contact {
        padding: 80px 0;
    }

    .contact__container {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .contact__content {
        padding: 64px 48px;
        border-radius: 48px;
        margin-bottom: 0;
    }

    .contact__title {
        font-size: 56px;
        margin-bottom: 48px;
    }

    .contact__form {
        max-width: 500px;
    }

    .form-input {
        padding: 14px 32px;
        font-size: 18px;
    }

    .form-checkbox-label {
        font-size: 16px;
    }

    .contact__submit {
        padding: 14px 0;
        font-size: 18px;
    }

    .contact__image {
        max-width: 100%;
        border-radius: 48px;
    }

    .contact__image img {
        border-radius: 48px;
    }

    /* Footer */
    .footer__main {
        padding: 64px 0;
    }

    .footer__content {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-start;
        gap: 48px 80px;
    }

    .footer__brand {
        flex-basis: 100%;
        text-align: center;
    }

    .footer__title-text {
        font-size: 20px;
    }

    .footer__nav {
        margin-top: 0;
        align-items: flex-start;
        flex: 1;
        min-width: 160px;
        max-width: 240px;
    }

    .footer__contacts-block {
        margin-top: 0;
        flex: 1;
        min-width: 160px;
        max-width: 280px;
    }

    .footer__list {
        align-items: flex-start;
        gap: 32px;
    }

    .footer__contacts {
        margin-top: 24px;
        align-items: flex-start;
        gap: 52px;
    }

    .footer__nav-title {
        text-align: left;
    }

    #footer-nav-title {
       padding-left: 20px;
    }

    .footer__item {
        text-align: left;
    }

    .footer__copyright {
        margin-top: 0;
        height: 72px;
    }

    .footer__copyright-link {
        font-size: 18px;
    }
}

/* ========================================
   Larger Tablets / Small Desktop (1024px and up)
   ======================================== */
@media (min-width: 1024px) {
    :root {
        --container-padding: 40px;
    }

    .tag--ecommerce {
        margin: 0 60px;
    }

    /* Container */
    .container {
        max-width: 1024px;
    }

    .header .container {
        max-width: 1024px;
    }

    /* Burger & nav - refined for larger tablets */
    .burger-menu {
        width: 40px;
        height: 28px;
    }

    .burger-line {
        height: 3px;
        min-height: 3px;
        flex-shrink: 0;
    }

    .burger-menu.is-active .burger-line:nth-child(1) {
        transform: translateY(12.5px) rotate(45deg);
    }

    .burger-menu.is-active .burger-line:nth-child(3) {
        transform: translateY(-12.5px) rotate(-45deg);
    }

    .mobile-nav__content {
        max-width: 1024px;
        padding: 0 var(--container-padding);
        gap: 64px;
    }

    .mobile-nav__list {
        gap: clamp(40px, 6vh, 56px);
        margin-bottom: 0;
    }

    .mobile-nav__link {
        font-size: 24px;
    }

    .mobile-nav__email {
        font-size: 20px;
    }

    .mobile-nav__icon {
        width: 32px;
    }

    .mobile-nav__btn {
        max-width: 420px;
        min-width: 420px;
        padding: 30px 52px;
        font-size: 22px;
    }

    /* Hero */
    .hero__tagline {
        font-size: 64px;
        max-width: 800px;
    }

    .hero__subtitle {
        font-size: 24px;
    }

    .hero__btn {
        max-width: 420px;
        min-width: 420px;
        padding: 30px 52px;
        font-size: 22px;
    }

    /* Services */
    .services__grid {
        gap: 32px;
    }

    .service-card {
        max-width: 460px;
        height: 700px;
    }

    .service-card__title {
        font-size: 48px;
    }

    .service-card__description {
        font-size: 18px;
        line-height: 27px;
        max-width: 400px;
    }

    .tag {
        padding: 15px 30px;
        font-size: 18px;
    }

    /* Projects Gallery - 14x6 layout (same as desktop) */
    .projects__gallery {
        display: grid;
        grid-template-columns: repeat(14, 1fr);
        grid-template-rows: repeat(6, 1fr);
        gap: 12px;
        max-width: 960px;
        aspect-ratio: 14 / 6;
    }

    .gallery__item:nth-child(1) {
        grid-area: 1 / 1 / 4 / 8;
        aspect-ratio: unset;
    }

    .gallery__item:nth-child(2) {
        grid-area: 1 / 8 / 4 / 13;
    }

    .gallery__item:nth-child(3) {
        grid-area: 1 / 13 / 4 / 15;
    }

    .gallery__item:nth-child(4) {
        grid-area: 4 / 1 / 7 / 6;
    }

    .gallery__item:nth-child(5) {
        grid-area: 4 / 6 / 7 / 8;
    }

    .gallery__item:nth-child(6) {
        grid-area: 4 / 8 / 7 / 15;
        aspect-ratio: unset;
    }

    /* Contact */
    .contact__container {
        flex-direction: row;
        gap: 24px;
        align-items: stretch;
    }

    .contact__content {
        flex: 1;
        max-width: 620px;
    }

    .contact__image {
        flex: 1;
        max-width: 50%;
        display: flex;
    }

    .contact__image img {
        width: 620px;
        height: 100%;
        object-fit: cover;
    }
}

/* ========================================
   Desktop Styles (1280px and up)
   ======================================== */
@media (min-width: 1280px) {
    :root {
        --container-padding: 48px;
        --header-height: 84px;
    }

    .tag--ecommerce {
        margin: 0;
    }

    /* Container */
    .container {
        max-width: 1280px;
    }

    .hero__container {
        max-width: unset;
        padding-top: calc(var(--header-height) + 40px);
    }

    /* Header - Desktop with glass effect */
    .header {
        padding: 24px 0;
        background-color: color-mix(in srgb, var(--color-white) 85%, transparent);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .header .container {
        max-width: 1280px;
        justify-content: space-between;
        align-items: center;
        padding: 0 20px;
    }

    /* Hide burger menu on desktop */
    .burger-menu {
        display: none;
    }

    /* Show desktop navigation */
    .desktop-nav {
        display: block;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .desktop-nav__list {
        display: flex;
        align-items: center;
        gap: 40px;
    }

    .desktop-nav__link {
        font-family: var(--font-family);
        font-weight: 500;
        font-size: 18px;
        line-height: 1;
        letter-spacing: 0.02em;
        color: var(--color-secondary);
        padding: 10px 20px;
        border-radius: 100px;
        border: 1px solid transparent;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .desktop-nav__link:hover,
    .desktop-nav__link:focus {
        border-color: var(--color-secondary);
    }

    /* Desktop social links */
    .desktop-nav__social {
        display: flex;
        align-items: center;
        gap: 32px;
    }

    .desktop-nav__social-link {
        display: flex;
        align-items: center;
        justify-content: center;
        transition: opacity var(--transition-default);
    }

    .desktop-nav__social-link:hover,
    .desktop-nav__social-link:focus {
        opacity: 0.7;
    }

    .desktop-nav__social-icon {
        width: 24px;
    }

    /* Hero */
    .hero__tagline {
        font-size: 64px;
        max-width: 1400px;
    }

    .hero__subtitle {
        font-size: 24px;
    }

    .hero__btn {
        max-width: 282px;
        min-width: 282px;
        padding: 20px 40px;
        font-size: 18px;
        margin-top: 52px;
    }

    /* Services */
    .services {
        padding: 100px 0 120px;
    }

    .services__title {
        font-size: 64px;
        margin-bottom: 64px;
    }

    .services__grid {
        gap: 12px;
    }

    .service-card {
        max-width: 620px;
        height: 620px;
        margin: 0;
    }

    .service-card__title {
        font-size: 64px;
    }

    .service-card__description {
        font-size: 18px;
        line-height: 30px;
        max-width: 480px;
    }

    .tag {
        padding: 18px 36px;
        font-size: 18px;
    }

    /* Projects */
    .projects {
        padding: 100px 0 120px;
    }

    .projects__title {
        font-size: 64px;
    }

    /* Desktop Gallery Grid - 14x6 layout */
    .projects__gallery {
        display: grid;
        grid-template-columns: repeat(14, 1fr);
        grid-template-rows: repeat(6, 1fr);
        gap: 16px;
        max-width: 1200px;
        aspect-ratio: 14 / 6;
    }

    .gallery__item:nth-child(1) {
        grid-area: 1 / 1 / 4 / 8;
        aspect-ratio: unset;
    }

    .gallery__item:nth-child(2) {
        grid-area: 1 / 8 / 4 / 13;
    }

    .gallery__item:nth-child(3) {
        grid-area: 1 / 13 / 4 / 15;
    }

    .gallery__item:nth-child(4) {
        grid-area: 4 / 1 / 7 / 6;
    }

    .gallery__item:nth-child(5) {
        grid-area: 4 / 6 / 7 / 8;
    }

    .gallery__item:nth-child(6) {
        grid-area: 4 / 8 / 7 / 15;
        aspect-ratio: unset;
    }

    /* Contact */
    .contact {
        padding: 100px 0;
    }

    .contact__container {
        gap: 32px;
    }

    .contact__content {
        padding: 60px 60px;
    }

    .contact__title {
        font-size: 64px;
    }

    .contact__form {
        max-width: 560px;
    }

    .form-input {
        padding: 10px 30px;
        font-size: 18px;
    }

    .form-checkbox-label {
        font-size: 18px;
    }

    .contact__submit {
        padding: 16px 0;
        font-size: 20px;
    }

    /* Footer - Desktop three-column layout to match design */
    .footer__main {
        padding: 60px 0 60px;
    }

    .footer__container {
        max-width: 1280px;
    }

    .footer__content {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 48px;
        text-align: left;
        padding: 0 20px;
    }

    .footer__brand {
        flex: 1;
        min-width: 0;
        text-align: left;
        max-width: 40%;
    }

    .footer__brand .footer__logo {
        margin: 0;
    }

    .footer__title-text {
        font-size: 24px;
        line-height: 100%;
        text-align: left;
        font-weight: 700;
    }

    .footer__nav {
        flex: 1;
        min-width: 0;
        margin-top: 0;
        align-items: flex-start;
        max-width: 200px;
    }

    .footer__nav-title {
        font-size: 18px;
        font-weight: 700;
        text-align: left;
        margin-bottom: 8px;
    }

    #footer-nav-title {
       padding-left: 20px;
    }

    .footer__list {
        align-items: flex-start;
        gap: 24px;
    }

    .footer__item {
        font-size: 18px;
        font-weight: 500;
        text-align: left;
    }

    .footer__contacts-block {
        flex: 1;
        min-width: 0;
        margin-top: 0;
        min-width: 420px;
    }

    .footer__contacts-block .footer__nav-title {
        font-size: 18px;
        font-weight: 700;
        text-align: left;
        margin-bottom: 34px;
    }

    .footer__contacts {
        align-items: flex-start;
        gap: 40px;
        margin-top: 8px;
    }

    .footer__contact-link {
        font-size: 18px;
        font-weight: 500;
    }

    .footer__copyright {
        margin-top: 0;
        height: 72px;
    }

    .footer__copyright-link {
        font-size: 16px;
        font-weight: 500;
    }

    .instagram-icon {
        width: 22px;
    }
}
