/* Phones (760 px and narrower): the site behaves like a phone app. Loaded after every other stylesheet, so these rules
 * win over the desktop and tablet ones without !important (one marked exception). Above 760 px nothing here applies
 * except hiding the phone-only elements (the tab bar, the card dots), so desktop and tablet stay as they are.
 * The behaviour is the phone block at the end of site.js.
 * Massimo, 28 Oct 2026: "easier to navigate and cleaner", then "just make it mobile native".
 * - A bottom tab bar (Home, Tour, Menu, Contact Sales) is always in reach of the thumb.
 * - The top bar is the logo only; it tucks away while scrolling down and comes back on the way up.
 * - The menu and the tour pop-ups open as sheets from the bottom; the menu closes on a tap outside or a swipe down.
 * - Card rows swipe sideways with dots; every tap target is at least 44 px. */
.tabbar, .pdots, .sheet-x, .vd-acts { display: none; }

@media (max-width: 760px) {
  :root { --tab-h: calc(3.75rem + env(safe-area-inset-bottom, 0px)); }
  a, button, summary, [role='button'] { -webkit-tap-highlight-color: transparent; }

  /* ── Top bar: the logo, centred. Menu and Contact Sales live in the tab bar. ── */
  .nav { transition: transform 0.32s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease); }
  .nav .shell { justify-content: center; }
  .nav-links, .burger { display: none; }
  html.nav-tuck:not(.menu-open) .nav:not(:focus-within) { transform: translateY(-100%); }
  /* Once the page scrolls, the top bar over a cover photo turns to dark glass, so the cover's text and buttons never
     show through behind the logo (the tour page already does this, see tour.css). */
  .nav.over.lifted { background: rgba(8, 10, 14, 0.78); border-bottom-color: rgba(255, 255, 255, 0.1); -webkit-backdrop-filter: blur(0.875rem) saturate(140%); backdrop-filter: blur(0.875rem) saturate(140%); }

  /* ── Tab bar ── */
  .tabbar { position: fixed; inset: auto 0 0 0; z-index: 57; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.75fr); align-items: center; gap: 0.25rem;
    height: var(--tab-h); padding: 0 0.75rem env(safe-area-inset-bottom, 0px); background: rgba(246, 245, 241, 0.9); border-top: 1px solid var(--rule);
    -webkit-backdrop-filter: blur(0.875rem) saturate(140%); backdrop-filter: blur(0.875rem) saturate(140%); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; min-height: 3.25rem; padding: 0; border: 0; background: none; color: var(--slate);
    font: 500 0.6875rem/1 var(--sans); letter-spacing: 0.01em; cursor: pointer; transition: color 0.2s ease, opacity 0.15s ease; }
  .tab svg { display: block; width: 1.375rem; height: 1.375rem; }
  .tab[aria-current='page'], .tab.is-cur, .tab[aria-expanded='true'] { color: var(--accent); }
  .tab[aria-current='page'] svg, .tab.is-cur svg { stroke-width: 2; }
  .tab:active { opacity: 0.55; }
  .tab-cta { display: flex; align-items: center; justify-content: center; min-height: 2.75rem; margin-left: 0.25rem; padding: 0 0.75rem; border-radius: 999px; background: var(--ink); color: var(--paper);
    font: 500 0.875rem/1 var(--sans); white-space: nowrap; transition: background 0.2s ease, transform 0.15s ease; }
  .tab-cta[aria-current='page'] { background: var(--accent); }
  .tab-cta:active { transform: scale(0.96); }
  /* Nothing hides behind the tab bar: the first screen's buttons, the end of the footer, the privacy notice */
  .cv-body { padding-bottom: calc(2.5rem + var(--tab-h)); }
  footer { padding-bottom: calc(1.25rem + var(--tab-h)); }
  .consent { bottom: calc(var(--tab-h) + 0.5rem); }

  /* ── Menu: a sheet from the bottom over a dimmed page ── */
  html.menu-open .nav { transform: none; background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; } /* no containing block for the sheet */
  html.menu-open .nav > .shell { visibility: hidden; }
  html.menu-open body::after { content: ''; position: fixed; inset: 0; z-index: 59; background: rgba(8, 10, 14, 0.5); animation: ph-fade 0.25s ease both; }
  /* The sheet sits on the tab bar, which stays in sight with Menu turned into Close */
  html.menu-open .tabbar { z-index: 61; }
  .tab-menu .t-close, .tab-menu[aria-expanded='true'] .t-open { display: none; }
  .tab-menu[aria-expanded='true'] .t-close { display: block; }
  .mobile.is-open { inset: auto 0 var(--tab-h) 0; height: auto; max-height: min(calc(88dvh - var(--tab-h)), 42rem); padding: 0 1.5rem 1rem; gap: 0; border: 0; border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -1.25rem 3rem -1.5rem rgba(8, 10, 14, 0.45); animation: ph-sheet 0.34s var(--ease) backwards; transition: transform 0.25s var(--ease); }
  .mobile.is-open::before { content: ''; justify-self: center; width: 2.25rem; height: 0.3125rem; margin: 0.5rem 0 0.25rem; border-radius: 999px; background: var(--rule-strong); }
  .mobile a { display: flex; align-items: center; min-height: 3rem; padding: 0.5rem 0; }
  .mobile a:active { background: var(--steel-2); }
  .mobile a[aria-current='page'] { color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); padding-left: 0.75rem; }
  .mobile .k { margin-top: 1.125rem; margin-bottom: 0.125rem; }
  .mobile .k:first-of-type { margin-top: 0.5rem; }
  .mobile-cta { display: none; } /* Contact Sales is in the tab bar right under the sheet */
  .sheet-x { position: absolute; top: 0.625rem; right: 1rem; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; border-radius: 999px; background: var(--steel); color: var(--ink); }
  .sheet-x svg { width: 1.25rem; height: 1.25rem; }
  .sheet-x:active { background: var(--rule); }

  /* ── Cards (capabilities, who we serve, related pages): one swipeable row with dots ── */
  .pcards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; gap: 0.75rem; margin-inline: -1.5rem; padding-inline: 1.5rem; scroll-padding-inline: 1.5rem;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .pcards::-webkit-scrollbar { display: none; }
  .pcards > .pcard { aspect-ratio: 1 / 1; scroll-snap-align: start; }
  .pcards > .pcard.reveal { opacity: 1; transform: none; }
  .pcard:active { transform: scale(0.985); }
  .pcard-body { left: 1.25rem; right: 1.25rem; bottom: 1.25rem; }
  .pcard h3, .pcard.sm h3 { font-size: 1.55rem; }
  .pdots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 0.875rem; }
  .pdots i { width: 0.375rem; height: 0.375rem; border-radius: 999px; background: var(--rule-strong); transition: width 0.25s var(--ease), background 0.25s ease; }
  .pdots i.on { width: 1.25rem; background: var(--ink); }

  /* ── Buttons and links: pressed state; no hover lift on touch screens ── */
  .btn:active { transform: scale(0.97); }
  .see-all { min-height: 2.75rem; }
  .pillars { gap: 2.25rem; }
  .pillars h3 { margin: 0.9rem 0 0.6rem; font-size: 1.45rem; }

  /* ── Footer: shorter, with links big enough to tap ── */
  footer { padding-top: 2.75rem; }
  .fgrid { gap: 1.75rem 1.5rem; padding-bottom: 1.5rem; }
  .fgrid > div:first-child { grid-column: 1 / -1; }
  .fgrid > div:nth-child(3) { grid-column: 1 / -1; order: 4; }
  .fgrid .tag { max-width: 34ch; font-size: 1.05rem; }
  .fgrid h4 { margin-bottom: 0.25rem; }
  .fgrid a:not(.brand) { display: flex; align-items: center; min-height: 2.75rem; padding: 0.25rem 0; line-height: 1.35; }
  .fbar { gap: 0.25rem; padding-top: 0.75rem; }
  .fbar > span:last-child a { display: inline-flex; align-items: center; min-height: 2.75rem; }

  /* ── Tour: the step bar moves up when the top bar tucks away, and names the current step in full ── */
  .vd-bar { transition: transform 0.35s var(--ease), opacity 0.25s ease, visibility 0s linear 0.35s, top 0.32s var(--ease); }
  .vd-bar.is-on { transition: transform 0.35s var(--ease), opacity 0.25s ease, visibility 0s, top 0.32s var(--ease); }
  html.nav-tuck:not(.menu-open) .vd-bar { top: 0; }
  .vd-bar a { height: 2.75rem; }
  .vd-bar ol:has(li:nth-child(1) a.is-now) { grid-template-columns: minmax(0, 1fr) 3.5rem 3.5rem; }
  .vd-bar ol:has(li:nth-child(2) a.is-now) { grid-template-columns: 3.5rem minmax(0, 1fr) 3.5rem; }
  .vd-bar ol:has(li:nth-child(3) a.is-now) { grid-template-columns: 3.5rem 3.5rem minmax(0, 1fr); }
  .vd-cv:active, .vd-doc:active { transform: scale(0.98); }

  /* Tour app windows: the title fits on one line ("Snowstone | Knowledge graph"); the finding's name pill is left out,
     because the finding card under the graph names it */
  .vi-bar .vi-prod { padding: 0 10px 0 0; font-size: 15px; }
  .vi-bar .vi-app { min-width: 0; padding: 0 10px; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ag-pill { display: none; }
  /* Tour step 2: a shorter graph, so the records fill it instead of leaving it half empty */
  .ag-cv, .ag-over { height: 16.5rem; }
  .ag-status { top: calc(16.5rem - 3.1rem); }

  /* Tour step 1: connector controls big enough for a finger */
  .vi-chip { height: 2.5rem; }
  /* The filter chips scroll sideways: the last one fades out instead of being cut off mid-word */
  .vi-chips { padding-right: 2.5rem; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 3rem), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 3rem), transparent); }
  .vi-go, .vi-btn { height: 2.75rem; }
  .vi-x { width: 2.75rem; height: 2.75rem; }
  .vi-more { min-height: 2.75rem; padding: 0 0.75rem; }

  /* Tour step 3: the documents show as soon as they scroll in, instead of waiting for the animation above them,
     which left a blank screen on phones */
  .vd .vd-get, .vd .vd-disc { opacity: 1; transform: none; }
  .vd .vd-viewer .tx-bar .tx-btn { height: 2.75rem; }
  .vd .vd-viewer .tx-bar .tx-ibtn { width: 2.75rem; }
  /* Massimo, 28 Oct: the three documents as icons, then a small Download and Full screen (site.js); no lines running
     into the icons; the big Download button, the hint and the zoom row only in full screen */
  .vd-s3ln { display: none; }
  .vd-get { position: relative; }
  .vd .vd-docs { grid-template-columns: repeat(3, 3.75rem); justify-content: start; padding: 8px 7.25rem 0 8px; }
  .vd-doc-m { min-height: 2.75rem; padding: 9px 0; }
  .vd-doc-m img { width: 1.625rem; height: 1.625rem; }
  .vd-doc-m b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* kept for screen readers */
  .vd-acts { position: absolute; top: 0.4375rem; right: 0.5rem; z-index: 3; display: flex; gap: 0.375rem; }
  .vd-act { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid #DCDFE2; border-radius: 0.5rem; background: #fff; color: var(--ink); }
  .vd-act svg { width: 1.25rem; height: 1.25rem; }
  .vd-act:active { background: var(--steel-2); }
  .vd .vd-viewer .tx-head, .vd-get:not(.is-full) .tx-bar { display: none; }
  /* The plan page sits narrower, with grey either side: there a finger scrolls the tour page, and on the page it moves
     through the plan (explorer-plan.js) */
  .vd .vd-viewer .xw-desk { width: 84%; margin-inline: auto; overflow: hidden; }
  /* Full screen: the documents fill the phone; the plan scrolls on its own again */
  html.ph-full, html.ph-full body { overflow: hidden; }
  html.ph-full .nav, html.ph-full .tabbar, html.ph-full .vd-bar { visibility: hidden; }
  #vd-get.is-full { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; margin: 0; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); background: var(--tab-bg); }
  #vd-get.is-full .vd-docs { border-radius: 0; }
  #vd-get.is-full .vd-viewer, #vd-get.is-full .txd { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  #vd-get.is-full .tx, #vd-get.is-full .tx[data-tab='slides'] { flex: 1 1 auto; min-height: 0; height: auto; border-radius: 0; }
  #vd-get.is-full .xw-desk { width: auto; margin-inline: 0; overflow: auto; }
  /* The slide that a swipe brings in slides in from that side (explorer-slides.js) */
  .pp-stage:not(.is-zoomed) { touch-action: pan-y; }
  .pp-frame.pp-in-r { animation: ph-in-r 0.28s var(--ease) both; }
  .pp-frame.pp-in-l { animation: ph-in-l 0.28s var(--ease) both; }
  /* The Office menu rows and the PowerPoint ribbon are decoration on a phone: each document sits right under its title
     bar */
  .pp-menu, .pp-ribbon, .xw-menu, .xl-menu { display: none; }
  /* The board deck window is as tall as its slide (explorer-slides.js sizes the stage), not a full screen with empty room */
  .vd .vd-viewer .tx[data-tab='slides'] { height: auto; }

  /* ── Tour pop-ups: sheets from the bottom, full width; a swipe down on the title bar closes them (site.js) ── */
  .tu-dialog, .tu-dialog.tu-wide, .tu-mode-learn, .tu-mode-gen, .tu-mode-gen.tu-wide, .tu-dialog.tu-src169 { width: 100%; max-width: 100%; max-height: calc(100dvh - 2.5rem); margin: auto 0 0;
    border-width: 0; border-radius: 1rem 1rem 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); transform: translateY(2.5rem); transition: opacity 0.2s ease, transform 0.34s var(--ease); }
  .tu-dialog.is-in { transform: none; }
  .tu-dialog.tu-src169 { width: 100% !important; } /* the one !important: tour-ui.js sizes this window inline */
  .tu-head .tu-x, .tu-head .tu-fs { width: 2.75rem; height: 2.75rem; }
  /* The source caption sits above the two buttons instead of being squeezed between them into one letter per line */
  .tu-src169 .tu-foot { flex-wrap: wrap; gap: 0.5rem; padding: 0.625rem 0.75rem 0.75rem; }
  .tu-src169 .tu-foot .tu-rawcap { flex: 1 1 100%; }
  .tu-src169 .tu-foot .tu-open { flex: 1 1 0; justify-content: center; min-height: 2.75rem; }
  .tu-foot .tu-dl { margin-left: 0; }
}

@media (max-width: 760px) and (hover: none) {
  .btn:hover { transform: none; box-shadow: none; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .mobile.is-open, html.menu-open body::after, .pp-frame.pp-in-r, .pp-frame.pp-in-l { animation: none; }
  .nav, .vd-bar, .tu-dialog { transition: none; }
}
@keyframes ph-sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes ph-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ph-in-r { from { transform: translateX(2rem); opacity: 0.2; } to { transform: none; opacity: 1; } }
@keyframes ph-in-l { from { transform: translateX(-2rem); opacity: 0.2; } to { transform: none; opacity: 1; } }
