/* Unicus mobile responsive overrides */

/* Platform: tablets keep the animated diagram; phones get animated stacked cards */
@media (min-width: 600px) and (max-width: 899px) {
  .ua-platform__diagram { display: block; margin-top: 28px; }
  .ua-platform__mobile { display: none; }
  .ua-platform__stage { min-height: 0; }
}
@media (max-width: 899px) {
  .ua-platform__buttons { display: flex; }
}
@media (max-width: 599px) {
  .ua-platform__mobile .ua-platform__node { opacity: .3 !important; transform: translateY(6px) !important; transition: opacity .6s ease, transform .6s ease, border-color .6s ease, box-shadow .6s ease, background-color .6s ease; }
  .ua-platform__mobile .ua-platform__node.is-shown { opacity: 1 !important; transform: none !important; }
  .ua-platform__mobile .ua-platform__node.is-active { border-color: #245AE2; box-shadow: 0 0 0 3px rgba(36,90,226,.15), 0 8px 20px rgba(36,90,226,.15); }
  .ua-platform__mobile-group:not(:last-child)::after { background: #E1E6F5; transition: background .4s ease; }
  .ua-platform__mobile-group.is-done:not(:last-child)::after { background: linear-gradient(#245AE2, #aabaf7); }
  .ua-platform__mobile-delivery { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px auto 0; max-width: 660px; padding: 12px 14px; border-radius: 10px; background: #EEEEFF; border: 1px solid #D6D6FF; opacity: 0; transform: translateY(8px); transition: opacity .45s ease, transform .45s ease; }
  .ua-platform__mobile-delivery.is-shown { opacity: 1; transform: none; }
  .ua-platform__mobile-delivery strong { font-size: 13px; font-weight: 650; }
  .ua-platform__mobile-delivery span { font-family: monospace; font-size: 11px; color: #545A67; }
}
@media (min-width: 600px) { .ua-platform__mobile-delivery { display: none; } }

/* Use cases: tap accordion on phones/tablets */
@media (max-width: 999px) {
  .usecases-section.uc-tap-mode { height: auto !important; }
  .usecases-section.uc-tap-mode .demo-wrap { height: auto !important; }
  .usecases-section.uc-tap-mode .case-accordion { transform: none !important; }
  .usecases-section .case-item:nth-child(n) { margin-inline: 0; }
  .usecases-section .case-item + .case-item { margin-top: 10px; }
  .usecases-section .case-tab { border-radius: 16px; }
  .usecases-section .case-item.is-active .case-tab { border-radius: 20px 20px 0 0; }
  .usecases-section .case-toggle { display: inline-flex; }
  .usecases-section .case-tab-inner { justify-content: space-between; gap: 12px; }
}
@media (max-width: 600px) {
  .usecases-section .case-tab { font-size: 15px; padding: 14px 16px; }
  .usecases-section .case-item.is-active .case-tab-inner { margin: 8px 8px 0; padding: 14px 16px; min-height: 0; }
  .usecases-section .case-tab-label { gap: 12px; }
  .usecases-section .case-tab-icon { width: 24px; height: 24px; flex-basis: 24px; }
  .usecases-section .case-panel { padding: 18px 16px 20px; gap: 18px; }
  .usecases-section .case-panel h3 { font-size: 22px; margin-bottom: 12px; }
  .usecases-section .case-panel p { font-size: 15px; line-height: 1.6; }
  .usecases-section .case-visual__body { min-height: 0; padding: 14px; }
  .usecases-section .case-visual__crumb { display: none; }
  .usecases-section .case-visual__topbar { justify-content: space-between; }
  .usecases-section .case-visual__registry-grid { grid-template-columns: 1fr; min-height: 0; }
  .usecases-section .case-visual__source-paper { min-height: 0; transform: none; }
  .usecases-section .case-visual__arrow { transform: rotate(90deg); line-height: 1; }
  .usecases-section .case-visual__table-wrap { overflow-x: auto; }
  .usecases-section .case-visual__screening-grid { grid-template-columns: 1fr; }
  .usecases-section .case-visual__metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
}

/* How it works: on phones, no tabs, no autoplay, no visuals — the four stages stacked as plain text */
@media (max-width: 767px) {
  .how-card { min-height: 0; padding: 8px 20px; border-radius: 24px; }
  .how-card .tab-list { display: none; }
  .how-card .stage-tab.active:before { display: none; animation: none; }
  .how-card .stage-panel,
  .how-card .stage-panel[hidden] { display: block !important; min-height: 0; padding: 24px 0; animation: none !important; opacity: 1 !important; transform: none !important; }
  .how-card .stage-panel + .stage-panel { border-top: 1px solid #E6E8EE; }
  .how-card .agent-console,
  .how-card .automate-console,
  .how-card .code-console,
  .how-card .provenance-console { display: none !important; }
  .how-card .stage-copy { max-width: none; }
  .how-card .stage-copy .eyebrow { margin-bottom: 10px; }
  .how-card .stage-copy h3 { font-size: 22px; line-height: 1.3; margin: 0 0 12px; }
  .how-card .stage-copy p, .how-card .stage-copy li { font-size: 15px; line-height: 1.6; }
  .how-card .check-list { margin-top: 12px; }
  .how-card .tag-set { margin-top: 14px; }
  .how-card .definition-row { margin-top: 12px; }
}

/* Audiences: on phones, no tabs — all six teams stacked as plain text */
.audience-stack { display: none; }
@media (max-width: 767px) {
  .audiences-section .audience-layout { display: none; }
  .audiences-section .audience-stack { display: block; }
  .audience-stack__item { padding: 24px 0; }
  .audience-stack__item + .audience-stack__item { border-top: 1px solid #E6E8EE; }
  .audience-stack__label { margin: 0 0 10px; color: #245AE2; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
  .audience-stack__item h3 { font-size: 21px; line-height: 1.3; margin: 0 0 14px; font-weight: 600; }
  .audience-stack .audience-benefits { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .audience-stack .audience-benefits article { padding: 0px 30px; border: 0; background: none; box-shadow: none; min-height: 0; }
  .audience-stack .audience-benefits b { display: block; font-size: 15px; margin-bottom: 4px; }
  .audience-stack .audience-benefits p { margin: 0; font-size: 15px; line-height: 1.55; color: #545A67; }
}

/* Results: compact 2×2 stat grid on phones */
@media (max-width: 767px) {
  .results-section, #results { overflow-x: clip; }
  #results .web_icons { display: none; }
  #results .results-copy h2 { margin: 10px 0 20px; }
  #results .result-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid rgba(127,140,170,.25); }
  #results .stat-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px 12px 18px 0; min-height: 0; border-bottom: 1px solid rgba(127,140,170,.25); }
  #results .stat-row:nth-child(even) { padding-left: 14px; padding-right: 0; border-left: 1px solid rgba(127,140,170,.25); }
  #results .stat-row strong { font-size: 32px; line-height: 1; }
  #results .stat-row p { margin: 0; font-size: 13px; line-height: 1.45; }
  #results .stat-row p b { display: block; font-size: 15px; line-height: 1.3; margin-bottom: 4px; }
}

/* ---------- All pages: general mobile safety ---------- */
@media (max-width: 767px) {
  /* 'clip' (not 'hidden') so sticky scroll sections like the globe keep working */
  html, body { overflow-x: clip; }
  main img, footer img { max-width: 100%; height: auto; }
  .hero-lead { min-width: 0 !important; max-width: 100% !important; }
  .btn { min-height: 44px; }
  .button-row { flex-wrap: wrap; gap: 10px; }
}

/* Homepage problem section: keep the globe animation, but make card text readable */
@media (max-width: 680px) {
  .ug-section .ug-source-card { max-width: 150px; }
  .ug-section .ug-source-title { font-size: 11px; }
  .ug-section .ug-source-value { font-size: 12px; }
  .ug-section .ug-source-status { font-size: 11px; }
  .ug-section .ug-verified, .ug-section .ug-result-caption { font-size: 11px; }
  .ug-section .ug-description { font-size: 14px; }
}

/* Platform page: step buttons use the full width (labels were wrapping at ~125px) */
@media (max-width: 767px) {
  .configure-button { width: 100%; }
  .configure-label { flex: 1 1 auto; min-width: 0; width: auto !important; max-width: none !important; }
}

/* Readable minimum text size inside mockup visuals; hide decorative icons that hang off the edge */
@media (max-width: 767px) {
  .web_icons, .usecase_icons, .use_caseleft { display: none !important; }
  .case-visual__badge, .case-visual__source-paper strong, .case-visual__source-paper span,
  .case-visual__field small, .case-visual__field em, .case-visual__heading span { font-size: 11px; }
  .case-visual__source-paper b, .case-visual__field strong { font-size: 13px; }
  .uar-kind { font-size: 11px; }
  [class^="configure-label-"], [class^="automate-detail-"] { font-size: 11px !important; }
}

/* Phones: sections appear without sliding, so scrolling feels steady */
@media (max-width: 767px) {
  .has-scroll-reveal main > .section.scroll-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Globe section: same side padding as the rest of the page */
@media (max-width: 680px) {
  .ug-section .ug-container { width: min(100% - 48px, 510px); }
}

/* Use cases on phones: text only — no mockups or icons, compact rows */
@media (max-width: 767px) {
  .usecases-section .case-visual,
  .usecases-section .case-tab-icon { display: none !important; }
  .usecases-section .case-tab-label { gap: 0; }
  .usecases-section .case-tab { font-size: 16px; font-weight: 600; padding: 16px 18px; border-radius: 14px; }
  .usecases-section .case-item.is-active .case-tab { border-radius: 14px 14px 0 0; }
  .usecases-section .case-item.is-active .case-tab-inner { margin: 0; padding: 0; min-height: 0; background: none; border-radius: 0; }
  .usecases-section .case-tab-inner { min-height: 0; padding: 0; }
  .usecases-section .case-toggle { font-size: 22px; color: #245AE2; }
  .usecases-section .case-panel { display: block; padding: 0 18px 20px; border-radius: 0 0 14px 14px; }
  .usecases-section .case-panel .eyebrow-blue { display: none; }
  .usecases-section .case-panel h3 { font-size: 18px; line-height: 1.35; margin: 0 0 8px; }
  .usecases-section .case-panel p { font-size: 15px; line-height: 1.6; max-width: none; }
  .usecases-section .case-item + .case-item { margin-top: 8px; }
}

/* Dark fallback colour behind white text, in case the background image is slow or fails to load */
.results-section { background-color: #061217; }
.cta-section { background-color: #061217; }

/* FAQ: equal side padding on phones */
@media (max-width: 767px) {
  .faq-section > .container { width: auto !important; max-width: none; margin-left: 24px !important; margin-right: 24px !important; padding: 0; }
  .faq-section .faq-grid { width: 100%; }
  .faq-section .faq-grid details { width: 100%; max-width: none; }
  .faq-section .faq-grid details p { margin-right: 0; }
}

/* Footer (every page): equal side padding on phones */
@media (max-width: 767px) {
  .site-footer > .container { width: auto !important; max-width: none; margin-left: 24px !important; margin-right: 24px !important; padding-left: 0; padding-right: 0; }
}

/* Every page: consistent 24px side padding for all content containers on phones */
@media (max-width: 767px) {
  main .container, main .unicus_container, footer .container, .stories-container {
    width: auto !important; max-width: none !important;
    margin-left: 24px !important; margin-right: 24px !important;
    padding-left: 0 !important; padding-right: 0 !important;
  }
}

/* Globe section: space above "Unicus AI brings it all together…" on phones */
@media (max-width: 680px) {
  .ug-section .ug-outcome { padding-top: 32px; }
}

/* Use cases: no inner scroll box on phones — the list flows with the page */
@media (max-width: 999px) {
  .usecases-section > .demo-wrap, .usecases-section .demo-wrap {
    height: auto !important; max-height: none !important;
    overflow: visible !important; position: relative !important; top: auto !important;
  }
  .usecases-section { height: auto !important; min-height: 0 !important; }
}

/* CTAs on phones: buttons stacked, full width, same size, label centred */
@media (max-width: 767px) {
  .button-row { flex-direction: column; align-items: stretch; gap: 12px; width: 100%; }
  .button-row .btn { width: 100%; justify-content: center; margin: 0; }
  .cta-section .cta-layout { gap: 24px; }
  .cta-section .section-title { margin-bottom: 20px; }
}

/* Use cases on phones: remove the white inner frame inside each grey row; one clean row style */
@media (max-width: 767px) {
  .usecases-section .case-tab-inner,
  .usecases-section .case-item.is-active .case-tab-inner { border: 0 !important; border-radius: 0; background: none; }
  .usecases-section .case-tab { background: #F2F4F9; border: 1px solid #E0E5ED; }
  .usecases-section .case-item.is-active .case-tab { background: #fff; border-bottom: 0; }
  .usecases-section .case-item.is-active .case-panel { background: #fff; border: 1px solid #E0E5ED; border-top: 0; }
}

/* Use cases on phones: the row title already names the use case, so hide the repeated heading inside the opened panel */
@media (max-width: 767px) {
  .usecases-section .case-panel h3 { display: none; }
  .usecases-section .case-panel { padding-top: 4px; }
}

/* Customer stories on phones: cards fit inside the page margins (were cut off on the left) */
@media (max-width: 680px) {
  .stories-section { padding-inline: 0 !important; }
  .story-viewport { container-type: inline-size; width: 100% !important; margin-left: 0 !important; scroll-snap-type: x mandatory; }
  .story-track { gap: 12px; padding-inline: 0 !important; min-width: 0; }
  .story-card { flex: 0 0 100cqw !important; width: 100cqw; scroll-snap-align: center; }
  .story-metrics { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-metrics b { font-size: 24px; overflow-wrap: anywhere; }
  .story-card { min-height: 0; }
  .carousel-footer { margin-top: 24px; gap: 14px; }
  .story-nav { width: 44px; height: 44px; border: 1px solid #DCE2E9; }
  .story-dots { gap: 8px; }
  .story-dot { width: 8px; height: 8px; background: #C5CBD3; }
  .story-dot[aria-current="true"] { width: 8px; height: 8px; background: #245AE2; transform: none; }
}

/* FAQ on phones: the question-mark icon sat on top of the heading — place it above, centred */
@media (max-width: 767px) {
  .faq-section .faq_icons { position: static !important; display: flex; justify-content: center; margin: 0 auto 12px; transform: none !important; }
  .faq-section .faq_icons img { width: 48px; height: auto; }
  .faq-section .section-heading { display: flex; flex-direction: column; align-items: center; }
  .faq-section .faq_icons { order: -1; }
}

/* Customer stories on phones: cards stacked vertically — read by scrolling down, no swiping needed */
@media (max-width: 680px) {
  .story-viewport { overflow: visible !important; scroll-snap-type: none !important; container-type: normal; cursor: auto; }
  .story-track { flex-direction: column; width: 100% !important; min-width: 0; gap: 14px; transform: none !important; }
  .story-card { flex: 0 0 auto !important; width: 100% !important; opacity: 1 !important; transform: none !important; filter: none !important; }
  .carousel-footer { display: none; }
}

/* ---------- Platform page on phones ----------
   Configure / Automate / Deploy / Govern: text + steps only, no app mockups. */
@media (max-width: 767px) {
  /* App mockups stay, placed full-width under the text */
  #connect .demo-frame, #automate .demo-frame, #deploy .demo-frame, #govern .demo-frame { width: 100% !important; max-width: none !important; margin: 24px 0 0 !important; }
  #connect .section-grid, #automate .section-grid-2, #deploy .section-grid, #govern .section-grid {
    display: block !important; grid-template-columns: none !important; height: auto !important; min-height: 0 !important;
    width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important;
  }
  #connect, #automate, #deploy, #govern { padding: 56px 24px !important; min-height: 0 !important; height: auto !important; }
  #connect .configure-stack, #automate .configure-stack, #deploy .configure-stack, #govern .configure-stack { width: 100%; max-width: none; padding: 0; }
  .configure-detail, .automate-detail-2 { font-size: 12px !important; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }
  .configure-title, .automate-title { font-size: 28px !important; line-height: 1.2 !important; margin-bottom: 14px !important; }
  .configure-description, .automate-description { font-size: 16px !important; line-height: 1.6 !important; max-width: none !important; }
  /* Steps become a simple numbered list (they only drove the hidden mockup) */
  .configure-stack-2 { counter-reset: pstep; display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
  .configure-stack-2 .configure-button, .configure-stack-2 .govern-button {
    counter-increment: pstep; cursor: pointer; width: 100%; min-height: 0;
    display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px !important;
    border: 1px solid #E3E6EE !important; border-radius: 10px; background: #fff !important; background-image: none !important;
  }
  #automate .configure-stack-2 .configure-button { background: rgba(255,255,255,.06) !important; border-color: rgba(255,255,255,.14) !important; }
  .configure-stack-2 .configure-button::before, .configure-stack-2 .govern-button::before {
    content: counter(pstep); flex: 0 0 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
    background: #245AE2; color: #fff; font-size: 12px; font-weight: 600; line-height: 1;
  }
  .configure-stack-2 .configure-label { font-size: 15px !important; font-weight: 500 !important; line-height: 1.4; color: inherit; }
  #automate .configure-stack-2 .configure-label { color: #fff !important; }
}

@media (max-width: 767px) {
  #automate .configure-stack-2 .configure-button,
  #automate .configure-stack-2 .configure-button * { color: #fff !important; opacity: 1 !important; }
}

/* Platform steps on phones: no numbers */
@media (max-width: 767px) {
  .configure-stack-2 .configure-button::before, .configure-stack-2 .govern-button::before { content: none !important; display: none !important; }
}

@media (max-width: 767px) {
  /* Current step highlighted (steps drive the mockup) */
  .configure-stack-2 .configure-button[aria-current="step"], .configure-stack-2 .govern-button[aria-current="step"] { border-color: #245AE2 !important; box-shadow: 0 0 0 2px rgba(36,90,226,.15); }
  #automate .configure-stack-2 .configure-button[aria-current="step"] { border-color: #5B86F2 !important; background: rgba(36,90,226,.18) !important; }
}

/* Platform page "How the Platform Works": section was capped at 570px, hiding 3 of the 4 cards */
@media (max-width: 767px) {
  .how_platform_works { max-height: none !important; height: auto !important; overflow: visible !important; }
  .how_platform_works .about-principles__grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 24px 12px; }
  .how_platform_works .about-principles__card { padding: 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
  .how_platform_works .about-principles__illustration { width: 110px; height: 110px; display: block !important; opacity: 1 !important; margin: 0 auto; }
  .how_platform_works .about-principles__card h3 { font-size: 18px; margin: 10px 0 6px; }
  .how_platform_works .about-principles__description { font-size: 14px; line-height: 1.5; }
}

/* About page "What we do" on phones: no right-side animated mockup; text uses the full width */
@media (max-width: 767px) {
  .about-what-we-do .preview-inner { display: none !important; }
  .about-what-we-do__content { display: block !important; grid-template-columns: none !important; padding: 0 !important; }
  .about-what-we-do__copy { width: 100% !important; max-width: none !important; }
  .about-what-we-do__divider { width: 100%; }
  .about-what-we-do h2 { font-size: 28px; line-height: 1.2; }
  .about-what-we-do__description { font-size: 16px; line-height: 1.6; }
}

/* Platform mockups on phones: drop the dark sidebar and render at 600px so they scale up ~1.5x and are readable */
@media (max-width: 767px) {
  #platform-page .demo-canvas, #platform-page .demo-canvas-2 { width: 600px !important; grid-template-columns: minmax(0, 1fr) !important; }
  #platform-page .demo-sidebar, #platform-page .demo-sidebar-2 { display: none !important; }
  .configure-stack-2 .configure-button, .configure-stack-2 .govern-button { width: 100% !important; box-sizing: border-box; }
}

/* About page teams section on phones: keep the desktop tab interaction (tap a team, panel swaps with a fade) */
@keyframes ua-audience-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 767px) {
  .about_audience .audience-layout { display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .about_audience .audience-stack { display: none !important; }
  .about_audience .audience-nav { display: flex; flex-direction: column; gap: 4px; }
  .about_audience .audience-nav button { min-height: 44px; text-align: left; font-size: 18px; line-height: 1.3; padding: 8px 0; transition: opacity .3s ease, color .3s ease; }
  .about_audience .audience-panel > * { animation: ua-audience-in .45s ease both; }
  .about_audience .audience-panel > *:nth-child(2) { animation-delay: .08s; }
  .about_audience .audience-panel h3 { font-size: 21px; line-height: 1.3; }
  .about_audience .audience-benefits p { font-size: 15px; line-height: 1.55; }
}
@media (prefers-reduced-motion: reduce) { .about_audience .audience-panel > * { animation: none; } }

/* About teams on phones (update): no team menu — all team details shown directly, each fading in */
@media (max-width: 767px) {
  .about_audience .audience-layout { display: none !important; }
  .about_audience .audience-stack { display: block !important; }
  .about_audience .audience-stack__item { animation: ua-audience-in .5s ease both; }
}

/* About principles on phones: restore the desktop stacking-cards scroll (each card sticks and the next slides over it) */
@media (max-width: 899px) {
  .principles-section, .principles-layout, .principles-card-list { overflow: visible !important; }
  .principles-card { position: sticky !important; top: 84px !important; }
  .principles-card:nth-child(2) { top: 96px !important; }
  .principles-card:nth-child(3) { top: 108px !important; }
  .principles-card:nth-child(4) { top: 120px !important; }
}

/* Contact page on phones: form directly after the heading */
@media (max-width: 767px) {
  .contactus-layout { display: flex !important; flex-direction: column; gap: 32px; }
  .contactus-intro { display: contents !important; }
  .contactus-intro > h1 { order: 1; margin-bottom: 0; }
  .contactus-form-card { order: 2; }
  .contactus-description { order: 3; margin: 0; }
  .contactus-features { order: 4; margin: 0; }
}

/* Platform "How it works" on phones: tidy text alignment (description lines stacked and centred) */
@media (max-width: 767px) {
  .how_platform_works .about-principles__grid { width: auto !important; margin-inline: 24px !important; align-items: start; }
  .how_platform_works .about-principles__description span { display: block; margin: 0 !important; padding: 0 !important; text-align: center; }
  .how_platform_works .about-principles__description { width: 100%; text-wrap: balance; }
}

/* Platform "How it works" 2x2 on phones: divider lines sit in the gaps, never across text */
@media (max-width: 767px) {
  .how_platform_works .about-principles__grid { gap: 40px 24px !important; }
  .how_platform_works .about-principles__card { position: relative; }
  .how_platform_works .about-principles__card::after { left: auto !important; right: -12px !important; top: 0 !important; bottom: 0 !important; height: auto !important; }
  .how_platform_works .about-principles__card:nth-child(2n)::after { display: none !important; }
  .how_platform_works .about-principles__card:nth-child(n+3)::before { top: -20px !important; left: 0 !important; right: 0 !important; width: auto !important; }
  .how_platform_works .about-principles__card:nth-child(-n+2)::before { display: none !important; }
}
