/* ===========================
   Responsive - Desktop First
   =========================== */

/* ---- Tablet: max-width 1199px ---- */
@media (max-width: 1199px) {
    :root {
        --container-padding: 1.5rem;
    }

    /* Scale cats down on tablet */
    .hero__cats {
        width: 75%;
    }

    /* Services */
    .service-row {
        grid-template-columns: 40px 1fr 50px;
        gap: 1.5rem;
    }

    .service-row__desc {
        display: none;
    }

    /* About */
    .about__grid {
        gap: var(--space-lg);
    }

    .about__stats {
        gap: var(--space-sm);
    }

    /* About Stats */
    .about-stats__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-sm);
    }

    .about-stats__item:nth-child(3)::after {
        display: none;
    }

    /* Why BEF */
    .why-bef__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Team */
    .team__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    /* Office */
    .office__locations {
        gap: var(--space-md);
    }

    /* Services (rwork) */
    .rwork__item--reversed .rwork__item-content {
        padding-left: 1.5rem;
    }

    .rwork__item-title {
        font-size: clamp(1.6rem, 3vw, 2.5rem);
    }

    .rwork__item-thumb {
        border-radius: 16px;
    }

    .rwork__item-placeholder {
        border-radius: 16px;
    }

    /* Contact */
    .contact__grid {
        gap: var(--space-lg);
    }

    /* Contact Offices */
    .contact-offices__map {
        height: 220px;
    }

    /* Footer */
    .footer__contact-row {
        gap: 0;
    }

    .footer__contact-value {
        font-size: clamp(1rem, 1.5vw, 1.25rem);
    }

    .footer__nav-row {
        gap: 1rem;
    }

    .footer__nav {
        gap: 1.25rem;
    }

    /* CTA */
    .cta__card-mock {
        width: 160px;
    }

    .cta__card-mock--sm {
        width: 130px;
    }

    /* Check-Up */
    .cu-form__row--3 {
        grid-template-columns: 1fr 1fr;
    }

    /* Career */
    .career-perks__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .career-detail__grid {
        grid-template-columns: 1fr 380px;
    }

    /* Team */
    .team-page__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Service Detail - Tablet */
    .sd-features__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sd-hero__visual {
        min-height: 380px;
    }

}

