/* Stable sticky navigation transitions and medium-screen layouts. */
.scale-nav a,.software-scale-nav a,.standard-section-nav a,
.is-compact-section-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;box-sizing:border-box;min-height:0;transition:padding .2s ease,background-color .16s ease,border-color .16s ease}
.scale-nav a,.software-scale-nav a,.standard-section-nav a{padding:.85rem .6rem}
.is-compact-section-nav a{padding:.6rem .5rem}
.scale-nav .research-category-icon,.software-scale-nav .section-nav-icon,.standard-section-nav .section-nav-icon{margin:0 0 .4rem;transition:margin .2s ease}
.is-compact-section-nav .research-category-icon,.is-compact-section-nav .section-nav-icon{margin:0 0 .2rem}
.scale-nav svg,.software-scale-nav svg,.standard-section-nav svg{width:30px;height:30px;transition:width .2s ease,height .2s ease}
.is-compact-section-nav svg{width:20px;height:20px}
.scale-nav small,.software-scale-nav small{display:block;max-height:2.8em;overflow:hidden;opacity:1;margin-top:.2rem;transition:max-height .2s ease,opacity .2s ease,margin .2s ease}
.is-compact-section-nav a small{display:block;max-height:0;opacity:0;margin:0}
.scale-nav a::after,.software-scale-nav a::after,.standard-section-nav a::after{display:none}
.scale-nav strong,.software-scale-nav strong,.standard-section-nav strong{font-size:.9375rem;line-height:1.35}
.is-compact-section-nav strong{font-size:.9375rem;line-height:1.35}
@media(min-width:761px) and (max-width:1150px){
 .home-page .hero-grid{width:calc(100% - 3rem);grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);gap:1.5rem}
 .home-page .hero .profile-name{font-size:clamp(1.9rem,3.3vw,2.6rem)}
 .home-page .hero .field-portrait{max-width:100%;box-sizing:border-box}
 .home-page .hero .photo-frame{height:clamp(300px,45svh,400px)}
 .home-page .hero .tool-names{flex-wrap:wrap}
 .home-page .highlight-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .home-page .highlight-card img,.home-page .highlight-card .ct-pair-preview,.home-page .highlight-card .labeled-research-image{height:230px}
 .home-page .highlight-card h3{font-size:1rem}
}
@media(max-width:1000px){
 .scale-nav,.software-scale-nav,.standard-section-nav{display:flex;overflow-x:auto;gap:.4rem;scrollbar-width:thin}
 .scale-nav a,.software-scale-nav a,.standard-section-nav a{flex:0 0 auto;min-width:140px;max-width:180px}
 .is-compact-section-nav a{min-width:140px}
}
@media(max-width:760px){
 .scale-nav a,.software-scale-nav a,.standard-section-nav a{min-width:130px;padding:.65rem .6rem}
 .scale-nav svg,.software-scale-nav svg,.standard-section-nav svg{width:22px;height:22px}
 .is-compact-section-nav svg{width:18px;height:18px}
 .is-compact-section-nav a{padding:.5rem .6rem}
 .scale-nav strong,.software-scale-nav strong,.standard-section-nav strong,.is-compact-section-nav strong{font-size:.875rem}
}
@media(prefers-reduced-motion:reduce){.scale-nav *, .software-scale-nav *, .standard-section-nav *{transition:none!important}}
/* Compact-height tabs fill the complete row on each page. */
body.research-page .scale-nav,body.software-page .software-scale-nav,body.standard-page .standard-section-nav{display:flex;gap:.5rem;justify-content:stretch;overflow-x:auto}
body.research-page .scale-nav>a,body.software-page .software-scale-nav>a,body.standard-page .standard-section-nav>a{display:flex;flex-direction:row;flex:1 1 0;width:auto;min-width:0;max-width:none;min-height:64px;gap:.5rem;padding:.6rem .75rem;transition:min-height .2s ease,padding .2s ease,background-color .16s ease,border-color .16s ease}
body .scale-nav a small,body .software-scale-nav a small{display:none}
body .scale-nav .research-category-icon,body .software-scale-nav .section-nav-icon,body .standard-section-nav .section-nav-icon{margin:0;flex-shrink:0}
body .scale-nav svg,body .software-scale-nav svg,body .standard-section-nav svg{width:22px;height:22px}
body.research-page .scale-nav.is-compact-section-nav>a,body.software-page .software-scale-nav.is-compact-section-nav>a,body.standard-page .standard-section-nav.is-compact-section-nav>a{min-height:52px;padding:.45rem .65rem}
@media(max-width:760px){
 body.research-page .scale-nav>a,body.software-page .software-scale-nav>a,body.standard-page .standard-section-nav>a{flex:1 0 110px;min-width:110px;min-height:52px;padding:.5rem .6rem}
 body.research-page .scale-nav.is-compact-section-nav>a,body.software-page .software-scale-nav.is-compact-section-nav>a,body.standard-page .standard-section-nav.is-compact-section-nav>a{min-height:48px}
}

