/* Shared responsive layout. Desktop page styles remain in each HTML file. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 104px; }
.page img, .page video { max-width: 100%; }
.burger { display: none; width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; position: relative; }
.burger span { position: absolute; left: 12px; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 200ms ease; }
.burger span:first-child { top: 17px; }
.burger span:last-child { top: 25px; }
.burger.open span:first-child { transform: translateY(4px) rotate(45deg); }
.burger.open span:last-child { transform: translateY(-4px) rotate(-45deg); }
.page-lab .burger span { background: #fff; }
.panel { position: fixed; inset: 0; z-index: 40; background: rgba(255,255,255,.97); backdrop-filter: blur(20px); display: flex; flex-direction: column; justify-content: safe center; gap: 8px; padding: 104px 24px 32px; overflow-y: auto; overscroll-behavior: contain; }
.panellink { display: block; flex: none; color: #111; text-decoration: none; font-size: 30px; line-height: 1.25; font-weight: 600; padding: 12px 0; }
.page-lab .panel { background: rgba(14,15,20,.98); }
.page-lab .panellink { color: #fff; }

@media (max-width: 1100px) {
  .nav { top: max(12px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); right: calc(max(16px, env(safe-area-inset-right)) + 118px); transform: none; justify-content: space-between; gap: 8px; padding: 8px; min-height: 62px; }
  .nav .navlinks, .nav .btn, .brandname { display: none; }
  .nav .brand { display: flex; }
  .nav > a:first-child { min-width: 0; min-height: 44px; align-items: center; }
  .nav > a:first-child img { max-width: 100%; object-fit: contain; }
  .burger { display: block; }
  .lang { top: max(12px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); }
}

@media (max-width: 760px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .wrap *, .grid2 > *, .grid3 > *, .layout > *, .herogrid > * { min-width: 0; }
  .page h1, .page h2, .page h3, .page p, .page li, .page dd, .page a, .page .badge, .page .pcap { overflow-wrap: anywhere; }
  .page .hero-title, .page .title { font-size: clamp(30px, 7.7vw, 44px) !important; line-height: 1.15 !important; white-space: normal; }
  .page .mega { font-size: clamp(56px, 16vw, 88px); }
  .page .h2, .page .h2.big { font-size: clamp(28px, 7vw, 36px) !important; line-height: 1.2 !important; white-space: normal; }
  .page .lead { font-size: 17px; line-height: 1.65; }
  .page main > section { padding-top: 56px !important; padding-bottom: 56px !important; }
  .page main > section:first-child { padding-top: calc(112px + env(safe-area-inset-top)) !important; }
  .herogrid { padding-top: calc(112px + env(safe-area-inset-top)); padding-bottom: 56px; gap: 32px; min-height: auto; }
  .page main > .hero2:first-child:has(.herogrid) { padding-top: 0 !important; padding-bottom: 0 !important; }
  .grid2, .grid3, .cta, .layout, .row2 { grid-template-columns: minmax(0, 1fr) !important; }
  .card, .sci-card, .form, .dev { padding: 20px; border-radius: 20px; }
  .pbody { padding: 20px; }
  .page .btn { max-width: 100%; white-space: normal; text-align: left; }
  .page .btn svg { flex: none; }
  .portrait { width: 100%; max-width: 360px; justify-self: center; }
  .pcap { left: 12px; right: 12px; bottom: 12px; padding: 12px 16px; }
  .stat { padding: 20px 12px; }
  .statnum { font-size: 30px; line-height: 1.2; }
  .sci-metrics { gap: 12px; }
  .pmeta > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ab-jump { flex-wrap: wrap; white-space: normal; }
  .person { flex-wrap: wrap; gap: 16px; }
  .eyebrow { align-items: baseline; }
  .eyebrow::before { flex: none; }
  .input { min-width: 0; font-size: 16px; }
  .page footer { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .card, .sci-card, .form, .dev, .pbody { padding: 16px; }
  .sci-metrics { grid-template-columns: minmax(0, 1fr); }
}

@media (max-height: 520px) and (max-width: 1100px) {
  .panel { justify-content: flex-start; padding-top: 88px; }
  .panellink { font-size: 24px; padding-block: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .burger span, .panellink { animation: none; transition: none; opacity: 1; }
}
