/* ==========================================================================
   Euclidz — responsive adaptations
   The PDF supplies a 1440px desktop design only; smaller layouts adapt it
   while keeping its type, colour and component language.
   ========================================================================== */

/* ---------- Laptop ---------- */
@media (max-width: 1360px) {
    :root { --gutter: 48px; --aside: 470px; --aside-sm: 380px; }
    .site-header__inner { padding-left: var(--gutter); padding-right: var(--gutter); }
    .main-nav { left: 50%; transform: translate(-50%, -50%); }
    .req { grid-template-columns: 440px 1fr; column-gap: 70px; }
    .site-footer__grid { grid-template-columns: 1.3fr 1.2fr .8fr 1fr; gap: 30px; }
    .post-grid { gap: 28px; }
}

@media (max-width: 1240px) {
    .display { font-size: 42px; line-height: 50px; }
    .dim-card { height: auto; }
    .dim-card__media { height: auto; aspect-ratio: 391 / 281; }
    .dim-card__foot { margin-top: 24px; }
    .process-card { aspect-ratio: auto; min-height: 300px; }
    .process-card__icon { margin-top: 30px; }
    .t-card__quote { max-width: none; }
}

/* ---------- Tablet landscape: switch to menu button ---------- */
@media (max-width: 1100px) {
    :root { --header-h: 84px; }
    .main-nav, .site-header .btn-pill { display: none; }
    .site-logo { width: 140px; }
    .menu-toggle {
        display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 7px;
        width: 48px; height: 48px; border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, .25);
        position: relative; z-index: 2;
    }
    .menu-toggle span { display: block; width: 18px; height: 1.5px; background: #fff; transition: transform .5s var(--ease-out), width .4s; }
    .menu-toggle span:last-child { width: 12px; margin-left: 6px; }
    .menu-open .menu-toggle span:first-child { transform: translateY(4.25px) rotate(45deg); }
    .menu-open .menu-toggle span:last-child { width: 18px; margin-left: 0; transform: translateY(-4.25px) rotate(-45deg); }
    .menu-open .site-header { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; transform: none; }

    .hero__tab { width: 150px; }
    .split-head { grid-template-columns: 1fr; gap: 28px; }
    .split-head__aside, .about .split-head__aside, .solutions .split-head__aside { margin-top: 0; }
    .split-head--blog, .testimonials .split-head { align-items: start; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
    .pillars { grid-template-columns: 1fr; gap: 14px; }
    .req { grid-template-columns: 1fr; row-gap: 40px; }
    .req__panel { padding-top: 0; }
    .req__media { height: auto; aspect-ratio: 693 / 316; }
    .process-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cta__inner { grid-template-columns: 1fr; gap: 0; padding: 70px var(--gutter); }
    .site-footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 46px; }
    .contact-grid { grid-template-columns: 1fr; gap: 60px; }
    .exec-grid { grid-auto-rows: auto; }
    .exec-item, .exec-item--wide { grid-column: span 6; aspect-ratio: 4 / 3; }
}