/* Category tabs keep the same compact dimensions at every scroll position. */
body.research-page .scale-nav>a,body.software-page .software-scale-nav>a,body.standard-page .standard-section-nav>a,
body.research-page .scale-nav.is-compact-section-nav>a,body.software-page .software-scale-nav.is-compact-section-nav>a,body.standard-page .standard-section-nav.is-compact-section-nav>a{min-height:48px;height:48px;padding:.45rem .65rem;transition:background-color .16s ease,border-color .16s ease}
/* Reduce oversized vertical gaps in short laptop/browser windows. */
@media(min-width:761px) and (max-height:760px){
 .home-page .hero{padding:1.5rem 0;min-height:calc(100svh - 75px)}
 .home-page .hero .profile-name{margin-bottom:1.25rem}
 .home-page .hero .lead{margin-top:1.25rem;margin-bottom:1rem}
 .home-page .hero .bio>p:not(.eyebrow):not(.profile-title):not(.affiliation):not(.home-location):not(.lead){line-height:1.6}
 .home-page .hero .platform-strip{margin:1.25rem 0}
 .home-page .hero .built-inline{margin-top:1rem;padding-top:1rem}
 .home-page .hero .tool-names{margin-top:.65rem}
 .home-page .hero .research-jump{margin-top:1rem}
}

