/* ---------- #mobile-system ---------- */
/* phones only (max-width 560px): the same phone system as the home and What We Do */
@media (max-width: 559px) {
  /* one rhythm: 48px between sections (the pinned band keeps its own spacing) */
  main > section:not(.hscroll) { padding-block: 48px !important; }
  /* text and buttons centered, buttons stacked */
  section h1, section h2, section h3, section p { text-align: center !important; }
  /* nothing spills past the screen */
  img, canvas, svg, video, iframe { max-width: 100%; }
  section h1 { font-size: clamp(28px, 9.2vw, 44px); overflow-wrap: break-word; }
  .endgrid .hl--h[style*="left:"] { display: none !important; }
  .endgrid .hl--v.hl--edge[style*="left: 24px"] { left: 12px !important; }
  .endgrid .hl--v.hl--edge[style*="left: 351px"] { left: calc(100% - 13px) !important; }

  /* footer: box between the side lines, one hairline at the page edge */
  footer { padding-top: 24px !important; padding-bottom: 48px !important; background-image: linear-gradient(var(--color-border), var(--color-border)) !important; background-repeat: no-repeat !important; background-size: 100% 1px !important; background-position: 0 100% !important; }
  /* the side lines start at the footer box, not above it; the black space above the box is a little smaller */
  .endgrid .hl--v.hl--edge { top: 6px !important; bottom: 0 !important; height: auto !important; }
  footer { padding-top: 6px !important; }
  /* ---------- #mobile-contact ---------- */
  /* Contact, phones: the "More ways" items centered (number above the title, the square hidden), the send button centered, the footer box between the frame lines */
  /* the cards: number at the left, the orange square at the top right, as on desktop */
  .pg-card__top { display: flex !important; flex-direction: row !important; justify-content: space-between !important; align-items: center !important; }
  .pg-card__top .pg-mark { display: block !important; }
  /* the "More ways" heading: less padding, centered vertically in its block */
  main > section.pg-split { padding-top: 0 !important; }   /* the heading block carries the top space */
  /* the "More ways" cards: content aligned left */
  section.pg-split :has(> .pg-card__top) { text-align: left !important; align-items: flex-start !important; }
  section.pg-split .pg-card__top, section.pg-split .pg-card__top ~ h3, section.pg-split .pg-card__top ~ p { text-align: left !important; }
  section.pg-split > .pg-split__head { padding: 50px 24px !important; display: flex !important; flex-direction: column !important; justify-content: center !important; }
  .pg-form__actions { display: flex; justify-content: center; }
  .pg-form__actions .btn { width: auto; }
  .footer__inner { margin-inline: 12px !important; width: auto !important; }
  /* the hero graphic shows on phones, under the text */
  .pg-hero__art { display: block !important; position: relative !important; top: auto !important; bottom: auto !important; left: auto !important; align-self: stretch !important; width: auto !important; margin-inline: -24px !important; height: 240px !important; margin-top: 48px !important; margin-bottom: 0 !important; padding: 0 !important; border-top: 1px solid var(--color-border) !important; border-bottom: 1px solid var(--color-border) !important; box-sizing: border-box; }
  .pg-hero__art canvas { position: absolute !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important; width: 100% !important; height: 100% !important; display: block; }
  /* title, text, then the graphic */
  section.pg-hero--art { display: flex !important; flex-direction: column !important; }
  section.pg-hero--art > .pg-hero__title { order: 1; }
  section.pg-hero--art > .pg-hero__side { order: 2; }
  section.pg-hero--art > .pg-hero__art { order: 3; }
  section.pg-hero--art > .pg-hero__title { margin: 0 !important; }
  section.pg-hero--art > .pg-hero__side { margin-top: 24px !important; }
  section.pg-hero--art > .pg-hero__art { margin-top: 48px !important; margin-bottom: 0 !important; }
  /* the hero frame: top hairline 36px in, side lines 12px in */
  main > section.pg-hero--art .pg-hero__sub { font-size: 16px !important; line-height: 1.5 !important; }
  /* the graphic has a slight space from the screen edges */
  .pg-hero__art canvas { left: 12px !important; right: auto !important; width: calc(100% - 24px) !important; }
  /* the form has no transform, so the native dropdown opens under its field */
  form.pg-form { transform: none !important; translate: none !important; }   /* smaller body text under the title */
  main > section.pg-hero--art { position: relative !important; padding-top: 72px !important; padding-bottom: 0 !important; background-image: linear-gradient(var(--color-border), var(--color-border)) !important; background-repeat: no-repeat !important; background-size: 100% 1px !important; background-position: 0 36px !important; }
  section.pg-hero--art::before, section.pg-hero--art::after { display: block !important; content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--color-border); border: 0; pointer-events: none; z-index: 1; }
  section.pg-hero--art::before { left: 12px; right: auto; }
  section.pg-hero--art::after { left: auto; right: 12px; }
}

/* ---------- #gap-fixes ---------- */