/* ---- Mobile: max-width 809px ---- */
@media (max-width: 809px) {
    :root {
        --container-padding: 1.25rem;
    }

    /* Navigation */
    .header__nav {
        display: none;
    }

    .site-header {
        padding: 1rem 1.25rem;
    }

    .site-header.is-scrolled {
        padding: 0.6rem 1.25rem;
    }

    .header__hamburger {
        display: flex;
    }

    .header__cta span {
        display: none;
    }

    .header__cta {
        padding: 0.5rem;
        width: 36px;
        height: 36px;
        justify-content: center;
    }

    .header__logo-img {
        height: 34px;
    }

    .site-header.is-scrolled .header__logo-img {
        height: 28px;
    }

    .side-socials {
        display: none;
    }

    .hero-location {
        left: 1.25rem;
        bottom: 1.25rem;
    }

    .hero-location__city {
        font-size: 0.6rem;
    }

    /* Hero mobile */
    .hero {
        height: 100svh;
        padding-top: 0;
        justify-content: center;
        padding-bottom: 15vh;
        background: #000;
    }

    .hero__bg {
        display: none;
    }

    .hero__vignette {
        display: none;
    }

    .hero__title {
        font-size: clamp(4rem, 18vw, 8rem);
        z-index: 10;
    }

    .hero__subtitle {
        font-size: 0.55rem;
        letter-spacing: 0.2em;
    }

    /* Scale cats for mobile - full width, overflow hidden clips edges */
    .hero__cats {
        width: 100%;
        max-width: none;
        bottom: 0;
        overflow: hidden;
    }

    .hero__cats-video {
        width: 160%;
        margin-left: -30%;
    }

    .hero__fade {
        height: 0;
    }

    /* Services */
    .service-row {
        grid-template-columns: 30px 1fr 40px;
        gap: 1rem;
        padding: 1.75rem 0.5rem;
    }

    .service-row__title {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
        white-space: normal;
    }

    .service-row__arrow {
        width: 36px;
        height: 36px;
    }

    /* Services (rwork) */
    .rwork__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        margin-bottom: 2.5rem;
    }

    .rwork__header-left {
        max-width: 100%;
    }

    .rwork__item,
    .rwork__item--reversed {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 1.25rem;
        border-radius: 16px;
    }

    .rwork__item-content {
        padding-left: 0;
    }

    .rwork__item--reversed .rwork__item-content {
        order: 0;
        padding-left: 0;
    }

    .rwork__item--reversed .rwork__item-thumb {
        order: -1;
    }

    .rwork__item-thumb {
        order: -1;
        border-radius: 12px;
    }

    .rwork__item-placeholder {
        border-radius: 12px;
    }

    .rwork__item-cat {
        margin-bottom: 1.25rem;
    }

    /* About */
    .about__grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .about__visual {
        order: -1;
    }

    .logo-scene {
        max-width: 280px;
        margin: 0 auto;
    }

    .about__stats {
        grid-template-columns: repeat(3, 1fr);
    }

    /* About Stats */
    .about-stats__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .about-stats__item::after {
        display: none;
    }

    .about-stats__item {
        padding: var(--space-sm);
    }

    /* Why BEF */
    .why-bef__grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    /* Office */
    .office__gallery-6 {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
    }

    .office__image--wide {
        grid-column: span 2;
    }

    /* Team */
    .team__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .member-card {
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }

    .member-card__avatar {
        width: 75px;
        height: 75px;
    }

    /* Contact Reach */
    .contact-reach__grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .contact-reach__card {
        display: grid;
        grid-template-columns: 48px 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        text-align: left;
        padding: 1.25rem 1.5rem;
        gap: 0.15rem 1rem;
    }

    .contact-reach__icon {
        margin-bottom: 0;
        width: 48px;
        height: 48px;
        flex-shrink: 0;
        grid-row: 1 / 3;
    }

    .contact-reach__label {
        margin-bottom: 0;
        grid-column: 2;
        grid-row: 1;
    }

    .contact-reach__value {
        grid-column: 2;
        grid-row: 2;
        font-size: 1rem;
        margin-bottom: 0;
    }

    .contact-reach__hint {
        display: none;
    }

    /* Contact */
    .contact__grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    /* Contact Offices */
    .contact-offices__grid {
        grid-template-columns: 1fr;
    }

    .contact-offices__map {
        height: 200px;
    }

    /* CTA */
    .cta__card {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 2rem;
    }

    .cta__card-visual {
        display: none;
    }

    .cta__card-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    /* Footer */
    .footer__contact-row {
        grid-template-columns: 1fr;
    }

    .footer__contact-item:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding-right: 0;
        padding-bottom: var(--space-md);
    }

    .footer__contact-item:not(:first-child) {
        padding-left: 0;
        padding-top: var(--space-md);
    }

    .footer__contact-item {
        padding: var(--space-md) 0;
    }

    .footer__addresses {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .footer__nav-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        padding: var(--space-md) 0;
    }

    .footer__nav {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .footer__bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer__mega-text {
        -webkit-text-stroke-width: 0.5px;
        font-size: clamp(1.8rem, 7.5vw, 4rem);
    }

    .logo-scene {
        max-width: 300px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-header {
        padding-top: calc(80px + var(--space-lg));
        text-align: left;
    }

    .page-header__subtitle {
        margin: 0;
    }

    /* Check-Up */
    .cu-hero {
        min-height: 100svh;
    }

    .cu-hero__title {
        font-size: clamp(2.8rem, 12vw, 5rem);
    }

    .cu-hero__ring--1 { width: 200px; height: 200px; }
    .cu-hero__ring--2 { width: 350px; height: 350px; }
    .cu-hero__ring--3 { width: 500px; height: 500px; }

    .cu-process__steps {
        flex-direction: column;
        gap: 0;
    }

    .cu-process__line {
        width: 1px;
        height: 40px;
        margin: 0;
        margin-left: 1.25rem;
    }

    .cu-form__row--2,
    .cu-form__row--3 {
        grid-template-columns: 1fr;
    }

    .cu-form__card {
        padding: 1.75rem;
    }

    .cu-form__footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    /* Services Listing */
    .services-list__grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .services-list__card {
        padding: 2rem 1.5rem;
    }

    /* Service Detail Pages */
    .sd-hero__grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        min-height: auto;
    }

    .sd-hero__title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .sd-hero__desc {
        max-width: 100%;
    }

    .sd-hero__visual {
        min-height: 350px;
        order: -1;
    }

    .sd-hero__actions {
        flex-direction: column;
    }

    .sd-hero__actions .btn {
        text-align: center;
        justify-content: center;
    }

    .sd-phone {
        width: 260px;
        height: 540px;
    }

    .sd-phone__float--1 {
        right: -10px;
        top: 5%;
    }

    .sd-phone__float--2 {
        left: -10px;
        bottom: 10%;
    }

    .sd-phone__float {
        padding: 10px 14px;
    }

    .sd-phone__float strong {
        font-size: 12px;
    }

    .sd-phone__stories {
        gap: 10px;
        padding: 10px 12px;
    }

    .sd-phone__story-ring {
        width: 44px;
        height: 44px;
    }

    .sd-dashboard {
        max-width: 100%;
    }

    .sd-dashboard__stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .sd-browser {
        max-width: 100%;
    }

    .sd-code-float {
        right: 0;
        bottom: -20px;
    }

    .sd-viewfinder {
        max-width: 100%;
    }

    .sd-model-cards {
        width: 240px;
        height: 350px;
    }

    .sd-model-cards__card {
        width: 180px;
    }

    .sd-model-cards__photo {
        height: 180px;
    }

    .sd-platforms__grid {
        grid-template-columns: 1fr;
    }

    .sd-platforms__card {
        padding: 2rem 1.5rem;
    }

    .sd-features__grid {
        grid-template-columns: 1fr;
    }

    .sd-features__card {
        padding: 1.5rem;
    }

    .sd-tech__grid {
        grid-template-columns: 1fr;
    }

    .sd-checkup__wrapper {
        grid-template-columns: 1fr;
    }

    .sd-checkup__card {
        max-width: 100%;
    }

    .sd-growth__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sd-growth__value {
        font-size: 2rem;
    }

    .sd-why-ads__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sd-process-cards__grid,
    .sd-process-cards__grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .sd-process-card__connector {
        display: none;
    }

    .sd-process__timeline::before {
        left: 24px;
    }

    .sd-process__num {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .sd-process__step {
        gap: 1.25rem;
    }

    /* Career */
    .career-perks__grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .career-perks__item {
        display: flex;
        align-items: flex-start;
        gap: 1rem;
    }

    .career-perks__icon {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .career-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .career-card__arrow {
        display: none;
    }

    .career-detail__grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .career-detail__sidebar {
        position: static;
    }

    .career-apply {
        padding: 1.5rem;
    }

    /* Team */
    .team-page__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .team-page__grid .team-card:last-child:nth-child(4n+1) {
        grid-column: auto;
        max-width: none;
        justify-self: auto;
    }

    .team-page__grid .team-card:last-child:nth-child(2n+1) {
        grid-column: 1 / -1;
        max-width: 50%;
        justify-self: center;
    }

    /* Contact Form Card */
    .contact__form-card {
        padding: 1.75rem;
    }

    .contact__details-list {
        margin-bottom: 1.5rem;
    }

}

/* ---- Small Mobile: max-width 479px ---- */
@media (max-width: 479px) {
    :root {
        --container-padding: 1rem;
    }

    .hero__title {
        font-size: clamp(4rem, 18vw, 8rem);
    }

    .hero__cats {
        width: 100%;
    }

    .about__stats {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .stat {
        display: flex;
        align-items: center;
        gap: 1rem;
        text-align: left;
    }

    .stat__label {
        margin-top: 0;
    }

    /* About Stats small mobile */
    .about-stats__grid {
        grid-template-columns: 1fr;
    }

    .about-stats__item {
        display: flex;
        align-items: center;
        gap: 1rem;
        text-align: left;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--color-border);
    }

    .about-stats__item:last-child {
        border-bottom: none;
    }

    .about-stats__label {
        margin-top: 0;
    }

    /* Team small mobile */
    .team__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .member-card {
        padding: 1.25rem 0.75rem;
    }

    .member-card__avatar {
        width: 60px;
        height: 60px;
    }

    .btn--large {
        padding: 1rem 2rem;
        font-size: var(--fs-small);
        width: 100%;
    }

    .logo-scene {
        max-width: 220px;
    }

    /* Office small mobile */
    .office__gallery-6 {
        grid-template-columns: 1fr;
        grid-auto-rows: 200px;
    }

    .office__image--wide {
        grid-column: span 1;
    }

    /* CTA small mobile */
    .cta__card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .cta__card-actions {
        flex-direction: column;
    }

    .cta__card-btn {
        width: 100%;
        justify-content: center;
    }

    /* Check-Up small mobile */
    .cu-form__card {
        padding: 1.25rem;
    }

    .cu-hero__badge {
        font-size: 0.65rem;
        padding: 0.4rem 1rem;
    }

    /* Career small mobile */
    .career-card__title {
        font-size: clamp(1.2rem, 5vw, 1.6rem);
    }

    .career-apply {
        padding: 1.25rem;
    }

    /* Contact small mobile */
    .contact__form-card {
        padding: 1.25rem;
    }

    .sd-growth__grid {
        grid-template-columns: 1fr;
    }

    .sd-process-cards__grid,
    .sd-process-cards__grid--3 {
        grid-template-columns: 1fr;
    }

    .sd-why-ads__grid {
        grid-template-columns: 1fr;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .logo-scene__logo,
    .logo-scene__blob,
    .logo-scene__arc,
    .logo-scene__dot,
    .cu-hero__ring,
    .cu-hero__ekg-line,
    .cu-hero__badge-dot,
    .cu-hero__cta svg,
    .cu-scope__items {
        animation: none !important;
    }
}
