/* Phone layout. <html class="is-mobile"> is set by device detection in index.html, not by window width;
   desktop windows of any width keep the desktop composition. Width queries below only fine-tune phone sizes. */
html.is-mobile {
  min-width: 0;
  -webkit-text-size-adjust: 100%;
}
html.is-mobile .portfolio {
  --gutter: 12px;
  --column: calc(100cqw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  --page-width: 100cqw;
  --offset: calc(12px + env(safe-area-inset-left, 0px));
  min-height: 0;
  padding-top: calc(72px + env(safe-area-inset-top, 0px));
}
html.is-mobile .site-meta {
  top: calc(10px + env(safe-area-inset-top, 0px));
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  font-size: 12px;
  line-height: 22px;
}
html.is-mobile .site-meta-value { min-width: auto; padding: 0; }
html.is-mobile .site-meta-item:last-child .site-meta-value { min-width: auto; }
html.is-mobile .site-meta-label,
html.is-mobile .site-meta-item:last-child .site-meta-label { min-width: auto; }
html.is-mobile .cover { height: clamp(180px, 45vw, 240px); }
html.is-mobile .cover-hover-hint { display: none; }
html.is-mobile .cover .morph-slider-btn { width: 44px; height: 44px; }
html.is-mobile .intro {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 0;
  padding: 8px 0 28px;
}
/* Smaller avatar (104px) so the name fits beside it, in the band below the cover. */
html.is-mobile .avatar { top: -52px; width: 104px; height: 104px; }
html.is-mobile .avatar-carousel-viewport,
html.is-mobile .avatar img { width: 100px; height: 100px; }
html.is-mobile .avatar-carousel-controls button { width: 36px; height: 36px; }
html.is-mobile .avatar-carousel-controls button svg { width: 12px; height: 12px; }
html.is-mobile .identity { position: relative; left: auto; top: auto; gap: 22px; min-width: 0; }
html.is-mobile h1 { margin-left: 120px; font-size: 32px; line-height: 38px; letter-spacing: 1.6px; white-space: nowrap; }
html.is-mobile .tagline { width: 100%; white-space: normal; overflow-wrap: anywhere; font-size: 16px; line-height: 24px; letter-spacing: .3px; }
html.is-mobile .tagline-editor { display: grid; width: 100%; gap: 20px; }
html.is-mobile .tagline-editor .tagline-toolbar,
html.is-mobile .tagline-editor[data-placement="below"] .tagline-toolbar {
  position: relative;
  top: auto;
  left: auto;
  width: max-content;
  max-width: 100%;
  height: 44px;
  gap: 4px;
  padding: 4px;
}
html.is-mobile .tt-frame { bottom: auto; height: calc(100% - 53px); }
/* 44px bar to match the 简历 / PDF buttons: buttons draw at 36px, tap area stretches over the bar's padding to 44px. */
html.is-mobile .tagline-toolbar button { position: relative; min-width: 44px; height: 36px; }
html.is-mobile .tagline-toolbar button::after { content: ""; position: absolute; inset: -4px 0; }
html.is-mobile .tagline-toolbar .tt-font-trigger { width: 88px !important; }
html.is-mobile .tt-font-label { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
html.is-mobile .tt-toggle { font-size: 18px; }
html.is-mobile .tt-divider { display: none; }
html.is-mobile .tt-swatch { width: 14px; height: 14px; }
html.is-mobile .tt-option { height: 44px; font-size: 16px; }
html.is-mobile .tt-paint-grid { grid-template-columns: repeat(5, 44px); gap: 0; }
html.is-mobile .tt-swatch-option { width: 44px; height: 44px; }
html.is-mobile .bio,
html.is-mobile .about-copy { font-size: 17px; line-height: 28px; }
html.is-mobile .about-copy { padding-top: 24px; padding-bottom: 28px; gap: 16px; }
html.is-mobile .curiosity { font-size: 22px; line-height: 34px; }
html.is-mobile .curiosity::before { top: 5px; }
html.is-mobile .contact-row { height: auto; margin-top: 0; flex-direction: column; align-items: flex-start; gap: 12px; }
html.is-mobile .downloads { gap: 12px; }
html.is-mobile .document-button { height: 44px; font-size: 16px; }
html.is-mobile .document-button-resume { width: 88px; }
html.is-mobile .document-button-primary { width: 140px; }
/* The shells are drawn for 112 × 32; scale the whole face up uniformly inside the 140 × 44 tap target. */
html.is-mobile .document-button-primary .document-button-face { --face-scale: 1.25; }
html.is-mobile .email { justify-content: flex-start; height: 44px; width: auto; padding: 0; font-size: 15px; }
html.is-mobile .section-heading { height: 64px; }
/* Filter sits to the right of the heading on one row; items size to their labels. */
html.is-mobile .experience-heading { height: auto; min-height: 64px; flex-wrap: wrap; gap: 8px 12px; padding-top: 12px; padding-bottom: 12px; }
html.is-mobile .experience-heading .section-title { flex: none; }
html.is-mobile #experience-filter { flex: none; }
html.is-mobile #experience-filter .rubber-segment { --rs-h: 40px !important; --rs-font: 13px !important; --rs-pad: 8px !important; }
html.is-mobile .experience-heading .rubber-segment__item { width: auto; }
html.is-mobile .subheading { font-size: 18px; }
html.is-mobile .entry-heading { align-items: flex-start; }
html.is-mobile .company-logo { margin-top: 4px; }
html.is-mobile .entry-title { flex-direction: column; align-items: flex-start; gap: 4px; }
html.is-mobile .entry-title h4 { display: block; white-space: normal; overflow-wrap: anywhere; font-size: 17px; line-height: 28px; }
html.is-mobile .entry-title h4 > span + span { margin-left: 4px; }
html.is-mobile .entry-title .entry-link { margin-left: 6px; }
html.is-mobile .date { width: auto; font-size: 14px; line-height: 24px; }
html.is-mobile .work-entries .entry-title { display: block; }
html.is-mobile .work-entries .entry-title h4 { display: inline; }
html.is-mobile .work-entries .entry-title .entry-link { margin-left: 0; }
html.is-mobile .work-entries .date { display: inline-block; margin-left: 0; line-height: 28px; }
html.is-mobile .work-entries .company-logo { width: 40px; height: 40px; border-radius: 10px; }
html.is-mobile .work-entries .bohrium-background { width: 100%; height: 100%; }
html.is-mobile .work-entries .bohrium-mark { left: 8.8px; top: 17.2px; width: 22.4px; height: 13.6px; }
html.is-mobile .work-entries .bohrium-detail { left: 18.6px; top: 8.8px; width: 12.6px; height: 4.6px; }
html.is-mobile .work-entries .notionpin-entry-artwork { left: 10px; top: 7.5px; transform: scale(1.25); transform-origin: top left; }
html.is-mobile .entry-description { font-size: 17px; line-height: 28px; overflow-wrap: anywhere; }
html.is-mobile .footer-hero { height: 320px; padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
html.is-mobile .footer-slogan { zoom: .48; }
html.is-mobile /* The visual tag scales with the slogan; its tap area remains finger-sized. */
.footer-badge::after { content: ""; position: absolute; inset: -16px 0; }
html.is-mobile .bottom-nav { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); gap: 6px; padding: 8px; border-radius: 16px; }
html.is-mobile .bottom-nav .bottom-nav-control { min-width: 44px; width: 44px; height: 44px; border-radius: 10px; }
html.is-mobile .bottom-nav-control svg { width: 20px; height: 20px; }
html.is-mobile .hover-card { max-width: calc(100vw - 24px); }
html.is-mobile .hover-card-titles { white-space: normal; }
html.is-mobile .progressive-blur { max-height: 100px; }

@media (max-width: 359px) {
  html.is-mobile h1 { font-size: 26px; letter-spacing: 1px; }
}
@media (min-width: 360px) {
  html.is-mobile .footer-slogan { zoom: .56; }
}
@media (min-width: 400px) {
  html.is-mobile .footer-slogan { zoom: .62; }
}
@media (min-width: 480px) {
  html.is-mobile .portfolio { padding-top: calc(48px + env(safe-area-inset-top, 0px)); }
  html.is-mobile .site-meta { flex-direction: row; gap: 24px; }
  html.is-mobile .footer-slogan { zoom: .75; }
  html.is-mobile .footer-hero { height: 360px; }
}
@media (min-width: 600px) {
  html.is-mobile .footer-slogan { zoom: .92; }
}

@media (pointer: coarse) {
  button, [role="button"] { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
  .document-button, .bottom-nav-control { touch-action: manipulation; }
}

/* Inline link buttons stay 22px tall in the text; the tap area extends to 44px. */
html.is-mobile .concat-button::after { content: ""; position: absolute; inset: -11px -6px; }
html.is-mobile .concat-button[data-auto-hover] .concat-button-shell-hover { opacity: 1; }
