/* =========================
   RESPONSIVE
   576 / 768 / 992 / 1200 / 1400
   Base in style.css: mobile first
========================= */

/* =========================
   576
========================= */

@media (min-width: 576px) {
  .hero-actions .btn {
    width: auto;
    justify-content: flex-start;
  }

  .win-slot {
    width: min(78%, 360px);
  }
}

/* =========================
   768
========================= */

@media (min-width: 768px) {
  .sequence {
    padding-left: 0;
  }

  .sequence-label {
    margin-bottom: 28px;
  }

  .sequence-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    position: relative;
    z-index: 1;
  }

  .sequence-step {
    text-align: center;
  }

  .sequence-name {
    font-size: clamp(1.8rem, 3.2vw, 3.15rem);
    line-height: 1;
    padding-bottom: 26px;
  }

  .sequence-rail {
    top: auto;
    bottom: 2px;
    left: 16.5%;
    right: 16.5%;
    width: auto;
    height: 1px;
    z-index: 2;
  }

  .sequence-rail-fill {
    transform: scaleX(var(--seq, 0));
    transform-origin: left center;
  }

  .sequence-node {
    top: 50%;
    left: auto;
  }

  .sequence-node:nth-child(3) {
    left: 0;
    top: 50%;
  }

  .sequence-node:nth-child(4) {
    left: 50%;
    top: 50%;
  }

  .sequence-node:nth-child(5) {
    left: 100%;
    top: 50%;
  }
}

@media (min-width: 768px) {
  :root {
    --text-hero: clamp(3rem, 7vw, 6.875rem);
  }

  .hero-title .split {
    display: inline;
  }

  .workspace {
    max-width: 560px;
  }

  .workspace-stage {
    display: block;
    height: 500px;
  }

  .crop {
    display: block;
  }

  .win-slot {
    position: absolute;
    width: auto;
  }

  .win-dash,
  .win-ai,
  .win-auto {
    align-self: auto;
  }

  .win-crm { width: 52%; max-width: 260px; top: 20px; left: 16px; z-index: 2; }
  .win-dash { width: 44%; max-width: 220px; top: 16px; right: 16px; z-index: 1; }
  .win-quote { width: 48%; max-width: 248px; top: 168px; left: 12px; z-index: 4; }
  .win-ai { width: 44%; max-width: 228px; top: 186px; right: 16px; z-index: 3; }
  .win-auto { width: 66%; max-width: 310px; top: 386px; left: 16px; bottom: auto; z-index: 2; }
}

@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  .win-crm .win { transform: rotate(-1deg); }
  .win-dash .win { transform: rotate(0.8deg); }
  .win-quote .win { transform: rotate(0.25deg); }
  .win-ai .win { transform: rotate(-0.4deg); }
  .win-auto .win { transform: rotate(0.5deg); }
}

/* =========================
   992
========================= */

@media (min-width: 992px) {
  .nav-desktop {
    display: flex;
    align-items: center;
    gap: clamp(14px, 1.7vw, 28px);
    margin-left: auto;
  }

  .header-cta {
    margin-left: 18px;
  }

  .nav-toggle,
  .nav-panel {
    display: none;
  }

  .hero-lower {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(460px, 520px);
    gap: clamp(28px, 4vw, 64px);
    align-items: start;
  }

  .workspace {
    max-width: none;
    margin-left: auto;
    width: 100%;
  }

  .paths {
    flex-direction: row;
    align-items: stretch;
    min-height: 100svh;
  }

  .path {
    flex: 50 1 0;
    min-height: 100svh;
    padding: clamp(36px, 4vw, 72px);
    transition: flex-grow 0.6s var(--ease);
  }

  .path-title {
    font-size: clamp(2.2rem, 2.7vw, 3.45rem);
  }

  .path-services {
    margin-top: auto;
    padding-top: clamp(28px, 4vh, 48px);
  }

  .problems-head,
  .problems-sticky,
  .problems-close {
    padding-inline: clamp(36px, 4vw, 72px);
  }

  .problems-title {
    font-size: clamp(2.2rem, 2.7vw, 3.45rem);
  }

  .offer {
    padding-inline: clamp(36px, 4vw, 72px);
  }

  .offer-title {
    font-size: clamp(2.2rem, 2.7vw, 3.45rem);
  }

  .offer-list li {
    grid-template-columns: 4.5rem minmax(12rem, 0.85fr) minmax(16rem, 1.15fr);
    column-gap: clamp(16px, 2vw, 32px);
    align-items: baseline;
  }

  .offer-list p {
    grid-column: 3;
    grid-row: 1;
  }

  .problems-reel.is-live {
    height: 280vh;
  }

  .intro-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.9fr);
    column-gap: clamp(36px, 5vw, 88px);
    row-gap: clamp(20px, 3vh, 32px);
    align-items: start;
  }

  .intro-title {
    grid-column: 1;
    grid-row: 1;
  }

  .intro-copy {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
  }

  .intro-close {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    margin-top: 0;
  }

  .intro-result {
    grid-column: 1 / -1;
    margin-top: clamp(8px, 2vh, 20px);
  }
}

