/* Section-by-section mobile refinement. Keep desktop composition unchanged. */

.industry-close-mobile {
  display: none;
}

@media (max-width: 780px) {
  /* A consistent phone rhythm keeps the long page composed without flattening it. */
  #ghost-period,
  #scenarios,
  #client-voices,
  #case-studies,
  #shift,
  #roadmap,
  #components,
  #ownership,
  #industries,
  #founder,
  #booking {
    padding-inline: 20px;
  }

  #ghost-period,
  #scenarios,
  #client-voices,
  #case-studies,
  #shift,
  #components,
  #ownership,
  #industries,
  #founder,
  #booking {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  #roadmap {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .conviction#ownership {
    padding-top: 64px;
  }

  #ghost-period h2,
  #scenarios h2,
  #client-voices h2,
  #shift h2,
  #roadmap > .section-intro h2,
  #components > .section-intro h2,
  #ownership > .section-intro h2,
  #industries h2,
  #diagnosis .quiz-intro h2,
  #founder h2,
  #booking h2,
  .build-close h2 {
    max-width: 100%;
    font-size: clamp(2.35rem, 10.5vw, 3rem);
    line-height: 1.02;
    text-wrap: balance;
  }

  /* Full case study reading order: heading, visual proof, then the breakdown. */
  .case-gallery-proof {
    order: 1;
    min-height: 430px;
  }

  .case-gallery-copy {
    order: 2;
  }

  .case-gallery-stage {
    min-height: 350px;
  }

  .case-gallery-stage figure {
    min-height: 310px;
  }

  .case-gallery-stage img {
    max-height: 330px;
  }

  .case-gallery-close,
  .case-gallery-arrow,
  .case-carousel-arrows button,
  .nav-menu-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .case-carousel-dots {
    min-height: 44px;
    gap: 6px;
  }

  .case-carousel-dots button,
  .case-carousel-dots button[aria-current="true"] {
    width: 44px;
    height: 44px;
  }

  /* The full-width booking bar is redundant beside the compact guided prompt. */
  .mobile-sticky-cta {
    display: none !important;
  }

  /* Reserve the badges' true combined width so repeated sets never overlap. */
  .trust-badge-set {
    width: 800px !important;
    min-width: 800px;
    padding-inline: 32px !important;
    gap: 44px !important;
  }

  /* Hero reading order: promise, live proof, explanation, action. */
  .hero {
    padding-inline: 18px;
  }

  .hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .hero-copy,
  .hero-media {
    display: contents;
  }

  .hero-copy .eyebrow {
    order: 1;
    width: fit-content;
    max-width: 100%;
    justify-self: start;
    margin: 0 0 18px;
  }

  .hero-media .live-system-preview {
    order: 3;
    width: 100%;
    min-width: 0;
    margin: 0 0 30px;
  }

  .hero-copy h1 {
    order: 2;
    width: 100%;
    margin: 0 0 28px;
    text-align: center;
    text-wrap: balance;
  }

  .hero-subhead {
    order: 4;
  }

  .hero-actions {
    order: 5;
  }

  .hero .agent-stack {
    order: 6;
  }

  /* A little more theater around the 16:9 film without stretching the frame. */
  .vsl-section {
    padding-top: clamp(96px, 18vw, 116px) !important;
    padding-bottom: clamp(104px, 20vw, 126px) !important;
  }

  /* Mobile case narrative: identify the client, see them, then read the result. */
  .case-study-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 26px 22px;
  }

  .case-study-copy {
    display: contents;
  }

  .case-study-kicker {
    order: 1;
    margin: 0 0 22px;
  }

  .case-proof {
    order: 2;
    min-height: 0;
    margin: 0 0 26px;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  .case-proof-media {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .case-proof-label {
    min-height: 56px;
    padding: 12px 14px;
  }

  .case-study-copy h3 {
    order: 3;
  }

  .case-gap {
    order: 4;
  }

  .case-slide-foot {
    order: 5;
    margin-top: 28px;
  }

  .roadmap-end {
    width: min(100%, 360px);
    margin-inline: auto;
    padding-inline: 8px;
    font-size: clamp(2.5rem, 12vw, 4rem);
    line-height: 0.98;
    text-align: center;
    text-wrap: balance;
  }

  /* Nine systems become one compact, touch-friendly carousel on mobile. */
  #components .bento-grid {
    display: flex;
    width: auto;
    margin-inline: -18px;
    padding: 6px 18px 18px;
    gap: 14px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 18px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
  }

  #components .bento-grid.is-swiping {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
  }

  #components .bento-grid::-webkit-scrollbar {
    display: none;
  }

  #components .bento-card,
  #components .bento-card.feature {
    flex: 0 0 min(82vw, 316px);
    min-height: 244px;
    padding: 24px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    transform: none;
  }

  #components .bento-card h3 {
    margin-top: 28px;
    font-size: clamp(1.55rem, 7.2vw, 2rem);
  }

  #components .bento-card p {
    font-size: 1rem;
    line-height: 1.55;
  }

  .system-carousel-dots {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 4px auto 0;
  }

  .system-carousel-dots button {
    position: relative;
    width: 36px;
    height: 44px;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
  }

  .system-carousel-dots button::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    border: 1px solid rgba(11, 13, 18, 0.34);
    border-radius: 50%;
    background: transparent;
    transform: translate(-50%, -50%);
    transition: width 220ms ease, background 220ms ease, border-color 220ms ease;
  }

  .system-carousel-dots button[aria-current="true"]::before {
    width: 14px;
    border-color: var(--amber);
    border-radius: 8px;
    background: var(--amber);
  }

  .system-carousel-dots button:focus-visible {
    outline: 1px solid var(--amber);
    outline-offset: -3px;
  }

  /* Keep familiar industries visible; disclose the specialist list on demand. */
  #industries .fit-grid {
    display: grid;
    row-gap: 28px;
  }

  .industry-chips:not(.is-expanded) span:nth-child(n + 7) {
    display: none;
  }

  .industry-close-mobile {
    display: block;
    max-width: 340px;
    margin: 4px 0 0;
    font-size: 0.72rem;
    line-height: 1.65;
  }

  .industry-close-desktop {
    display: none;
  }

  .industry-chips {
    gap: 8px;
  }

  .industry-chips span {
    padding: 10px 12px;
    font-size: 0.78rem;
  }

  .industry-more {
    width: fit-content;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 0;
    background: transparent;
    color: var(--ink);
    padding: 7px 4px;
    font-family: var(--mono-font);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 12px;
  }

  .industry-more b {
    font: inherit;
    text-decoration: underline;
    text-decoration-color: var(--amber);
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
    transition: color 180ms ease, text-decoration-thickness 180ms ease;
  }

  .industry-more > span {
    width: 8px;
    height: 8px;
    background: var(--amber);
    transition: transform 220ms ease;
  }

  .industry-more[aria-expanded="true"] > span {
    transform: rotate(45deg);
  }

  .industry-more:hover b,
  .industry-more:active b,
  .industry-more[aria-expanded="true"] b {
    color: var(--amber-deep);
    text-decoration-thickness: 2px;
  }

  .industry-more:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 4px;
  }

  /* Let the diagnosis feel like a deliberate stop, not another tight card. */
  #diagnosis.quiz-section {
    padding-top: clamp(96px, 25vw, 116px);
    padding-bottom: clamp(108px, 28vw, 132px);
    padding-inline: 20px;
  }

  #diagnosis .quiz-shell {
    min-height: 600px;
    padding: 36px 24px;
  }

  /* Mobile contact journey: message first, details and map second, navigation last. */
  #contact .footer-contact-grid {
    min-height: 0;
  }

  #contact .footer-message-panel {
    order: 1;
    min-height: 0;
    padding: 62px 22px 58px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  #contact .footer-contact-details {
    order: 2;
    min-height: 0;
    padding: 64px 22px 58px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  #contact .footer-form-head {
    margin-bottom: 34px;
  }

  #contact .footer-form-head h2 {
    max-width: 330px;
    font-size: clamp(2.7rem, 12vw, 3.65rem);
    line-height: 0.98;
  }

  #contact .contact-form {
    margin-top: 0;
    gap: 20px;
  }

  #contact .contact-form > label:nth-of-type(3),
  #contact .contact-form textarea {
    min-height: 168px;
  }

  #contact .footer-contact-details > h2 {
    max-width: 330px;
    margin: 28px 0 38px;
    font-size: clamp(2.8rem, 12.5vw, 3.9rem);
    line-height: 0.98;
  }

  #contact .footer-locations {
    margin-top: 48px;
  }

  #contact .footer-map-shell {
    margin-top: 48px;
  }

  #contact .footer-navigation {
    justify-items: center;
    text-align: center;
  }

  #contact .footer-navigation::before {
    left: 50%;
    transform: translateX(-50%);
  }

  #contact .footer-brand-block {
    display: grid;
    justify-items: center;
  }

  #contact .footer-brand-block .footer-logo-wordmark,
  #contact .footer-brand-block p,
  #contact .footer-brand-block .footer-outro-cta {
    margin-right: auto;
    margin-left: auto;
  }

  #contact .footer-brand-block p {
    text-align: center;
  }

  #contact .footer-links,
  #contact .footer-socials {
    width: min(100%, 320px);
    justify-self: center;
  }

  #contact .footer-nav-label {
    text-align: center;
  }

  #contact .footer-links a,
  #contact .footer-socials a {
    position: relative;
    justify-content: center;
    padding-right: 30px;
    padding-left: 30px;
    text-align: center;
  }

  #contact .footer-links a::after,
  #contact .footer-socials a > span {
    position: absolute;
    right: 8px;
  }

  #contact .fine-print {
    justify-items: center;
    gap: 16px;
    text-align: center;
  }

  #contact .fine-print > div {
    flex-wrap: wrap;
    justify-content: center;
  }

  #contact .fine-print > a:last-child {
    justify-self: center;
  }

  /* Keep the founder human and present without letting the portrait dominate. */
  #founder .founder-portrait {
    width: 66%;
    margin-inline: auto;
  }

  #founder .founder-portrait-shell {
    margin-bottom: 68px;
  }

  #founder .founder-signature-mark {
    right: -4px;
    bottom: -54px;
    width: min(132px, 38vw);
  }

  /* The guided sequence stays useful without covering the mobile page. */
  .scroll-nudge {
    right: 12px;
    bottom: 14px;
    width: min(252px, calc(100vw - 24px));
    min-height: 72px;
    padding: 12px 50px 12px 14px;
    border-radius: 6px;
    box-shadow: 5px 5px 0 rgba(255, 90, 0, 0.2);
  }

  .scroll-nudge a strong,
  .scroll-nudge .nudge-subcopy {
    max-width: 178px;
  }

  .scroll-nudge a strong {
    font-size: 0.78rem;
    line-height: 1.22;
  }

  .scroll-nudge .nudge-subcopy {
    margin-top: 4px;
    font-family: var(--mono-font);
    font-size: 0.61rem;
    line-height: 1.3;
    text-transform: uppercase;
  }

  .scroll-nudge button {
    top: 50%;
    right: 3px;
    width: 44px;
    height: 44px;
    border: 0;
    transform: translateY(-50%);
  }

  .scroll-nudge button::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(11, 13, 18, 0.42);
  }
}