/* Clear media controls and compact labelled icons across smaller devices. */
.photo-pause svg{width:20px;height:20px;display:block;margin:auto}
.tab-label-short{display:none}
@media(max-width:1100px){
 body .scale-nav .tab-label-full,body .software-scale-nav .tab-label-full,body .standard-section-nav .tab-label-full{display:none}
 body .scale-nav .tab-label-short,body .software-scale-nav .tab-label-short,body .standard-section-nav .tab-label-short{display:inline;font-weight:600}
 body .scale-nav .research-category-icon,body .software-scale-nav .section-nav-icon,body .standard-section-nav .section-nav-icon{display:flex!important;width:20px;height:20px;align-items:center;justify-content:center}
 body .scale-nav svg,body .software-scale-nav svg,body .standard-section-nav svg{display:block;width:20px;height:20px}
 body .research-category-icon svg+svg,body .section-nav-icon svg+svg{display:none}
 body.research-page .scale-nav>a,body.software-page .software-scale-nav>a,body.standard-page .standard-section-nav>a{flex:1 0 auto;min-width:max-content;gap:.35rem;padding:.45rem .6rem;white-space:nowrap;font-size:.875rem}
 body.research-page .scale-nav,body.software-page .software-scale-nav,body.standard-page .standard-section-nav{gap:.3rem;scroll-padding-inline:.5rem}
}
@media(max-width:760px){
 body.home-page .highlight-card{display:flex;flex-direction:column}
 body.home-page .highlight-card>.research-card-copy{order:-1}
}
/* Keep one label visible and active-tab content at full contrast. */
body .scale-nav .tab-label-short,body .software-scale-nav .tab-label-short,body .standard-section-nav .tab-label-short{display:none}
body .scale-nav a[aria-current="location"] span,body .software-scale-nav a[aria-current="location"] span,body .standard-section-nav a[aria-current="location"] span{color:#fff}
@media(max-width:1100px){
 body .scale-nav .tab-label-short,body .software-scale-nav .tab-label-short,body .standard-section-nav .tab-label-short{display:inline}
}

/* All section tabs remain visible on narrow phones. */
@media(max-width:600px){
 body.research-page .scale-nav,body.software-page .software-scale-nav,body.standard-page .standard-section-nav{gap:.2rem;overflow:visible;width:100%;box-sizing:border-box}
 body.research-page .scale-nav>a,body.software-page .software-scale-nav>a,body.standard-page .standard-section-nav>a,
 body.research-page .scale-nav.is-compact-section-nav>a,body.software-page .software-scale-nav.is-compact-section-nav>a,body.standard-page .standard-section-nav.is-compact-section-nav>a{flex:1 1 0;min-width:0;width:0;flex-direction:column;gap:.15rem;height:48px;min-height:48px;padding:.2rem .1rem;font-size:.75rem}
 body .scale-nav .tab-label-short,body .software-scale-nav .tab-label-short,body .standard-section-nav .tab-label-short{font-size:.75rem;line-height:1.2;letter-spacing:0}
 body .scale-nav .research-category-icon,body .software-scale-nav .section-nav-icon,body .standard-section-nav .section-nav-icon{width:18px;height:18px}
 body .scale-nav svg,body .software-scale-nav svg,body .standard-section-nav svg{width:18px;height:18px}
}

/* Equal outer frames across the research cards at each screen size. */
body.home-page .highlight-grid{align-items:stretch;grid-auto-rows:1fr}
body.home-page .highlight-card{height:100%;box-sizing:border-box}

/* Preserve the original image presentation; only the topic/scale move above it. */
body.home-page .highlight-card{display:flex;flex-direction:column}
body.home-page .highlight-card>.research-card-heading{padding:1.05rem 1.05rem .45rem;box-sizing:border-box;min-height:4.8rem}
body.home-page .research-card-heading h3{margin:0 0 .25rem}
body.home-page .research-card-heading>span{display:block;line-height:1.4}
body.home-page .highlight-card>.research-card-description{margin:0;padding:1.05rem;color:var(--tone-muted);font-size:var(--type-detail);line-height:1.55}

/* Shared inline category tabs and natural phone card heights. */
body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav)>a,
body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav).is-compact-section-nav>a{flex-direction:row;align-items:center;justify-content:center;gap:.4rem;color:#28533b;font-family:var(--font-ui);font-size:.9375rem;font-weight:600;line-height:1.3}
body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav)>a :is(strong,.tab-label-full,.tab-label-short,span:not(.research-category-icon):not(.section-nav-icon)){font:inherit;color:inherit;letter-spacing:0;text-transform:none}
body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav) :is(.research-category-icon,.section-nav-icon){display:flex;align-items:center;justify-content:center;width:22px;height:22px;flex-shrink:0;color:inherit;margin:0}
body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav) svg{width:22px;height:22px;color:inherit}
body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav)>a[aria-current="location"]{color:#fff}
@media(max-width:760px){
 body.home-page .highlight-grid{grid-auto-rows:auto;align-items:start}
 body.home-page .highlight-card{height:auto}
 body.home-page .highlight-card>.ct-pair-preview,body.home-page .highlight-card>.labeled-research-image{height:260px;box-sizing:border-box}
 body.home-page .highlight-card>img{height:260px;min-height:0}
 body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav)>a,
 body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav).is-compact-section-nav>a{flex-direction:row;font-size:.75rem;gap:.2rem;padding:.2rem .15rem;flex:1 1 auto;width:auto;min-width:max-content;height:44px;min-height:44px}
 body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav) :is(.research-category-icon,.section-nav-icon){width:18px;height:18px}
 body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav) svg{width:18px;height:18px}
 body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav){overflow-x:auto;gap:.2rem}
}
body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav) svg{width:22px!important;height:22px!important}
body .tab-label-phone{display:none}
@media(max-width:760px){
 body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav) svg{width:18px!important;height:18px!important}
 body :is(.scale-nav,.software-scale-nav) .tab-label-tablet{display:none}
 body :is(.scale-nav,.software-scale-nav) .tab-label-phone{display:inline}
}
body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav) :is(.research-category-icon,.section-nav-icon) svg{width:22px!important;height:22px!important}
@media(max-width:760px){body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav) :is(.research-category-icon,.section-nav-icon) svg{width:18px!important;height:18px!important}}
body:is(.research-page,.software-page,.standard-page) :is(.research-category-icon,.section-nav-icon) svg{flex:0 0 22px}
@media(max-width:760px){body:is(.research-page,.software-page,.standard-page) :is(.research-category-icon,.section-nav-icon) svg{flex:0 0 18px}}