@media (min-width: 992px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .paths:hover .path {
    flex-grow: 45;
  }

  .paths:hover .path:hover {
    flex-grow: 55;
  }
}

@media (min-width: 992px) and (prefers-reduced-motion: no-preference) {
  .workspace-stage {
    animation: workspace-drift 9s ease-in-out infinite alternate;
  }
}

/* =========================
   1200
   Headline a sinistra, workspace a destra
========================= */

@media (min-width: 1200px) {
  :root {
    --text-hero: clamp(4rem, 6.3vw, 5.75rem);
  }

  .nav-desktop {
    gap: 26px;
  }

  .hero {
    display: grid;
    grid-template-columns: max-content minmax(280px, 560px);
    column-gap: clamp(28px, 3vw, 64px);
    justify-content: space-between;
    align-items: center;
    padding-top: clamp(8px, 2vh, 24px);
  }

  .hero .kicker {
    grid-column: 1;
    grid-row: 1;
  }

  .hero-title {
    grid-column: 1;
    grid-row: 2;
  }

  .hero-title .l {
    white-space: nowrap;
  }

  .hero-lower {
    display: contents;
  }

  .hero-copy {
    grid-column: 1;
    grid-row: 3;
    width: 0;
    min-width: 100%;
    margin-top: clamp(28px, 4vh, 40px);
  }

  .workspace {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    justify-self: end;
    width: 100%;
    max-width: 560px;
    margin-left: 0;
  }
}

@media (min-width: 768px) {
  .form-row,
  .audience-grid {
    grid-template-columns: 1fr 1fr;
  }

  .websites {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
    gap: clamp(28px, 4vw, 64px);
    align-items: end;
  }

  .websites-list {
    margin-top: 0;
  }
}

@media (min-width: 992px) {
  .hero,
  .band,
  .subpage {
    padding-inline: clamp(36px, 4vw, 72px);
  }

  .ai {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    align-items: end;
  }

  .cases-title,
  .websites-title,
  .audiences-title,
  .fit-title,
  .ladder-title,
  .about-title,
  .contact-title,
  .method-title {
    font-size: clamp(2.2rem, 2.7vw, 3.45rem);
  }

  .ai-title,
  .ai-lead,
  .principle-title,
  .principle-line {
    font-size: clamp(2.6rem, 4.2vw, 4.5rem);
  }

  .method-reel.is-live {
    height: 280vh;
  }

  .case-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .cases .case-grid {
    grid-template-columns: minmax(0, 40rem);
  }

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

  .contact {
    grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1fr);
    align-items: start;
  }

  .ladder-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: clamp(40px, 6vh, 72px);
  }

  .ladder-steps li {
    padding: 28px 24px 0 0;
  }

  .ladder-steps li::before {
    top: 0;
    left: 0;
  }

  .ladder-steps li::after {
    top: 3px;
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    height: 1px;
    transform: scaleX(var(--flow));
    transform-origin: left center;
  }

  .ladder-steps li:last-child::after {
    display: block;
    right: 12%;
  }

}

@media (min-width: 1200px) {
  .subpage.has-stage {
    --stage-w: clamp(400px, 34vw, 540px);
    --stage-gap: clamp(56px, 6vw, 112px);
    --stage-inset: clamp(36px, 4vw, 72px);
    --stage-top: clamp(56px, 10vh, 104px);
    --stage-bottom: clamp(80px, 12vh, 128px);
    position: relative;
    min-height: calc(var(--stage-top) + var(--stage-bottom) + max(460px, min(640px, 100vh - 124px)) + 40vh);
    padding-right: calc(var(--stage-inset) + var(--stage-w) + var(--stage-gap));
  }

  .subpage.has-stage > .stage {
    position: absolute;
    top: var(--stage-top);
    right: var(--stage-inset);
    bottom: var(--stage-bottom);
    display: block;
    width: var(--stage-w);
  }
}

@media (prefers-reduced-motion: reduce) {
  .problems-reel.is-live,
  .method-reel.is-live {
    height: auto;
  }
}
