/* Viewport and device insets are shared by the header, content and overlays. */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --header-block: 100px;
  --mobile-gutter: clamp(20px, 5.5vw, 32px);
  --page-left: max(var(--mobile-gutter), var(--safe-left));
  --page-right: max(var(--mobile-gutter), var(--safe-right));
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; scroll-padding-top: calc(var(--header-block) + 16px); }
html.scroll-restoring { scroll-behavior: auto !important; }
button, a, summary { touch-action: manipulation; }
body.scroll-locked { position: fixed; inset-inline: 0; width: 100%; overflow: hidden; }
.header { padding-left: max(4.5%, var(--safe-left)); padding-right: max(4.5%, var(--safe-right)); }
footer { padding-bottom: calc(22px + var(--safe-bottom)); }
@media (max-width: 1100px) { :root { --header-block: 86px; } }

/* A compact, scrollable navigation for phones, portrait tablets and short landscape screens. */
@media (max-width: 900px), (max-width: 1024px) and (max-height: 520px) {
  :root { --header-block: calc(68px + var(--safe-top)); }
  .header { height: var(--header-block); padding: var(--safe-top) var(--page-right) 0 var(--page-left); background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .header .logo { width: 132px; min-height: 44px; display: flex; align-items: center; }
  .header-cta { display: none; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; flex-direction: column; width: 48px; height: 48px; padding: 10px; margin-right: -10px; gap: 7px; background: transparent; }
  .menu-toggle span { width: 25px; height: 1px; background: var(--navy); transition: transform .2s; }
  .menu-toggle[aria-expanded=true] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-toggle[aria-expanded=true] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .header nav { display: none; position: fixed; inset: var(--header-block) 0 0; padding: 24px var(--page-right) max(28px, var(--safe-bottom)) var(--page-left); overflow-y: auto; overscroll-behavior-y: contain; background: #fff; box-shadow: none; }
  .header nav.open { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 0; }
  .header nav a { display: flex; align-items: center; min-height: 68px; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: clamp(20px, 5vw, 27px); line-height: 1.4; font-weight: 450; }
  .header nav a:after { content: '↗'; position: static; width: auto; height: auto; margin-left: auto; background: none; font-size: 24px; }
}

@media (max-width: 760px), (max-width: 1024px) and (max-height: 520px) {
  html { scrollbar-gutter: auto; }
  body { font-size: 16px; }
  .wrap { width: auto; margin-left: var(--page-left); margin-right: var(--page-right); }
  .section { padding-block: clamp(56px, 13vw, 76px); }
  h2, .about h2 { font-size: clamp(29px, 7.9vw, 38px); line-height: 1.23; letter-spacing: -1.15px; }
  h2>span { color: #737f85; }
  .eyebrow { font-size: 10px; letter-spacing: 1.25px; line-height: 1.6; gap: 10px; margin-bottom: 20px; }
  .eyebrow>span { width: 6px; height: 6px; flex-shrink: 0; }
  .button { min-height: 52px; padding: 15px 20px; font-size: 14px; line-height: 1.45; gap: 24px; }
  .text-link { min-height: 48px; font-size: 13px; line-height: 1.5; padding: 12px 0; gap: 22px; }

  /* Content participates in layout: the bottom actions can never cover the headline or CTA. */
  .hero { height: auto; min-height: calc(100vh - var(--header-block)); min-height: calc(100svh - var(--header-block)); max-height: none; display: flex; flex-direction: column; }
  .hero-content { margin: 0; padding: clamp(40px, 7.5svh, 76px) var(--page-right) 42px var(--page-left); flex-shrink: 0; }
  .hero h1 { font-size: clamp(30px, calc(8.45vw + 2px), 45px); line-height: 1.2; letter-spacing: -1.4px; }
  .hero .eyebrow { font-size: 9px; line-height: 1.6; letter-spacing: 1px; margin-bottom: 25px; }
  .hero-content>p:not(.eyebrow) { font-size: 15px; line-height: 1.75; margin-top: 23px; color: #e0e6ed; }
  .hero .button { margin-top: 27px; min-width: 218px; }
  .hero-image { width: 100%; object-position: 50% 45%; }
  .hero-grid { inset-inline: var(--page-left) var(--page-right); }
  .hero-bottom { position: relative; inset: auto; margin: auto var(--page-right) 0 var(--page-left); min-height: 112px; padding-block: 19px max(19px, var(--safe-bottom)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 14px; flex-shrink: 0; }
  .scroll-link { min-width: 0; min-height: 72px; gap: 10px; padding: 4px 0; }
  .scroll-icon, .project-open { width: 32px; height: 32px; font-size: 19px; }
  .scroll-copy { gap: 6px; }
  .scroll-copy small, .featured-copy>small { font-size: 9px; line-height: 1.4; letter-spacing: .5px; }
  .scroll-copy strong { font-size: 13px; line-height: 1.4; max-width: 116px; }
  .hero-project { min-height: 72px; gap: 9px; padding: 4px 0 4px 14px; border-left: 1px solid #ffffff2b; }
  .featured-thumb { display: none; }
  .featured-copy { min-width: 0; gap: 5px; flex: 1; }
  .featured-summary { flex-direction: column; align-items: flex-start; gap: 4px; }
  .featured-summary strong { font-size: 17px; line-height: 1.2; }
  .featured-area { font-size: 12px; }
  .hero-project .project-open { margin-left: 0; }

  .intro-strip { padding: 28px var(--page-right) 28px var(--page-left); gap: 25px 18px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .intro-strip>p { font-size: 15px; line-height: 1.65; }
  .intro-strip>div { gap: 12px; align-items: center; }
  .intro-strip>div>span { font-size: 30px; }
  .intro-strip small { font-size: 9px; line-height: 1.5; letter-spacing: .6px; max-width: 70px; }
  .intro-strip>a { display: none; }
  .about { display: grid; grid-template-columns: minmax(0, 1fr); gap: 27px; }
  .about-copy>p { font-size: 15px; line-height: 1.85; color: #5f6b75; margin-bottom: 20px; }
  .about-copy>p.lead { font-size: 19px; line-height: 1.65; letter-spacing: -.3px; margin: 0 0 24px; }
  .about-signature { display: none; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 22px; margin-bottom: 30px; }
  .section-heading .eyebrow { margin-bottom: 20px; }
  .section-heading .text-link { padding-block: 10px; }
  .project-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .project-image, .project-grid .project-card:nth-child(2) .project-image { height: auto; aspect-ratio: 4 / 4.3; }
  .project-grid .project-card:nth-child(2) .project-image { aspect-ratio: 4 / 4.7; }
  .project-image img { position: absolute; inset: 0; }
  .project-index { font-size: 10px; line-height: 1.4; letter-spacing: 1px; top: 16px; left: 16px; }
  .round-arrow { width: 44px; height: 44px; font-size: 25px; }
  .project-meta { flex-wrap: wrap; gap: 8px 12px; margin-top: 19px; }
  .project-meta h3 { font-size: 21px; line-height: 1.35; letter-spacing: -.5px; }
  .project-meta>span { font-size: 13px; line-height: 1.5; }
  .project-card>p { font-size: 10px; line-height: 1.6; letter-spacing: 1px; margin-top: 7px; }
  .sectors-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .sector-mark { display: none; }
  .sector-intro>p:not(.eyebrow) { font-size: 15px; line-height: 1.75; margin-top: 22px; color: #bdc9d8; }
  .sector-list summary { min-height: 80px; padding: 22px 0; gap: 12px; }
  .sector-no { font-size: 11px; }
  .sector-list h3 { font-size: clamp(18px, 5vw, 22px); line-height: 1.4; letter-spacing: -.35px; }
  .sector-list .plus { flex-shrink: 0; }
  .sector-copy { padding: 0 0 28px 0; }
  .sector-company { font-size: 10px; line-height: 1.6; letter-spacing: 1px; }
  .sector-copy p { font-size: 15px; line-height: 1.85; color: #bdc9d8; }
  .sector-copy a { min-height: 44px; display: inline-flex; align-items: center; font-size: 13px; line-height: 1.6; margin-top: 18px; padding-block: 10px; }

  .heading-note { font-size: 14px; line-height: 1.75; }
  .map-layout { display: flex; flex-direction: column-reverse; min-height: 0; }
  .map-container { height: clamp(300px, 48svh, 420px); min-height: 300px; }
  .map-aside { padding: 22px 18px; }
  .map-aside>.mini-label { font-size: 10px; letter-spacing: 1px; margin-bottom: 18px; }
  #map-project-card { grid-template-columns: 95px minmax(0, 1fr); gap: 18px; }
  .map-aside img { height: 152px; }
  .map-project-copy { min-width: 0; }
  .map-project-copy>span { font-size: 9px; line-height: 1.5; letter-spacing: .6px; margin-top: 2px; }
  .map-project-copy h3 { font-size: 21px; line-height: 1.25; margin-top: 8px; }
  .map-project-copy p { font-size: 13px; margin-top: 8px; }
  .map-project-copy .text-link { font-size: 12px; min-height: 44px; gap: 10px; margin-top: 8px; padding-block: 8px; }
  .map-project-tabs { gap: 10px; margin-top: 20px; }
  .map-project-tabs button { min-width: 44px; min-height: 44px; font-size: 12px; }
  .map-reset { min-height: 44px; padding: 12px 14px; font-size: 12px; }
  .map-note { font-size: 10px; line-height: 1.5; padding: 8px 10px; bottom: 25px; }
  .leaflet-touch .leaflet-bar a, .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
  .leaflet-container .leaflet-control-attribution { font-size: 10px; }
  .leaflet-container a.leaflet-popup-close-button { width: 44px; height: 44px; line-height: 40px; }
  .leaflet-popup-content { margin-right: 35px; }
  .leaflet-popup-content button { min-height: 44px; font-size: 12px; }
  .google-link { font-size: 12px; line-height: 1.6; min-height: 44px; padding-block: 10px; margin-top: 14px; }

  .contact-top { padding-bottom: 28px; }
  .contact-top h2 { font-size: clamp(31px, 8.4vw, 40px); line-height: 1.25; letter-spacing: -1.2px; }
  .contact-circle { position: static; width: 52px; height: 52px; margin-top: 24px; font-size: 30px; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 30px; }
  .contact .mini-label, .mini-label { font-size: 10px; line-height: 1.6; letter-spacing: 1px; }
  .email { max-width: 100%; min-height: 44px; display: inline-flex; align-items: center; padding-block: 7px; margin-top: 8px; font-size: clamp(16px, 4.6vw, 22px); line-height: 1.5; letter-spacing: -.35px; overflow-wrap: anywhere; }
  address { font-size: 15px; line-height: 1.8; margin-top: 12px; }
  .small-link { min-height: 44px; display: inline-flex; align-items: center; padding-block: 10px; font-size: 13px; line-height: 1.5; margin-top: 8px; }
  .office-map { grid-template-columns: minmax(0, 1fr); margin-top: 40px; }
  .office-map>div { padding: 24px 20px; }
  .office-map>div>p:last-child { font-size: 23px; line-height: 1.4; margin-top: 18px; }
  .office-map iframe { height: 300px; }
  footer { padding-top: 36px; padding-bottom: max(28px, var(--safe-bottom)); }
  .footer-top { flex-wrap: wrap; justify-content: space-between; gap: 24px; padding-bottom: 25px; }
  .footer-top .logo { width: 130px; min-height: 44px; display: flex; align-items: center; }
  .footer-top p { font-size: 12px; line-height: 1.75; }
  .back-top { margin: 0; min-height: 44px; display: inline-flex; align-items: center; width: 100%; font-size: 13px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; font-size: 11px; line-height: 1.7; letter-spacing: 0; padding-top: 23px; }

  /* Full viewport dialogs have their own scroll area and a permanently reachable close control. */
  dialog { inset: 0; margin: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: 100%; max-height: 100dvh; padding: var(--safe-top) 0 0; border-radius: 0; overflow: hidden; }
  dialog[open] { display: flex; flex-direction: column; }
  .dialog-close { position: absolute; top: calc(var(--safe-top) + 12px); right: calc(var(--safe-right) + 12px); float: none; margin: 0; width: 48px; height: 48px; font-size: 20px; box-shadow: 0 2px 16px #10203c20; z-index: 6; }
  .dialog-layout { display: block; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; padding-bottom: max(24px, var(--safe-bottom)); }
  .dialog-layout>img { width: 100%; height: clamp(180px, 33svh, 300px); min-height: 0; max-height: none; object-fit: cover; }
  .dialog-copy { padding: 30px var(--page-right) 0 var(--page-left); }
  .dialog-copy .eyebrow { font-size: 10px; letter-spacing: 1px; margin-bottom: 17px; padding-right: 0; }
  .dialog-copy h2 { font-size: clamp(29px, 8vw, 36px); line-height: 1.25; letter-spacing: -1px; }
  .dialog-copy>p { font-size: 15px; line-height: 1.8; margin-top: 16px; color: #5f6b75; }
  .dialog-copy dl { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; margin: 24px 0; padding: 22px 0; }
  .dialog-copy dt { font-size: 10px; line-height: 1.5; letter-spacing: .7px; margin-bottom: 9px; }
  .dialog-copy dd { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
  .dialog-copy>p.detail-note { font-size: 12px; line-height: 1.6; margin-bottom: 22px; }
  .dialog-copy .button { font-size: 13px; min-height: 52px; line-height: 1.5; padding: 15px 18px; gap: 12px; }
  .dialog-copy>.text-link { font-size: 13px; line-height: 1.5; margin-top: 13px; }
  .dialog-pagination { margin-top: 25px; padding-top: 18px; font-size: 12px; }
  .dialog-pagination button { width: 48px; height: 48px; font-size: 23px; }
  .values-content { margin: 0; width: 100%; max-width: none; flex: 1; min-height: 0; padding: 80px var(--page-right) max(32px, var(--safe-bottom)) var(--page-left); overflow-y: auto; overscroll-behavior-y: contain; }
  .values-content h2 { font-size: clamp(29px, 8vw, 36px); line-height: 1.25; }
  .values-content h3 { font-size: 22px; line-height: 1.4; margin-top: 30px; }
  .values-content p:not(.eyebrow) { font-size: 15px; line-height: 1.85; color: #5f6b75; }

  /* Shorter one-time entrances keep the touch experience responsive. */
  .hero-line>span { animation-duration: .7s; }
  .hero-line:nth-child(2)>span { animation-delay: .28s; }
  .hero-image { animation-duration: 1.2s; }
  .hero-content>p:not(.eyebrow) { animation-delay: .4s; animation-duration: .65s; }
  .hero-content>.button { animation-delay: .5s; animation-duration: .65s; }
  .js-animated .reveal { transition-duration: .6s; transform: translateY(16px); }
  .js-animated .reveal.visible { transform: none; }
  .js-animated .project-card .project-image { clip-path: none; transition: none; }
}

@media (max-width: 360px) {
  .hero-bottom { gap: 12px; }
  .scroll-link { gap: 8px; }
  .scroll-icon, .project-open { width: 28px; height: 28px; font-size: 18px; }
  .scroll-copy small, .featured-copy>small { font-size: 9px; letter-spacing: 0; }
  .scroll-copy strong { font-size: 13px; }
  .hero-project { padding-left: 12px; gap: 8px; }
  .featured-summary strong { font-size: 16px; }
  #map-project-card { grid-template-columns: 80px minmax(0, 1fr); gap: 14px; }
  .map-aside { padding-inline: 16px; }
  .map-project-copy h3 { font-size: 19px; }
  .project-meta h3 { font-size: 20px; }
}
@media (min-width: 761px) and (max-width: 1024px) and (min-height: 521px) {
  .about-copy>p, .sector-copy p { font-size: 15px; line-height: 1.85; }
  .sector-intro>p:not(.eyebrow) { font-size: 15px; }
  .project-meta { flex-wrap: wrap; gap: 8px; }
  .project-meta h3 { font-size: 18px; line-height: 1.4; }
  .project-meta>span { font-size: 12px; }
  .map-project-tabs button { min-width: 44px; min-height: 44px; }
  .text-link { font-size: 13px; min-height: 44px; }
  .map-project-copy .text-link { gap: 12px; }
  .sector-list summary { min-height: 80px; }
}
@media (max-width: 1024px) and (max-height: 520px) {
  .hero { min-height: calc(100svh - var(--header-block)); }
  .hero-content { padding-top: 28px; padding-bottom: 30px; }
  .hero h1 { font-size: clamp(32px, 4.5vw, 42px); }
  .hero .eyebrow { margin-bottom: 17px; }
  .hero-content>p:not(.eyebrow) { margin-top: 18px; }
  .hero .button { margin-top: 20px; }
  .hero-bottom { grid-template-columns: 1fr 1fr; }
  .scroll-copy strong { max-width: none; }
  .header nav { padding-top: 10px; }
  .header nav a { min-height: 52px; padding-block: 11px; font-size: 20px; }
  .project-image, .project-grid .project-card:nth-child(2) .project-image { aspect-ratio: 16 / 9; }
  .dialog-layout>img { height: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  .js-animated .reveal { transform: none; }
}
