/**
 * Digi Creation — global responsive layer (all public pages)
 * Loaded after style.css, landing.css, and page-specific sheets.
 */

/* ================================================================
   FOUNDATION — overflow, fluid media, grid/flex safety
   ================================================================ */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  width: 100%;
  overflow-x: clip;
}

body {
  width: 100%;
  overflow-x: clip;
}

body.nav-open,
body.modal-open {
  overflow: hidden;
}

img,
video,
iframe,
embed,
object,
svg {
  max-width: 100%;
  height: auto;
}

/* Prevent flex/grid children from forcing horizontal scroll */
:is(
  .header-inner,
  .container,
  .section,
  .trust-inner,
  .cards-3,
  .cards-4,
  .why-grid,
  .stories-grid,
  .stats-row,
  .footer-cta-inner,
  .footer-links,
  .pricing-grid,
  .portfolio-grid,
  .contact-body,
  .lp-hero-inner,
  .lp-about-grid,
  .lp-why-grid,
  .lp-video-grid,
  .lp-video-track,
  .lp-quotes-grid,
  .lp-process-grid,
  .lp-contact-grid,
  .lp-footer-grid,
  .lp-footer-inner,
  .la-hero-grid,
  .la-process,
  .la-quotes,
  .la-contact-grid,
  .va-hero-grid,
  .va-services,
  .va-plans,
  .va-process,
  .va-work-grid,
  .ws-hero-grid,
  .ws-offer-grid,
  .ws-how,
  .ws-timeline,
  .ws-stats-grid,
  .ws-cta-box,
  .ws-cta-cols,
  .story-hero-inner,
  .story-split,
  .story-journey,
  .story-values,
  .story-approach,
  .story-vision,
  .audit-shell,
  .lead-modal-card
) > * {
  min-width: 0;
}

main.va-page,
main.la-page,
main.ws-page,
main.story-page,
.lp-band,
.lp-page {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

.btn,
.nav-toggle,
.nav-link,
.nav-trigger,
.whatsapp-float,
.t-nav,
.tab-btn,
.pricing-nav-link,
.portfolio-tab,
.va-filter,
.lp-btn {
  min-height: 44px;
}

.table-scroll,
.leads-table-wrap,
.sa-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

@media (min-width: 1920px) {
  :root {
    --page-gutter: clamp(2rem, 3vw, 4rem);
  }
}

@media (min-width: 2560px) {
  :root {
    --max: min(1720px, 92vw);
  }
}

@media (max-width: 1200px) {
  .cards-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lp-value-grid,
  .lp-process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .cards-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-grid,
  .pricing-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-card.is-featured {
    transform: none;
  }

  .portfolio-grid--logos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portfolio-grid--websites {
    grid-template-columns: 1fr;
  }

  .why-grid,
  .stories-grid,
  .footer-cta-inner,
  .section-head.split {
    grid-template-columns: 1fr;
  }

  .hero-title,
  .hero-sub {
    white-space: normal;
  }

  .lp-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem;
  }

  .lp-trust-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 1.5rem;
  }
}

