/* Responsive refinements. The original palette, images and composition stay in styles.css. */
html, body { max-width: 100%; overflow-x: hidden; overflow-x: clip; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:where(p, small, label, figcaption, dd) {
  overflow-wrap: anywhere;
}
:where(h1, h2, h3, strong, blockquote) {
  overflow-wrap: normal;
  word-break: normal;
}
:where(.intro-layout, .section-heading, .approach-layout, .service-grid,
  .process-panel, .process-tabs, .management-heading, .team-grid,
  .management-grid, .founder-entry-card, .leader-hero, .leader-profile-grid,
  .leader-facts, .leader-principles-heading, .leader-principles-grid,
  .leader-return, .contact, .company-facts, .steps li) > * { min-width: 0; }
.service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.process-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.process-panel { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.team-grid, .management-grid, .leader-facts, .leader-principles-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.company-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.founder-entry-card { grid-template-columns: minmax(0, 1.05fr) minmax(0, .72fr); }
.leader-hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, .68fr); }
.contact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.leader-hero h1 { font-size: clamp(2.5rem, 5.1vw, 6.4rem); line-height: 1.08; }
.hero h1 { font-size: clamp(2.5rem, 5.8vw, 6rem); line-height: 1.08; letter-spacing: -.035em; }
.hero h1 span, .leader-hero h1 span { letter-spacing: 0; font-kerning: normal; }
html[lang="ky"] .hero h1 .ky-solid-line {
  color: #fff;
  -webkit-text-stroke: 0;
}
.hero-content { max-width: 64rem; padding-right: .15rem; }
.leader-hero-copy { padding-right: max(1.25rem, 3.5vw); }
.leader-actions, .hero-actions { flex-wrap: wrap; }
.button-label { min-width: 0; overflow-wrap: anywhere; }
.button > [aria-hidden="true"] { flex-shrink: 0; }
.eyebrow::before, .location > span, .founder-entry-link b { flex-shrink: 0; }
.founder-entry-link b { min-width: 2.8rem; }
.contact-links { flex-wrap: wrap; }
.contact-links a { flex: 1 1 10rem; min-width: 0; }
.contact-form, .field, input, select, textarea { min-width: 0; }
.contact-form { grid-template-columns: minmax(0, 1fr); }
.form-note, .section-number { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.field textarea { min-height: 6rem; }
.field label, .form-note, .founder-entry-person span { font-size: .875rem; }
.form-note { line-height: 1.6; }
.form-fallback { color: var(--sky); text-decoration: underline; text-underline-offset: .2em; }
a, button, input, select, textarea { -webkit-tap-highlight-color: rgba(89,185,255,.2); }
:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--sky); outline-offset: 4px;
}
.skip-link { position: fixed; top: .5rem; left: 1rem; z-index: 100;
  width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden;
  padding: 0; background: var(--navy); color: white; }
.skip-link:focus { width: auto; height: auto; max-width: calc(100% - 2rem);
  clip-path: none; overflow: visible; padding: .7rem 1rem; }
section[id] { scroll-margin-top: 1.5rem; }
.whatsapp-float { right: max(1.2rem, env(safe-area-inset-right)); max-width: calc(100vw - 2.4rem);
  bottom: max(1.2rem, env(safe-area-inset-bottom)); }
footer { padding-bottom: 6rem; }
.menu-button[aria-expanded="true"] span:first-child { transform: translateY(.25rem) rotate(45deg); }
.menu-button[aria-expanded="true"] span:last-child { transform: translateY(-.25rem) rotate(-45deg); }
.menu-button span { transition: transform .2s; }
.language-switch { display: flex; align-items: center; gap: .25rem; flex-shrink: 0; }
.language-switch a { display: grid; place-items: center; width: 2.15rem; min-height: 2.15rem;
  padding: 0; border: 1px solid rgba(255,255,255,.24); font: 700 .68rem/1 Montserrat, sans-serif;
  letter-spacing: .04em; opacity: .72; transition: background-color .2s, border-color .2s, opacity .2s; }
