/* =====================================================================
   RONIC — responsive layer  (loaded LAST on every page)

   1. All other stylesheets express sizes in rem (converted from px).
      The root is 16px up to 1440px, so laptops and below render exactly
      as designed. Above 1440px the root grows fluidly, so type, spacing
      and the container scale together on large monitors instead of
      floating in a small column.
   2. This file then fixes section-level behaviour per viewport class:
        mobile  ≤ 600   · tablet ≤ 900 / ≤ 1100   · laptop 1101–1440
        desktop 1441–2199 · large ≥ 2200
   ===================================================================== */

/* ---------- 1. fluid root scale ---------- */
html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (min-width: 1441px) {
  html { font-size: min(calc(100% + (100vw - 1440px) * .0036), 175%); }
}

:root {
  --page-gutter: 1.5rem;
  --header-h: 5.25rem;
}
@media (max-width: 600px) { :root { --page-gutter: 1.125rem; } }
@media (max-width: 380px) { :root { --page-gutter: 1rem; } }

/* ---------- 2. one container width everywhere ----------
   Hero (1100), feature cards (1160) and sections (1200) used different
   widths, so left edges did not line up. */
.container,
.hero-section .container,
.hero-content,
.hero-features-section .container,
.hero-bottom,
.hero-bottom.reveal-on-scroll,
.hero-bottom.reveal-on-scroll.is-visible {
  width: min(var(--container-width), calc(100% - 2 * var(--page-gutter))) !important;
  margin-inline: auto !important;
}

/* Sub-page heroes (About, Contact, Services): the copy column was a narrow
   box pinned near the screen edge (or on a fixed 1280px formula), so it never
   lined up with the logo or the sections below. On desktop-size screens, pin
   its left edge to the shared container and keep the original reading width. */
@media (min-width: 901px) {
  :root { --hero-left: max(var(--page-gutter), calc((100vw - var(--container-width)) / 2)); --hero-copy: 38rem; }
  /* the hero is a copy | visual grid: widen the copy cell by the container offset */
  :root body .service-hero { justify-content: flex-start; }
  :root body .service-hero.co-hero { grid-template-columns: calc(var(--hero-left) + var(--hero-copy)) minmax(0, 1fr); }
  :root body .service-hero > .container,
  :root body .co-hero > .container,
  :root body .service-hero-content {
    margin-left: var(--hero-left) !important;
    margin-right: 0 !important;
    width: var(--hero-copy) !important;
    max-width: calc(100vw - var(--hero-left) - var(--page-gutter)) !important;
  }
}

/* media never exceeds its box */
img, video, svg, canvas, iframe { max-width: 100%; }
img { height: auto; }
.hero-image img, .hero-image video, .ind-card-image img,
.timeline-photo-wrap img, [class*="-visual"] img { height: 100%; }

/* long words never force overflow */
h1, h2, h3, h4, p, li, a, summary, label { overflow-wrap: break-word; }

/* =====================================================================
   TABLET & BELOW  (≤ 1100)
   ===================================================================== */
@media (max-width: 1100px) {
  /* home timeline: photo was a fixed 36rem wide, spilling over the copy */
  .timeline-photo-wrap { width: 100%; max-width: 100%; }
  .timeline-detail.is-active,
  .timeline-detail { min-width: 0; }
  .timeline-detail-copy { min-width: 0; }
}

/* =====================================================================
   TABLET  (≤ 900)
   ===================================================================== */