@media (max-width: 992px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "logo actions toggle";
    align-items: center;
    gap: 0.65rem;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }

  .logo {
    grid-area: logo;
    min-width: 0;
  }

  .logo-text {
    font-size: clamp(0.72rem, 2.8vw, 0.82rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: min(42vw, 180px);
  }

  .header-actions {
    grid-area: actions;
    margin-left: 0;
  }

  .nav-toggle {
    grid-area: toggle;
    display: flex;
    flex-shrink: 0;
    z-index: 110;
  }

  .nav {
    grid-column: 1 / -1;
    display: none;
    position: static;
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem;
    margin-top: 0.35rem;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 40px rgba(40, 30, 80, 0.12);
    border: 1px solid var(--border);
    max-height: min(70vh, calc(100dvh - 88px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav.is-open {
    display: flex;
  }

  .nav-link,
  .nav-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 0.85rem 0.65rem;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }

  .nav-link:last-child,
  .nav-item:last-child .nav-trigger {
    border-bottom: 0;
  }

  .dropdown {
    position: static;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: none;
    border: 0;
    padding: 0.35rem 0 0.65rem;
    margin: 0;
    display: none;
    min-width: 0;
    width: 100%;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
  }

  .nav-item.has-dropdown {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .nav-item.is-open .dropdown {
    display: flex !important;
    flex-direction: column;
    gap: 0.15rem;
  }

  .dropdown a {
    padding: 0.75rem 0.85rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 10px;
    background: var(--white);
    border: 1px solid var(--border);
  }

  .dropdown a:hover,
  .dropdown a.is-active {
    background: var(--lavender-panel);
    color: var(--purple);
  }

  .nav-toggle.is-active span:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
  }

  .nav-toggle.is-active span:nth-child(2) {
    transform: translateY(-4px) rotate(-45deg);
  }

  .lp-hero-copy {
    text-align: center;
  }

  .lp-hero-sub {
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
  }

  .lp-hero-actions {
    justify-content: center;
  }

  .lp-hero-fasttrack-wrap {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .lp-hero-fasttrack {
    padding: 1.25rem 1.15rem 1rem;
    border-radius: 20px;
  }

  .lp-hero-badge {
    margin-left: auto;
    margin-right: auto;
  }

  .lp-hero-logos {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 0.35rem;
    gap: 1.25rem 2rem;
    scrollbar-width: none;
  }

  .lp-hero-logos::-webkit-scrollbar {
    display: none;
  }

  .lp-hero-logo {
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  .lp-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    overflow: visible;
    padding: 0.75rem 0 0.25rem;
    scroll-snap-type: none;
  }

  .lp-step-arrow {
    display: none !important;
  }

  .lp-step-card {
    flex: unset;
    min-width: 0;
    max-width: none;
    width: 100%;
    scroll-snap-align: unset;
  }

  .lp-contact-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .lp-contact-info {
    order: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }

  .lp-contact-info .lp-info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.85rem;
    background: #faf9ff;
    border-radius: 14px;
    border: 1px solid rgba(13, 13, 13, 0.06);
    height: 100%;
  }

  .lp-contact-info .lp-info-item .lp-icon-circle {
    flex-shrink: 0;
  }

  .lp-contact-info .lp-info-item:last-child {
    grid-column: 1 / -1;
  }

  .lp-form {
    order: 2;
  }

  .lp-contact-side {
    order: 1;
  }

  .lp-why-grid,
  .lp-video-grid,
  .lp-video-track,
  .lp-quotes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lp-card-slider .lp-video-grid,
  .lp-card-slider .lp-quotes-grid {
    grid-template-columns: unset;
  }

  .lp-about-grid {
    grid-template-columns: 1fr;
  }

  .lp-about-visual {
    order: -1;
  }
}

@media (max-width: 768px) {
  .section {
    padding-top: clamp(2.5rem, 8vw, 3.5rem);
    padding-bottom: clamp(2.5rem, 8vw, 3.5rem);
  }

  .section-title {
    font-size: clamp(1.55rem, 6vw, 2rem);
  }

  .cards-3,
  .cards-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .why-section {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    border-radius: var(--radius-lg);
    padding: 2.25rem var(--page-gutter);
  }

  .tab-panel {
    min-height: auto;
    padding-top: 2.5rem;
    margin-top: 2.75rem;
  }

  .tab-list {
    position: static;
    margin-bottom: 1rem;
    gap: 0.35rem;
    flex-wrap: wrap;
  }

  .tab-btn {
    flex: 1 1 auto;
    text-align: center;
    border-radius: var(--radius-sm);
    min-width: fit-content;
  }

  .expert-stats,
  .stats-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .stats-box {
    width: 100%;
    padding: 1.75rem var(--page-gutter);
  }

  .footer-cta {
    padding: 2.5rem var(--page-gutter);
  }

  .footer-nav {
    flex-direction: column;
    gap: 0.85rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-nav,
  .portfolio-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .pricing-nav-link,
  .portfolio-tab {
    flex-shrink: 0;
  }

  .pricing-grid,
  .pricing-grid--4 {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  .contact-hero {
    padding-top: 2.5rem;
  }

  .contact-title {
    font-size: clamp(1.85rem, 8vw, 2.5rem);
  }

  .contact-body {
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
  }

  .contact-primary,
  .contact-social-grid {
    grid-template-columns: 1fr;
  }

  .testimonial-grid {
    grid-template-columns: 1fr;
  }

  .testimonial-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .testimonial-dash {
    display: none;
  }

  .trust-inner {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 1.5rem;
  }

  .story-card {
    flex: 0 0 100%;
  }

  .stories-track {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
  }

  .la-hero,
  .va-hero,
  .ws-hero,
  .os-hero,
  .story-hero {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .la-hero-title,
  .va-hero-title,
  .ws-hero-title,
  .os-hero-title,
  .story-hero-title {
    font-size: clamp(1.65rem, 7vw, 2.35rem);
  }

  .la-actions,
  .va-actions,
  .ws-actions,
  .os-hero-actions,
  .story-hero-actions {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }

  .la-actions .la-btn,
  .va-actions .va-btn,
  .ws-actions .ws-btn,
  .os-hero-actions .os-btn,
  .la-btn,
  .va-btn,
  .ws-btn,
  .os-btn,
  .story-btn {
    width: 100%;
    justify-content: center;
  }

  .lp-why-grid,
  .lp-value-grid,
  .lp-steps,
  .lp-process-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* Video testimonials + client quotes — 1-up swipe slider on mobile */
  .lp-card-slider .lp-video-grid,
  .lp-card-slider .lp-quotes-grid,
  .lp-card-slider .ws-quotes,
  .lp-card-slider .la-quotes {
    display: flex !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding: 0.15rem 0 0.65rem;
    margin-bottom: 0.35rem;
    scrollbar-width: none;
    grid-template-columns: unset !important;
  }

  .lp-card-slider .lp-video-grid::-webkit-scrollbar,
  .lp-card-slider .lp-quotes-grid::-webkit-scrollbar,
  .lp-card-slider .ws-quotes::-webkit-scrollbar,
  .lp-card-slider .la-quotes::-webkit-scrollbar {
    display: none;
  }

  .lp-card-slider .lp-video-card,
  .lp-card-slider .lp-quote-card,
  .lp-card-slider .ws-quote,
  .lp-card-slider .la-quote {
    flex: 0 0 100%;
    scroll-snap-align: center;
    min-width: 0;
    max-width: 100%;
  }

  .lp-card-slider-pager {
    display: flex;
    margin: 0.35rem 0 1.25rem;
  }

  .lp-pager-dot {
    border: 0;
    padding: 0;
    cursor: pointer;
  }

  .lp-steps {
    display: grid !important;
    overflow: visible !important;
    gap: 1rem;
  }

  .lp-step-arrow {
    display: none !important;
  }

  .lp-step-card {
    flex: unset !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .lp-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1rem;
    text-align: left;
  }

  .lp-footer-brand {
    grid-column: 1 / -1;
  }

  .lp-footer-bottom {
    grid-column: 1 / -1;
    text-align: center;
  }

  .lp-form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Other public pages — 2-up card grids on mobile */
  .la-features-grid,
  .la-services,
  .la-work-grid,
  .la-process,
  .la-plans,
  .va-services,
  .va-plans,
  .va-process,
  .va-work-grid,
  .ws-how,
  .ws-checks,
  .ws-stats-grid,
  .story-journey,
  .story-values,
  .story-approach,
  .stats-row,
  .expert-stats,
  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lp-card-slider .la-quotes,
  .lp-card-slider .ws-quotes {
    grid-template-columns: unset !important;
  }

  /* Websites — 7 steps horizontal flow (2 rows on mobile) */
  .ws-timeline {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 1.35rem 0.5rem;
    grid-template-columns: unset !important;
  }

  .ws-tl-step {
    flex: 0 0 calc(25% - 0.5rem);
    max-width: calc(25% - 0.5rem);
    min-width: 68px;
  }

  .ws-tl-line {
    display: none;
  }

  .ws-tl-step h3 {
    font-size: 0.82rem;
  }

  .ws-tl-step p {
    font-size: 0.72rem;
    max-width: none;
  }

  .ws-tl-num {
    width: 38px;
    height: 38px;
    font-size: 0.75rem;
    margin-bottom: 0.65rem;
  }

  /* Tighter cards for 2-column mobile layout */
  .lp-value-card,
  .lp-why-card,
  .lp-step-card {
    padding: 1rem 0.85rem;
  }

  .lp-card-slider .lp-video-card,
  .lp-card-slider .lp-quote-card {
    padding: 1rem 0.95rem;
  }

  .lp-value-card h3,
  .lp-why-card h3,
  .lp-step-card h3 {
    font-size: 0.9rem;
  }

  .lp-value-card p,
  .lp-why-card p,
  .lp-step-card p,
  .lp-video-body > p,
  .lp-quote-text {
    font-size: 0.78rem;
    line-height: 1.5;
  }

  .lp-video-body h3 {
    font-size: 0.88rem;
  }

  .lp-contact-bar {
    flex-direction: column;
    text-align: center;
  }

  .lp-contact-bar > div {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .lp-hero {
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
  }

  .lp-hero-title {
    font-size: clamp(1.65rem, 7.5vw, 2.15rem);
  }

  .lp-hero-visual {
    min-height: 220px;
  }

  .lp-hero-stage {
    width: min(100%, 300px);
    margin-left: auto;
    margin-right: auto;
  }

  .lp-section {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .lp-why-banner {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .lp-contact-bar .lp-btn,
  .lp-btn--block,
  .lp-form .btn-dark {
    width: 100%;
    justify-content: center;
  }

  .lp-stat {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .lp-cta-split {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .hero-cta-hit {
    width: 48%;
    min-width: 110px;
  }

  .audit-page {
    padding: 1.5rem var(--page-gutter) 3rem;
  }

  .audit-shell {
    padding: 1.75rem 1.25rem 1.5rem;
  }

  .audit-actions {
    justify-content: stretch;
  }

  .audit-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .audit-phone-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --page-gutter: clamp(0.85rem, 4vw, 1.25rem);
    --radius-xl: 32px;
    --radius-lg: 24px;
  }

  .header-actions .btn-header {
    padding: 0.65rem 0.75rem;
    font-size: clamp(0.58rem, 2.5vw, 0.68rem);
  }

  .header-actions .btn-header .btn-arrow {
    display: none;
  }

  .logo-mark,
  .logo-img {
    width: 32px;
    height: 32px;
  }

  .ring {
    width: 96px;
    height: 96px;
    font-size: 1.25rem;
  }

  .whatsapp-float {
    right: max(0.85rem, env(safe-area-inset-right));
    bottom: max(0.85rem, env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
  }

  .lead-modal {
    padding: 0.85rem;
    align-items: flex-end;
  }

  .lead-modal-card {
    max-height: calc(100dvh - 1.5rem);
    overflow-y: auto;
  }
}

@media (max-width: 375px) {
  .lp-hero-services {
    border-radius: 14px;
    padding: 0.65rem 0.85rem;
  }

  .lp-hero-svc {
    font-size: 0.76rem;
  }

  .lp-hero-title {
    font-size: clamp(1.45rem, 8vw, 1.85rem);
  }

  .section-title {
    font-size: clamp(1.4rem, 7vw, 1.75rem);
  }
}

@media (max-width: 320px) {
  :root {
    --page-gutter: 0.75rem;
  }

  .logo-text {
    display: none;
  }

  .header-actions .btn-header {
    padding: 0.55rem 0.6rem;
    font-size: 0.56rem;
  }

  .lp-socials a {
    width: 34px;
    height: 34px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .nav {
    max-height: calc(100dvh - 72px);
  }

  .lp-hero {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .lp-hero-visual {
    min-height: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
