/* Phone layout is a readable vertical catalogue; wide screens retain the carousel. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.modal-open { position: fixed; width: 100%; left: 0; right: 0; }
.mobile-project-filter, .dock-projects { display: none; }
.round-button { width: 44px; height: 44px; }
.menu-toggle[aria-expanded="true"] { background: var(--light); }

@media (max-width: 767px), (max-width: 950px) and (max-height: 500px) {
  :root { --gutter: max(20px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); --header: calc(64px + env(safe-area-inset-top, 0px)); --mobile-dock: calc(72px + env(safe-area-inset-bottom, 0px)); }
  html { scroll-padding-top: calc(var(--header) + 16px); scroll-padding-bottom: calc(var(--mobile-dock) + 16px); }
  body { padding-bottom: var(--mobile-dock); }
  .header { padding: env(safe-area-inset-top, 0px) var(--gutter) 0; gap: 12px; }
  .header .group-wordmark, .header-contact { display: none; }
  .group-logo { width: 44px; height: 44px; }
  .header-actions { gap: 8px; }
  .language-switch { gap: 0; }
  .language-switch button { min-width: 44px; min-height: 48px; padding: 8px; font-size: 12px; }
  .menu-toggle { width: 48px; height: 48px; align-items: center; border-radius: 6px; }
  .button { min-height: 48px; padding: 14px 16px; font-size: 15px; }
  .text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; line-height: 1.45; }
  h2, .section-heading h2 { font-size: clamp(30px, 8.2vw, 40px); line-height: 1.12; }
  .section { padding-top: 48px; padding-bottom: 48px; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
  .section-heading p:not(.eyebrow) { font-size: 16px; line-height: 1.55; }
  .section-heading p br { display: none; }
  .eyebrow, .section-heading .eyebrow { font-size: 12px; line-height: 1.5; }
  .hero { height: auto; min-height: min(660px, calc(100svh - var(--header) - var(--mobile-dock))); max-height: none; display: flex; flex-direction: column; justify-content: space-between; padding: 40px var(--gutter) 62px; }
  .hero-image, .hero-shade { position: absolute; inset: 0; }
  .hero-copy { position: relative; inset: auto; width: 100%; }
  .hero-copy h1 { font-size: clamp(38px, 11vw, 58px); }
  .hero-copy p { font-size: 17px; line-height: 1.5; margin: 16px auto 24px; max-width: 30em; }
  .hero-copy .button { font-size: 14px; min-height: 48px; }
  .hero .button-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-single .hero-caption { position: relative; inset: auto; margin-top: 100px; font-size: 13px; line-height: 1.5; }
  .photo-credit { left: 20px; right: 20px; bottom: 4px; min-height: 44px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 10px; }
  .vision { padding-top: 24px; padding-bottom: 48px; }
  .vision-panel { display: flex; flex-direction: column; min-height: 0; }
  .founder-portrait { height: auto; aspect-ratio: 4/3; }
  .founder-portrait img { object-position: 27% 32%; }
  .vision-copy { padding: 28px 24px; }
  .vision-copy h2 { font-size: clamp(28px, 7.6vw, 36px); }
  .vision-copy blockquote { font-size: 16px; line-height: 1.65; }
  .founder-signature strong { font-size: 16px; }
  .founder-signature span { font-size: 13px; }
  .film-section { padding-top: 0; }
  .film-frame { min-height: 0; aspect-ratio: 16/9; }
  .film-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .film-actions .button { min-height: 48px; font-size: 15px; }
  .film-actions .text-link { margin: 0; justify-content: center; }
  .projects { padding-bottom: 48px; }
  .filters { display: none; }
  .mobile-project-filter { display: grid; gap: 8px; margin-bottom: 12px; }
  .mobile-project-filter label { font-size: 13px; color: var(--muted); }
  .mobile-project-filter select { width: 100%; min-width: 0; min-height: 50px; padding: 12px 36px 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: #f4f4f4; color: var(--ink); font: inherit; font-size: 16px; }
  .mobile-project-filter select:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
  #project-count { position: static; width: auto; height: auto; margin: 0 0 20px; padding: 0 var(--gutter); clip: auto; overflow: visible; white-space: normal; color: var(--muted); font-size: 13px; }
  .project-track { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; overflow: visible; scroll-snap-type: none; padding: 0 var(--gutter); }
  .project-card { display: grid; grid-template-rows: auto 1fr; min-height: 0; height: auto; max-height: none; padding: 0; gap: 0; color: var(--ink); background: #f4f4f4; border-radius: 10px; }
  .project-card:after { display: none; }
  .project-visual { position: relative; inset: auto; aspect-ratio: 16/10; z-index: 0; overflow: hidden; }
  .project-top { position: absolute; inset: 14px 14px auto; gap: 12px; z-index: 1; align-items: flex-start; }
  .project-category { flex: 0 1 auto; max-width: calc(100% - 92px); padding: 7px 9px; background: #171a20e8; color: white; font-size: 12px; line-height: 1.4; border-radius: 4px; }
  .project-logo { width: 80px; height: 54px; max-width: 32%; margin-left: auto; padding: 6px; }
  .project-copy { display: flex; flex-direction: column; margin: 0; padding: 22px; }
  .project-copy h3 { font-size: clamp(24px, 6.5vw, 30px); line-height: 1.15; margin-bottom: 10px; overflow-wrap: anywhere; }
  .project-copy > p { font-size: 16px; line-height: 1.55; color: var(--muted); }
  .project-buttons { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px; margin-top: 20px; }
  .project-buttons .button { width: 100%; min-width: 0; min-height: 48px; padding: 13px 10px; font-size: 14px; }
  .project-buttons .button-light { background: white; border: 1px solid #d8d9db; }
  .project-prev, .project-next, .project-pagination { display: none; }
  .association-note { grid-template-columns: 48px minmax(0, 1fr); margin-top: 28px; padding: 24px 20px; gap: 16px; }
  .association-note h3 { font-size: 24px; }
  .association-note p { font-size: 15px; }
  .association-note .button { grid-column: 1/-1; justify-self: stretch; }
  .region-countries { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .region-countries p { font-size: 15px; }
  .region-countries .button { justify-self: stretch; }
  .regional-map { margin-top: 24px; overflow: hidden; }
  .investment-panel { padding: 28px 22px; gap: 24px; }
  .investment-panel h2 { font-size: 32px; }
  .investment-panel h2 br { display: initial; }
  .investment-panel > div > p:not(.eyebrow) { font-size: 16px; }
  .investment-row { min-height: 58px; font-size: 15px; padding: 16px 0; }
  .budget-note { font-size: 13px!important; line-height: 1.6; }
  .partners, .team { padding-top: 0; }
  .partner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .partner-card { min-height: 142px; padding: 18px 12px; gap: 12px; }
  .partner-card span { font-size: 12px; line-height: 1.45; }
  .partner-card img { filter: none; opacity: 1; }
  .team-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .team-card, .team-card:first-child, .team-ai { display: grid; grid-template-columns: minmax(0, 34%) minmax(0, 1fr); grid-template-rows: auto auto 1fr; grid-column: auto; column-gap: 18px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
  .team-photo, .team-card:first-child .team-photo, .team-ai .team-photo { grid-column: 1; grid-row: 1/5; aspect-ratio: 3/4; margin: 0; }
  .team-card h3, .team-card:first-child h3, .team-ai h3 { grid-column: 2; align-self: start; font-size: 20px; margin: 0 0 8px; line-height: 1.2; }
  .team-card p, .team-card .team-detail { grid-column: 2; font-size: 14px!important; line-height: 1.55; }
  .team-card .team-detail { margin-top: 8px; }
  .team-contacts { grid-column: 1 / -1; margin-top: 16px; padding: 10px 14px; border-radius: 6px; background: var(--light); font-size: 14px; }
  .team-ai .team-photo img { padding: 0; width: 100%; height: 100%; object-fit: cover; }
  .team-chat { grid-column: 2; margin-top: 8px; font-size: 14px; padding-block: 8px; }
  .media-heading { flex-wrap: wrap; gap: 8px 20px; }
  .media-heading .text-link { margin: 0; font-size: 14px; }
  .news-list { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .news-content { padding: 24px; }
  .news-meta { font-size: 12px; line-height: 1.5; }
  .news-content h4 { font-size: 23px; }
  .news-content b { font-size: 14px; }
  .contact { height: auto; min-height: 0; padding: 44px var(--gutter) 28px; }
  .contact-image, .contact-shade { position: absolute; inset: 0; }
  .contact-shade { background: linear-gradient(180deg,#0009,#0005,#000b); }
  .contact-copy { position: relative; inset: auto; }
  .contact-copy h2 { font-size: 36px; }
  .contact-copy p { font-size: 16px; max-width: none; }
  .contact .button-pair { flex-direction: column; }
  .contact .button { font-size: 15px; }
  .contact address { position: relative; inset: auto; display: flex; flex-direction: column; gap: 6px; margin-top: 72px; }
  .contact address a { display: flex; align-items: center; justify-content: center; min-height: 44px; font-size: 14px; max-width: 100%; }
  .contact address span { font-size: 13px; line-height: 1.6; margin-top: 8px; }
  .footer { font-size: 13px; padding: 24px var(--gutter); gap: 16px; }
  .footer nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; width: 100%; }
  .footer nav a, .footer button { display: flex; align-items: center; justify-content: center; min-height: 44px; font-size: 13px; padding: 8px; }
  .contact-dock { height: var(--mobile-dock); padding: 10px max(16px,env(safe-area-inset-right,0px)) calc(10px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px)); gap: 10px; backdrop-filter: none; background: #fff; }
  .dock-projects { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-weight: 500; flex: 0 0 auto; }
  .dock-chat { flex: 1; width: auto; max-width: none; min-height: 48px; height: auto; gap: 8px; padding: 8px 12px; font-size: 13px; }
  .dock-ansara-logo { width: 54px; height: 28px; }
  .dock-send, .dock-contact { display: none; }
  body.modal-open .contact-dock { visibility: hidden; }
  dialog::backdrop { backdrop-filter: none; background: #0008; }
  .site-menu { width: 100%; max-width: 100%; padding: calc(16px + env(safe-area-inset-top,0px)) max(24px,env(safe-area-inset-right,0px)) calc(24px + env(safe-area-inset-bottom,0px)) max(24px,env(safe-area-inset-left,0px)); }
  .dialog-top { position: sticky; top: env(safe-area-inset-top,0px); background: white; z-index: 3; padding-block: 8px; margin-bottom: 18px; }
  .site-menu nav { gap: 0; }
  .site-menu nav a { font-size: 25px; min-height: 60px; padding: 16px 0; }
  .site-menu .menu-email { font-size: 14px; min-height: 44px; margin-top: 24px; padding-block: 12px; }
  .project-dialog { inset: 0; margin: 0; width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; padding-bottom: env(safe-area-inset-bottom,0px); }
  .dialog-close { top: calc(12px + env(safe-area-inset-top,0px)); margin: calc(12px + env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) -56px 0; box-shadow: 0 1px 8px #0002; }
  .dialog-visual { height: auto; aspect-ratio: 16/9; }
  .dialog-body { padding: 26px max(24px,env(safe-area-inset-right,0px)) 32px max(24px,env(safe-area-inset-left,0px)); }
  .dialog-title { font-size: 32px; }
  .dialog-tagline { font-size: 19px; }
  .dialog-description { font-size: 16px; line-height: 1.65; }
  .dialog-details { font-size: 15px; line-height: 1.65; padding-left: 20px; }
  .dialog-details li+li { margin-top: 10px; }
  .dialog-actions { flex-direction: column; align-items: stretch; gap: 8px; margin: 24px 0 12px; }
  .dialog-actions .text-link { justify-content: center; }
  .dialog-home { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; line-height: 1.5; }
  .chat-dialog { top: calc(var(--viewport-top,0px) + 8px + env(safe-area-inset-top,0px)); bottom: auto; margin: 0 auto; width: calc(100% - 24px); max-width: 480px; max-height: calc(var(--viewport-height,100dvh) - 16px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)); padding: 26px max(24px,env(safe-area-inset-right,0px)) 26px max(24px,env(safe-area-inset-left,0px)); border-radius: 12px; scroll-padding-block: 20px; }
  .chat-brand { width: 126px; height: 54px; }
  .chat-close { position: sticky; float: right; top: 12px; right: auto; margin: -14px -12px -30px 0; z-index: 3; box-shadow: 0 1px 6px #0002; }
  .chat-dialog > p:not(.eyebrow) { font-size: 15px; }
  .chat-topics { gap: 8px; margin: 18px 0; }
  .chat-topics button { min-height: 44px; padding: 10px 14px; font-size: 14px; }
  .chat-dialog label { font-size: 14px; }
  .chat-dialog textarea { font-size: 16px; min-height: 100px; line-height: 1.5; }
  .chat-dialog small { font-size: 12px; line-height: 1.5; }
}

@media (max-width: 359px) {
  :root { --gutter: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); }
  .project-copy { padding: 18px; }
  .project-buttons { grid-template-columns: minmax(0, 1fr); }
  .team-card, .team-card:first-child, .team-ai { column-gap: 14px; }
  .team-card h3 { font-size: 18px; }
  .dock-projects { padding-inline: 12px; }
  .dock-chat { padding-inline: 10px; }
  .dock-ansara-logo { display: none; }
}
@media (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
  .hero { padding-top: 28px; }
  .hero-copy h1 { font-size: 42px; }
  .project-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-single .hero-caption { margin-top: 52px; }
  .founder-portrait { aspect-ratio: 16/8; }
  .dialog-visual { max-height: 180px; }
}
@media (hover: none) {
  .project-card:hover .project-photo, .team-card:hover img, .news-item:hover .news-cover img { transform: none; }
}

@media (pointer: coarse) {
  .carousel-arrow { width: 44px; height: 44px; }
  .project-pagination { flex-wrap: wrap; }
  .project-pagination button { width: 44px; height: 44px; }
  .project-pagination button:after { top: 17px; left: 17px; }
}
