/* 04 · What we do on phones (<= 767px). No pinned screen, plain scroll. Services and
   integrations share one accordion, switched by two tabs set like the section's overline
   (the active one in ink). The open entry (services-ui.js placeOpen) shows its number
   above the title, then the tagline, and the copy beside a grey plate with the mark
   (tab-figure.js) that runs out to the screen's edge; the other entries stand closed in
   grey. Under it the stack is a block of its own: the desktop's grey screen with the big
   mark, the headline and the chips (services-ui.js placeTech). The scroll changes nothing. sections.css's <= 768 rules for this card use !important
   (tablets keep them); the overrides here have to as well. */

@media (max-width: 767px) {
  .s-what {
    --open-air: 40px; /* the open entry's air above and below (see "The open entry") */
    height: auto;
    padding: 0;
  }
  .s-what .what-sticky {
    position: relative;
    display: block;
    height: auto;
    padding: 0;
  }

  /* ---- The card: one column in flow ---- */
  .s-what .what-card {
    display: flex;
    flex-direction: column;
    padding: var(--section-y) var(--card-x) 0;
  }
  .s-what .what-card .what-list { display: contents; }
  .s-what .what-card .what-detail { display: none; } /* its pieces live in the open entry */
  /* ---- Tabs: the overline's type, the active one in ink behind the slash ---- */
  .s-what .what-tabs {
    display: flex;
    /* = the slash's own air to its word (1.3em of the slash, ~12.8px; the word's trailing
       letter-spacing and the slash's cancel out), so word / word is evenly spaced */
    gap: 12px;
    margin-bottom: 40px;
  }
  .what-tab {
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: var(--track-caps);
    text-transform: uppercase;
    color: var(--quiet); /* the tab that is off: lighter than the one in ink, and still 4.67:1 on the white card (was #a3a5ac, 2.46:1) */
    cursor: pointer;
    transition: color var(--dur-base) ease;
  }
  .what-tab::before {
    content: "/";
    margin-right: 1.3em;
    font-size: 0.82em;
  }
  .what-tab.is-on {
    color: var(--ink);
    font-weight: 500;
  }
  /* The tabs name the subsection; the h2 stays for screen readers only */
  .s-what .what-card .what-sec {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* ---- Groups: the tab's one in flow, the other out; the stack's lives in its block ---- */
  .s-what .what-card[data-sec] .what-group {
    position: relative;
    inset: auto;
    translate: none;
    visibility: visible;
    gap: 12px;
  }
  .s-what .what-card .what-list .what-group:not(.is-on) { display: none; }
  /* The accordion fills a screen (lvh: with Safari's toolbar away too) whatever is open: the card's top air, the tabs (44 + 40)
     and the gap to the stack's block make up the rest. It also keeps the block from
     changing height when the tab switches. */
  .s-what .what-card .what-list > .what-group.is-on { min-height: calc(100lvh - 2 * var(--section-y) - 84px); }

  /* ---- Rows: closed in grey, the open one in ink. Their line masks stay open: the rows
     are a plain list here, not the pinned screen's entrance. ---- */
  .s-what .what-card .what-row { color: var(--muted); }
  .s-what .what-card .what-row.is-now,
  .s-what .what-card .what-group[data-sec="tech"] .what-row { color: var(--ink); }
  .s-what .what-card .what-row .rli {
    transform: none !important;
    transition: none !important;
  }
  /* Sizes from the type scale (typography.css), not one-offs: the service titles take the
     36 step (.h5), the integrations the 28 step (.h3 / .h4 floor); the stack's headline
     below is the 34 step (.list-xl floor). 36 is the largest step at which the longest
     title ("Hotel & Brand Websites") still holds one line. */
  .s-what .what-card .list-lg { font-size: calc(36 * var(--um)); }
  .s-what .what-card .list { font-size: calc(28 * var(--um)); }

  /* ---- The open entry ---- */
  /* The open entry stands apart from the closed ones: --open-air above its number (or
     its title, where there is no number) and below its block (.s-what sets it, above) */
  .s-what .what-card .what-num {
    margin: calc(var(--open-air) - 12px) 0 -2px; /* the group's 12px gap makes up the rest */
    font-size: 12px;
  }
  .s-what .what-card[data-sec="integrations"] .what-group[data-sec="integrations"] .what-row.is-now {
    margin-top: calc(var(--open-air) - 12px);
  }
  /* First in its group: the label's own gap is the air above */
  .s-what .what-card .what-num:first-child,
  .s-what .what-card .what-group .what-row.is-now:first-child { margin-top: 0; }
  /* The plate stands absolutely at the entry's lower right, flush with the screen's edge;
     the copy keeps clear of it (--plate-w + 16px) and is at least as tall, so the plate
     never climbs over the tagline or the title */
  .what-open {
    --plate-w: calc(150 * var(--um)); /* inside the gutter; the bleed adds the gutter */
    --plate-h: calc(108 * var(--um));
    position: relative;
    align-self: stretch; /* the group's column aligns its items to the start: the entry spans the card */
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 4px 0 calc(var(--open-air) - 12px);
  }
  .what-open .what-text { display: contents; }
  .s-what .what-open .what-tag {
    max-width: 30ch;
    font-size: 16px;
    color: var(--ink);
  }
  .s-what .what-open .what-copy {
    max-width: calc(100% - var(--plate-w) - 16px);
    min-height: var(--plate-h);
    font-size: 14px;
    color: var(--ink);
    white-space: normal;
  }
  /* The grey plate is always there (it travels to the entry that opens, services-ui.js);
     the mark wipes down over it -- the works tiles' and the quote portrait's reveal, with
     their curve and length */
  .s-what .what-open .what-slot {
    position: absolute;
    inset: auto calc(-1 * var(--card-x)) 0 auto;
    width: calc(var(--plate-w) + var(--card-x));
    height: var(--plate-h);
    overflow: hidden;
  }
  .s-what .what-card .what-slot::before { clip-path: inset(0) !important; }
  .s-what .what-card[data-slot-sec] .tab-figure { transition: clip-path 1.6s var(--ease-io); }
  .s-what .what-card[data-slot-sec] .what-slot::before,
  .s-what .what-card[data-slot-sec] .tab-figure {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
  }
  .s-what .what-card[data-slot-sec] .what-slot::before { transition: none; }
  /* The desktop's optical nudge for the two top-heavy forms is a flat 12px -- 5% of its
     panel, but 15% of this small plate, which threw them visibly low. Kept in proportion. */
  .s-what .what-open .tab-figure canvas[data-form="funnel"],
  .s-what .what-open .tab-figure canvas[data-form="rings"] { translate: 6% 5%; } /* and a touch right: their mass leans left on the plate */

  /* ---- The stack: the desktop's grey screen, full bleed -- the big mark above, the
     overline, the headline and the chips at the foot ---- */
  .what-tech {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100lvh; /* the whole screen with the toolbar away, like the accordion above */
    margin: var(--section-y) calc(-1 * var(--card-x)) 0;
    padding: var(--section-y) var(--card-x) calc(48px + env(safe-area-inset-bottom));
    background: var(--field-grey) var(--scene-field);
    overflow: hidden; /* clips the mark's bleed past the gutter (below) */
  }
  /* The overline at the block's top, where the accordion's tabs stand in theirs */
  .what-tech::before {
    content: "/\2003tech stack";
    font-size: 12px;
    font-weight: 400;
    letter-spacing: var(--track-caps);
    text-transform: uppercase;
    color: var(--muted);
  }
  /* Big, off to the right (the desktop has it in the upper right too) and standing on the
     headline rather than floating mid-block; the bleed past the gutter is clipped */
  .what-tech-figure {
    flex: 1 1 auto;
    display: grid;
    place-items: end;
    min-height: 0;
    pointer-events: none;
  }
  .what-tech-figure canvas {
    display: block;
    width: min(86vw, 50svh);
    height: min(86vw, 50svh);
    margin-right: calc(-0.5 * var(--card-x));
  }
  .s-what .what-tech .what-row { cursor: default; }
  .s-what .what-tech .list-xl {
    font-size: calc(34 * var(--um));
    line-height: 1.2; /* the desktop's 1.08 reads cramped at this size over three lines */
  }
  .s-what .what-card .what-chips {
    position: relative;
    inset: auto;
    width: auto;
    visibility: visible;
    pointer-events: auto;
    flex-wrap: wrap;
    overflow: visible;
    margin: 24px 0 0;
    padding: 0;
  }
  .s-what .what-card .what-chips .chip {
    visibility: visible;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .s-what .what-card[data-slot-sec] .tab-figure { transition: none; }
}
