/* Hero component: geometry, image, statistics and contact cards.
 * Shared H1 roles stay in typography.css; spacing remains in tokens.css.
 * No viewport-wide patches or fixed content heights. */
.hero {
  --mio-hero-inset: 80px;
  padding: 0;
  background: #fff;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 640px) minmax(0, 800px);
  align-items: stretch;
  width: 1440px;
  max-width: 100%;
  min-height: 733px;
  height: auto;
  margin: 0 auto;
  background: #fff;
  overflow: hidden;
}
.hero-copy {
  position: relative;
  z-index: 3;
  min-width: 0;
  min-height: 733px;
  display: flex;
  flex-direction: column;
  padding-top: var(--mio-space-hero-start);
  padding-right: 40px;
  padding-bottom: calc(var(--mio-space-hero-end) + 10px);
  padding-left: var(--mio-hero-inset);
}
.hero-copy > * { flex-shrink: 0; }
.hero .eyebrow {
  margin: 0 0 12px;
  font-family: var(--mio-font-body);
  font-size: 13px;
  line-height: 13px;
  font-weight: 500;
  letter-spacing: 1.54px;
  color: #7a8694;
}
.hero h1.hero-title {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 560px;
  max-width: 560px;
  margin: 0 0 32px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.hero-title-main, .hero-title-accent {
  display: block;
  margin: 0;
  padding: 0;
  word-spacing: normal;
  white-space: normal;
}
.hero-title-main { color: #0e1116; }
.hero-title-accent { color: #5691b8; }
.hero-description {
  width: 520px;
  max-width: 100%;
  font-family: var(--mio-font-body);
  font-size: 14.5px;
  line-height: 1.75;
  color: #4e5a67;
  overflow-wrap: anywhere;
}
.hero-description p { margin: 0 0 26px; }
.hero-description p:last-child { margin-bottom: 0; }
.hero .stats {
  display: flex;
  align-items: center;
  gap: 40px;
  margin: 24px 0 10px;
}
.hero .stat { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hero .stat strong {
  display: block;
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
  color: #111722;
  text-transform: none;
}
.hero .stat span {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.1;
  color: #7a8694;
}
.hero .stat > div { min-width: 0; overflow-wrap: anywhere; }
.hero .stat-icon, .hero .contact-mini-icon, .hero .control-row-icon {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}
.hero .stat-icon, .hero .contact-mini-icon { width: 26px; height: 26px; }
.hero-actions {
  position: relative;
  z-index: 7;
  left: -48px;
  right: auto;
  bottom: auto;
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 260px);
  gap: 22px;
  width: auto;
}
.hero .contact-mini, .hero .hero-realizations {
  display: flex;
  align-items: center;
  gap: 16px;
  height: auto;
  min-height: 69px;
  min-width: 0;
  padding: 12px 20px;
  background: #fff;
  border: 1px solid #e4e9ef;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15,33,51,.08);
}
.hero .contact-mini > span, .hero .hero-realizations > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-wrap: anywhere;
}
.hero .contact-mini small, .hero .hero-realizations small {
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 1.32px;
  color: #a0a8b3;
}
.hero .contact-mini strong, .hero .hero-realizations strong {
  margin-top: 2px;
  font-size: 15px;
  line-height: 18px;
  font-weight: 700;
  color: #141b24;
}
.hero .hero-realizations strong { color: #5b95c3; }
.hero .hero-realizations > .hero-realizations-simple-arrow {
  display: block;
  margin-left: auto;
  color: #5691b8;
  font-family: var(--mio-font-body);
  font-size: 30px;
  line-height: 1;
  font-weight: 400;
  flex: 0 0 auto;
}
.hero-media {
  position: relative;
  background-image: var(--hero-image-desktop);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 441px;
  background: linear-gradient(90deg,#fff 0%,rgba(255,255,255,.96) 16%,rgba(255,255,255,.7) 53%,rgba(255,255,255,0) 100%);
  pointer-events: none;
}
.hero .control-panel {
  position: absolute;
  top: 56px;
  right: 155px;
  z-index: 6;
  width: 218px;
  height: auto;
  min-height: 0;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: linear-gradient(180deg,rgba(86,145,184,.94),rgba(23,85,142,.94));
  border-radius: 18px;
  color: #fff;
  box-shadow: 0 18px 44px rgba(13,43,79,.28);
}
.hero .control-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: auto;
  min-height: 45px;
  margin: 0;
  padding: 0;
  gap: 16px;
  border: 0;
  font-size: 13.5px;
  line-height: 1;
  font-weight: 500;
  text-align: left;
}
.hero .control-row-icon { width: 22px; height: 22px; flex: 0 0 22px; margin: 0; }
.hero .control-row span {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}
/* Legacy icon markup is hidden; current template uses image icons. */
.hero .stat .mio-icon, .hero .contact-mini .mio-icon,
.hero .hero-realizations .mio-icon, .hero-realizations-arrow,
.hero .hero-realizations > b { display: none; }

/* Desktop: preserve the two-line title and one-line contact address.
 * Text may still wrap when enlarged or replaced with longer content. */
@media (min-width: 1101px) {
  .hero h1.hero-title { width: 600px; max-width: 600px; }
  .hero .contact-mini, .hero .hero-realizations { gap: 12px; padding: 10px 20px; }
}

/* Large desktop: keep the image flush with the right edge without 100vw. */
@media (min-width: 1440px) {
  .hero { --mio-hero-inset: calc(max(0px, (100vw - 1440px) / 2) + 80px); }
  .hero-grid { width: 100%; grid-template-columns: minmax(0, 1fr) 800px; margin: 0; }

  .hero-actions {
    left: 0;
    grid-template-columns: repeat(3, 290px);
    width: 914px;
  }
  .hero .control-panel { right: 190px; }
}

/* Tablet: copy and contacts stay in flow, then the image. */
@media (min-width: 761px) and (max-width: 1100px) {
  .hero-grid { display: block; width: 100%; min-height: 0; }
  .hero-copy { display: block; min-height: 0; padding-right: 32px; padding-left: 32px; padding-bottom: var(--mio-space-hero-end); }
  .hero .eyebrow { margin-bottom: 14px; letter-spacing: 2px; color: #8d97a3; line-height: 1.2; }
  .hero h1.hero-title { max-width: 100%; gap: 2px; margin: 12px 0 18px; }
  .hero-title-main { color: #09111c; }
  .hero-title-accent { color: #5b95c3; }
  .hero-description { width: auto; font-size: 15px; color: #556271; }
  .hero .stats { gap: 48px; margin-top: 26px; flex-wrap: wrap; }
  .hero .stat strong { font-size: 18px; }
  .hero .stat span { font-size: 14px; }
  .hero-actions {
    position: static;
    inset: auto;
    width: auto;
    margin: 18px 32px 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }
  .hero .contact-mini, .hero .hero-realizations { min-height: 78px; padding: 12px 22px; box-shadow: none; }
  .hero .contact-mini small, .hero .hero-realizations small { font-size: 13px; letter-spacing: 1.8px; }
  .hero .contact-mini strong, .hero .hero-realizations strong { font-size: 20px; margin-top: 8px; line-height: 1.05; }
  .hero-media { height: 520px; }
  .hero-media::after { display: none; }
  .hero .control-panel { top: auto; bottom: 170px; right: 74px; box-shadow: none; }
  .hero .control-row { min-height: 44px; gap: 12px; }
}

/* Mobile matches the native Figma 390px frame (reference: Mobile - Home.svg).
   Header ends at 76px; hero reaches 668px, including all three CTA cards.
   Content grows naturally for longer user-edited texts, no clipping. */
@media (max-width: 760px) {
  .hero {
    position: relative;
    background: #fff;
    width: 100%;
    min-height: 592px;
    height: auto;
    isolation: isolate;
  }
  .hero-grid {
    position: relative;
    display: block;
    width: 100%;
    min-height: 592px;
    height: auto;
    overflow: visible;
    background: transparent;
  }
  .hero-copy {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 592px;
    height: auto;
    padding: 17px 11px 6px;
  }
  .hero .eyebrow {
    margin: 0 0 11px;
    font-size: 8px;
    line-height: 1.25;
    font-weight: 500;
    letter-spacing: 1.55px;
    color: #7b8b9e;
  }
  .hero h1.hero-title {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    margin: 0 0 13px;
    gap: 0;
    font-size: 20px;
    line-height: 1.26;
    font-weight: 800;
    letter-spacing: -.48px;
    overflow-wrap: normal;
  }
  .hero-title-main, .hero-title-accent { white-space: normal; }
  .hero-description {
    width: 100%;
    max-width: 348px;
    font-size: 13px;
    line-height: 1.6;
    font-weight: 400;
    color: #4e5a67;
    overflow-wrap: break-word;
  }
  .hero-description p { margin: 0 0 16px; }
  .hero-description p:last-child { margin-bottom: 0; }
  .hero .stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 348px;
    margin: 18px 0 11px;
    align-items: center;
  }
  .hero .stat { display: flex; gap: 7px; min-width: 0; align-items: center; }
  .hero .stat-icon { width: 24px; height: 24px; flex: 0 0 24px; }
  .hero .stat strong {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
  }
  .hero .stat span {
    margin-top: 2px;
    font-size: 8px;
    line-height: 1.2;
    white-space: normal;
  }
  .hero-actions {
    position: relative;
    inset: auto;
    left: auto;
    right: auto;
    bottom: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
    width: 289px;
    max-width: 100%;
    margin: auto 0 0 3px;
  }
  .hero .contact-mini, .hero .hero-realizations {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    min-height: 68px;
    height: auto;
    width: 100%;
    padding: 12px 17px;
    border: 1px solid #e4e9ef;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 7px 18px rgba(20, 45, 68, .06);
  }
  .hero .contact-mini-icon { width: 24px; height: 24px; flex: 0 0 24px; }
  .hero .contact-mini small, .hero .hero-realizations small {
    font-size: 10px;
    line-height: 1.25;
    font-weight: 500;
    letter-spacing: 1.4px;
    color: #8d9bb0;
  }
  .hero .contact-mini strong, .hero .hero-realizations strong {
    margin-top: 2px;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 800;
    overflow-wrap: anywhere;
    color: #121821;
  }
  .hero .hero-realizations strong { color: #5595c0; }
  .hero .hero-realizations > .hero-realizations-simple-arrow { font-size: 23px; }
  .hero-grid > .hero-media {
    position: absolute;
    z-index: 0;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    background-image: var(--hero-image-mobile);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
  }
  .hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    display: block;
    width: auto;
    height: 100%;
    background: rgba(255, 255, 255, .76);
    pointer-events: none;
  }
  .hero .control-panel { display: none; }
}
@media (min-width: 431px) and (max-width: 760px) {
  .hero .eyebrow { font-size: 10px; }
  .hero h1.hero-title { font-size: clamp(21px, 4.8vw, 28px); }
  .hero-description { font-size: clamp(13px, 2.2vw, 13px); line-height: 1.6; }
  .hero .stats { margin-top: 20px; }
}
@media (max-width: 359px) {
  .hero .eyebrow { letter-spacing: 1px; }
  .hero h1.hero-title { font-size: 19px; }
  .hero .stats { gap: 6px; }
  .hero .stat-icon { width: 21px; height: 21px; flex-basis: 21px; }
  .hero .stat strong { font-size: 12px; }
}
