/* Blaze — the phone layer: these fixes are for phones only, the desktop
   stays as it is. Everything below sits inside max-width 767 px, so tablets and computers keep exactly what they had.
   Loaded last on every page (after site.css, the page's own <style> and the home's inline copy), so equal selectors win here.
   The font sizes of the type scale carry !important: the pages set them with many different
   selectors (and the home with calc() shorthands), and on phones this one scale is meant to win over all of them. */

@media (max-width: 767px) {

  /* ---- spacing and contrast tokens. Sections start 96 px apart (was 169–219 px); the faint grey reads 4.5 : 1 and
     more (was .45 = 4.2 : 1). The home has no --faint of its own, so it gets it here too */
  :root { --sec-space: 96px; --faint: rgba(248, 248, 248, .6); }

  /* ---- the cookie bar: docked to the bottom edge, the text 13 px, the two buttons in one row, no bot on a phone.
     consent.js injects its own <style> after this file, hence the html prefix */
  html .cc { left: 0; right: 0; bottom: 0; width: 100%; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
             border-width: 1px 0 0; border-radius: 16px 16px 0 0; font-size: 13px; line-height: 1.45; }
  html .cc .cc__h { display: none; }
  html .cc .cc__row { flex-wrap: nowrap; margin-top: 12px; }
  html .cc button { flex: 1 1 0; }
  html .cc .cc__bot { display: none; }

  /* ---- the closing contact section: as tall as its content, 48 px above its hairline, 56 px to the headline
     and about 96 px from the buttons to the footer (was 169 + 241 px before and 180–270 px after) */
  .cta { min-height: 0; padding: 56px var(--gutter) 64px; }
  .cta--line { margin-top: 48px; }

  /* ---- the footer: every link a 32 px row (was 44, the footer was too tall; smaller gaps), the
     copyright and IČO on one line, the two legal links side by side (each wraps under the other only on a narrow phone),
     13 px labels in the readable grey */
  .foot__h { margin: 0 0 2px; font-size: 13px; color: var(--faint); }
  .foot__list { gap: 0; }
  .foot__list > li { display: flex; align-items: center; min-height: 32px; }
  .foot__list a { display: flex; align-items: center; min-height: 32px; }
  .foot__legal { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 16px; padding-top: 10px; font-size: 13px;
                 color: var(--faint); }
  .foot__legal > span { padding: 4px 0; }
  .foot__legal a { display: flex; align-items: center; min-height: 32px; }
  /* still a little too tall: a link row 28 px (still above the 24 px touch minimum, WCAG 2.5.8),
     16 px between the groups and 24 px above them, the legal links 28 px; the wordmark stays as it is */
  .foot { padding-top: 24px; }
  .foot__list > li, .foot__list a, .foot__legal a { min-height: 28px; }
  .foot__grid { row-gap: 16px; }
  .foot__legal { padding-top: 8px; }
  .foot__legal > span { padding: 2px 0; }
  /* the home: the footer is no longer fixed under the page for the contact section to lift off it like a sheet (on a phone the
     reveal felt unnatural); it simply follows the contact section in the page's flow, like on the
     subpages. Tablets and computers keep the sheet */
  .foot-wrap { height: auto; clip-path: none; }
  .foot-wrap > .foot { position: relative; left: auto; right: auto; bottom: auto; }

  /* ---- the small controls get a 44 px touch area (the icons stay their size) */
  .bar__menu { min-height: 44px; }
  .fm__pause, .fm__sound { width: 44px; height: 44px; }
  .fm__pause { right: calc(var(--u) * .9 + 56px); }   /* 12 px between pause and sound */
  .kfilm__pause { width: 44px; height: 44px; }
  .kfilm__full { height: 44px; }
  /* the sound button lies in the stone's screen, which is drawn at about 0.4 of its size: an invisible margin makes it 46 px to
     the finger without making the icon bigger */
  .island__sound::before { content: ""; position: absolute; inset: -16%; border-radius: 50%; }
  .copy { width: 44px; height: 44px; }
  .btn--small { min-height: 44px; }
  .direct__mail { padding: 4px 0; }
  .direct .link { min-height: 44px; padding-bottom: 0; border-bottom: 0; text-decoration: underline; text-decoration-color: var(--line);
                  text-underline-offset: 6px; }

  /* ---- the open menu: the items stay on the right under the thumb; „Domluvit konzultaci" is an orange button as wide
     as its text, on the same right edge as the page names (a full-width button fought the right-aligned list), the
     e-mail a 44 px row under it */
  .menu__foot { justify-items: end; gap: 0; margin-top: 28px; }
  .menu__foot a:first-child { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
                              border-radius: 6px; background: var(--heat); color: #000;
                              font: 600 16px/1 var(--bf, "Hanken Grotesk"), sans-serif; }
  .menu__foot a + a { display: flex; align-items: center; justify-content: flex-end; min-height: 44px; margin-top: 8px; }

  /* ---- one type scale on phones: 13 / 16 / 20 / 28 / 36. The signature pieces keep their own size: Spark, Build,
     Blaze; the written sentences; the figures; the menu's page names; the e-mail on Kontakt; the footer's wordmark */
  .hero__title, h1.h, .pc-title, .legal h1 { font-size: 36px !important; }
  .refs__title, .sec-head__title, .cta__title, h2.h, .h.h2, .pc-h { font-size: 28px !important; }
  .svc__title, .rules h3, .steps h3, .role__t, .ch h3, .expect h3, .legal h2 { font-size: 20px !important; }
  .refs__item b, .pj__name { font-size: 28px !important; }
  .cta__title .slot img { max-height: 1em; }

  /* ---- running text 16 px with 1.55 between the lines (was 15 px on the home, Kontakt, Kariéra, Proč Blaze and GDPR) */
  .lead, .hero__lead, .sec-head__lead, .svc__desc, .proc__desc, .cta__lead, .pj__lead, .kohero__lead, .khero__lead, .intro__lead,
  .direct__ask, .rules p, .steps p, .acc__body, .story p, .expect p, .role__intro, .role__list li, .pc-lede, .pc-text p:not(.pc-label),
  .legal p, .legal li { font-size: 16px !important; line-height: 1.55; }
  .eyebrow, .sec-head__eyebrow, .cta__label, .proc__meta, .pc-label, .role__meta, .story h4, .trust p,
  .refs__item small { font-size: 13px !important; }

  .role__cols h4 { font-size: 13px; }

  /* ---- GDPR: the headline like the other pages' (Figtree 500, 36 px, set above), the text 16 px; the content unchanged */
  .legal h1 { font: var(--hw) 36px/1.05 var(--hf), sans-serif; letter-spacing: var(--hls); }

  /* ================================================================ page by page */

  /* ---- Úvod. The sentence with the figures: as tall as itself, 72 px above and below, written once it comes into view
     (index.html starts it earlier on phones). A section's heading 96 px under the section before it (--sec-space) and
     32 px above its content. Spark, Build, Blaze: 520 px a step instead of a whole screen */
  .nums, .nums.is-anim { height: auto; }
  .nums__stage { position: static; height: auto; padding: 72px var(--gutter); }
  /* the projects' section ends 24 px under its button, so the sentence starts 96 px under it, not 205 */
  #reference.isl { padding-bottom: 24px; }
  .sec-head { padding-bottom: 32px; }
  .proc__step { min-height: 520px; }
  /* the last step („Blaze.") is no longer centred in its 520 px: the black under its sentence was empty room before the
     contact section (223 px). It keeps the room above it, so „Build." to „Blaze." reads as before, and
     ends 40 px under its sentence: with the contact section's 56 px above its headline, 96 px, the usual section space */
  .proc__step:last-child { min-height: 0; padding-top: 160px; padding-bottom: 40px; }

  /* ---- Kariéra. The sentence under the film, 56 px above and below, no screen of its own. The facts of a role one
     under another, without the dots between them */
  .writ { height: auto; }
  .writ__stage { position: static; height: auto; padding: 56px var(--gutter); }
  .role__meta { flex-direction: column; align-items: flex-start; text-align: left; }
  .role__meta span + span::before { content: none; }

  /* ---- Kontakt. The message under a field: 14 px, a lighter red (6 : 1), 20 px clear of the next field's label (the form's
     rows move apart for it; the message still appears without moving anything) */
  .form { gap: 44px; }
  .f-2 { gap: 44px 16px; }
  .form__check:empty + .form__acts { margin-top: calc(32px - 2 * 44px); }
  .fld .err { font-size: 14px; color: #ff6b6f; }
  .brief { margin-bottom: 64px; }   /* the photo ends about 96 px above the footer, as the other pages' buttons (was 180 px) */

  /* ---- Klienti. No button that only scrolls to the list right under it. The monitor stays at the top of the page
     instead of riding along over the list. The projects without a page of their own open in place: a plus, as the roles
     on Kariéra, not the arrow that promises a page. The logos 28 px high */
  .pj__cue { display: none; }
  .pj__stage { position: relative; }
  .pj__stage::after { content: none; }
  .pj__item--more .pj__go svg { display: none; }
  .pj__item--more .pj__go { display: grid; place-items: center; transform: none !important; }
  .pj__item--more .pj__go::before { content: "+"; font: 400 26px/1 var(--bf, "Hanken Grotesk"), sans-serif; color: var(--muted); transition: transform .3s ease; }
  .pj__item--more[open] .pj__go::before { transform: rotate(45deg); }
  .trust img { height: 28px; }
}

/* ---- the project pages: the key figures in a row under the opening paragraph and the chapters as a strip of links that
   scrolls sideways (both built by projekt.js on a phone only; hidden again should the window grow) */
.pc-top { display: none; }
@media (max-width: 767px) {
  .pc-top { display: block; margin-top: 28px; }
  .pc-top__figs { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 16px; padding: 18px 0;
                  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  /* three figures that wrap into two columns: the third, alone on its row, is a column wide and centred under the two; its text
     stays left like theirs. A full row of three is untouched */
  .pc-top__figs.is-wrap > .pc-top__fig:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc((100% - 16px) / 2); }
  .pc-top__fig b { display: block; font: 500 28px/1 var(--hf), sans-serif; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .pc-top__fig span { display: block; margin-top: 6px; font-size: 13px; line-height: 1.35; color: var(--muted); }
  .pc-top__chap { display: flex; gap: 8px; margin: 20px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter); overflow-x: auto;
                  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .pc-top__chap::-webkit-scrollbar { display: none; }
  .pc-top__chap a { flex: none; display: flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line);
                    border-radius: 999px; font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; }
  .pc-top__chap a:active { color: var(--fg); border-color: rgba(248, 248, 248, .4); }
  .pc-h[id] { scroll-margin-top: 88px; }
}

/* ---- Proč Blaze: the step's number above its heading, small and grey, so the text has the full width (the page's own
   phone layout starts at 760 px, so this one does too) */
@media (max-width: 760px) {
  .steps li { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .steps .steps__n, .steps li:nth-child(even) .steps__n { grid-column: 1; grid-row: 1; justify-self: start; padding: 0;
                                                          font-size: 28px; line-height: 1; color: var(--faint); }
  .steps li .steps__t, .steps li:nth-child(even) .steps__t { grid-column: 1; grid-row: 2; align-self: start; }
  .steps li .steps__ph, .steps li:nth-child(even) .steps__ph { grid-row: 3; grid-column: 1; }
  .steps p { max-width: none; }
}

/* ---- Proč Blaze: on a phone the opener's main button is
   „Jak pracujeme" and the second „Domluvit konzultaci"; „Co od nás dostanete" stays on bigger screens */
.intro__phone { display: none; }
@media (max-width: 767px) {
  .intro__actions .intro__desk { display: none; }
  .intro__actions .intro__phone { display: inline-flex; flex: 1 1 100%; }
  .intro__actions a[href^="/"] .mi-icon { transform: none; }               /* the consultation goes to Kontakt, not down the page */
  .intro__actions a[href^="/"].is-hot .mi-icon { transform: rotate(-45deg); }
}

/* ---- Home hero, the film on a phone: no darkening over its top and no tilt, so it is not dark
   and small (hero-film.js). It starts rounded inside the page's gutters, grows to the full width on the way down and stays so
   (hero-film.js, PHONE), and only then the logos' black rises over it, later than before: the logos and the
   black's edge lower */
@media (max-width: 767px) {
  html.hero-film .hero__logos { margin-top: 200px; }   /* was 56: the logos and the black edge they ride on sit lower */
  html.hero-film .fm__film { border-radius: 14px; }
  html.hero-film .fm__film::after, html.hero-film .fm__dim { display: none; }
}

/* ---- Home hero, the client logos on a phone (five in a row hardly fitted): two slots, much bigger, turning one at a
   time as before (hero-film.js builds two slots on phones) */
@media (max-width: 767px) {
  html.hero-film { --logo-h: 44px; }   /* 60 was too big */
  html.hero-film .hero__logos { max-width: 300px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
}

/* ---- No grey-blue box on a tap (on Služby, the logo, the hero button and the project names). It is the browser's
   own tap highlight, so it goes on every touch screen; the keyboard's :focus-visible ring stays as it was */
html { -webkit-tap-highlight-color: transparent; }

/* ---- Home hero, the first screen on a phone, as on the desktop, so the film does not pull the eyes from the headline: the
   headline, the line and the button fill the first screen and sit in its middle, the film starts below with only its top edge
   showing, as the desktop's --fm-peek. The headline a size bigger (still two lines down to 360 px), the line bigger and only its
   first sentence, so it takes two to three rows instead of four (the headline already says „software na míru") */
@media (max-width: 767px) {
  html.hero-film { --fm-peek-phone: 72px; --fm-gap-phone: 30px; }   /* the gap: the film's own margin above it on phones */
  html.hero-film .hero__copy { justify-content: center; box-sizing: border-box;
    min-height: calc(100vh - clamp(20px, 4vh, 40px) - 76px - var(--fm-gap-phone, 0px) - var(--fm-peek-phone));
    min-height: calc(100svh - clamp(20px, 4vh, 40px) - 76px - var(--fm-gap-phone, 0px) - var(--fm-peek-phone)); }
  html.hero-film .hero__title { font-size: min(44px, calc((100vw - 2 * var(--gutter)) / 8.2)) !important; }
  html.hero-film .hero__lead { font-size: 18px !important; }
  html.hero-film .hero__more { display: none; }
}
