/* Full detail on larger screens; concise, native disclosures on phones. */
.phone-details { display: contents; }
.phone-details > summary, .phone-teaser { display: none; }
.phone-details-body { display: contents; }
.phone-copy { display: none; }
.phone-entry-logo { display: none; }
.hero-bio-full { display: contents; }
.snapshot-more { display: block; grid-column: 1 / -1; }
.snapshot-more > .snapshot-secondary { display: grid; grid-template-columns: 1fr; gap: .28rem; }
.contact-email-row > a { min-width: 0; overflow-wrap: anywhere; }
button.contact-copy-icon { min-width: 44px; min-height: 44px; border-radius: 10px; }
button.contact-copy-icon:focus-visible { outline: 2px solid #edb1bd; outline-offset: 2px; }
.email-address-line { overflow-wrap: anywhere; }
.email-modal-close { min-width: 44px; min-height: 44px; }
.email-modal-action { min-height: 44px; }
.email-modal h2 { color: #edf0f5; }

/* Keep touch scrolling while excluding pinch and double-tap page zoom. */
@media (pointer: coarse) {
  html { touch-action: pan-x pan-y; }
}

@media (min-width: 601px) and (max-width: 1023px) {
  .snapshot-more > .snapshot-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem 1.5rem; }
}

@media (max-width: 600px), (max-width: 1023px) and (max-height: 500px) {
  .phone-details { display: block; margin: 10px 0 14px; }
  .phone-details > summary {
    --disclosure-solid: #202737;
    position: relative; isolation: isolate;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 44px; padding: 8px 12px; border: 1px solid #ffffff20;
    border-radius: 12px; color: #efc2cc;
    overflow: hidden; clip-path: inset(0 round 12px);
    background-color: #181e2b5c;
    background-image: linear-gradient(165deg, #ffffff12, #ffffff02 48%, #ffffff06);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    box-shadow: inset 0 1px 2px #ffffff1f, inset 0 -1px 2px #ffffff06;
    font: 500 14px/1.4 "IBM Plex Sans", sans-serif; cursor: pointer;
    list-style: none; -webkit-tap-highlight-color: transparent;
  }
  .phone-details > summary::-webkit-details-marker { display: none; }
  .phone-details > summary::before {
    content: ""; position: absolute; inset: 0; padding: 1px; border-radius: inherit;
    background: linear-gradient(135deg, #ffffff85, #ffffff1f 22%, #ffffff04 46%, #ffffff0b 68%, #ffffff47);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
  }
  .phone-details > summary::after { content: "+"; font-size: 20px; font-weight: 400; }
  .phone-summary-title { display: block; font-weight: 600; }
  .phone-details > summary > span { flex: 1; min-width: 0; }
  .phone-entry-logo { display: block; width: 28px; height: 28px; flex: 0 0 28px; object-fit: contain; }
  .phone-summary-meta { display: block; margin-top: 3px; color: #b2bacb; font-size: 12px; font-weight: 400; }
  .phone-details[open] > summary::after { content: "−"; }
  .phone-details > summary:focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }
  .phone-details-body { display: block; padding-top: 6px; }
  .phone-teaser { display: block; }
  .phone-copy { display: inline; }
  .wide-copy { display: none; }
  .phone-project-result { padding: 18px 0; }
  .phone-project-result span { display: block; font-size: 12px; color: #aeb8cd; }
  .phone-project-result strong { display: block; margin-top: 6px; font-size: clamp(20px, 6vw, 28px); }
  .project-article .article-heading { margin-bottom: 8px; padding-bottom: 0; border-bottom: 0; }
  .project-article .phone-project-result { margin-bottom: 8px; padding: 10px 0; }
  .project-article .phone-details { margin: 8px 0 0; }
  .project-article .article-body > .phone-details { margin: 0; }
  .project-article .phone-details-body > p { margin: 0; font-size: 14.5px; line-height: 1.5; }
  .project-article .phone-details-body > h2 { margin: 0 0 6px; font-size: 16px; line-height: 1.35; }
  .project-article .source-links {
    flex-direction: row; align-items: center; gap: 0 16px;
    margin: 10px 0 0; padding: 0; border-top: 0;
  }
  .hero-phone-intro { margin: 14px 0; font-size: 16px; line-height: 1.55; }
  .snapshot-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .snapshot-card { align-items: flex-start; }
  .hero-bio-full, .snapshot-more, .hero-kicker-divider, .hero-degree-field { display: none; }
  .hero-department { display: block; }
  .site-footer, #featured .card .tags, .projects-page .card .tags { display: none; }
  #top > .section:not(.hero) { padding-top: 24px; padding-bottom: 0; }
  #top .section-head { margin-bottom: 12px; gap: 10px; }
  #top .section-head .see-more { min-height: 32px; padding: 4px 10px; font-size: 11px; }
  .research-feature { gap: 12px; padding: 14px 0; }
  .research-copy { display: grid; gap: 6px; }
  .research-copy .tags, .research-copy .research-authors,
  .research-copy .research-summary, .research-copy .publication-links {
    margin: 0; font-size: 14px; font-weight: 400; line-height: 1.45; letter-spacing: 0;
  }
  .research-copy h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.35; }
  .research-copy .publication-links a { display: inline-flex; align-items: center; min-height: 32px; }
  #featured .card-grid { gap: 12px; }
  #featured .card { padding: 14px; }
  #featured .card h3 { margin-bottom: 6px; font-size: 17px; font-weight: 600; }
  #featured .card p:not(.tags) { font-size: 14px; line-height: 1.45; }
  #featured .nd-preview { margin-bottom: 10px; }
  .pdf-cv .phone-details { margin: 8px 0; }
  .pdf-cv .phone-summary-meta { color: #60636a; }
  .pdf-cv .phone-details > summary {
    --disclosure-solid: #f2f3f5;
    color: #9e0000; border-color: #626f8729;
    background-color: #eaedf180;
    background-image: linear-gradient(165deg, #ffffffd9, #ffffff1f 48%, #acb7c81f);
    box-shadow: inset 0 1px 2px #ffffffe6, inset 0 -1px 2px #626f8714;
    font-family: Lato, Arial, sans-serif;
  }
  .pdf-cv .resume-contact { display: none; }
  .pdf-cv .resume-banner { height: 28px; }
  .pdf-cv .resume-heading { padding-top: 16px; }
  .pdf-cv .cv-preview-hint { font-size: 0; }
  .pdf-cv .cv-preview-hint::after { content: "Tap linked text for more."; font-size: 13px; }
  .pdf-cv .resume-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .pdf-cv .resume-toolbar > a { display: inline-flex; align-items: center; min-height: 44px; }
  .research-feature figure { max-height: 240px; overflow: hidden; border-radius: 14px; }
  .research-feature figure img { width: 100%; height: 240px; object-fit: cover; object-position: top; }
  .contact-toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .phone-details > summary, .pdf-cv .phone-details > summary { background-color: var(--disclosure-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  .phone-details > summary, .pdf-cv .phone-details > summary {
    background: var(--disclosure-solid);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}

@media print {
  .phone-details { display: contents; }
  .phone-details > summary, .phone-teaser { display: none; }
  .phone-details-body { display: contents; }
  .wide-copy { display: inline; }
  .research-copy > p.wide-copy { display: block; }
  .phone-copy { display: none; }
}