@media (max-width: 900px) {
  /* section headings: stack instead of squeezing the title into a sliver
     next to its intro paragraph (broke words mid-way on the Industries page) */
  .section-heading,
  .ind-section-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: .875rem;
  }
  .section-heading > div { max-width: 100%; }
  .section-heading > p,
  .ind-section-heading > p { max-width: 38rem; margin-top: 0; font-size: .875rem; line-height: 1.75; }
  .section-heading h2 { overflow-wrap: normal; word-break: normal; hyphens: manual; }

  /* home contact panel: heading above form, form uses full width */
  .contact-panel { grid-template-columns: 1fr !important; gap: 1.75rem; padding: clamp(1.5rem, 5vw, 2.5rem); }
  .contact-copy { max-width: 36rem; }
  .contact-form { width: 100%; grid-template-columns: 1fr !important; gap: .5rem; }
  .contact-form label { margin-top: .5rem; }
  .contact-form label:first-child { margin-top: 0; }

  /* Industries hero: content height, no empty band */
  .ind-hero { min-height: 0; padding-bottom: 2rem; }

  /* hero: size to its content instead of forcing a full viewport.
     Tablet/phone heroes had large empty bands above/below the copy. */
  .hero-section { min-height: 0 !important; padding-top: calc(var(--header-h) + clamp(2rem, 8vh, 4.5rem)) !important; padding-bottom: clamp(2.5rem, 8vh, 4.5rem) !important; }
  .hero-section .container,
  .hero-content { min-height: 0 !important; }
  .hero-features-section { margin-top: 0 !important; padding-top: 1.5rem !important; }
}

/* ---- legibility floor on touch-size screens: reading text never below 12-13px ---- */
@media (max-width: 900px) {
  .ronic-footer-column a, .ronic-footer-bottom, .ronic-footer-bottom a, .ronic-footer-bottom span,
  .back-to-top { font-size: .8125rem; }
  .ind-card-body li, .ind-capability p, .ind-capability > b, .ind-card-link,
  .ind-proofline span, .ind-process-steps p,
  .contact-form label, .form-note, .contact-copy p,
  .timeline-point small, .timeline-next, .timeline-detail-nav em,
  .service-tile .tile-copy b, .flow-step-content small,
  .traceability-data-item small,
  .mobile-feature strong, .mobile-feature small,
  .floating-spec-card strong, .floating-spec-card small,
  .faq-contact-link, .image-caption,
  .traceability-image-label, .traceability-image-caption span, .qr-visual-note { font-size: .75rem; }
  .ind-card-body li, .ind-capability p, .ind-process-steps p, .contact-form label,
  .form-note, .traceability-data-item small { font-size: .75rem; line-height: 1.7; }
  .eyebrow, .production-tag, .timeline-photo-index, .timeline-duration span,
  .engineering-step-label, .art-caption, .faq-eyebrow, .overview-kicker,
  .service-hero-meta span, .service-hero-meta a, .hero-side-label span,
  .engineering-card-kicker { font-size: .6875rem; }
}

/* =====================================================================
   MOBILE  (≤ 600)
   ===================================================================== */
@media (max-width: 600px) {
  .hero-section { padding-top: calc(var(--header-h) + 1.5rem) !important; padding-bottom: 2rem !important; }
  .section-heading > p, .ind-section-heading > p { font-size: .875rem; }
  .service-text-link, .engineering-step-description { font-size: .75rem; }
}

/* =====================================================================
   LARGE SCREENS  (≥ 1441): rem scaling does the work; keep line
   lengths comfortable and let backgrounds run edge to edge.
   ===================================================================== */
@media (min-width: 1441px) {
  .hero-section { min-height: min(100svh, 62.5rem) !important; }
}
@media (min-width: 2200px) {
  :root { --container-width: 80rem; }
}

/* =====================================================================
   DEVICE CAPABILITY
   ===================================================================== */
/* notches / rounded corners: purely additive (0 on devices without a cutout) */
.site-footer::after { content: ""; display: block; height: env(safe-area-inset-bottom, 0px); }

/* touch: comfortable tap targets */
@media (pointer: coarse) {
  .button, .form-submit, button, summary,
  .menu a, .site-footer a, footer a, .contact-form input, .contact-form select { min-height: 2.75rem; }
  footer a, .site-footer a { display: inline-flex; align-items: center; }
}
