/* tablets and phones (1024px and below; desktop unchanged). Loaded last so it wins over the section files. */
@media(max-width:1024px){
  /* section title and its button/link on one row */
  .works-heading,.sol-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}
  .works-heading h2,.sol-heading h2{min-width:0}
  .works-heading .btn,.sol-heading .btn{flex:none;margin-top:0;white-space:nowrap}
  /* services: title and "see more" on the first row, the intro line below */
  .services-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:0 16px}
  .services-intro{display:contents}
  .services-heading h2{grid-column:1;grid-row:1}
  .services-heading .services-intro p{grid-column:1/-1;grid-row:2;text-align:left;margin:14px 0 0}
  .services-heading .link-arrow{grid-column:2;grid-row:1;margin-top:0;white-space:nowrap}
  /* FAQ: "see all questions" becomes an outline pill button, like "more cases" */
  .faq-intro .link-arrow{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-width:0;min-height:48px;padding:0 24px;border:1px solid #30375f66;border-radius:999px;font-size:15px;font-weight:700;color:var(--navy);transition:background .2s,color .2s,border-color .2s}
  .faq-intro .link-arrow svg{width:18px;height:18px;stroke:currentColor}
  .faq-intro .link-arrow:hover{background:var(--navy);border-color:var(--navy);color:#fff}
  .faq-intro .link-arrow:hover svg{transform:none}
}
/* 769px–1024px: all section titles 32px (except the CTA) */
@media(min-width:769px) and (max-width:1024px){
  #problems-title,#solutions-title,#works-title,#services-title,#about-title,#process-title,#faq-title{font-size:32px}
}
/* phones and small tablets (768px and below use the phone layout); the same sizes from 375px down to 320px */
@media(max-width:768px){
  /* "why zuoyou": title and button stacked, not side by side */
  .sol-heading{display:block}
  .sol-heading .btn{margin-top:18px}
  /* section titles */
  #problems-title,#solutions-title,#works-title,#services-title,#process-title,#faq-title{font-size:28px}
  #about-title{font-size:32px}
  #contact-title{font-size:34px}
  /* item titles */
  .q-list li{font-size:17px}
  .solutions .sol-col h3{font-size:18px}
  .works-list h3{font-size:20px}
  .services .service-title h3{font-size:18px}
  .process .process-list h3{font-size:18px}
  .faq-list summary{font-size:16px}
}
/* small tablets (481px–768px): same phone layout, slightly bigger type than phones */
@media(min-width:481px) and (max-width:768px){
  #problems-title,#solutions-title,#works-title,#services-title,#process-title,#faq-title{font-size:30px}
  .q-list li{font-size:18px}
  .solutions .sol-col h3{font-size:19px}
  .services .service-title h3{font-size:19px}
  .faq-list summary{font-size:17px}
}
/* hero on phones and small tablets (stacked layout) */
@media(max-width:768px){
  /* no empty band under the cases: the case area reaches the bottom of the hero */
  .hero{padding-bottom:0}
  /* room between the buttons and the cases (height and fade are set with the sliding rows below) */
  .hero-wall{margin-top:56px}
  /* the orange glow sits at the top right of the text */
  .fx-orb.o1{left:auto;right:-230px;top:-60px;bottom:auto}
}
/* hero cases as two sliding rows (option B) on phones and small tablets; desktop keeps the tilted wall */
.wall-rows{display:none}
@media(max-width:768px){
  .wall-stage{display:none}
  .wall-rows{display:flex;flex-direction:column;gap:18px;position:absolute;left:-40px;right:-40px;top:42%;transform:translateY(-50%) rotate(-5deg)}
  .wall-track{display:flex;gap:12px;width:max-content;animation:rowLeft 60s linear infinite}
  .wall-row:nth-child(2) .wall-track{margin-left:-100px;animation-name:rowRight;animation-duration:70s}
  .wall-rows .case{flex:none;width:190px;border-radius:10px;box-shadow:0 14px 28px #0b0f2a73}
}
/* each row moves by exactly one copy of its cases (half the track plus half a gap) */
@keyframes rowLeft{from{transform:translateX(0)}to{transform:translateX(calc(-50% - 6px))}}
@keyframes rowRight{from{transform:translateX(calc(-50% - 6px))}to{transform:translateX(0)}}
@media(prefers-reduced-motion:reduce){.wall-track{animation:none}}
/* two sliding rows: the case area height and its soft top fade; the rows sit high enough to end clear of the
   wave; small tablets get bigger cards */
@media(max-width:768px){
  /* the cards are solid, so the background grid runs behind them all the way down; only a short soft fade at the top */
  .hero-wall{height:360px;-webkit-mask-image:linear-gradient(transparent,#000 8%);mask-image:linear-gradient(transparent,#000 8%)}
}
@media(min-width:481px) and (max-width:768px){
  .hero-wall{height:460px}
  .wall-rows .case{width:270px}
  .wall-row:nth-child(2) .wall-track{margin-left:-140px}
}
/* 768px and below: each section's button moves under its list (why zuoyou, works, services, FAQ).
   The heading wrappers are flattened (display:contents) so the title, list and button can be reordered. */
@media(max-width:768px){
  .solutions,.works,.services{display:flex;flex-direction:column}
  .faq{display:flex;flex-direction:column;gap:0}
  .sol-heading,.works-heading,.services-heading,.services-intro,.faq-intro{display:contents}
  .sol-cols,.works-wrap,.service-list,.faq-list{order:1}
  .sol-heading .btn,.works-heading .btn,.services-heading .link-arrow,.faq-intro .link-arrow{order:2;align-self:flex-start;margin-top:32px}
  /* the space under each title that the heading wrapper used to give */
  .solutions .sol-heading h2{margin-bottom:30px}
  .works .works-heading h2{margin-bottom:34px}
  .services .services-intro p{margin:14px 0 36px}
  .faq .faq-intro p{margin:16px 0 28px}
}
/* 768px and below: buttons centred under their lists (the services "see more" link sits on the right) */
@media(max-width:768px){
  .sol-heading .btn,.works-heading .btn,.faq-intro .link-arrow{align-self:center}
  .services-heading .link-arrow{align-self:flex-end}
}
/* 768px and below, "why zuoyou": a big number on the left of each point, with the point's title and text beside it */
@media(max-width:768px){
  .solutions .sol-col{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:16px;align-items:start}
  .solutions .sol-no{grid-row:1/3;align-self:center;font-size:30px;font-weight:700;line-height:1;letter-spacing:0;min-width:42px}
  .solutions .sol-col h3{margin:0 0 8px}
  .solutions .sol-col p,.solutions .sol-col small{grid-column:2}
}
/* button text sizes on smaller screens */
@media(max-width:768px){
  .hero-copy .btn{font-size:14px}
}
@media(max-width:480px){
  .sol-heading .btn{font-size:14px}
  .services-heading .link-arrow{font-size:15px}
}
/* FAQ (768px and below): the question list always spans the panel's full width. The section is a flex column
   here and had align-items:start from its desktop grid, so with every answer closed the list shrank to the
   width of its longest question. */
@media(max-width:768px){
  .faq{align-items:stretch}
}
/* hero text on phones and small tablets: a little bigger */
@media(max-width:768px){
  .hero-copy h1{font-size:23px}
  .hero-tagline{font-size:clamp(26px,7.8vw,34px)}
}
/* FAQ on tablets (769px–1024px): "see all questions" sits on the right of the title, the intro line and
   the questions below; 768px and below keep the button under the list, centred */
@media(min-width:769px) and (max-width:1024px){
  .faq{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0 16px;align-items:center}
  .faq-intro{display:contents}
  .faq .faq-intro h2{grid-column:1;grid-row:1}
  .faq .faq-intro .link-arrow{grid-column:2;grid-row:1;margin-top:0;align-self:center}
  .faq .faq-intro p{grid-column:1/-1;grid-row:2}
  .faq-list{grid-column:1/-1;grid-row:3}
}