/* ---------- #tablet-contact ---------- */
/* Contact, tablet only (561px to 900px): the same layout as the phone version: title, text and graphic under it on the frame lines; "More ways" cards with the number at the left and the square at the top right; the send button centered; the footer box between the frame lines */
@media (min-width: 560px) and (max-width: 759px) {
  .pg-card__top { display: flex !important; flex-direction: row !important; justify-content: space-between !important; align-items: center !important; }
  .pg-card__top .pg-mark { display: block !important; }
  main > section.pg-split { padding-top: 0 !important; }
  section.pg-split :has(> .pg-card__top) { text-align: left !important; align-items: flex-start !important; }
  section.pg-split .pg-card__top, section.pg-split .pg-card__top ~ h3, section.pg-split .pg-card__top ~ p { text-align: left !important; }
  section.pg-split > .pg-split__head { padding: 50px 36px !important; display: flex !important; flex-direction: column !important; justify-content: center !important; }
  .pg-form__actions { display: flex; justify-content: center; }
  .pg-form__actions .btn { width: auto; }
  .pg-hero__art { display: block !important; position: relative !important; top: auto !important; bottom: auto !important; left: auto !important; align-self: stretch !important; width: auto !important; margin-inline: 0 !important; height: 240px !important; margin-top: 48px !important; margin-bottom: 0 !important; padding: 0 !important; border-top: 1px solid var(--color-border) !important; border-bottom: 1px solid var(--color-border) !important; box-sizing: border-box; }
  .pg-hero__art canvas { position: absolute !important; top: 0 !important; left: 12px !important; right: auto !important; bottom: 0 !important; width: calc(100% - 24px) !important; height: 100% !important; display: block; }
  section.pg-hero--art { display: flex !important; flex-direction: column !important; }
  section.pg-hero--art > .pg-hero__title { order: 1; margin: 0 !important; }
  section.pg-hero--art > .pg-hero__side { order: 2; margin-top: 24px !important; }
  section.pg-hero--art > .pg-hero__art { order: 3; margin-top: 48px !important; margin-bottom: 0 !important; }
  main > section.pg-hero--art .pg-hero__sub { font-size: 16px !important; line-height: 1.5 !important; }
  form.pg-form { transform: none !important; translate: none !important; }
  main > section.pg-hero--art { padding-inline: 0 !important; }
  main > section.pg-hero--art { position: relative !important; padding-top: 72px !important; padding-bottom: 0 !important; background-image: linear-gradient(var(--color-border), var(--color-border)) !important; background-repeat: no-repeat !important; background-size: 100% 1px !important; background-position: 0 36px !important; }
  section.pg-hero--art::before, section.pg-hero--art::after { display: block !important; content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--color-border); border: 0; pointer-events: none; z-index: 1; }
  section.pg-hero--art::before { left: 12px; right: auto; }
  section.pg-hero--art::after { left: auto; right: 12px; }
  section h1, section h2, section h3, section p { text-align: center !important; }
  section.pg-hero--art > .hlines > i[style*="width: 1px"] { display: none !important; }
  /* hero spacing: 48px above the heading, as at the top of the other heroes */
  main > section.pg-hero--art { padding-top: 92px !important; padding-inline: 0 !important; }
  /* the hero's frame is only the 12px lines and the top hairline: the lines drawn by the script are hidden here */
  section.pg-hero--art .hlines { display: none !important; }
  /* the sections are full width, with no own side borders: the frame lines are the 12px ones only */
  /* conservan sus lineas laterales, a 12px del borde */
  main > section.pg-hero--art, main > section.pg-rows.pg-contact, main > section.pg-split { margin: 0 0 0 12px !important; width: calc(100% - 23px) !important; }
}
/* the closing section, with the footer frame and lines it shares, stays stacked up to 939px, where its button first fits two columns (a section breakpoint) */
@media (min-width: 560px) and (max-width: 939px) {
  .footer__inner { margin-inline: 12px !important; width: auto !important; }
  /* a hairline along the bottom edge of the gray footer box, across the whole screen width */
  footer { position: relative !important; }
  footer::after { content: ""; display: block; position: absolute; left: 0; right: 0; bottom: 48px; height: 1px; background: var(--color-border); pointer-events: none; }
  /* a hairline along the top edge of the footer, across the whole screen width (under the pre-footer box) */
  footer::before { content: ""; display: block; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--color-border); pointer-events: none; }
  footer { padding-top: 24px !important; padding-bottom: 48px !important; background-image: linear-gradient(var(--color-border), var(--color-border)) !important; background-repeat: no-repeat !important; background-size: 100% 1px !important; background-position: 0 100% !important; }
}
/* 821px to 900px: the Contact lines are the frame at 12px (from the hero) only; the extra desktop column line and the duplicate side lines are hidden here */

/* ---------- #hero-art-901 ---------- */
/* Contact, 901px to 1100px: the hero graphic shows in the middle column, between the heading and the text, as on the wider desktop */
@media (min-width: 760px) and (max-width: 1099px) {
  .pg-hero__art, .pg-hero--art::before, .pg-hero--art::after { display: block !important; }
  .pg-hero--art .pg-hero__side { grid-column: 3 / -1 !important; }
}

/* "Code and community": the LinkedIn and GitHub links under the card's text */
.pg-split__links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 16px 0 0; }
.pg-split__links a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 400 12px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--color-off-white); text-decoration: none; transition: color .2s; }
.pg-split__links a:hover, .pg-split__links a:focus-visible { color: var(--color-orange); }
.pg-split__links svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
/* a link inside a card's text: underlined so it reads as a link, orange under the cursor */
.pg-split__link { color: var(--color-off-white); text-decoration: underline; text-decoration-color: var(--color-orange); text-underline-offset: 3px; transition: color .2s; }
.pg-split__link:hover, .pg-split__link:focus-visible { color: var(--color-orange); }
/* P-CON-2: from 760 to 939 px the headline's column is 217-265 px wide, too narrow for "Let's talk about" at 36 px,
   which left "about" alone on a middle line. Scaling with the viewport keeps it on two lines; from 940 px it is 36 px. */
@media (min-width: 760px) and (max-width: 939px) {
  main > section.pg-hero--art #pg-title { font-size: min(36px, 3.9vw) !important; }
}