@media (min-width: 781px) {
  main [id] {
    scroll-margin-top: 0;
  }

  .industry-more,
  .system-carousel-dots {
    display: none;
  }
}

@media (min-width: 1040px) {
  /* Keep the scrolling scenario visible above the grid, but beneath real content. */
  #main {
    z-index: auto;
  }

  .agent-rail {
    left: 14px;
    width: 168px;
    padding: 12px;
    z-index: 1 !important;
  }

  .agent-rail strong {
    font-size: 0.94rem;
  }

  .agent-rail span {
    font-size: 0.68rem;
    line-height: 1.35;
  }

  .agent-rail[data-active-section="diagnosis"],
  .agent-rail[data-active-section="founder"],
  .agent-rail[data-active-section="booking"],
  .agent-rail[data-active-section="contact"] {
    opacity: 0 !important;
    visibility: hidden !important;
  }
}

@media (max-width: 380px) {
  .hero {
    padding-inline: 16px;
  }

  #ghost-period,
  #scenarios,
  #client-voices,
  #case-studies,
  #shift,
  #roadmap,
  #components,
  #ownership,
  #industries,
  #diagnosis,
  #founder,
  #booking {
    padding-inline: 18px;
  }

  #ghost-period h2,
  #scenarios h2,
  #client-voices h2,
  #shift h2,
  #roadmap > .section-intro h2,
  #components > .section-intro h2,
  #ownership > .section-intro h2,
  #industries h2,
  #diagnosis .quiz-intro h2,
  #founder h2,
  #booking h2,
  .build-close h2 {
    font-size: clamp(2.2rem, 10.2vw, 2.65rem);
  }

  .case-gallery-proof {
    min-height: 400px;
  }

  .case-gallery-stage {
    min-height: 320px;
  }

  .case-gallery-stage figure {
    min-height: 280px;
  }

  .case-gallery-stage img {
    max-height: 300px;
  }

  .hero-media .live-system-preview {
    margin-bottom: 26px;
  }

  .hero-copy h1 {
    margin-bottom: 24px;
  }

  .scroll-nudge {
    right: 10px;
    width: min(236px, calc(100vw - 20px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-nudge {
    transition: none;
  }

  .industry-more > span {
    transition: none;
  }

  .system-carousel-dots button::before {
    transition: none;
  }
}