/* Tighter phone tabs without shrinking their labels or touch height. */
@media(max-width:760px){
 body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav){gap:.15rem;justify-content:center}
 body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav)>a,
 body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav).is-compact-section-nav>a{flex:0 0 auto;width:auto;min-width:44px;padding:.2rem .15rem;gap:.1rem}
}

/* Phone tabs share the complete available row. */
@media(max-width:760px){
 body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav)>a,
 body:is(.research-page,.software-page,.standard-page) :is(.scale-nav,.software-scale-nav,.standard-section-nav).is-compact-section-nav>a{flex:1 1 auto}
}
/* Keep the Contact footer at the bottom of short screens without overlaying content. */
body.contact-page{min-height:100svh;display:flex;flex-direction:column}
body.contact-page>main{flex:1 0 auto}
body.contact-page>footer{margin-top:auto;flex-shrink:0}

/* Compact footer on phones, with natural wrapping for all footer text. */
@media(max-width:760px){
 body footer{padding:.75rem 0;font-size:.75rem;line-height:1.4}
 body footer .footer-row{width:calc(100% - 2rem);display:flex;flex-direction:column;gap:.25rem}
 body footer .footer-row>span{margin:0}
 body footer .footer-row span span{display:inline}
}

/* Keep footer keywords on larger screens; omit them on phones. */
@media(max-width:760px){body footer .footer-row>span:nth-child(2){display:none}}

/* Tabs show one icon only (the second SVG is a spare variant that overlapped the label on desktop). */
body :is(.scale-nav,.software-scale-nav,.standard-section-nav) :is(.research-category-icon,.section-nav-icon) svg+svg{display:none!important}

/* Compact footer on desktop: left, center and right groups, with less height. */
@media(min-width:761px){
 body footer{padding:.9rem 0}
 body footer .footer-row{justify-content:space-between;gap:.4rem 2.5rem}
}

/* Phone: a clear labelled Menu button instead of a bare "+". */
@media(max-width:760px){
 body .menu-toggle{display:flex;align-items:center;gap:.5rem;width:auto;min-width:44px;padding:0 .85rem;font-size:0;line-height:1;font-family:var(--font-ui);color:#28533b;border:1px solid #b8cbbb;background:#f3f6f1}
 body .menu-toggle::before{content:"";width:18px;height:14px;background:linear-gradient(currentColor 0 0) 0 0/100% 2px no-repeat,linear-gradient(currentColor 0 0) 0 50%/100% 2px no-repeat,linear-gradient(currentColor 0 0) 0 100%/100% 2px no-repeat}
 body .menu-toggle::after{content:"Menu";font-size:.9375rem;font-weight:600}
 body .menu-toggle[aria-expanded="true"]{background:#28533b;color:#fff;border-color:#28533b}
 body .menu-toggle[aria-expanded="true"]::before{content:"×";width:auto;height:auto;background:none;font-size:1.5rem;line-height:1}
 body .menu-toggle[aria-expanded="true"]::after{content:"Close"}
 body .nav-links.open a{font-size:1rem;font-weight:600;padding:.75rem .55rem;border-bottom:1px solid #dce4dc}
 body .nav-links.open a[aria-current="page"]{color:#28533b;background:#f3f6f1}
}

/* Home keeps a plain white Menu button; the green fill is for the inner pages. */
@media(max-width:760px){
 body.home-page .menu-toggle,body.home-page .menu-toggle[aria-expanded="true"]{background:#fff;color:#28533b;border-color:#28533b}
 body.home-page .nav-links.open a[aria-current="page"]{background:#fff}
}

/* Hamburger icon drawn with a bar and two shadows so every browser shows it. */
@media(max-width:760px){
 body .menu-toggle::before{width:18px;height:2px;background:currentColor;box-shadow:0 -6px 0 currentColor,0 6px 0 currentColor;margin:0 .1rem}
 body .menu-toggle[aria-expanded="true"]::before{box-shadow:none;background:none}
}
/* Small phones: keep the name on one line and the header compact. */
@media(max-width:380px){
 html{font-size:15px}
 body .brand{font-size:.85rem;white-space:nowrap;gap:.5rem}
 body .brand span:last-child{white-space:nowrap}
 body .menu-toggle{padding:0 .65rem;gap:.4rem}
 body .nav{gap:.5rem}
}
@media(max-width:380px){
 body .brand span:last-child{display:none}
 body .nav{min-height:56px}
}