/* ---------- Tablet portrait ---------- */
@media (max-width: 900px) {
    :root { --gutter: 32px; }
    .display { font-size: 36px; line-height: 44px; }
    .dim-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
    .dim-grid .dim-card:last-child { grid-column: 1 / -1; }
    .post-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .post-grid .post-card:last-child { grid-column: 1 / -1; }
    .prose-cards { grid-template-columns: 1fr; }
    .t-slider { max-width: none; }

    .hero__slide { width: auto; }
    .hero__bottom { flex-direction: column-reverse; justify-content: flex-end; height: auto; padding-bottom: 22px; gap: 14px; }
    .hero__hints { padding-top: 0; }
    .hero__tabs { margin-top: 0; width: 100%; }
    .hero__tab { flex: 1; width: auto; }

    .clients { height: auto; padding-bottom: 80px; }
    .hero__img.is-euclid::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(2, 2, 2, .95) 0%, rgba(2, 2, 2, .72) 40%, rgba(2, 2, 2, .1) 72%); }
    .hero__content { align-content: end; padding-bottom: 44px; }
    .post-grid .post-card:last-child .post-card__media { aspect-ratio: 16 / 7; }
    .closer { height: auto; padding-bottom: 340px; }
    .closer__bg img { left: -10%; width: 120%; top: auto; bottom: 0; height: 380px; }
    .closer__bg::after { background: linear-gradient(180deg, #150f0f 0%, #171213 40%, rgba(21, 15, 15, .6) 60%, rgba(21, 15, 15, 0) 85%); }
    .clients__copy { padding-top: 290px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
    :root { --gutter: 20px; --header-h: 72px; }
    body { font-size: 15px; line-height: 24px; }
    .display { font-size: 30px; line-height: 36px; }
    .eyebrow, .pill { font-size: 10px; letter-spacing: .12em; gap: 10px; }
    .pill { height: auto; min-height: 30px; padding: 7px 14px; line-height: 14px; }
    .site-logo { width: 118px; }
    .menu-toggle { width: 44px; height: 44px; }

    /* Hero */
    .hero__stage { min-height: max(640px, 100svh); }
    .hero__media { bottom: 0; }
    .hero__img img, .hero__img.is-euclid img { object-position: 64% 0%; }
    .hero__img.is-euclid::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(2, 2, 2, .96) 0%, rgba(2, 2, 2, .7) 42%, rgba(2, 2, 2, .1) 75%); }
    .hero__img.is-photo::after { background: linear-gradient(0deg, rgba(2, 2, 2, .97) 0%, rgba(2, 2, 2, .78) 48%, rgba(2, 2, 2, .25) 80%); }
    .hero__slide .eyebrow { font-size: 10px; }
    .hero__title { margin-top: 16px; font-size: 34px; line-height: 40px; }
    .hero__text { margin-top: 14px; font-size: 14px; line-height: 22px; }
    .hero__content { padding-bottom: 28px; }
    .hero__actions { margin-top: 26px; gap: 10px; width: 100%; }
    .hero__actions .btn { flex: 1; width: auto !important; min-width: 0; padding: 0 14px; gap: 10px; }
    .hero__hints { display: none; }
    .hero__bottom { padding-bottom: 20px; }
    .hero__tabs { gap: 4px; overflow-x: auto; scrollbar-width: none; }
    .hero__tabs::-webkit-scrollbar { display: none; }
    .hero__tab { flex: 1 0 auto; height: 44px; padding: 0 10px; gap: 6px; min-width: 76px; background: rgba(255, 255, 255, .03); }
    .hero__tab span { font-size: 11px; }
    .hero__shade { height: 80px; }

    /* Sections: shared rhythm */
    .about, .dimensions, .solutions, .process, .testimonials, .perspectives { padding: 64px 0; }
    .about .split-head, .solutions .split-head, .testimonials .split-head, .split-head--blog { margin-top: 24px; }
    .dimensions .display, .process .display { margin-top: 26px; }
    .section-sub, .dimensions .section-sub { margin-top: 18px; }
    .split-head__aside .link-line, .about .split-head__aside .link-line { margin-top: 22px; margin-left: 0; }

    .stats { gap: 30px 20px; margin-top: 44px; padding: 0; }
    .stat__num { font-size: 38px; line-height: 44px; margin-top: 16px; }
    .stat__label { margin-top: 6px; }
    .pillars { margin-top: 40px; }
    .pillar { height: auto; min-height: 88px; padding: 18px; gap: 16px; }

    .dim-grid { grid-template-columns: 1fr; margin-top: 36px; gap: 16px; }
    .dim-grid .dim-card:last-child { grid-column: auto; }
    .dim-card { padding: 12px; border-radius: 14px; }
    .dim-card__head { padding: 10px 10px 0; }
    .dim-card__title { font-size: 26px; line-height: 32px; }
    .dim-card__text { padding: 0 10px; }
    .dim-card__media { margin-top: 18px; }
    .dim-card__foot { padding: 0 10px 12px; margin-top: 18px; }

    .req { margin-top: 36px; }
    .req__item { height: 66px; }
    .req__num { width: 32px; }
    .req__label { font-size: 19px; line-height: 24px; }
    .req__copy { min-height: 140px; }

    .process-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 32px; }
    .process-card { min-height: 0; padding: 28px 24px 24px; display: grid; grid-template-columns: 1fr 84px; grid-template-rows: auto auto 1fr; column-gap: 16px; }
    .process-card__num, .process-card__title, .process-card__text { grid-column: 1; }
    .process-card__title { margin-top: 18px; font-size: 22px; }
    .process-card__text { margin-top: 10px; }
    .process-card__icon { position: static; transform: none; grid-column: 2; grid-row: 1 / span 3; align-self: center; justify-self: center; margin: 0; }
    .process-card .process-card__icon svg { width: 76px !important; height: 76px !important; }

    .closer { height: auto; padding-bottom: 300px; }
    .closer__bg img { left: -40%; width: 180%; top: auto; bottom: 0; height: 330px; }
    .closer__bg::after { background: linear-gradient(180deg, #150f0f 0%, #171213 40%, rgba(21, 15, 15, .6) 62%, rgba(21, 15, 15, 0) 85%); }
    .closer__inner { padding-top: 60px; }
    .closer .display { margin-top: 18px; }
    .closer__text { margin-top: 16px; }
    .closer .btn { width: auto; }

    .clients { padding-bottom: 64px; }
    .clients__marquees { top: 56px; gap: 14px; }
    .marquee__group { gap: 40px; padding-right: 40px; height: 64px; }
    .client-logo img { height: calc(var(--h) * .72); }
    .clients__copy { padding-top: 230px; }
    .clients__copy .display { margin-top: 24px; }
    .clients__text br { display: none; }

    .t-slider { margin-top: 36px; }
    .t-card { height: auto !important; min-height: 290px; }
    .t-card__quote { margin-top: 30px; }

    .post-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 36px; }
    .post-grid .post-card:last-child { grid-column: auto; }
    .post-card__link { padding: 24px 20px; }
    .post-card__title { min-height: 0; font-size: 18px; line-height: 25px; }
    .post-card__media { margin-top: 20px; }
    .post-card__excerpt { margin-top: 20px; white-space: normal; height: auto; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .post-card__more { margin-top: 20px; }

    .cta__inner { padding: 60px var(--gutter); }
    .cta .btn { margin-top: 26px; width: 100%; }
    .cta__title br { display: none; }

    .site-footer { padding-top: 54px; }
    .site-footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px 20px; }
    .site-footer__brand, .site-footer__grid > .site-footer__col:nth-child(2) { grid-column: 1 / -1; }
    .site-footer__brand p { margin-top: 20px; }
    .site-footer address br { display: none; }
    .site-footer__bottom { margin-top: 44px; padding: 22px 0 26px; }

    .to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }

    .page-hero { padding: calc(var(--header-h) + 70px) 0 60px; }
    .exec-grid { gap: 14px; }
    .exec-item, .exec-item--wide { grid-column: 1 / -1; }
    .form { grid-template-columns: 1fr; }
    .form__actions .btn { width: 100%; }
}

/* ---------- Small phones ---------- */
@media (max-width: 380px) {
    .display { font-size: 26px; line-height: 32px; }
    .hero__title { font-size: 30px; line-height: 36px; }
    .hero__actions { flex-direction: column; }
    .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .stat__num { font-size: 32px; }
    .site-footer__grid { grid-template-columns: 1fr; }
}

/* Short landscape phones: let the hero breathe */
@media (max-height: 560px) and (orientation: landscape) {
    .hero__stage { min-height: 640px; }
}

/* Short laptop screens (e.g. 1366px wide with ~600px visible): keep the whole hero readable */
@media (min-width: 901px) and (max-height: 820px) {
    .hero__title { margin-top: 20px; font-size: 40px; line-height: 46px; }
    .hero__text { margin-top: 18px; }
    .hero__actions { margin-top: 30px; }
    .hero__bottom { height: 96px; }
    .hero__hints { padding-top: 26px; }
}