.language-switch a:hover { border-color: rgba(255,255,255,.65); opacity: 1; }
.language-switch a[aria-current="page"] { border-color: var(--sky); background: var(--blue); color: #fff; opacity: 1; }

@media (max-width: 1100px) {
  .nav { gap: 1rem; }
  .nav .nav-cta { padding-inline: .7rem; }
}
@media (min-width: 861px) {
  .hero-meta { right: calc(var(--pad) + 4rem); }
}
@media (max-width: 1000px) {
  .process-panel, .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .management-grid, .leader-principles-grid { grid-template-columns: minmax(0, 1fr); }
  .leader-actions { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 860px) {
  .contact { grid-template-columns: minmax(0, 1fr); }
  .company-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { max-height: calc(100svh - 6.5rem); overflow-y: auto; }
  .nav a { min-height: 44px; font-size: 1rem; }
  .nav .nav-cta { padding-inline: 0; }
  .language-switch { gap: .55rem; padding-top: 1rem; }
  .nav .language-switch a { width: 2.75rem; min-height: 2.75rem; padding: 0;
    border: 1px solid rgba(255,255,255,.24); font-size: .75rem; }
  .hero { min-height: auto; padding-bottom: 2.75rem; }
  .hero-meta { position: relative; left: auto; right: auto; bottom: auto;
    margin-top: 2.25rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.16); }
}
@media (max-width: 760px) {
  .service-card--bitumen .service-index { top: 1.4rem; right: 1.4rem; }
  .process-tabs, .founder-entry-card, .leader-hero, .leader-facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .leader-hero h1 { font-size: clamp(1.75rem, 7.2vw, 3.4rem); letter-spacing: -.045em; }
  .leader-hero-copy { padding-inline: var(--pad); padding-bottom: 3rem; }
  .leader-hero-photo { min-height: 0; aspect-ratio: 3 / 4; }
  .management-portrait figcaption { left: 1.25rem; right: 1.25rem; max-width: none; }
  .management-portrait { min-height: 38rem; }
}
@media (max-width: 580px) {
  .service-grid, .process-panel, .team-grid, .company-facts { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: clamp(1.9rem, 8.7vw, 2.85rem); line-height: 1.12; }
  :where(.intro, .section-heading, .approach, .contact, .management-heading,
    .founder-entry-copy, .leader-profile, .leader-principles, .leader-return) h2 {
    font-size: clamp(1.65rem, 7.5vw, 2.5rem); line-height: 1.18; letter-spacing: -.035em;
  }
  .hero-lead { font-size: 1rem; }
  .eyebrow, .kicker { font-size: .875rem; letter-spacing: .07em; line-height: 1.6; }
  .eyebrow { grid-template-columns: 1.5rem minmax(0, 1fr); }
  .eyebrow::before { width: 1.5rem; }
  .section-number { font-size: .8rem; letter-spacing: .12em; }
  .hero-actions .text-link { display: inline-block; }
  .service-card, .process-step, .management-grid article { padding: 1.4rem; }
  .steps li { grid-template-columns: 2rem minmax(0, 1fr); gap: .7rem; }
  .contact-links a { flex: auto; }
  .contact-form { padding: 1.2rem; }
  .button { max-width: 100%; gap: min(1rem, 3vw); padding-inline: min(1.25rem, 5vw); text-align: left; }
  .founder-entry-copy { padding: 2rem 1.4rem; }
  .founder-entry-link { gap: 1rem; }
  .founder-entry-photo figcaption, .leader-hero-photo figcaption { left: 1.25rem; right: 1.25rem; }
  .management-portrait figcaption strong { font-size: clamp(1.35rem, 6vw, 1.85rem); }
  .leader-quote blockquote { font-size: clamp(1.75rem, 7.5vw, 2.5rem); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Some iOS in-app viewers expose a desktop layout viewport inside a narrow
   physical screen. Force the established mobile composition on those devices. */
@media (max-device-width: 860px) {
  :root { --pad: max(1.25rem, env(safe-area-inset-left)); }
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; overflow-x: clip; }
  .site-header { position: absolute; padding-right: max(1.25rem, env(safe-area-inset-right));
    padding-left: max(1.25rem, env(safe-area-inset-left)); }
  .brand-logo { width: 9.5rem; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; display: none;
    flex-direction: column; align-items: stretch; gap: 0; max-height: calc(100svh - 6.5rem);
    overflow-y: auto; padding: 1rem max(1.25rem, env(safe-area-inset-right)) 1.5rem
      max(1.25rem, env(safe-area-inset-left)); background: var(--navy); }
  .nav.open { display: flex; }
  .nav a { min-height: 44px; padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,.12);
    font-size: 1rem; }
  .nav .nav-cta { padding-inline: 0; border: 0; }
  .menu-button { display: block; flex: 0 0 3rem; }
  .language-switch { gap: .55rem; padding-top: 1rem; }
  .nav .language-switch a { width: 2.75rem; min-height: 2.75rem; padding: 0;
    border: 1px solid rgba(255,255,255,.24); font-size: .75rem; }

  .hero { display: block; min-height: auto; padding: 8.5rem max(1.25rem, env(safe-area-inset-right))
    2.75rem max(1.25rem, env(safe-area-inset-left)); background-position: 62% center; }
  .hero-content { width: 100%; max-width: 100%; padding-right: 0; }
  .eyebrow { display: grid; grid-template-columns: 1.5rem minmax(0,1fr); gap: .7rem;
    align-items: start; font-size: .75rem; line-height: 1.55; letter-spacing: .08em; }
  .eyebrow::before { width: 1.5rem; margin-top: .7em; }
  .hero h1 { max-width: 100%; font-size: 2.15rem; line-height: 1.1; letter-spacing: -.035em;
    overflow-wrap: normal; word-break: normal; }
  .hero-lead { max-width: 100%; font-size: 1rem; line-height: 1.65; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: .8rem; margin-top: 1.8rem; }
  .hero-actions .text-link { display: none; }
  .hero-meta { position: relative; left: auto; right: auto; bottom: auto; display: grid;
    grid-template-columns: minmax(0,1fr); gap: .55rem; margin-top: 2.25rem;
    padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.16); }
  .hero-meta div { display: grid; grid-template-columns: 2rem minmax(0,1fr); }
  .hero-meta strong, .hero-meta small { display: block; }
  .hero-meta small { grid-column: 2; }
  .scroll-note { display: none; }

  .section-pad { padding: 4.5rem max(1.25rem, env(safe-area-inset-right)) 4.5rem
    max(1.25rem, env(safe-area-inset-left)); }
  .intro-layout, .section-heading, .approach-layout, .contact, .management-heading,
  .leader-profile-grid, .leader-principles-heading, .leader-return,
  .service-grid, .process-tabs, .process-panel, .team-grid, .management-grid,
  .company-facts, .founder-entry-card, .leader-hero, .leader-facts,
  .leader-principles-grid { grid-template-columns: minmax(0,1fr); }
  :where(.intro, .section-heading, .approach, .contact, .management-heading,
    .founder-entry-copy, .leader-profile, .leader-principles, .leader-return) h2 {
    font-size: 2rem; line-height: 1.18; letter-spacing: -.035em; }
  .section-heading { align-items: start; }
  .section-heading p { max-width: 38rem; }
  .company-facts, .management-grid { margin-top: 3rem; }
  .service-card { min-height: 19rem; padding: 1.4rem; }
  .service-icon { margin-bottom: 3.2rem; }
  .approach-title { position: static; }
  .steps li { grid-template-columns: 2rem minmax(0,1fr); gap: .7rem; }
  .process-tab { min-height: 4.4rem; border-right: 0; border-bottom: 1px solid #bbc7d1; }
  .process-tab:last-child { border-bottom: 0; }
  .process-step { min-height: 18rem; padding: 1.4rem; }
  .team-heading, .management-transition, .bitumen-transition { align-items: flex-start;
    flex-direction: column; }
  .team-heading span { text-align: left; }
  .management-grid article { min-height: 0; padding: 1.4rem; }
  .management-grid h3 { margin-top: 3rem; }
  .management-portrait { min-height: 38rem; }
  .management-portrait img { top: 0; right: 0; width: 100%; height: 76%; object-fit: contain;
    object-position: center top; -webkit-mask-image: none; mask-image: none; }
  .management-portrait::after { background: linear-gradient(0deg,rgba(6,20,37,.96) 0%,
    rgba(6,20,37,.5) 43%,transparent 72%); }
  .founder-entry-copy, .founder-entry-card--text .founder-entry-copy { grid-template-columns: 1fr;
    gap: 2.5rem; padding: 3rem 1.4rem; }
  .founder-entry-main h2 { font-size: 2rem; line-height: 1.14; }
  .founder-entry-details { padding: 2rem 0 0; border-left: 0;
    border-top: 1px solid rgba(255,255,255,.18); }

  .service-card--bitumen { min-height: 30rem; }
  .service-card--bitumen > img { object-position: 64% center; }
  .service-card--bitumen::before { background: linear-gradient(0deg,rgba(6,20,37,.98) 0%,
    rgba(6,20,37,.82) 54%,rgba(6,20,37,.2) 100%); }
  .service-card--bitumen .service-card-content { justify-content: flex-end; min-height: 30rem;
    padding: 2rem 1.4rem; }
  .bitumen-flow { padding: 2rem 1.4rem; }
  .bitumen-flow-heading, .bitumen-flow-steps { grid-template-columns: minmax(0,1fr); }
  .bitumen-flow-heading { gap: 1rem; }
  .bitumen-flow-steps li { min-height: 0; }
  .rail-logistics { min-height: 42rem; }
  .rail-logistics > img { object-position: 67% center; }
  .rail-logistics::before { background: linear-gradient(0deg,rgba(6,20,37,.99) 0%,
    rgba(6,20,37,.92) 54%,rgba(6,20,37,.25) 100%); }
  .rail-logistics .service-index { top: 1.4rem; right: 1.4rem; }
  .rail-logistics-content { justify-content: flex-end; min-height: 42rem; padding: 2rem 1.4rem; }
  .rail-logistics h3 { font-size: 2rem; line-height: 1.14; }

  .contact { gap: 3rem; }
  .contact-links { grid-template-columns: minmax(0,1fr); }
  .contact-links a { min-width: 0; }
  .contact-form { padding: 1.2rem; }
  .button { max-width: 100%; gap: 1rem; padding-inline: 1.1rem; text-align: left; }
  footer { align-items: flex-start; flex-direction: column; flex-wrap: wrap;
    padding-right: max(1.25rem, env(safe-area-inset-right));
    padding-left: max(1.25rem, env(safe-area-inset-left)); }
  footer > p { width: 100%; }
  .copyright { text-align: left; }

  .leader-hero-copy { max-width: 100%; padding: 9rem max(1.25rem, env(safe-area-inset-right)) 3rem
    max(1.25rem, env(safe-area-inset-left)); }
  .leader-hero h1 { font-size: 2.5rem; line-height: 1.08; letter-spacing: -.045em; }
  .leader-actions { align-items: flex-start; flex-direction: column; }
  .leader-principles-grid article { min-height: 18rem; }
  .leader-principles-grid h3 { margin-top: 5rem; }
  .leader-quote blockquote { font-size: 2.1rem; }
}

/* Compact phones: keep every line inside the screen and reduce the empty
   vertical space above the main message. */
@media (max-width: 580px), (max-device-width: 580px) {
  .site-header {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  .brand-logo { width: 8.6rem; }
  .hero {
    padding-top: 6.8rem;
    padding-bottom: 2.25rem;
  }
  .hero h1 {
    font-size: clamp(1.8rem, 8.3vw, 2.35rem);
    line-height: 1.1;
  }
  .hero-lead {
    margin-top: 1.2rem;
    font-size: .95rem;
    line-height: 1.55;
  }
  .hero-actions { margin-top: 1.25rem; }
  .hero-meta { margin-top: 1.6rem; }
}

/* Russian and Kyrgyz hero copy is longer than the English version. Keep the
   same composition while giving the supporting text and actions room to stay
   in the first viewport. English intentionally keeps its existing scale. */
@media (min-width: 861px) {
  html[lang="ky"] .hero h1 .ky-solid-line,
  html[lang="ky"] .hero h1 .ky-outline-line {
    display: block;
  }
  html[lang="ky"] .hero h1 br { display: none; }
  html[lang="ky"] .hero h1 {
    font-size: clamp(2.35rem, 4.35vw, 4.85rem);
    line-height: 1.05;
  }
  html[lang="ru"] .hero h1 {
    font-size: clamp(2.45rem, 4.7vw, 5.15rem);
    line-height: 1.05;
  }
  html[lang="ky"] .hero-lead,
  html[lang="ru"] .hero-lead { margin-top: 1.55rem; }
  html[lang="ky"] .hero-actions,
  html[lang="ru"] .hero-actions { margin-top: 1.75rem; }
  html[lang="ky"] .hero-meta { bottom: 1rem; }
  html[lang="ky"] .scroll-note { bottom: 1.3rem; }
}

@media (max-width: 860px), (max-device-width: 860px) {
  html[lang="ky"] .hero h1 {
    font-size: clamp(1.65rem, 7.6vw, 2rem);
    line-height: 1.1;
  }
  html[lang="ru"] .hero h1 {
    font-size: clamp(1.7rem, 8vw, 2.05rem);
    line-height: 1.1;
  }
}
