/* Homepage heading sizes and compact layouts for Case Studies and Why Retrix. */
#why .why-branding-picture { display: contents; }

.why { --retrix-wrap-inset: 12px; }

@media (max-width: 1199px) {
  body.home #top .hero { padding-top: 90px; }
  #work { padding-block: 45px; }
  #work .case-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  #work .case-line { white-space: normal; }
  #work .case-intro { max-width: 60ch; }
  #work .case-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow: visible; padding: 0; }
  #work .case-tab { min-width: 0; grid-template-columns: 34px minmax(0, 1fr) 32px; gap: 10px; }
  #work .case-tab:hover { transform: none; }
  #work .case-tab-num { width: 34px; height: 34px; }
  #work .case-tab-arrow { width: 32px; height: 32px; }
  #work .case-tab-name, #work .case-tab-tags { white-space: normal; overflow-wrap: anywhere; }
  #work .case-tab-tags { line-height: 1.5; }
  #work .case-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; }
  #work .case-copy { width: auto; min-width: 0; padding: 28px 0 28px 28px; }
  #work .case-kicker { margin-top: 26px; line-height: 1.6; }
  #work .case-kicker::before { flex-shrink: 0; width: 22px; }
  #work .case-title { max-width: none; font-size: clamp(30px, 4vw, 44px); line-height: 1.08; overflow-wrap: anywhere; }
  #work .case-description { max-width: none; font-size: 15px; }
  #work .case-cta { max-width: 100%; white-space: normal; }
  #work .case-visual { position: relative; inset: auto; align-self: center; width: 100%; height: auto; aspect-ratio: 1; opacity: 1; transform: none !important; will-change: auto; }
  #work .case-image { width: 100%; height: 100%; object-fit: contain; object-position: center; }
  #work .case-footer { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 16px 28px 28px; }
  #work .case-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  #work .case-fact { gap: 10px; padding: 0; }
  #work .case-fact + .case-fact::before { content: none; }
  #work .case-fact-icon { flex-basis: 32px; height: 32px; }
  #work .case-fact strong { font-size: 14px; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
  #work .case-fact small { line-height: 1.5; }
  #work .case-nav { justify-content: flex-end; }
  #work .case-nav button { width: 48px; height: 48px; }

  #why .why > .wrap { min-height: 0; padding-block: 45px; }
  #why .why-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: 20px; min-height: 0; margin-bottom: 36px; }
  #why .why-kicker { justify-self: start; align-self: end; margin: 0; }
  #why .why-title { align-self: start; min-width: 0; }
  #why .why-title span { white-space: normal; }
  #why .why-branding-picture { display: block; grid-column: 2; grid-row: 1 / 3; min-width: 0; aspect-ratio: 3 / 2; }
  #why .why-branding-composition { position: static; width: 100%; max-width: 100%; height: 100%; object-fit: contain; opacity: 1; translate: none !important; }
  #why .why-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; min-height: 0; padding-top: 0; }
  #why .why-point { grid-template-columns: 28px 50px minmax(0, 1fr); width: 100%; max-width: none; margin: 0; }
  #why .why-point-number { align-self: center; padding-top: 0; }
  #why .why-point-number::after { top: 50%; left: 19px; width: 9px; }
  #why .why-point-copy { grid-column: 1 / -1; padding: 16px 0 0; }
  #why .why-point-label { line-height: 1.4; overflow-wrap: anywhere; }
  #why .why-point h3 { font-size: clamp(23px, 2.7vw, 28px); line-height: 1.15; overflow-wrap: anywhere; }
  #why .why-point p { max-width: none; font-size: 15px; }
  #why .why-art { position: relative; inset: auto; grid-column: 1 / -1; order: 3; width: min(100%, 420px); margin: 0 auto; transform: none; }
  #why .why-orbit-lines { width: 100%; translate: none !important; }
  #why .why-center-orbit { width: 88%; translate: none !important; }
  #why .why-point--one { order: 1; }
  #why .why-point--two { order: 2; }
  #why .why-point--three { order: 4; }
  #why .why-point--four { order: 5; }
  #why .why-point--extra { order: 6; }
}

@media (max-width: 700px) {
  #portfolio .svc { border-bottom: 0; }
  #work { padding-block: 30px; }
  #work .case-intro { margin-top: 20px; font-size: 15px; }
  #work .case-tabs { grid-template-columns: minmax(0, 1fr); margin-top: 24px; }
  #work .case-tab { min-height: 70px; }
  #work .case-main { grid-template-columns: minmax(0, 1fr); }
  #work .case-copy { padding: 24px 20px 0; }
  #work .case-title { font-size: clamp(30px, 7vw, 40px); }
  #work .case-visual { aspect-ratio: 4 / 3; margin-top: 16px; }
  #work .case-footer { padding: 16px 20px 24px; }
  #work .case-facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  #work .case-fact { padding-block: 12px; }
  #work .case-fact + .case-fact { border-top: 1px solid #393440; }
  #work .case-nav { width: 100%; justify-content: space-between; }

  #why { padding-inline: 0; }
  #why .why { --retrix-wrap-inset: 0px; width: 100%; border-radius: 0; }
  #why .why > .wrap { padding-block: 30px; }
  #why .why-hero { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-bottom: 28px; }
  #why .why-branding-picture { grid-column: 1; grid-row: auto; width: min(100%, 420px); aspect-ratio: 4 / 3; margin-inline: auto; }
  #why .why-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  #why .why-point h3 { font-size: clamp(23px, 6.5vw, 28px); }
  #why .why-art { width: min(100%, 350px); }
}

/* One smaller heading scale; allow every authored line to wrap within its column. */
body.home {
  --home-heading-size: clamp(40px, 3.2vw, 48px);
  --home-hero-size: clamp(48px, 6.2vw, 104px);
  --home-contact-size: clamp(48px, 6vw, 96px);
}
#top :is(.head, .svc-intro, .testimonial-head, .testimonial-head-grid, .contact-heading, .case-sidebar, .why-hero, .hero-copy),
#top .head > * { min-width: 0; max-width: 100%; }
#top :is(.head h2, .svc-intro h2, .case-sidebar h2, .why-title, .proc-title, .testimonial-head h2) {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: var(--home-heading-size);
  line-height: 1.08;
  white-space: normal;
  overflow-wrap: anywhere;
}
#top :is(.services-heading-line, .svc-line, .case-line, .proc-line, .contact-title-line, .testimonial-head h2 > span) { white-space: normal; }
#top .hero h1 { font-size: var(--home-hero-size); white-space: normal; line-height: .98; }
#top .hero h1 .row > span { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
#top .hero-note h2 { font-size: clamp(20px, 1.65vw, 26px); line-height: 1.2; overflow-wrap: anywhere; }
#top .cta h2 { font-size: var(--home-contact-size); line-height: 1.04; overflow-wrap: anywhere; }
body.home .footer-pitch h2 { font-size: var(--home-heading-size); line-height: 1.08; overflow-wrap: anywhere; }
body.home .footer-title-line { white-space: normal; }

@media (max-width: 1199px) {
  body.home { --home-heading-size: clamp(32px, 4.1vw, 40px); --home-hero-size: clamp(46px, 8vw, 72px); --home-contact-size: clamp(36px, 5.5vw, 64px); }
}
@media (max-width: 700px) {
  body.home { --home-heading-size: clamp(26px, 7.2vw, 32px); --home-hero-size: clamp(32px, 9.2vw, 50px); --home-contact-size: clamp(28px, 7.8vw, 40px); }
}
